让主页显示指定板块的“板块置顶帖子”

在你当前启用的主题里的hook文件夹创建一个文件,文件名为“index_threadlist_before.htm”,内容任选其一:

<?php
/* 指定板块<a target="_blank" href="https://labishaxin.com/tag/438.html" title="View all posts in 帖子">帖子</a> + <a target="_blank" href="https://labishaxin.com/tag/437.html" title="View all posts in 置顶帖">置顶帖</a>子 + 普通帖子 */
if($page === 1) {
$threadlist = thread_find_by_fids(array(1), 1, $pagesize, $order, $threads) + $threadlist; //把array(1)中的1换成要显示的板块ID(可在后台看到)
thread_list_access_filter($threadlist, $gid); //过滤帖子列表,必须要做
}
?>
<?php
<?php 
/* 指定板块<a target="_blank" href="https://labishaxin.com/tag/438.html" title="View all posts in 帖子">帖子</a> + <a target="_blank" href="https://labishaxin.com/tag/437.html" title="View all posts in 置顶帖">置顶帖</a>子 + 普通帖子 */
if($page === 1) {
    $threadlist = thread_find_by_fids(array(1), 1, $pagesize, $order, $threads) + $threadlist; //把array(1)中的1换成要显示的板块ID(可在后台看到)
    thread_list_access_filter($threadlist, $gid); //过滤帖子列表,必须要做
}
?>
<?php
<?php /* 指定板块帖子 + 置顶帖子 + 普通帖子 */ if($page === 1) { $threadlist = thread_find_by_fids(array(1), 1, $pagesize, $order, $threads) + $threadlist; //把array(1)中的1换成要显示的板块ID(可在后台看到) thread_list_access_filter($threadlist, $gid); //过滤帖子列表,必须要做 } ?> <?php
<span class="php"><span class="hljs-comment">/* 置顶帖子 + 指定板块帖子 + 普通帖子 */</span></span>
<span class="php"><span class="hljs-comment">/* 置顶帖子 + 指定板块帖子 + 普通帖子 */</span></span>
/* 置顶帖子 + 指定板块帖子 + 普通帖子 */
<span class="php"><span class="hljs-keyword">if</span>($page === <span class="hljs-number">1</span>) {
$threadlist = $toplist3 + thread_find_by_fids(<span class="hljs-keyword">array</span>(<span class="hljs-number">1</span>), <span class="hljs-number">1</span>, $pagesize, $order, $threads) + thread_find_by_fids($fids, $page, $pagesize, $order, $threads); <span class="hljs-comment">//把array(1)中的1换成要显示的板块ID(可在后台看到)</span>
thread_list_access_filter($threadlist, $gid); <span class="hljs-comment">//过滤没有权限访问的帖子,必须要做</span>
}
<span class="hljs-meta">?></span></span>
<span class="php"><span class="hljs-meta"><?php</span>
<span class="hljs-comment">/* 指定板块置顶帖子 + 全站置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span>($page === <span class="hljs-number">1</span>) {
$threadlist = thread_top_find(<span class="hljs-number">1</span>) + $threadlist;
thread_list_access_filter($threadlist, $gid); <span class="hljs-comment">//过滤没有权限访问的帖子,必须要做</span>
}
<span class="hljs-meta">?></span></span>
<span class="php"><span class="hljs-meta"><?php</span>
<span class="hljs-comment">/* 全站置顶帖子 + 指定板块置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span>($page === <span class="hljs-number">1</span>) {
$threadlist = $toplist3 + thread_top_find(<span class="hljs-number">1</span>) + thread_find_by_fids($fids, $page, $pagesize, $order, $threads); <span class="hljs-comment">//把1换成要显示的板块ID(可在后台看到)</span>
thread_list_access_filter($threadlist, $gid); <span class="hljs-comment">//过滤没有权限访问的帖子,必须要做</span>
}
<span class="hljs-meta">?></span></span>
<span class="php"><span class="hljs-meta"><?php</span>
<span class="hljs-comment">/* 所有板块置顶帖子 + 全站置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span> ($page === <span class="hljs-number">1</span>) {
$threadlist_alltop = <span class="hljs-keyword">array</span>();
<span class="hljs-keyword">foreach</span> (arrlist_values($forumlist, <span class="hljs-string">'fid'</span>) <span class="hljs-keyword">as</span> $key => $value) {
$r = thread_top_find( $value );
$threadlist_alltop = array_merge($threadlist_alltop , $r );
}
$threadlist = $threadlist_alltop + $threadlist;
thread_list_access_filter($threadlist, $gid);
}
<span class="hljs-meta">?></span></span>
<span class="php"><span class="hljs-meta"><?php</span>
<span class="hljs-comment">/* 全站置顶帖子 + 所有板块置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span> ($page === <span class="hljs-number">1</span>) {
$threadlist_alltop = <span class="hljs-keyword">array</span>();
<span class="hljs-keyword">foreach</span> (arrlist_values($forumlist, <span class="hljs-string">'fid'</span>) <span class="hljs-keyword">as</span> $key => $value) {
$r = thread_top_find( $value );
$threadlist_alltop = array_merge($threadlist_alltop , $r );
}
$threadlist = $toplist3 + $threadlist_alltop + thread_find_by_fids($fids, $page, $pagesize, $order, $threads);
thread_list_access_filter($threadlist, $gid);
}
<span class="hljs-meta">?></span></span>
<span class="php"><span class="hljs-keyword">if</span>($page === <span class="hljs-number">1</span>) {
    $threadlist = $toplist3 + thread_find_by_fids(<span class="hljs-keyword">array</span>(<span class="hljs-number">1</span>), <span class="hljs-number">1</span>, $pagesize, $order, $threads) + thread_find_by_fids($fids, $page, $pagesize, $order, $threads); <span class="hljs-comment">//把array(1)中的1换成要显示的板块ID(可在后台看到)</span>
    thread_list_access_filter($threadlist, $gid); <span class="hljs-comment">//过滤没有权限访问的帖子,必须要做</span>
}
<span class="hljs-meta">?></span></span>
<span class="php"><span class="hljs-meta"><?php</span> 
<span class="hljs-comment">/* 指定板块置顶帖子 + 全站置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span>($page === <span class="hljs-number">1</span>) {
    $threadlist = thread_top_find(<span class="hljs-number">1</span>) + $threadlist;
    thread_list_access_filter($threadlist, $gid); <span class="hljs-comment">//过滤没有权限访问的帖子,必须要做</span>
}
<span class="hljs-meta">?></span></span>
<span class="php"><span class="hljs-meta"><?php</span> 
<span class="hljs-comment">/* 全站置顶帖子 + 指定板块置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span>($page === <span class="hljs-number">1</span>) {
    $threadlist = $toplist3 + thread_top_find(<span class="hljs-number">1</span>) + thread_find_by_fids($fids, $page, $pagesize, $order, $threads); <span class="hljs-comment">//把1换成要显示的板块ID(可在后台看到)</span>
    thread_list_access_filter($threadlist, $gid); <span class="hljs-comment">//过滤没有权限访问的帖子,必须要做</span>
}
<span class="hljs-meta">?></span></span>

<span class="php"><span class="hljs-meta"><?php</span>
<span class="hljs-comment">/* 所有板块置顶帖子 + 全站置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span> ($page === <span class="hljs-number">1</span>) {
    $threadlist_alltop = <span class="hljs-keyword">array</span>();
    <span class="hljs-keyword">foreach</span> (arrlist_values($forumlist, <span class="hljs-string">'fid'</span>) <span class="hljs-keyword">as</span> $key => $value) {
        $r = thread_top_find( $value );
        $threadlist_alltop = array_merge($threadlist_alltop , $r );
    }
    $threadlist = $threadlist_alltop + $threadlist;
    thread_list_access_filter($threadlist, $gid);
}
<span class="hljs-meta">?></span></span>

<span class="php"><span class="hljs-meta"><?php</span>
<span class="hljs-comment">/* 全站置顶帖子 + 所有板块置顶帖子 + 普通帖子 */</span>
<span class="hljs-keyword">if</span> ($page === <span class="hljs-number">1</span>) {
    $threadlist_alltop = <span class="hljs-keyword">array</span>();
    <span class="hljs-keyword">foreach</span> (arrlist_values($forumlist, <span class="hljs-string">'fid'</span>) <span class="hljs-keyword">as</span> $key => $value) {
        $r = thread_top_find( $value );
        $threadlist_alltop = array_merge($threadlist_alltop , $r );
    }
    $threadlist = $toplist3 + $threadlist_alltop + thread_find_by_fids($fids, $page, $pagesize, $order, $threads);
    thread_list_access_filter($threadlist, $gid);
}
<span class="hljs-meta">?></span></span>
if($page === 1) { $threadlist = $toplist3 + thread_find_by_fids(array(1), 1, $pagesize, $order, $threads) + thread_find_by_fids($fids, $page, $pagesize, $order, $threads); //把array(1)中的1换成要显示的板块ID(可在后台看到) thread_list_access_filter($threadlist, $gid); //过滤没有权限访问的帖子,必须要做 } ?> <?php /* 指定板块置顶帖子 + 全站置顶帖子 + 普通帖子 */ if($page === 1) { $threadlist = thread_top_find(1) + $threadlist; thread_list_access_filter($threadlist, $gid); //过滤没有权限访问的帖子,必须要做 } ?> <?php /* 全站置顶帖子 + 指定板块置顶帖子 + 普通帖子 */ if($page === 1) { $threadlist = $toplist3 + thread_top_find(1) + thread_find_by_fids($fids, $page, $pagesize, $order, $threads); //把1换成要显示的板块ID(可在后台看到) thread_list_access_filter($threadlist, $gid); //过滤没有权限访问的帖子,必须要做 } ?> <?php /* 所有板块置顶帖子 + 全站置顶帖子 + 普通帖子 */ if ($page === 1) { $threadlist_alltop = array(); foreach (arrlist_values($forumlist, 'fid') as $key => $value) { $r = thread_top_find( $value ); $threadlist_alltop = array_merge($threadlist_alltop , $r ); } $threadlist = $threadlist_alltop + $threadlist; thread_list_access_filter($threadlist, $gid); } ?> <?php /* 全站置顶帖子 + 所有板块置顶帖子 + 普通帖子 */ if ($page === 1) { $threadlist_alltop = array(); foreach (arrlist_values($forumlist, 'fid') as $key => $value) { $r = thread_top_find( $value ); $threadlist_alltop = array_merge($threadlist_alltop , $r ); } $threadlist = $toplist3 + $threadlist_alltop + thread_find_by_fids($fids, $page, $pagesize, $order, $threads); thread_list_access_filter($threadlist, $gid); } ?>
内容看完了
© 版权声明
1:本网站名称:蜡笔傻新
2:本站永久网址:https://labishaxin.com/
3:本站部分内容收集于互联网,如果有侵权内容、请联系我们删除,不妥之处,敬请谅解
4:本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责
5:本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6:本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新
点赞15赞赏 分享
评论 抢沙发

请登录后发表评论