ECSHOP调用分类文章函数index_get_class_articles
/**
* 获得指定栏目最新的文章列表。
*
* @access private
* @return array
*/
function index_get_class_articles($cat_aid, $cat_num)
{
$sql = "SELECT article_id, title,open_type,cat_id,file_url FROM " .$GLOBALS['ecs']->table('article'). " WHERE cat_id = ".$cat_aid." and is_open = 1 LIMIT " . $cat_num;
$res = $GLOBALS['db']->getAll($sql);
$arr = array();
foreach ($res AS $idx => $row)
{
$arr[$idx]['id'] = $row['article_id'];
$arr[$idx]['title'] = $row['title'];
$arr[$idx]['short_title'] = $GLOBALS['_CFG']['article_title_length'] > 0 ?
sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title'];
$arr[$idx]['cat_name'] = $row['cat_name'];
$arr[$idx]['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']);
$arr[$idx]['url'] = $row['open_type'] != 1 ?
build_uri('article', array('aid' => $row['article_id']), $row['title']) : trim($row['file_url']);
$arr[$idx]['cat_url'] = build_uri('article_cat', array('acid' => $row['cat_id']));
}
return $arr;
}
2、第二步是在index.dwt模板想调用的地方增加以下代码,(注:以下调上面设置里的分类ID为8的文章列表):
/**
* 获得指定栏目最新的文章列表。
*
* @access private
* @return array
*/
function index_get_class_articles($cat_aid, $cat_num)
{
$sql = "SELECT article_id, title,open_type,cat_id,file_url FROM " .$GLOBALS['ecs']->table('article'). " WHERE cat_id = ".$cat_aid." and is_open = 1 LIMIT " . $cat_num;
$res = $GLOBALS['db']->getAll($sql);
$arr = array();
foreach ($res AS $idx => $row)
{
$arr[$idx]['id'] = $row['article_id'];
$arr[$idx]['title'] = $row['title'];
$arr[$idx]['short_title'] = $GLOBALS['_CFG']['article_title_length'] > 0 ?
sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title'];
$arr[$idx]['cat_name'] = $row['cat_name'];
$arr[$idx]['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']);
$arr[$idx]['url'] = $row['open_type'] != 1 ?
build_uri('article', array('aid' => $row['article_id']), $row['title']) : trim($row['file_url']);
$arr[$idx]['cat_url'] = build_uri('article_cat', array('acid' => $row['cat_id']));
}
return $arr;
}
2、第二步是在index.dwt模板想调用的地方增加以下代码,(注:以下调上面设置里的分类ID为8的文章列表):
ecshop会员中心订单搜索功能
在user.php中的act=order_list中增加以下程序。
$order_sn = isset($_REQUEST['order_sn'])?$_REQUEST['order_sn']:'';
$consignee = isset($_REQUEST['consignee'])?$_REQUEST['consignee']:'';
$start_date = isset($_REQUEST['start_date'])?$_REQUEST['start_date']:'';
$end_date = isset($_REQUEST['end_date'])?$_REQUEST['end_date']:'';
$pay_status = isset($_REQUEST['pay_status'])?$_REQUEST['pay_status']:'';
$shipping_status = isset($_REQUEST['shipping_status'])?$_REQUEST['shipping_status']:'';
$order_status = isset($_REQUEST['order_status'])?$_REQUEST['order_status']:'';
$where ="";
if($order_sn){
$where.=" and order_sn ='$order_sn'";
}
if($consignee){
$where.=" and consignee = '$$consignee'";
}
if($start_date){
$t = strtotime($start_date);
$where.=" and add_time >= $t";
}
if($end_date){
$t = strtotime($end_date);
$where.=" and add_time <= $t";
}
if($pay_status && $pay_status!= '-1'){
$where.=" pay_status = '$pay_status'";
}
if($shipping_status && $shipping_status!= '-1'){
$where.=" and shipping_status = '$shipping_status'";
}
if($order_status && $order_status!= '-1'){
$where.=" and order_status = '$order_status'";
}
$record_count = $db->getOne("SELECT COUNT(*) FROM " .$ecs->table('order_info'). " WHERE user_id = '$user_id' $where");
$pager = get_pager('user.php', array('act' => $action,'order_status'=>$order_status,'order_sn'=>$order_sn,'consignee'=>$consignee,'start_date'=>$start_date,'end_date'=>$end_date,'pay_status'=>$pay_status,'shipping_status'=>$shipping_status), $record_count, $page);
$orders = get_user_orders($user_id, $pager['size'], $pager['start']);
$merge = get_user_merge($user_id);
$smarty->assign('os_list', get_status_list('order'));
$smarty->assign('ps_list', get_status_list('payment'));
$smarty->assign('ss_list', get_status_list('shipping'));
$smarty->assign('merge', $merge);
$smarty->assign('pager', $pager);
$smarty->assign('orders', $orders);
$smarty->display('user_transaction.dwt');
在分页模板中,传递要查询的参数。
2:模板中增加以下程序。用于搜索表单
<link href="js/calendar/calendar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/calendar.php"></script>
<tr align="center">
<td bgcolor="#ffffff" colspan="5"><div align="left">订单编号
<input type="hidden" name="act" value="order_list">
<input type="text" name="order_sn"><br>
收货人姓名
<input type="text" name="consignee">
<br>
下单时间 <input name="start_date" value="{$start_date}" style="width:80px;" onclick="return showCalendar(this, '%Y-%m-%d', false, false, this);" />
-
<input name="end_date" value="{$end_date}" style="width:80px;" onclick="return showCalendar(this, '%Y-%m-%d', false, false, this);" />
<br>
订单状态: <select name="order_status" id="select9">
<option value="-1">请选择</option>
{html_options options=$os_list selected=-1}
</select>
付款状态: <select name="pay_status" id="select11">
<option value="-1">请选择</option>
{html_options options=$ps_list selected=-1}
</select>
发货状态: <select name="shipping_status" id="select10">
<option value="-1">请选择</option>
{html_options options=$ss_list selected=-1}
</select> <input type="submit" value="搜索"></div></td>
</tr>
3:将以下搜索条件加到搜索函数中去。在includes/lib_transaction.php中ecshop函数get_user_orders()中
$order_sn = isset($_REQUEST['order_sn'])?$_REQUEST['order_sn']:'';
$consignee = isset($_REQUEST['consignee'])?$_REQUEST['consignee']:'';
$start_date = isset($_REQUEST['start_date'])?$_REQUEST['start_date']:'';
$end_date = isset($_REQUEST['end_date'])?$_REQUEST['end_date']:'';
$pay_status = isset($_REQUEST['pay_status'])?$_REQUEST['pay_status']:'';
$shipping_status = isset($_REQUEST['shipping_status'])?$_REQUEST['shipping_status']:'';
$order_status = isset($_REQUEST['order_status'])?$_REQUEST['order_status']:'';
$where ="";
if($order_sn){
$where.=" and order_sn ='$order_sn'";
}
if($consignee){
$where.=" and consignee = '$$consignee'";
}
if($start_date){
$t = strtotime($start_date);
$where.=" and add_time >= $t";
}
if($end_date){
$t = strtotime($end_date);
$where.=" and add_time <= $t";
}
if($pay_status && $pay_status!= '-1'){
$where.=" pay_status = '$pay_status'";
}
if($shipping_status && $shipping_status!= '-1'){
$where.=" and shipping_status = '$shipping_status'";
}
if($order_status && $order_status!= '-1'){
$where.=" and order_status = '$order_status'";
}
在user.php中的act=order_list中增加以下程序。
$order_sn = isset($_REQUEST['order_sn'])?$_REQUEST['order_sn']:'';
$consignee = isset($_REQUEST['consignee'])?$_REQUEST['consignee']:'';
$start_date = isset($_REQUEST['start_date'])?$_REQUEST['start_date']:'';
$end_date = isset($_REQUEST['end_date'])?$_REQUEST['end_date']:'';
$pay_status = isset($_REQUEST['pay_status'])?$_REQUEST['pay_status']:'';
$shipping_status = isset($_REQUEST['shipping_status'])?$_REQUEST['shipping_status']:'';
$order_status = isset($_REQUEST['order_status'])?$_REQUEST['order_status']:'';
$where ="";
if($order_sn){
$where.=" and order_sn ='$order_sn'";
}
if($consignee){
$where.=" and consignee = '$$consignee'";
}
if($start_date){
$t = strtotime($start_date);
$where.=" and add_time >= $t";
}
if($end_date){
$t = strtotime($end_date);
$where.=" and add_time <= $t";
}
if($pay_status && $pay_status!= '-1'){
$where.=" pay_status = '$pay_status'";
}
if($shipping_status && $shipping_status!= '-1'){
$where.=" and shipping_status = '$shipping_status'";
}
if($order_status && $order_status!= '-1'){
$where.=" and order_status = '$order_status'";
}
$record_count = $db->getOne("SELECT COUNT(*) FROM " .$ecs->table('order_info'). " WHERE user_id = '$user_id' $where");
$pager = get_pager('user.php', array('act' => $action,'order_status'=>$order_status,'order_sn'=>$order_sn,'consignee'=>$consignee,'start_date'=>$start_date,'end_date'=>$end_date,'pay_status'=>$pay_status,'shipping_status'=>$shipping_status), $record_count, $page);
$orders = get_user_orders($user_id, $pager['size'], $pager['start']);
$merge = get_user_merge($user_id);
$smarty->assign('os_list', get_status_list('order'));
$smarty->assign('ps_list', get_status_list('payment'));
$smarty->assign('ss_list', get_status_list('shipping'));
$smarty->assign('merge', $merge);
$smarty->assign('pager', $pager);
$smarty->assign('orders', $orders);
$smarty->display('user_transaction.dwt');
在分页模板中,传递要查询的参数。
2:模板中增加以下程序。用于搜索表单
<link href="js/calendar/calendar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/calendar.php"></script>
<tr align="center">
<td bgcolor="#ffffff" colspan="5"><div align="left">订单编号
<input type="hidden" name="act" value="order_list">
<input type="text" name="order_sn"><br>
收货人姓名
<input type="text" name="consignee">
<br>
下单时间 <input name="start_date" value="{$start_date}" style="width:80px;" onclick="return showCalendar(this, '%Y-%m-%d', false, false, this);" />
-
<input name="end_date" value="{$end_date}" style="width:80px;" onclick="return showCalendar(this, '%Y-%m-%d', false, false, this);" />
<br>
订单状态: <select name="order_status" id="select9">
<option value="-1">请选择</option>
{html_options options=$os_list selected=-1}
</select>
付款状态: <select name="pay_status" id="select11">
<option value="-1">请选择</option>
{html_options options=$ps_list selected=-1}
</select>
发货状态: <select name="shipping_status" id="select10">
<option value="-1">请选择</option>
{html_options options=$ss_list selected=-1}
</select> <input type="submit" value="搜索"></div></td>
</tr>
3:将以下搜索条件加到搜索函数中去。在includes/lib_transaction.php中ecshop函数get_user_orders()中
$order_sn = isset($_REQUEST['order_sn'])?$_REQUEST['order_sn']:'';
$consignee = isset($_REQUEST['consignee'])?$_REQUEST['consignee']:'';
$start_date = isset($_REQUEST['start_date'])?$_REQUEST['start_date']:'';
$end_date = isset($_REQUEST['end_date'])?$_REQUEST['end_date']:'';
$pay_status = isset($_REQUEST['pay_status'])?$_REQUEST['pay_status']:'';
$shipping_status = isset($_REQUEST['shipping_status'])?$_REQUEST['shipping_status']:'';
$order_status = isset($_REQUEST['order_status'])?$_REQUEST['order_status']:'';
$where ="";
if($order_sn){
$where.=" and order_sn ='$order_sn'";
}
if($consignee){
$where.=" and consignee = '$$consignee'";
}
if($start_date){
$t = strtotime($start_date);
$where.=" and add_time >= $t";
}
if($end_date){
$t = strtotime($end_date);
$where.=" and add_time <= $t";
}
if($pay_status && $pay_status!= '-1'){
$where.=" pay_status = '$pay_status'";
}
if($shipping_status && $shipping_status!= '-1'){
$where.=" and shipping_status = '$shipping_status'";
}
if($order_status && $order_status!= '-1'){
$where.=" and order_status = '$order_status'";
}
ecshop首页调用指定的文章
ecshop中 首页调用指定的文章可以是如下操作:
1、先打开index.php文件找到以下代码:
$smarty->assign('new_articles', index_get_new_articles()); // 最新文章
在它下面增加以下:
ecshop中 首页调用指定的文章可以是如下操作:
1、先打开index.php文件找到以下代码:
$smarty->assign('new_articles', index_get_new_articles()); // 最新文章
在它下面增加以下:
jQuery ecshop冲突问题解决方法
原因分析:
在transport.js文件中,大概 580行到590行之间,这个句用于格式化json,他重写了 object的结构,导致于js框架冲突。冲突的原因是jquery给一个object增加了很多元素,那么在 Object.prototype.toJSONString = function () 这个函数中 for (k in this) 语句中进行了无数次的循环,导致网页很卡,并且在IE中会报错。
原因分析:
在transport.js文件中,大概 580行到590行之间,这个句用于格式化json,他重写了 object的结构,导致于js框架冲突。冲突的原因是jquery给一个object增加了很多元素,那么在 Object.prototype.toJSONString = function () 这个函数中 for (k in this) 语句中进行了无数次的循环,导致网页很卡,并且在IE中会报错。
Deprecated: Function eregi() is deprecated in /var/www/ecshop/admin/template.php on line 843
产生错误的原因是:
eregi()函数在php 5.30不被支持
修正方法:
将admin/template.php 843行的
1.if (eregi(”^(style|style_)(.*)*”, $file))
修改为
1.if (preg_match(”/^(style|style_)(.*)*/i”, $file))
修改 文件路径: admin/includes/lib_main.php
function create_html_editor($input_name, $input_value = '')
{
global $smarty;
$editor = new FCKeditor($input_name);
$editor->BasePath = '../includes/fckeditor/';
$editor->ToolbarSet = 'Normal';
$editor->Width = '100%';
$editor->Height = '320';
$editor->Value = $input_value;
$FCKeditor = $editor->CreateHtml();
$smarty->assign('FCKeditor', $FCKeditor);
}
//修改 成
function create_html_editor($input_name, $input_value = '', $add=false)
{
global $smarty;
$editor = new FCKeditor($input_name);
$editor->BasePath = '../includes/fckeditor/';
$editor->ToolbarSet = 'Normal';
$editor->Width = '100%';
$editor->Height = '320';
$editor->Value = $input_value;
$FCKeditor = $editor->CreateHtml();
if ($add) {
$smarty->assign('FCKeditor_'.$input_name, $FCKeditor);
}
else{
$smarty->assign('FCKeditor', $FCKeditor);
}
}
主要是 :create_html_editor 把值定死了
使用范例:
create_html_editor(’editor’, $goods['editor'], true); //生成编辑框
{$FCKeditor_editor} //模板替换
function create_html_editor($input_name, $input_value = '')
{
global $smarty;
$editor = new FCKeditor($input_name);
$editor->BasePath = '../includes/fckeditor/';
$editor->ToolbarSet = 'Normal';
$editor->Width = '100%';
$editor->Height = '320';
$editor->Value = $input_value;
$FCKeditor = $editor->CreateHtml();
$smarty->assign('FCKeditor', $FCKeditor);
}
//修改 成
function create_html_editor($input_name, $input_value = '', $add=false)
{
global $smarty;
$editor = new FCKeditor($input_name);
$editor->BasePath = '../includes/fckeditor/';
$editor->ToolbarSet = 'Normal';
$editor->Width = '100%';
$editor->Height = '320';
$editor->Value = $input_value;
$FCKeditor = $editor->CreateHtml();
if ($add) {
$smarty->assign('FCKeditor_'.$input_name, $FCKeditor);
}
else{
$smarty->assign('FCKeditor', $FCKeditor);
}
}
主要是 :create_html_editor 把值定死了
使用范例:
create_html_editor(’editor’, $goods['editor'], true); //生成编辑框
{$FCKeditor_editor} //模板替换
一、首页版权去除
首先\includes\lib_main.php(143):
$page_title = $GLOBALS['_CFG']['shop_title'] . ' - ' . 'Powered by ECShop';
修改为
$page_title = $GLOBALS['_CFG']['shop_title'] ;
PS:标题上面的Powered by EC SHOP.
二、删除底部版权
第一步:首先用txt打开js目录里的common.js,在txt里点看右下角,从244行开始删到336行。删除后保存。下面既是要删除掉的代码。也就是为什么会有在页底随机生成的ecshop的版权标识。
找到文件js/common.js
首先\includes\lib_main.php(143):
$page_title = $GLOBALS['_CFG']['shop_title'] . ' - ' . 'Powered by ECShop';
修改为
$page_title = $GLOBALS['_CFG']['shop_title'] ;
PS:标题上面的Powered by EC SHOP.
二、删除底部版权
第一步:首先用txt打开js目录里的common.js,在txt里点看右下角,从244行开始删到336行。删除后保存。下面既是要删除掉的代码。也就是为什么会有在页底随机生成的ecshop的版权标识。
找到文件js/common.js
生命中总有挫折,那不是尽头,
只是在提醒你,该转弯了。
『不是路已走到尽头,而是该转弯了!』
当你遇到一件事,已无法解决,甚至是已经影响到你的生活、心情时,
何不停下脚步,暂时的想一想是否有转阛的空间,
或许换种方法,换条路走事情便会简单点。
但,通常在那一刻,我们并来不及想到这些,
只是一昧的在原地踏步、绕圈,
让自己一直的陷在痛苦的深渊中,
生命中总有挫折,那不是尽头,只是在提醒你:该转弯了!
只是在提醒你,该转弯了。
『不是路已走到尽头,而是该转弯了!』
当你遇到一件事,已无法解决,甚至是已经影响到你的生活、心情时,
何不停下脚步,暂时的想一想是否有转阛的空间,
或许换种方法,换条路走事情便会简单点。
但,通常在那一刻,我们并来不及想到这些,
只是一昧的在原地踏步、绕圈,
让自己一直的陷在痛苦的深渊中,
生命中总有挫折,那不是尽头,只是在提醒你:该转弯了!
药疗不如食疗
1、若要不失眠,煮粥加白莲。 2、心血气不足,桂圆煨米粥。
3、萝卜小人参,常吃有精神。
4、常吃萝卜和葱姜,不用医生开药方。
5、常吃萝卜常喝茶,不用医生把药拿。
6、吃萝卜,喝热茶,郎中改行拿钉耙。
7、九月九,大夫抄着手,家家吃萝卜病从哪里有?
8、萝卜抗癌,降福消灾。
9、萝卜缨子不要钱,止泻止痢赛黄连。
10、萝卜、干姜、梨,治咳有效又便宜。
11、多吃芹菜不用问,降低血压喊得应。
12、黄瓜鲜脆甜,常吃美容颜。
13、吃了十月茄,饿死郎中爷。
14、多吃紫茄煮米饭,黄疸肝炎好得快。
15、多吃番茄营养好,貌美年轻疾病少。
16、胡萝卜,小人参,常吃长精神。
17、红萝卜,显神通,降压降脂有奇功。
18、韭根韭叶,散瘀活血。
19、盐醋防毒消炎好,韭菜补肾暖膝腰。
20、青龙白虎汤,喉病保安康。(俗谓橄榄是治喉病的“青龙”,萝卜是治喉病的“白虎”)
21、包饭用荷叶,清香又解热。
1、若要不失眠,煮粥加白莲。 2、心血气不足,桂圆煨米粥。
3、萝卜小人参,常吃有精神。
4、常吃萝卜和葱姜,不用医生开药方。
5、常吃萝卜常喝茶,不用医生把药拿。
6、吃萝卜,喝热茶,郎中改行拿钉耙。
7、九月九,大夫抄着手,家家吃萝卜病从哪里有?
8、萝卜抗癌,降福消灾。
9、萝卜缨子不要钱,止泻止痢赛黄连。
10、萝卜、干姜、梨,治咳有效又便宜。
11、多吃芹菜不用问,降低血压喊得应。
12、黄瓜鲜脆甜,常吃美容颜。
13、吃了十月茄,饿死郎中爷。
14、多吃紫茄煮米饭,黄疸肝炎好得快。
15、多吃番茄营养好,貌美年轻疾病少。
16、胡萝卜,小人参,常吃长精神。
17、红萝卜,显神通,降压降脂有奇功。
18、韭根韭叶,散瘀活血。
19、盐醋防毒消炎好,韭菜补肾暖膝腰。
20、青龙白虎汤,喉病保安康。(俗谓橄榄是治喉病的“青龙”,萝卜是治喉病的“白虎”)
21、包饭用荷叶,清香又解热。
QQ2009正式版去广告方法
QQ 跑起来很慢,很烦恼,QQ广告满天飞,要怎么办才能让QQ跑起来快,又没有广告呢,很简单跟着下面做
最新的QQ2009正式版QQ2009广告方式变更了,具体的文字链广告信息是保存于每个QQ号码下。下介绍具体方法
QQ 跑起来很慢,很烦恼,QQ广告满天飞,要怎么办才能让QQ跑起来快,又没有广告呢,很简单跟着下面做
最新的QQ2009正式版QQ2009广告方式变更了,具体的文字链广告信息是保存于每个QQ号码下。下介绍具体方法




2009
11:34
752
1


