跨境电商博客

如何在zen-cart模板里面调用简易页面?

如何在zen-cart模板里面调用简易页面?
1.在/includes/functions/extra_functions/建立一个PHP文件,如extra_functions.php
放入代码:
[php]
function zen_get_ezpage_contents($title){
global $db;
if($title){
$sql = ‘select pages_html_text from ezpages_content where pages_title="’.$title.’" and languages_id = "’.$_SESSION[‘languages_id’].’" limit 1′;
$result = $db->Execute($sql)->fields[‘pages_html_text’];
return $result;
}
return false;
}

function zen_define_page_content($title) {
global $db;
$title = $db->prepare_input($title);
$sql = "SELECT `pages_html_text` FROM ".TABLE_EZPAGES_TEXT." WHERE `pages_title` = ‘{$title}’ AND `languages_id` = {$_SESSION[‘languages_id’]}";
$pages = $db->Execute($sql);
return $pages->fields[‘pages_html_text’];
}
[/php]
2.后台:Tools>EZ-pages>新建一个页面 名称如footer_links.
3.在要调用的模板文件放入如下代码:
[php]<?php echo zen_define_page_content(‘footer_links’); ?>[/php]
其中footer_links 是简易页面名称

赞 (1) 打赏

评论 0

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