当前位置:LaySNS首页 > 技术交流

【CMS】首页->最近更新中的 置顶文章 显示 加粗红色

楼主:云阳 时间:2018-05-28 22:31:09 点击:4731 回复:11

1、PHP文件\application\index\controller\index.php第33行左右改成

 //最近更新
        $article_new = Db::name('article')->alias('a')->join('user u', 'u.id=a.uid')->join('articlecate c', 'c.id=a.tid')->where('a.open', 1)->field('u.userhead,u.username,a.id,a.uid,a.settop,a.title,a.time,c.template')->order('a.settop desc,a.time desc')->limit($this->site_config['c_home_newlist'])->select();
$this->assign('article_new', $article_new);


2、HTML文件 \template\c_default\html\index_index.html第45行左右改成

    <a href="{:url( 'index/index/'.$vo.template,array( 'id'=>$vo.id))}" title="{$vo.title}" class="col-xs-8" {if $vo.settop eq 1 }style="color:red;font-weight:bold;" {/if}>{$vo.title|mb_substr=0,20,'utf-8'} 



作者: 云阳 时间:2018-05-28 06:41:39

你别复制错了地方就行

作者: sky88 时间:2018-05-29 19:24:01

QQ图片20180529192211

非常棒棒的

作者: 大婊謌 时间:2018-07-17 18:06:41

可以了!昨天弄好了 https://www.xxxxii.cn/

原来需要用php和htm编辑器用编码保存才可以

<

作者: 小辰 时间:2018-08-25 09:44:10

还有一种写法是这样的:

直接修改index_index.html的文件

找到最近更新文件

在标题栏的a标签下加入如下代码也是可以实现红标题效果。

如需改变颜色,只需if语句判断下的color后的red改成你想要的颜色即可

作者: 邵先森博客 时间:2018-10-03 17:47:34

不错啊

作者: QQ知啦资源 时间:2020-04-13 14:29:43

哒哒

0.136062s