1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Wednesday, December 2, 2009

The Zen Cart Execution Process

The Zen Cart Execution Process

Zen Cart, like most open-source code, is a largly undocumented. Luckily for us, it also has a habit of mixing in much of it's program/application logic with it's actual HTML design, so it's not only undocumented, it's also hard to browse the HTML code. To top it off, it also has a dynamic template loader, which means that the program logic and HTML templates could be in any one of four different directories. Also undocumented, and of dubious usefullness.

The result is that it's not only difficult to browse through the program logic and HTML code, but you often don't even know which files are going to get loaded.

This document is an attempt to sort through the overarching structure of how Zen Cart tends to work.

index.php steps:

Here's where all of action begins.
  1. it loads 'includes/application_top.php'
  2. if $main_page isn't set, it gets set to 'index'
  3. if the directory 'includes/modules/pages/$main_page' doesn't exist, $main_page gets set to 'index'
  4. it loads all of the files starting with 'header_php' in 'includes/modules/pages/$main_page'
  5. now it loads 'html_header.php' from the first first place it finds it from the following directories
    1. includes/templates/mytemplate/$main_page/
    2. includes/templates/template_default/$main_page/
    3. includes/templates/mytemplate/common/
    4. includes/templates/template_default/common/
  6. now it does the same thing for finding and loading 'main_template_vars.php'
  7. now it does the same thing for finding and loading 'tpl_main_page.php'
  8. Finally it displays the '</html>' tag. Why display it here when the '<html>' tag is displayed somewhere else? Who knows.

application_top.php steps:

This file will load in all of general definitions used site-wide, initialize some site-wide classes ($template, $db) and do other general stuff.

html_header.php steps:

The default html_header.php file will simply create all of the HTML up to the </head> tag It loads 'includes/modules/meta_tags.php', which uses a bloated switch statement to figure out what the site's title, meta-keywords, and meta-description should be. It tries to find the css directory, and loads in it all stylesheets that begin with 'style' and end with '.css' It does the same thing for the jscript directory, and tries to load all files that begin with 'jscript_' and end with '.js'

main_template_vars.php steps:

it simply sets $body_code to the first of:
  1. includes/modules/pages/$main_page/main_template_vars.php
  2. includes/templates/mytemplate/$main_page/tpl_{$main_page}_default.php
  3. includes/templates/template_default/$main_page/tpl_{$main_page}_default.php
  4. includes/templates/mytemplate/templates/tpl_{$main_page}_default.php
  5. includes/templates/template_default/templates/tpl_{$main_page}_default.php
that's it.

tpl_main_page.php steps:

this file lays out the basic page.
  1. <body>
  2. loads the 'includes/modules/header.php' file
  3. if the left column is enabled, it loads 'includes/modules/column_left.php'
  4. it loads the file set in $body_code
  5. if the right column is enabled, it loads 'includes/modules/column_right.php'
  6. loads 'includes/modules/footer.php'
  7. </body>

includes/modules/pages/$main_page/main_template_vars.php steps:

this is where the meat of the actual content if loaded and displayed. it typically does all of the program logic first, sets all of the necessary variables, and then loads the template file. As usual, the template file is loaded from the first of the following:
  1. includes/templates/mytemplate/$main_page/
  2. includes/templates/template_default/$main_page/
  3. includes/templates/mytemplate/templates/
  4. includes/templates/template_default/templates/
The standard is that the template file will be named 'tpl_SOMENAME.php'. Note that it doesn't end with '_default.php'. The undocumented naming convention is that files that end with '_default.php' are files that get loaded with it can't find the 'includes/modules/pages/$main_page/main_template_vars.php' file.

tpl_{$main_page}_default.php steps:

If it doesn't find the above file and it instead finds a tpl_*_default.php file, then it means that all of the program logic and variables will be mixed up with the actual displayed HTML code. In Zen-Cart's defense, this generally means that there's not a lot of program logic to be had here, hardly any really, but it's still damn annoying to be mixing the program logic with design. No sir, I don't like it one bit.

Future Updates

Eventually this document will also cover the process by which the program loads in the language files, such as "english.php" and the content files like "privacy.php" and "conditions.php." The Zen Cart creators actually created these files with the idea that they would be a part of your custom template, which is a clear violation of the content/design seperation.

