bbPress米点站 » 主题:实现在帖子查看时显示楼层 http://www.bbpress.me/forums/topic/%E5%AE%9E%E7%8E%B0%E5%9C%A8%E5%B8%96%E5%AD%90%E6%9F%A5%E7%9C%8B%E6%97%B6%E6%98%BE%E7%A4%BA%E6%A5%BC%E5%B1%82/feed/ Mon, 27 Jan 2014 14:09:08 +0000 http://bbpress.org/?v=2.5.1-5217 zh-CN http://www.bbpress.me/forums/topic/%e5%ae%9e%e7%8e%b0%e5%9c%a8%e5%b8%96%e5%ad%90%e6%9f%a5%e7%9c%8b%e6%97%b6%e6%98%be%e7%a4%ba%e6%a5%bc%e5%b1%82/#post-2293 <![CDATA[实现在帖子查看时显示楼层]]> http://www.bbpress.me/forums/topic/%e5%ae%9e%e7%8e%b0%e5%9c%a8%e5%b8%96%e5%ad%90%e6%9f%a5%e7%9c%8b%e6%97%b6%e6%98%be%e7%a4%ba%e6%a5%bc%e5%b1%82/#post-2293 Thu, 26 Dec 2013 01:02:39 +0000 管理员 最简单的实现方法,如下。

找到该文件:
wordpress目录下的,wp-content\plugins\bbpress\templates\default\bbpress\loop-single-reply.php

打开文件,找到如下行,并在其下方加入添加的代码,即可实现:
1.  <a href="<?php bbp_reply_url(); ? rel="nofollow">" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>

添加代码如下:

 Code: arbitrary (select
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.

<a href="<?php bbp_reply_url(); ? rel="nofollow">" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>  

    <?php //添加的代码 ?>
    <a class="bbp-reply-permalink" rel="nofollow">
    <?php
      global $ReplyCount;
      $addnum = bbp_get_replies_per_page()*$_GET['paged'];
      ++$ReplyCount;
      $num = $ReplyCount + $addnum;
      echo $num.'楼';

    ?>
    </a>

    <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>

即可实现,实现原理很简单,通过记数与页数等计算,可以安自己需要稍稍修改。

实现效果如下图。

附件:
您必须登陆才能查看附件。
]]>
http://www.bbpress.me/forums/topic/%e5%ae%9e%e7%8e%b0%e5%9c%a8%e5%b8%96%e5%ad%90%e6%9f%a5%e7%9c%8b%e6%97%b6%e6%98%be%e7%a4%ba%e6%a5%bc%e5%b1%82/#post-2313 <![CDATA[回复:实现在帖子查看时显示楼层]]> http://www.bbpress.me/forums/topic/%e5%ae%9e%e7%8e%b0%e5%9c%a8%e5%b8%96%e5%ad%90%e6%9f%a5%e7%9c%8b%e6%97%b6%e6%98%be%e7%a4%ba%e6%a5%bc%e5%b1%82/#post-2313 Wed, 01 Jan 2014 14:13:11 +0000 32ichigo 成功了~3Q

]]>