zencart 新页面调用好功能代码集:

其实很多就是看变量,就可以直接调用,而变量的定义地方很多,比如language

1.  includes\languages\语言.php
2. 写个文件,放进includes\extra_configures、

3. languages\englis\extra_definitions\
 
4. FILENAME_:includes\filenames.php
 
例如 FILENAME_LOGIN=login;
<li><a href="<?php echo zen_href_link(FILENAME_FAQ, '', 'SSL'); ?>" rel="nofollow"><?php echo BOX_INFORMATION_FAQ;?></a></li>
 
注:BOX_INFORMATION_FAQ是在 language/语言.php定义的啦
 
尾部本来 <?php echo FOOTER_TEXT_BODY; ?>

添加几个关键词:

<div class="footlink2">
    copyright @ 2013 <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?>beatsbydrdreus.com</a> All Right Reserves.
  </div>
   <br class="clearBoth" />
  <?php
   $keywordarray = @explode(",",META_TAG_KEYWORDS);
   foreach($keywordarray as $a)
   {
    echo "<h1><a href=".HTTP_SERVER . DIR_WS_CATALOG.">".$a."</a></h1>";
   }
  ?>

----------------------------------------------------

按列来的话《ul》

<ul>
   <li class="foot14t">Information</li>
   <li><a href="<?php echo zen_href_link(FILENAME_NEWS_INDEX, '', 'SSL'); ?>">News</a></li>
   <li><a href="<?php echo zen_href_link('rss_feed', '', 'SSL'); ?>">RSS</a></li>
   <li><a href="<?php echo '' . HTTP_SERVER . DIR_WS_CATALOG;?>blog">Blog</a></li>
   <li><a href="sitemap.xml">Sitemap</a></li>
  </ul>
  <ul>
   <li class="foot15t">Hot Sale</li>
   <?php
    $keywordarray = @explode(",",HOME_PAGE_META_KEYWORDS);
    foreach($keywordarray as $a)
    {
     echo "<li><h1><a href=".HTTP_SERVER . DIR_WS_CATALOG.">".$a."</a></h1></li>";
    }
   ?>
  </ul>

<div class="foot2">
  <img src="includes/templates/happy/images/footer.gif"/><br/>
  Copyright @ 2013 <?php echo STORE_NAME;?>

         或则 <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'.STORE_NAME.'</a>';?>
 </div>

 text-decoration:none; 去下划线

=======================================添加到后台新编辑页面=======================================

==============================================

/*****************************************************/
  /************************about us******************/
  /************************payment******************/
  /************************faq*************************/
  /*************************privacy****************************/

1、将includes复制到zen-cart的根目录下

includes\languages\english\faq.php

define('NAVBAR_TITLE', 'F.A.Q');
define('HEADING_TITLE', 'F.A.Q');

define('TEXT_INFORMATION', 'Your faq should be on this page.');
?>

includes\languages\english\html_includes\define_faq.php

<p><strong>FAQ Sample Text ...</strong></p>
<p>This section of text is from the Define Pages Editor located under Tools in the Admin.</p>

includes\modules\pages\faq\header_php.php

<?require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_FAQ, 'false');

$breadcrumb->add(NAVBAR_TITLE);
?>

includes\templates\template_default\templates\tpl_faq_default.php

<div class="centerColumn" id="privacy">
<h1 id="privacyDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

<div id="privacyDefaultMainContent" class="content">
<?php
/**
* require the html_define for the privacy page
*/
require($define_page);
?>
</div>

<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
</div>

2、includes/modules/sideboxes/information.php在是适当位置添加以下代码
/******************************************/
$information[] = '<a href="' . zen_href_link(FILENAME_ABOUT_US) . '">' . BOX_INFORMATION_ABOUT_US . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_PAYMENT) . '">' . BOX_INFORMATION_PAYMENT . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a>';
 if (DEFINE_PRIVACY_STATUS <= 1) {    $information[] = '<a href="' . zen_href_link(FILENAME_PRIVACY) . '" rel="nofollow">' . BOX_INFORMATION_PRIVACY . '</a>';  }
/*****************************************/

3、includes/languages/your template/english.php在适当的地方添加以下代码
 /**************************************/
  define('BOX_INFORMATION_PAYMENT', 'Payment');
  define('BOX_INFORMATION_ABOUT_US', 'About Us');
  define('BOX_INFORMATION_FAQ', 'F.A.Q');
++ define('BOX_INFORMATION_PRIVACY', 'Vie Priv&eacute;e');
/***************************************/

4、includes/filenames.php在适当的地方添加以下代码
/*****************************************/
define('FILENAME_PAYMENT', 'payment');
define('FILENAME_ABOUT_US', 'about_us');
define('FILENAME_FAQ', 'faq'); 
++define('FILENAME_DEFINE_PRIVACY', 'define_privacy');
++define('FILENAME_PRIVACY', 'privacy');
define('FILENAME_DEFINE_PAYMENT', 'define_payment');
define('FILENAME_DEFINE_ABOUT_US', 'define_about_us');
define('FILENAME_DEFINE_FAQ', 'define_faq');
/*****************************************/
调用方法 在tpl_header.php中
<?php    if ($current_page_base == 'privacy'){  $active = 'aaccttiivvee';      } else { $active = '';    }?>       <a href="<?php echo zen_href_link(FILENAME_PRIVACY, '', 'SSL'); ?>" class="<?php echo $active;?>"><?php echo BOX_INFORMATION_PRIVACY;?></a>

<a href="<?php echo '' . HTTP_SERVER . DIR_WS_CATALOG;?>blog">Blog</a>
<?php    if ($current_page_base == 'index' || $current_page_base == '') { $active = 'aaccttiivvee'; }     else { $active = ''; }   ?>    <a href="<?php echo '' . HTTP_SERVER . DIR_WS_CATALOG;?>" class="<?php echo $active;?>"><?php echo TOP_MENU_HOME;?></a>

上一篇:javascript --- 实时监听输入框值的变化


下一篇:【核心API开发】Spark入门教程[3]