修改文章列表页面
2016-07-07 15:04 来源:www.chinab4c.com 作者:ecshop专家
| 我想要修改文章列表的显示风格. 在article_cat.dwt中看到{$article.url}{$article.title} 但是我在article_cat.php中没有找到这些定义. 请问这些定义是在哪一个文件中? 我想要显示一部分该标题对应的文章内容 | 
回答:
| 他封装在数组中 你打印$article数组。就明白了。 | 
| 找到了  | 
|  不错不错。 | 
| 下面是我在lbl_article.php中找到的方法.里面那个content是我自己加进去的.但是在dwt模版中调用却不会出来.也不出错.缓存也清了,我把改过的地方标成红色 function get_cat_articles($cat_id, $page = 1, $size = 20 ,$requirement='') { //取出所有非0的文章 if ($cat_id == '-1') { $cat_str = 'cat_id > 0'; } else { $cat_str = get_article_children($cat_id); } //增加搜索条件,如果有搜索内容就进行搜索 if ($requirement != '') { $sql = 'SELECT article_id, title, content, author, add_time, file_url, open_type' . ' FROM ' .$GLOBALS['ecs']->table('article') . ' WHERE is_open = 1 AND ' . $cat_str . ' ANDtitle like \'%' . $requirement . '%\' ' . ' ORDER BY article_type DESC, article_id DESC'; } else { $sql = 'SELECT article_id, title, content, author, add_time, file_url, open_type' . ' FROM ' .$GLOBALS['ecs']->table('article') . ' WHERE is_open = 1 AND ' . $cat_str . ' ORDER BY article_type DESC, article_id DESC'; } $res = $GLOBALS['db']->selectLimit($sql, $size, ($page-1) * $size); $arr = array(); if ($res) { while ($row = $GLOBALS['db']->fetchRow($res)) { $article_id = $row['article_id']; $arr[$article_id]['id'] = $article_id; $arr[$article_id]['title'] = $row['title']; $arr[$article_id]['content']= sub_str($row['content'],300); $arr[$article_id]['short_title'] = $GLOBALS['_CFG']['article_title_length'] > 0 ? sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title']; $arr[$article_id]['author']= empty($row['author']) || $row['author'] == '_SHOPHELP' ? $GLOBALS['_CFG']['shop_name'] : $row['author']; $arr[$article_id]['url']= $row['open_type'] != 1 ? build_uri('article', array('aid'=>$article_id), $row['title']) : trim($row['file_url']); $arr[$article_id]['add_time'] = date($GLOBALS['_CFG']['date_format'], $row['add_time']); } } return $arr; } 这是我在dwt随便写的 <div style=" margin-top:5px; border:1px solid #f2f2f2;"> <div>{$article.title}</div> <div>{$article.content}</div> </div> 请帮看一下哪里有问题? | 
| 我自己顶一下.顶到前面位置.请各位帮解决一下.看是哪里的问题 | 
 
        
					
						
					
					
						
                          
					
				 
      
      最近更新
常用插件
- ecshop2.7.1打印发货单插件
                                  ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs... 
- ecshop二次开发详细页面生
                                  插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人... 
- ecshop二次商品订购人信息
                                  ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的... 
- ecshop商品分类名称增加样
                                  ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样... 
- ecshop分类批量扩展插件
                                  ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们... 
ecshop热门问答
ecshop热门资料
          
               
            ecshop抬头 
                
            ecshop是时候 
                
            ecshop高級 
                
            ecshop品牌列表 
                
            ecshop装机 
                
            ecshop格式 
                
            ecshop国家 
                
            ecshop多用户商城 
                
            ecshopCOCO 
                
            ecshop插入图像 
                
            ecshop客服 
                
            B4C内容SEO 
                
            ecshop上传 
                
            ecshopbuild 
                
            ecshop百科 
                
            ecshop台式机 
                
            ecshop拍卖商品 
                
            ecshopecmall免费支付 
                
            session 
                
            ecshop台电脑 
                
            网店备案 
                
            ecshop新品排列顺序问题 
                
            ecshop指令码 
                
            ecshop手机中国 
                
            ecshop幫助 
                
            ecshoplvmore模板 
                
            ecshop倒序 
                
            ecshop详细页 
                
            ecshop仿暖岛 
                
            ecshop杀毒软件 
             
        
      