This document will also cover sideboxes (which requires a whole nother custom template directory). As an interesting sidenote, when you switch to a new template, all of the sideboxes get turned off. The level of user-unfriendliness of Zen Cart is amazing to me sometimes.

Zen Cart Database Schema

Developers - Database Schema - Zen Cart(tm) Wiki

address_book
address_format
admin
admin_activity_log
authorizenet
banners
banners_history
categories
categories_description
configuration *
configuration_group
counter
counter_history *
countries
coupons
coupons_description
coupon_email_track
coupon_gv_customer
coupon_gv_queue
coupon_redeem_track
coupon_restrict
currencies
customers
customers_basket
customers_basket_attributes
customers_info
customers_wishlist
db_cache
email_archive
ezpages
featured
files_uploaded
geo_zones
get_terms_to_filter
group_pricing
languages
layout_boxes
manufacturers
manufacturers_info
media_clips
media_manager
media_to_products
media_types
meta_tags_categories_description
meta_tags_products_description
music_genre
newsletters
orders *
orders_products *
orders_products_attributes *
orders_products_download *
orders_status
orders_status_history
orders_total *
paypal *
paypal_payment_status
paypal_payment_status_history *
paypal_session *
paypal_testing *
products *
products_attributes *
products_attributes_download *
products_description *
products_discount_quantity *
products_notifications
products_options *
products_options_types
products_options_values *
products_options_values_to_products_options *
products_to_categories *
product_music_extra *
product_types *
product_types_to_category *
product_type_layout *
project_version
project_version_history
query_builder *
record_artists *
record_artists_info *
record_company *
record_company_info *
reviews *
reviews_description *
salemaker_sales *
sessions *
specials *
tax_class *
tax_rates *
template_select *
upgrade_exceptions *
whos_online *
zones *
zones_to_geo_zones *

Friday, November 27, 2009

如何修改Zen-cart模板

如何修改Zen-cart模板(經典!!經典)_zen-cart网店开源系统,免费网店系统
2009-08-27 16:59

最近一直在调度zen-cart,找到了下面这篇文章,是关于如果修改zen cart模版的,很有用,,跟大家分享一下。

DIR_WS_CATALOG // zent cat目录 这些在includes/configure.php定义

meta_tags.php //定义网站的meta信息。这些是从数据库中取出来的。在includes/modules/下面

HTML_PARAMS //模板语言常量文件定义的。

$current_page_base 在includes/init_inicludes/init_sanitize.php $_GET['main_page']

manufacturers_id 生产厂商ID

product_id 产品ID

$tmp_pagename index_home
有加载modules/pages

======================
首页加载的文件
html_header.php

tpl_index_default.php {indeXDefaultMainContent 首页可以编辑}

tpl_modules_featured_products.php -> tpl_columnar_display.php
bannerOne banners [后台bannner控制]

logo 修改 tpl_header.php 页面 在模板的images/logo.gif

id="mainwrapper"

common/tpl_header.php 功能:所有页面的页眉 基本可以不用或者广告用

id="headerwrapper"

navColumnOnewrapper

navEZpagesTOp 简易页面的连接

左边分类在 templates/模板/sideboxes/下面 sql参数在categories.php
=============================

1. 在首页顶部增加连接的方法。
找到模板文件夹下面的zcen/tpl_header.php
在#topbarwrap与#topbar 增加一个<div>连接</div> 里面写上你要的连接

2. Logo的替换。这个在后台是没有的。在语包的文件里定义。
找到languages/english/zcen/header.php 找到Header_logo_image 常量 修改
或者 替换 模板下面的 logo.gif文件/includes/templates/zcen/images/logo.gif

3. 导航栏的东西〔这个后台的设计的)
样式调节#navEZPagesTop
后台的 参数调整:0 1 2
后台的 ezpage设置

