为了在分类列表中显示隐藏的文章,修改下面哪个文件呢?

插件开发及发布

版主: woniou

回复
sincway
帖子: 2
注册时间: 2015年 10月 17日 13:41

为了在分类列表中显示隐藏的文章,修改下面哪个文件呢?

帖子 sincway »

我想把隐藏的文章只在首页被隐藏,而在具体的 Tag、分类页面还是可以看到。通过 grep 查询

代码: 全选

->where('table.contents.status = ?', 'publish')
语句,发现下面的文件包含了此语句:

代码: 全选

var/Widget/Contents/Post/Date.php:        ->where('table.contents.status = ?', 'publish')
var/Widget/Contents/Post/Recent.php:        ->where('table.contents.status = ?', 'publish')
var/Widget/Contents/Page/List.php:        ->where('table.contents.status = ?', 'publish')
var/Widget/Contents/Related.php:            ->where('table.contents.status = ?', 'publish')
var/Widget/Contents/Related/Author.php:            ->where('table.contents.status = ?', 'publish')
var/Widget/Archive.php:                    $select = $this->select()->where('table.contents.status = ?', 'publish');
var/Widget/Archive.php:            ->where('table.contents.status = ?', 'publish')
var/Widget/Archive.php:            ->where('table.contents.status = ?', 'publish')


然而逐个将上面的语句修改为

代码: 全选

->where('table.contents.status IN (?, ?)', 'publish', 'hidden')
之后,隐藏的文章仍然未被输出。

是没改对地方吗?还是由于其他原因造成隐藏的文章被拦截了呢?改了好久也不成功,对 Typecho 结构不太熟悉,希望能在这里得到指点 :mrgreen:
hnoor0033
帖子: 1
注册时间: 2016年 1月 25日 15:20

Re: 为了在分类列表中显示隐藏的文章,修改下面哪个文件呢?

帖子 hnoor0033 »

the hidden article has still not been output. Is no change of place? Or due to other causes hidden article was blocked out?


_______________
Download and Play dragon prince season 4 free on Mobile
上次由 hnoor0033 在 2020年 12月 10日 23:34,总共编辑 2 次。
头像
ClayMore
帖子: 2481
注册时间: 2007年 11月 29日 02:55
来自: Sleeping Forest
联系:

Re: 为了在分类列表中显示隐藏的文章,修改下面哪个文件呢?

帖子 ClayMore »

hnoor0033 写了:the hidden article has still not been output. Is no change of place? Or due to other causes hidden article was blocked out?


_______________
NOOR

woreirsis Rosette Bravo maya112<-your ID?


__________________

新版阿里百秀Alibaixiu主题 v11.1 For Typecho
http://xiu.160.me/
doncheto
帖子: 2
注册时间: 2016年 3月 10日 17:50

Re: 为了在分类列表中显示隐藏的文章,修改下面哪个文件呢?

帖子 doncheto »

xxx
上次由 doncheto 在 2020年 9月 8日 17:14,总共编辑 1 次。
JessWalker
帖子: 1
注册时间: 2020年 8月 31日 16:15
来自: New York
联系:

Re: 为了在分类列表中显示隐藏的文章,修改下面哪个文件呢?

帖子 JessWalker »

Thanks for sharing!
回复