在ecshop中添加页面,并且实现后台管理
2010-07-10 23:08
453 查看
后台一共需要修改下面的四个文件
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/template.php
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
C:/Program
Files/ShopEx/shop/docroot/ecshop/languages/zh_cn/admin/template.php
C:/Program
Files/ShopEx/shop/docroot/ecshop/themes/default/libs.xml
1、
首先做模板文件
help.dwt
和
help.php
见下面的
7
和
8
的文件内容
2
、修改
C:/Program Files/ShopEx/shop/docroot/ecshop/languages/zh_cn
/admin/template.php
追加如下内容
$_LANG['template_files']['help'] = '
用户定义帮助
';
3
、后台就可以显示出用户定义的模板文件了
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/ad6061c96e5f3b9a7d64195eb60130ac.gif)
4
、修改下面一个文件的
bug
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
将
while
($vals[++$i]['tag'] != 'FILE' || !isset($vals[$i]['attributes']))
修改成
$i++;
while ($vals[$i]['tag'] != 'FILE' || !isset($vals[$i]['attributes']))
//
读出可编辑区库文件名称,放到一个数组中
{
……
$i++;
}
5
、【每个模板允许设置的库项目】做成
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
在
$page_libs =
array(……
中加入下面代码
'help' => array(
'/library/ur_here.lbi' => 0,
'/library/search_form.lbi' => 0,
'/library/member.lbi' => 0,
'/library/new_articles.lbi' => 0,
'/library/category_tree.lbi' => 0,
'/library/top10.lbi' => 0,
'/library/invoice_query.lbi' => 0,
'/library/recommend_best.lbi' => 3,
'/library/recommend_new.lbi' => 3,
'/library/recommend_hot.lbi' => 3,
'/library/recommend_promotion.lbi' => 4,
'/library/group_buy.lbi' => 3,
'/library/auction.lbi' => 3,
'/library/brands.lbi' => 3,
'/library/promotion_info.lbi' => 0,
'/library/cart.lbi' => 0,
'/library/order_query.lbi' => 0,
'/library/email_list.lbi' => 0,
'/library/vote_list.lbi' => 0
),
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/088b47ac6c191501d45be518619a5aaa.gif)
6
、编辑可否设定
C:/Program
Files/ShopEx/shop/docroot/ecshop/themes/default/libs.xml
加入下面代码,这些区域就变成可指定的了,以外的部分就不能被设定。如果不在这个文件中加入任何信息,所有的项目都是可编辑的
<file name="help.dwt">
<region name="
左边区域
">
<lib>cart</lib>
<lib>category_tree</lib>
<lib>top10</lib>
<lib>promotion_info</lib>
<lib>order_query</lib>
<lib>invoice_query</lib>
<lib>vote_list</lib>
<lib>email_list</lib>
</region>
<region name="
站内快讯上广告位(宽:
210px
)
"/>
<region name="
右边主区域
">
<lib>recommend_best</lib>
<lib>recommend_new</lib>
<lib>recommend_hot</lib>
<lib>auction</lib>
<lib>group_buy</lib>
</region>
</file>
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/878dfe7c5bbb6bc7d0744791c6a0be12.gif)
7
、模板文件
help.dwt
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta
http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<!--
TemplateBeginEditable name="doctitle" -->
<title>{$page_title}</title>
<!--
TemplateEndEditable --><!-- TemplateBeginEditable name="head"
--><!-- TemplateEndEditable -->
<meta
name="Keywords" content="{$keywords}" />
<meta
name="Description" content="{$description}" />
<link
rel="shortcut icon" href="favicon.ico" />
<link
rel="icon" href="animated_favicon.gif"
type="image/gif" />
<link
href="{$ecs_css_path}" rel="stylesheet"
type="text/css" />
</head>
<body>
<!--
#BeginLibraryItem "/library/page_header.lbi" --><!--
#EndLibraryItem -->
<div class="AreaR">
<!--
焦点图和站内快讯
START-->
<div class="box clearfix">
<div class="box_1
clearfix">
<div class="f_l"
id="focus">
<!--
#BeginLibraryItem "/library/index_ad.lbi" --><!--
#EndLibraryItem -->
</div>
<!--news-->
<div id="mallNews"
class="f_r">
<div
class="NewsTit"></div>
<div class="NewsList
tc">
<!-- TemplateBeginEditable
name="
站内快讯上广告位
" -->
<!-- #BeginLibraryItem "/library/cat_goods.lbi"
--><!-- #EndLibraryItem -->
<!-- TemplateEndEditable -->
<!-- #BeginLibraryItem
"/library/new_articles.lbi" --><!-- #EndLibraryItem -->
</div>
</div>
<!--news end-->
</div>
</div>
<!--
#BeginLibraryItem "/library/page_footer.lbi" --><!--
#EndLibraryItem -->
</body>
</html>
红色背景部分是可编辑区域,如下图
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/757dd226efbb1c437bb54bcef35134b9.gif)
8
、
help.dwt
<?php
define('IN_ECS',
true);
require(dirname(__FILE__)
. '/includes/init.php');
assign_template('c',
array($cat_id));
$position=
assign_ur_here(0, 'asdfasdfaadsfasd');
$smarty->assign('ur_here',
$position['ur_here']);
//
当前位置
$smarty->display('help.dwt');
?>
9
、最终效果
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/template.php
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
C:/Program
Files/ShopEx/shop/docroot/ecshop/languages/zh_cn/admin/template.php
C:/Program
Files/ShopEx/shop/docroot/ecshop/themes/default/libs.xml
1、
首先做模板文件
help.dwt
和
help.php
见下面的
7
和
8
的文件内容
2
、修改
C:/Program Files/ShopEx/shop/docroot/ecshop/languages/zh_cn
/admin/template.php
追加如下内容
$_LANG['template_files']['help'] = '
用户定义帮助
';
3
、后台就可以显示出用户定义的模板文件了
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/ad6061c96e5f3b9a7d64195eb60130ac.gif)
4
、修改下面一个文件的
bug
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
将
while
($vals[++$i]['tag'] != 'FILE' || !isset($vals[$i]['attributes']))
修改成
$i++;
while ($vals[$i]['tag'] != 'FILE' || !isset($vals[$i]['attributes']))
//
读出可编辑区库文件名称,放到一个数组中
{
……
$i++;
}
5
、【每个模板允许设置的库项目】做成
C:/Program
Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
在
$page_libs =
array(……
中加入下面代码
'help' => array(
'/library/ur_here.lbi' => 0,
'/library/search_form.lbi' => 0,
'/library/member.lbi' => 0,
'/library/new_articles.lbi' => 0,
'/library/category_tree.lbi' => 0,
'/library/top10.lbi' => 0,
'/library/invoice_query.lbi' => 0,
'/library/recommend_best.lbi' => 3,
'/library/recommend_new.lbi' => 3,
'/library/recommend_hot.lbi' => 3,
'/library/recommend_promotion.lbi' => 4,
'/library/group_buy.lbi' => 3,
'/library/auction.lbi' => 3,
'/library/brands.lbi' => 3,
'/library/promotion_info.lbi' => 0,
'/library/cart.lbi' => 0,
'/library/order_query.lbi' => 0,
'/library/email_list.lbi' => 0,
'/library/vote_list.lbi' => 0
),
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/088b47ac6c191501d45be518619a5aaa.gif)
6
、编辑可否设定
C:/Program
Files/ShopEx/shop/docroot/ecshop/themes/default/libs.xml
加入下面代码,这些区域就变成可指定的了,以外的部分就不能被设定。如果不在这个文件中加入任何信息,所有的项目都是可编辑的
<file name="help.dwt">
<region name="
左边区域
">
<lib>cart</lib>
<lib>category_tree</lib>
<lib>top10</lib>
<lib>promotion_info</lib>
<lib>order_query</lib>
<lib>invoice_query</lib>
<lib>vote_list</lib>
<lib>email_list</lib>
</region>
<region name="
站内快讯上广告位(宽:
210px
)
"/>
<region name="
右边主区域
">
<lib>recommend_best</lib>
<lib>recommend_new</lib>
<lib>recommend_hot</lib>
<lib>auction</lib>
<lib>group_buy</lib>
</region>
</file>
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/878dfe7c5bbb6bc7d0744791c6a0be12.gif)
7
、模板文件
help.dwt
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta
http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<!--
TemplateBeginEditable name="doctitle" -->
<title>{$page_title}</title>
<!--
TemplateEndEditable --><!-- TemplateBeginEditable name="head"
--><!-- TemplateEndEditable -->
<meta
name="Keywords" content="{$keywords}" />
<meta
name="Description" content="{$description}" />
<link
rel="shortcut icon" href="favicon.ico" />
<link
rel="icon" href="animated_favicon.gif"
type="image/gif" />
<link
href="{$ecs_css_path}" rel="stylesheet"
type="text/css" />
</head>
<body>
<!--
#BeginLibraryItem "/library/page_header.lbi" --><!--
#EndLibraryItem -->
<div class="AreaR">
<!--
焦点图和站内快讯
START-->
<div class="box clearfix">
<div class="box_1
clearfix">
<div class="f_l"
id="focus">
<!--
#BeginLibraryItem "/library/index_ad.lbi" --><!--
#EndLibraryItem -->
</div>
<!--news-->
<div id="mallNews"
class="f_r">
<div
class="NewsTit"></div>
<div class="NewsList
tc">
<!-- TemplateBeginEditable
name="
站内快讯上广告位
" -->
<!-- #BeginLibraryItem "/library/cat_goods.lbi"
--><!-- #EndLibraryItem -->
<!-- TemplateEndEditable -->
<!-- #BeginLibraryItem
"/library/new_articles.lbi" --><!-- #EndLibraryItem -->
</div>
</div>
<!--news end-->
</div>
</div>
<!--
#BeginLibraryItem "/library/page_footer.lbi" --><!--
#EndLibraryItem -->
</body>
</html>
红色背景部分是可编辑区域,如下图
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/757dd226efbb1c437bb54bcef35134b9.gif)
8
、
help.dwt
<?php
define('IN_ECS',
true);
require(dirname(__FILE__)
. '/includes/init.php');
assign_template('c',
array($cat_id));
$position=
assign_ur_here(0, 'asdfasdfaadsfasd');
$smarty->assign('ur_here',
$position['ur_here']);
//
当前位置
$smarty->display('help.dwt');
?>
9
、最终效果
![](https://oscdn.geek-share.com/Uploads/Images/Content/201912/31/36c4bbd43108b52371528e754b757881.gif)
相关文章推荐
- 在ecshop中添加页面,并且实现后台管理
- 在ecshop中添加页面,并且实现后台管理
- [转]在ecshop中添加页面,并且实现后台管理
- 用html、jquery、php编写新闻后台管理页面,动态添加新闻数据并实现数据的增删改查功能
- jsp页面中实现时间相减,并且在最近添加的新闻后右上角添加标记(涉及struts2标签和jquey)
- web.config中实现对后台管理必须登录(manage文件夹所有页面都要登录),但是其他页面不需要
- Ecshop :后台添加新功能 菜单及 管理权限 配置
- Spring Boot 定时任务实现后台管理动态配置(动态添加修改删除定时任务)
- 基于YIi的三栏frameset框架后台管理页面的实现
- ecshop后台商品列表和添加修改选择供货商处只显示自己管理的
- 给ecshop后台增加管理功能页面
- Wordpress 在后台添加一个类似Post 的专门管理某类文章的单独页面
- Ecshop:后台添加新功能栏目以及管理权限设置
- 自由添加菜单,类似易趣的管理页面中的那些小菜单.javascript实现,可跨多种浏览器
- 使用VUE实现后台管理的前端操作页面
- 给ecshop后台增加管理功能页面
- Ecshop:后台添加新功能栏目以及管理权限设置
- ecshop 添加后台页面以及设置权限
- Ecshop:后台添加新功能栏目以及管理权限设置
- 第四章:Django模型——在 admin 后台管理页面上面添加 Event 发布会名称