4. 首页分类名称的修改
打开 /templates/languages/english.php
找到:define("BOX_HEADING_CATEGORIES","CATEGORIES")
改为:define("BOX_HEADING_CATEGORIES","Select you game");
主`
D:\WEB\zen-cart\includes\templates\classic\css\stylesheet.css
整个页面组织
D:\WEB\zen-cart\includes\templates\template_default\common\tpl_main_page.php
网页左右栏width源代码:<td id="navColumnOne" class="columnLeft" style="width: 150px;">
动态调用width: <?php echo COLUMN_WIDTH_LEFT; ?>">,
在后台-configuration-layout里可以更改Column Width/

Column Width – Left Boxes
商品分类名称Categories更改:BOX_HEADING_CATEGORIES,
"D:\WEB\zen-cart\includes\languages\english.php"(78,11): define('BOX_HEADING_CATEGORIES', 'Categories');

spooer名称更改:define('BOX_HEADING_BANNER_BOX','Sponsors')
默认模板,左spooner对应'BOX_HEADING_BANNER_BOX' 右上spooer对'BOX_HEADING_BANNER_BOX_ALL'
右下spooer对应BOX_HEADING_BANNER_BOX2

左边栏处理:只保留includes\templates\template_default\sideboxes\tpl_categories.php,在里面增加
图片链接

右边栏的处理:
1.后台设置为保留who's onlie(sideboxes/whos_online.php),
与之对应的 tpl_box_default_right.php,查找<?php echo $title; ?>进行替换

2.添加左边栏目内容,对tpl_box_default_right.php更改:

中部修改:
===========
\includes\templates\template_default\templates\tpl_index_default.php

去掉顶部说明:<?php if (SHOW_CUSTOMER_GREETING == 1) { ?>
<h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
<?php } ?>

去掉欢迎信息:
<h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

去掉顶部导航:
\includes\templates\template_default\common\tpl_main_page.php
<div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
模板顶部修改:
==========
\zen-cart\includes\templates\template_default\common

\tpl_header.php
<div id="navMain"></div>内可增加链接
<?php
/**
* prepares and displays header output
*
*/
if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or

$_SESSION['customer_id'] == ")) {
$flag_disable_header = true;
}
require($template->get_template_dir('tpl_header.php',DIR_WS_
TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>

上段从<div id="mainWrapper">抽出,放在它前面做全屏导航版块
顶部搜索按钮修改:
\includes\templates\template_default\common\tpl_header.php :
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
自动生成导航栏:
\includes\templates\template_default\templates\
tpl_modules_categories_tabs.php
将其代码掏空,重新添加导航代码:
~~~~~~~~~~~~~~~~~~~~~~~~~
<?php
/**
* Module Template – categories_tabs
*
* Template stub used to display categories-tabs output
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_modules_categories_tabs.php 3395 2006-04-08 21:13:00Z ajeh $
*/

include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS));
?>
<?php if (CATEGORIES_TABS_STATUS ==

'1′ && sizeof($links_list) >= 1) { ?>
<div id="navCatTabsWrapper">
<div id="navCatTabs">
<ul>
<?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?>
<li><?php echo $links_list[$i];?></li>
<?php } ?>
</ul>
</div>
</div>
<?php } ?>
~~~~~~~~~~~~~~~~~~~~~~

的log背景:
\zen-cart\includes\templates\template_default\common

\tpl_header.php
<div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
底部导航修改:
\includes\templates\template_default\common\tpl_main_page.php
<div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>


提高Google Adsense广告相关度的技巧

提高Google Adsense广告相关度的技巧-月光博客

  昨天在听AdSense的一个网络会议的时候,主讲人提到了一个提高Adsense广告相关度的技巧,可供那些感觉广告匹配度不高、广告点击率低的AdSense用户参考使用。

  Google AdSense广告通常会针对用户网页的内容自动显示广告,但AdSense可能并不清楚你网页上的哪些部门的内容更重要,如果用户通过手动添加一些HTML代码的方式,突出或忽略网页中的某些部分,这在一定程度上可以引导AdSense抓取工具重点分析网页的某些部分或忽略某些部分,以提高广告的相关度。

  比如,用户想要强调网页上某部分,那么可以在这部门的前后增加下面两段HTML代码。

  <!-- google_ad_section_start -->

  <!-- google_ad_section_end -->

  将需要强调的部分放在这两段代码中间即可。

  如果用户想要忽略掉从某处开始的信息,可以在那个位置前增加下面的HTML代码。

  <!-- google_ad_section_start(weight=ignore) -->

  经过这些处理后,AdSense广告的相关度就会得到一定的提高。

  不过,如果用户页面的内容不足,那么有可能会因为没有广告内容而显示公益广告。

Thursday, November 26, 2009

怎么去修改zen cart 程序

以下是zen cart 首页程序的修改。根据各个文件修改不同的功能。希望这些能对你有所帮助。

首页界面://include/templates/zccn/common/tpl_main_page.php
首页主样式表://include/templates/zccn/css/schinese_stylesheet.css

首页左边栏目:
/includes/templates/template_default/common/tpl_box_default_left.php

商品分类内容修改:
/includes/modules/sideboxes/categories.php
/includes/templates/zccn/sideboxes/tpl_categories.php

推荐产品
/includes/modules/sideboxes/featured.php
/includes/templates/template_default/sideboxes/tpl_featured.php

新进产品
/includes/modules/sideboxes/whats_new.php
/includes/templates/template_default/sideboxes/tpl_whats_new.php

特价产品
/includes/modules/sideboxes/specials.php
/includes/templates/template_default/sideboxes/tpl_specials.php

数据库表
/includes/database_tables.php

首页中间商品修改:
/includes/templates/template_default/common/main_template_vars.php
/includes/templates/template_default/templates/tpl_index_default.php

内页中间商品修改:
/includes/templates/template_default/templates/tpl_index_catergories.php

首页中间 August新进商品
/includes/templates/template_default/templates/tpl_modules_whats_new.php

首页中间 August特价商品
/includes/templates/template_default/templates/tpl_modules_specials_default.php

首页中间 推荐商品
/includes/templates/template_default/templates/tpl_modules_featured_products.php

首页右边栏目:
/includes/templates/template_default/common/tpl_box_default_right.php

商品搜索
/includes/templates/template_default/sideboxes/tpl_search.php

客服中心
/includes/templates/template_default/sideboxes/tpl_ezpages.php

畅销商品
/includes/templates/template_default/sideboxes/tpl_best_sellers.php

商品评论
/includes/templates/template_default/sideboxes/tpl_reviews_write.php

在线名单
/includes/templates/template_default/sideboxes/tpl_whos_online.php

Wappalyzer: Check which apps are powering a particular site

Wappalyzer: Check which apps are powering a particular site
November 14th, 2009 Leave a comment Visited 160 times, 8 so far today

Wappalyzer is a useful add-on for Mozilla Firefox web browser that can be used to check the tools used by a particular website.

It can report on the CMS being used to power the website. You can also get information on the various third party plug-ins being used by it.

It can detect following applications and services:

AWStats, BIGACE, BigDump, Blogger, Clicky, CMS Made Simple, ConversionLab, Coppermine, cPanel, Crazy Egg, CubeCart, DirectAdmin, dojo, DokuWiki, Drupal, e107, ExtJS, eZ Publish, FluxBB, Google Analytics,Google Friend Connect, Google Maps, IPB, Joomla, jQuery, Koego, Kolibri CMS, LiveJournal, Magento, MediaWiki, MiniBB, MochiKit, MODx, MooTools, Movable Type, MyBB, MyBlogLog, OneStat, osCommerce, osCSS, papaya CMS, PHP-Fusion,phpBB, phpDocumentor, phpMyAdmin, Plesk, posterous, Prestashop, Prototype, punBB, Quantcast, s9y, script.aculo.us, Site Meter, SMF, SPIP, Squarespace, StatCounter, Tumblr, TypePad, TYPO3, TYPOlight, Ubercart, Vanilla, vBulletin, viennaCMS, VisualPath, Vox, VP-ASP, W3Counter, webEdition, WebPublisher, WikkaWiki, WordPress, XMB, xtCommerce, YaBB, YUI, and Zen Cart.

Pretty comprehensive!

Checkout: Wappalyzer

Tuesday, November 24, 2009

放个完善的 Zen Cart 模版+运行环境

放个完善的Lightinthebox 模版+运行环境
radnows » 2009年 9月 1日 03:54

1.没有错误没有木马。
2.生成图像没有锯齿。
3.完整windows 运行环境 (apache + php +mysql)。解压到d盘根目录后,运行D:\apache\apache.exe和D:\apache\mysql41\mysqld41- start nolog后即可在浏览器浏览 (如已有apache和mysql运行,先停止其运行)。
4.不得买卖该模板,只限研究交流。 :mrgreen:

忘了说:
后台admin
用户admin
密码admin

-------------------------------------------------------
2009-09-04补充:
大图只有水印那是new_product_preview.php里有函数参数没好少了0 哈哈。补上即可。

D:\apache\htdocs\lightbox\admin\includes\modules\new_product_preview.php里129行
代码: 全选
ImageCopyResampled($im_s,$im, 0, 0, 0,$width,$height,$width_orig,$height_orig );
改为
代码: 全选
ImageCopyResampled($im_s,$im, $wpos, $hpos, 0, 0,$width,$height,$width_orig,$height_orig );
-------------------------------------------------------------------------------------------------------------

图片不居中是ImageCopyResampled($im_s,$im, 0, 0, 0, 0,$width,$height,$width_orig,$height_orig );作怪

改为
代码: 全选
ImageCopyResampled($im_s,$im, $wpos, $hpos, 0, 0,$width,$height,$width_orig,$height_orig );
即可
------------------------------------------------------------------------------------------------------------

批量上传建议下载安装使用txt版本覆盖替代。

运输地址与帐单地址必须一致问题更好解决:
覆盖原版tpl_modules_checkout_address_book.php和tpl_modules_checkout_new_address.php即可

前台搜索不到商品问题:

用原版替换D:\apache\htdocs\lightbox\includes\modules\pages\advanced_search和advanced_search_result目录内容
用原版product_listing.php改名为search_product_listing.php复制到D:\apache\htdocs\lightbox\includes\modules\lightinthebox
修改tpl_advanced_search_result_default.php内容为以下代码:
代码: 全选
<div class="centerColumn" id="advSearchResultsDefault">
<?php
require($template->get_template_dir('tpl_modules_search_product_listing.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_search_product_listing.php');
?>
</div>
新建tpl_modules_search_product_listing.php文件在D:\apache\htdocs\lightbox\includes\templates\lightinthebox\templates目录

内容为:
代码: 全选
<?php
include(DIR_WS_MODULES . zen_get_module_directory('search_product_listing.php'));
?>
<div id="productListing">
<?php
if ($show_top_submit_button == true) {
?>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit1" name="submit1"'); ?></div>
<br class="clearBoth" />
<?php
}
?>

<?php
require($template->get_template_dir('tpl_list_box_content.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_list_box_content.php');
?>

<?php if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<div id="productsListingBottomNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div>
<div id="productsListingListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>
<br class="clearBoth" />
<?php
}
?>

<?php
if ($show_bottom_submit_button == true) {
?>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit2" name="submit1"'); ?></div>
<br class="clearBoth" />
<?php
}
?>
</div>

<?php
if ($show_top_submit_button == true or $show_bottom_submit_button == true) {
?>
</form>
<?php } ?>
至于购物流程问题嘛,有人喜欢那样方式有人不喜欢。不喜欢替换为原版即可。

下载地址:
http://drop.io/tawalll/asset/apache-php ... e_download

-------------
radnows » 2009年 9月 28日 14:40
gueston 写道: 首页“Recent Orders”栏目里内容有重叠,看不清,如下图,是否能帮忙解决下,谢谢。
请自行编辑tpl_order_history.php文件去掉
代码: 全选
ship to '.$customer_orders[$i]['customers_state'].','.$customer_orders[$i]['customers_country'].
即可

------------
radnows » 2009年 10月 13日 07:51
gueston 写道:
Jack 写道:本站搜索下如何重置管理员密码
这个模版好像没有品牌(制造商)的选择了了,像我这样的目录就有必要用到品牌的筛选了http://cbwp.us 。
我有尝试在前台布局里吧manufactory打开,但没有显示,所以在此求助,
希望达到的效果:
页面的搜索栏都有品牌选择,在搜索栏种类(Categories)后面为品牌做同样的下拉选项,最好再把页面宽度增加点。
或者沿用原汁原味的高级搜索,原版的高级搜索里有这个选项。
修 改tpl_index_categories.php,在require(DIR_WS_MODULES . zen_get_module_directory('sideboxes/categories.php'));下增加 require(DIR_WS_MODULES . zen_get_module_directory('sideboxes/manufacturers.php'));

修改sideboxes/manufacturers.php,把$column_box_default改为'tpl_box_default_left.php'

---------
radnows » 2009年 10月 13日 07:53
kingking 写道:现在的producttag只是把产品的名称列出来了,和lightinthebox的不一样,light是列出来些tags
代码: 全选
Product Tags:
'.strtoupper($letter).' ';
}
echo '0-9 ';
echo 'WishList ';
?>

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...