已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Cen Cart 二次开发Author:leafage Q:317856394跟着序程跑(安装略)http:/localhost/testCart/index.php require(includes/application_top.php); /包含以下重要信息define(DEBUG_AUTOLOAD, false); /debuginclude(includes/configure.php);/* * if main configure file doesnt contain valid info (ie: is dummy or doesnt match filestructure, display assistance page to suggest running the installer) 如果主要的配置文件不包含有效的信息(即:是假的或不匹配filestructure,显示帮助页面,建议在运行安装程序)也就是这个是安装时用的,不用管 */if (!defined(DIR_FS_CATALOG) | !is_dir(DIR_FS_CATALOG./includes/classes) $problemString = includes/configure.php file contents invalid. ie: DIR_FS_CATALOG not valid or not set; require(includes/templates/template_default/templates/tpl_zc_install_suggested_default.php); exit;require(includes/initsystem.php);进入这个文件是一个加载文件器的初始工作$base_dir = DIR_WS_INCLUDES . auto_loaders/;if (file_exists(DIR_WS_INCLUDES . auto_loaders/overrides/ . $loader_file) $base_dir = DIR_WS_INCLUDES . auto_loaders/overrides/;/* * load the default application_top autoloader file. */include($base_dir . $loader_file);if ($loader_dir = dir(DIR_WS_INCLUDES . auto_loaders) while ($loader_file = $loader_dir-read() $matchPattern = / . $loaderPrefix . ./; if (preg_match($matchPattern, $loader_file) 0) & (preg_match(/.php$/, $loader_file) 0) if ($loader_file != $loaderPrefix . .core.php) $base_dir = DIR_WS_INCLUDES . auto_loaders/;加载了config.core.php和paypal_ipn.core.php这两个文件config.core.php/* * 加载了下面的文件并放入$autoLoadConfig 数组里 * require(DIR_WS_CLASSES . class.base.php); * require(DIR_WS_CLASSES . class.notifier.php); * $zco_notifier = new notifier() * require(DIR_WS_CLASSES . mime.php); * require(DIR_WS_CLASSES . email.php); * require(DIR_WS_CLASSES . boxes.php); * require(DIR_WS_CLASSES . category_tree.php); * require(DIR_WS_CLASSES . cache.php); * require(DIR_WS_CLASSES . sniffer.php); * require(DIR_WS_CLASSES . shopping_cart.php); * require(DIR_WS_CLASSES . navigation_history.php); * require(DIR_WS_CLASSES . currencies.php); * require(DIR_WS_CLASSES . message_stack.php); * require(DIR_WS_CLASSES . template_func.php); * require(DIR_WS_CLASSES . split_page_results.php); * require(DIR_WS_CLASSES . breadcrumb.php); * require(DIR_WS_CLASSES . language.php); * */ $autoLoadConfig0 = array(autoType=class, loadFile=class.base.php); $autoLoadConfig0 = array(autoType=class, loadFile=class.notifier.php); $autoLoadConfig0 = array(autoType=classInstantiate, className=notifier, objectName=zco_notifier); $autoLoadConfig0 = array(autoType=class, loadFile= class.phpmailer.php);。让人还看不懂的是有下面的加载 一直到Breakpoint 180$autoLoadConfig10 = array(autoType=init_script, loadFile= init_file_db_names.php); $autoLoadConfig10 = array(autoType=init_script, loadFile=init_database.php);/* * Breakpoint 60. * * require(includes/init_includes/init_general_funcs.php); * require(includes/init_includes/init_tlds.php); */ $autoLoadConfig60 = array(autoType=init_script, loadFile= init_general_funcs.php); $autoLoadConfig60 = array(autoType=init_script, loadFile= init_tlds.php);/* * Breakpoint 70.* require(includes/init_includes/init_sessions.php); */ $autoLoadConfig70 = array(autoType=init_script, loadFile= init_sessions.php);显然模块很细,并且一次性装入内存中,运行起来速度优势。还有里的部分文件。比如:在加载inti_databasese.php里require(includes/classes/db/ .DB_TYPE . /query_factory.php);/* * load the autoloader interpreter code.加载自动加载器代码这个很迷惑人*/require(includes/autoload_func.php);Configure.php内容以DIR_开头 数据连字符串define(HTTP_SERVER, http:/localhost); define(HTTPS_SERVER, https:/localhost); / Use secure webserver for checkout procedure? define(ENABLE_SSL, false);/ NOTE: be sure to leave the trailing / at the end of these lines if you make changes!/ * DIR_WS_* = Webserver directories (virtual/URL) / these paths are relative to top of your webspace . (ie: under the public_html or httpdocs folder) define(DIR_WS_CATALOG, /zenCart/); define(DIR_WS_HTTPS_CATALOG, /zenCart/); define(DIR_WS_IMAGES, images/); define(DIR_WS_INCLUDES, includes/); define(DIR_WS_FUNCTIONS, DIR_WS_INCLUDES . functions/); define(DIR_WS_CLASSES, DIR_WS_INCLUDES . classes/); define(DIR_WS_MODULES, DIR_WS_INCLUDES . modules/); define(DIR_WS_LANGUAGES, DIR_WS_INCLUDES . languages/); define(DIR_WS_DOWNLOAD_PUBLIC, DIR_WS_CATALOG . pub/); define(DIR_WS_TEMPLATES, DIR_WS_INCLUDES . templates/); define(DIR_WS_PHPBB, /);/ * DIR_FS_* = Filesystem directories (local/physical) /the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define(DIR_FS_CATALOG, D:/APMServ/www/htdocs/zenCart/); define(DIR_FS_DOWNLOAD, DIR_FS_CATALOG . download/); define(DIR_FS_DOWNLOAD_PUBLIC, DIR_FS_CATALOG . pub/); define(DIR_WS_UPLOADS, DIR_WS_IMAGES . uploads/); define(DIR_FS_UPLOADS, DIR_FS_CATALOG . DIR_WS_UPLOADS); define(DIR_FS_EMAIL_TEMPLATES, DIR_FS_CATALOG . email/);/ define our database connection define(DB_TYPE, mysql); define(DB_CHARSET, utf8); define(DB_PREFIX, zen_); define(DB_SERVER, localhost); define(DB_SERVER_USERNAME, root); define(DB_SERVER_PASSWORD, root); define(DB_DATABASE, zencart); define(USE_PCONNECT, false); define(STORE_SESSIONS, db); / for STORE_SESSIONS, use db for best support, or for file-based storage / The next 2 defines are for SQL cache support. / For SQL_CACHE_METHOD, you can select from: none, database, or file / If you choose file, then you need to set the DIR_FS_SQL_CACHE to a directory where your apache / or webserver user has write privileges (chmod 666 or 777). We recommend using the cache folder inside the Zen Cart folder / ie: /path/to/your/webspace/public_html/zen/cache - leave no trailing slash define(SQL_CACHE_METHOD, none); define(DIR_FS_SQL_CACHE, D:/APMServ/www/htdocs/zenCart/cache);/ EOF/* * load the counter code*/if ($spider_flag = false) / counter and counter history require(DIR_WS_INCLUDES . counter.php);counter.php下面是客户登陆记录if (isset($_SESSIONsession_counter) & $_SESSIONsession_counter = true) $session_counter = 0; else $session_counter = 1; $_SESSIONsession_counter = true;回到index.php $language_page_directory = DIR_WS_LANGUAGES . $_SESSIONlanguage . /; /语言 $directory_array = $template-get_template_part($code_page_directory, /header_php/); Templatetemplate_func.php/这个类是用来为模板覆盖计算class template_func extends base function template_func($template_dir = default) $this-info = array(); /得到模板文件的路径 且返回,而下一方法是只得到模板路径因为模板是可以换的 function get_template_part($page_directory, $template_part, $file_extension = .php) $directory_array = array(); if ($dir = dir($page_directory) while ($file = $dir-read() if (!is_dir($page_directory . $file) if (substr($file, strrpos($file, .) = $file_extension & preg_match($template_part, $file) $directory_array = $file; sort($directory_array); $dir-close(); return $directory_array; function get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false) /echo template_default/ . $template_dir . = . $template_code; if ($this-file_exists($current_template . $current_page, $template_code) return $current_template . $current_page . /; elseif ($this-file_exists(DIR_WS_TEMPLATES . template_default/ . $current_page, preg_replace(/, , $template_code), $debug) return DIR_WS_TEMPLATES . template_default/ . $current_page; elseif ($this-file_exists($current_template . $template_dir, preg_replace(/, , $template_code), $debug) return $current_template . $template_dir; else return DIR_WS_TEMPLATES . template_default/ . $template_dir; / return $current_template . $template_dir; function file_exists($file_dir, $file_pattern, $debug=false) $file_found = false; $file_pattern = /.str_replace(/, /, $file_pattern).$/; if ($mydir = dir($file_dir) while ($file = $mydir-read() if (preg_match($file_pattern, $file) $file_found = true; break; $mydir-close(); return $file_found; 在inti_template.php里有两句:require(DIR_FS_CATALOG . DIR_WS_CLASSES . template_func.php); $template = new template_func(DIR_WS_TEMPLATE);回到index.php里:$directory_array = $template-get_template_part($code_page_directory, /header_php/);foreach ($directory_array as $value) /* * We now load header code for a given page. * Page code is stored in includes/modules/pages/PAGE_NAME/directory * header_php.php files in that directory are loaded now. * 加载页面信息,页面的制定存储在SQL里面,这些参数在后台设置的 */ require($code_page_directory . / . $value); require($template-get_template_dir(html_header.php,DIR_WS_TEMPLATE, $current_page_base,common). /html_header.php);/*require($template-get_template_dir(main_template_vars.php,DIR_WS_TEMPLATE, $current_page_base,common). /main_template_vars.php);/*下面是找到pages/目录下以on_load_开头的js文件。$directory_array = $template-get_template_part(DIR_WS_MODULES . pages/ . $current_page_base, /on_load_/, .js); foreach ($directory_array as $value) $onload_file = DIR_WS_MODULES . pages/ . $current_page_base . / . $value; $read_contents=; $lines = file($onload_file); foreach($lines as $line) $read_contents .= $line; $za_onload_array = $read_contents; /now read includes/templates/TEMPLATE/jscript/on_load/on_load_*.js, which would be site-wide settings $directory_array=array(); $tpl_dir=$template-get_template_dir(.js, DIR_WS_TEMPLATE, jscript/on_load, jscript/on_load_); $directory_array = $template-get_template_part($tpl_dir ,/on_load_/, .js); foreach ($directory_array as $value) $onload_file = $tpl_dir . / . $value; $read_contents=; $lines = file($onload_file); foreach($lines as $line) $read_contents .= $line; $za_onload_array = $read_contents; /* * Define the template that will govern the overall page layout, can be done on a page by page basis * or using a default template. The default template installed will be a standard 3 column layout. This * template also loads the page body code based on the variable $body_code. */ require($template-get_template_dir(tpl_main_page.php,DIR_WS_TEMPLATE, $current_page_base,common). /tpl_main_page.php);怎样找到模块进行修改includestemplatestemplate_defaultcommon tpl_main_page.php这个文件就是index.php的主文件从上面可以明显看得出来。还有zen Cart 的各个模块是显示与否都是写进数据库然后放进自定义defind()中写入全局,统一由后台管理。body id=RecordCount() 0) ?/代码中SHOW_BANNERS_GROUP_SET1就是从数据库查询后放入defind();Logo修改logo 修改tpl_header.php 页面 在模板的images/logo.gif classic/images/logo.gif 2. Logo的替换。这个在后台是没有的。在语包的文件里定义。找到languages/english/zcen/header.php 找到Header_logo_image 常量 修改或者 替换 模板下面的 logo.gif文件/includes/templates/zcen/images/logo.gif3. 导航栏的东西这个后台的设计的)样式调节#navEZPagesTop后台的 参数调整:0 1 2后台的 ezpage设置首页分类名称的修改首页分类名称的修改打开 /templates/languages/english.php找到:define(”BOX_HEADING_CATEGORIES”,”CATEGORIES”)改为:define(”BOX_HEADING_CATEGORIES”,”Select you game”);主D:WEBzen-cartincludestemplatesclassiccssstylesheet.css整个页面组织D:WEBzen-cartincludestemplatestemplate_defaultcommontpl_main_page.php网页左右栏width源代码:动态调用width: ”,在后台configuration-layout里可以更改Column Width/Column Width Left Boxes商品分类名称Categories更改:BOX_HEADING_CATEGORIES,“D:WEBzen-cartincludeslanguagesenglish.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左边栏处理:只保留includestemplatestemplate_defaultsideboxestpl_categories.php,在里面增加图片链接右边栏的处理:1.后台设置为保留whos onlie(sideboxes/whos_online.php),与之对应的 tpl_box_default_right.php,查找进行替换2.添加左边栏目内容,对tpl_box_default_right.php更改:中部修改:includestemplatestemplate_defaulttemplatestpl_index_default.php去掉顶部说明:去掉欢迎信息:去掉顶部导航:includestemplatestemplate_defaultcommontpl_main_page.phptrail(BREAD_CRUMBS_SEPARATOR); ?模板顶部修改:zen-cartincludestemplatestemplate_defaultcommontpl_header.php内可增加链接get_template_dir(tpl_header.php,DIR_WS_TEMPLATE, $current_page_base,common). /tpl_header.php);?上段从抽出,放在它前面做全屏导航版块顶部搜索按钮修改:includestemplatestemplate_defaultcommontpl_header.php :自动生成导航栏:includestemplatestemplate_defaulttemplatestpl_modules_categories_tabs.php将其代码掏空,重新添加导航代码:= 1) ?php for ($i=0, $n=sizeof($links_list); $i的log背景:zen-cartincludestemplatestemplate_defaultcommontpl_header.php底部导航修改:includestemplatestemplate_defaultcommontpl_main_page.php首页界面:/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如何修改zen-cart描述和标题在中文Google里面搜索找不到答案,最后在zen-cart的英文官方网站找到了,具体的路径为:includes/languages/english/meta_tags.phpzen-cart的功能很强大,而且是开源程序,开源购物车系统,用于建立网上商店完全免费,源代码完全开放安全,几十万家在线商店应用适用小型或是上万商品的大型商店内置搜索引擎优化工具内置电子邮件群发功能支持多语言、多货币支持网上商城批量更新最完善的网店系统流程世界上平均每个小时有15个店主选择ZenCart系统优点是蛮多,不过一般人难上手,需要自己懂些PHP。如何修改zen cart商店浏览器标题显示的Zen Cart!, 电子商务的艺术如何修改zen cart商店浏览器标题显示的”Zen Cart!, 电子商务的艺术”,首页我们纠正一个问题:在Zen Cart v1.3.9f 中文插件版 (推荐
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 节能型建筑与供热系统优化方案
- 城区老旧小区改造项目施工方案
- 灰岩矿石开采技术方案
- 保定市定兴县公务员考试试题及答案
- 安庆怀宁县公务员考试试题及答案
- 保障安置房工程建议书
- 2026年蔬菜种植公司蔬菜产品质量标准制定管理制度
- 房建工程安全生产保证措施
- 通信设备行业MRO采购优化报告
- 十五五基础设施建设市场化:多元投入的改革探索
- 金刚砂地坪施工质量验收标准
- 新疆的若干历史问题
- 脑梗死伴高血压3级病例分析专题报告
- 论文写作讲座(英语科技论文撰写与投稿)课件
- 肺癌知识讲座
- 国家一等奖《纪念刘和珍君》教学设计
- 医疗质量每月检查记录表
- vas疼痛评分完整版
- 全科医师转岗培训理论考试试题及答案
- 银行异地工作调动申请书
- 实验三基因组序列分析
评论
0/150
提交评论