Aug122010

备忘-改动两种功能。

网上搜到的一些对于typecho进行改动以达到一些功能的实现,我在此转载过来并记录一下,以方便以后升级

A1、不显示博客主人的评论。 (需改动源码 来源)

typecho目录下找到 /var/Widget/Comments/Recent.php文件,大概在代码第44行处,找到:
$select = $this->select()->limit($this->parameter->pageSize)   
->where('table.comments.status = ?', 'approved')

在where这一行的前面新加入一行where条件
->where('table.comments.authorId = ?', '0')

保存即可。

A2、不显示博客主人的评论。(不用改动源码 来源

在侧栏找到:
<?php $this->widget('Widget_Comments_Recent')->to($comments); ?>

修改为:
<?php $this->widget('Widget_Comments_Recent','ignoreAuthor=true')->to($comments); ?>

分类及标签只输出sulg

<?php $this->category(',', false); //输出分类名,不带连接?>
<?php $this->tags(', ', false, '没有标签');  //输出当前标签,不带连接?>
  1. 1
  2. 2

4 个流言蜚语 (制造者:3 个流言, 博主:1 次澄清)散布流言

  1. JET
    JET 2010年08月12日     
    沙发 回复

    嘿嘿,我来试试看行不!

  2. JET
    JET 2010年08月12日     
    板凳 回复

    看了下你的源码 author_info 放错地方了

    是包住 那个三个 input 输入框

  3. 飞天舞
    飞天舞 (博主) 2010年08月12日     
    地毯 回复

    @JET:好的,已经改了。

  4. 丁臣
    丁臣 2月8日     
    门口 回复

    第一招我在M4那里学的,最后一招没学过,看下,中间的自己也想不起来在哪学的了。。

增加一个流言 »


Powered By Typecho))) | Theme By simpleJun Base | 文章 RSS and 评论 RSS | 粤ICP备10208985号 | 空间赞助 By 散漫