livibetter (@livibetter)

Forum Replies Created

Viewing 25 replies - 101 through 125 (of 145 total)
  • In reply to: How Do I Do This?

    Is this? screenshot1

    The structure of forums: screenshot2

    Modification for Kakumei theme:

    Find <?php if ( bb_forums() ) : ?> to <?php endif; // bb_forums() ?> (Total: 19 lines) in front-page.php.

    Replace them with:

    if ( bb_forums() ) :
    global $bb_forums_loop;
    $_loop =& $bb_forums_loop;
    while ($_loop) :
    if ($_loop->walker->depth == 1) {
    <h2<?php bb_forum_class?>><?php forum_name(); ?></h2>
    <table id="forumlist">
    <th><?php _e('Main Theme'); ?></th>
    <th><?php _e('Topics'); ?></th>
    <th><?php _e('Posts'); ?></th>
    else {
    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description(); ?></small><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    if ($_loop === null || $_loop->walker->depth == 1)
    echo '</table>';
    endwhile; ?>
    <?php endif; // bb_forums() ?>

    In reply to: exploit?

    I suggest you move to other hosting providers.

    I checked few sites on your hosting server (using to find out), they are inserted the same code.

    Hope you can get refund!

    Have you tried to post a very simple post like only one letter ‘a’ and deactivate all your plugins?

    Okay. I finally got it. I think this is a bug of bbPress.

    line 29-55 in rss.php ensures there is a post found at least, if not then die().

    Normally, we see no entries in a feed if there is no posts matched. But bbPress choose to die. You can replace each line of die(); with a dummy statement like

    1; // die();

    However, this is no enough. The third statement from bottom:

    bb_send_304( $posts[0]->post_time );

    Replace it with

    if ($posts)
    bb_send_304( $posts[0]->post_time );

    Since bbPress can’t find any posts, therefore it has no way to decide that should it send a 304.

    Can anyone confirm this is a bug about choosing to die?

    Was there any error entries in your web server’s log when someone accessed /forum/rss/?

    <?php global $forum; if ($forum->forum_parent == 0) forum_description(); ?>

    Quick explanation of the code: When $forum‘s forum_parent is 0, that means $forum is a top-level forum; if not, it is a sub-forum of another forum whose forum_id equals $forum‘s forum_parent.

    In reply to: sub-sub forums

    I checked the svn repos. It seems you are using bbPress prior to 0.8.2, please upgrade first.

    In reply to: sub-sub forums

    Check this screenshot

    If this what you need, then open your front-page.php and forum.php. Find

    <?php while ( bb_forum() ) : ?>
    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description(); ?></small><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    <?php endwhile; ?>

    Replace this (7 lines) with

    <?php while ( bb_forum() ) :
    global $bb_forums_loop;
    $_loop =& $bb_forums_loop;
    if($_loop->walker->depth == 3) : ?>
    <tr<?php bb_forum_class(); ?>>
    <td colspan="3"><?php bb_forum_pad( '<div class="nest">' ); ?>Subsubforums:
    <?php while ($_loop->walker->depth > 2) : ?>
    <a href="<?php forum_link(); ?>"><?php forum_name(); ?></a>
    if ($_loop !== null && $_loop->walker->depth > 2)
    echo ', ';
    <?php endif; ?>
    <?php if ($_loop !== null) : ?>
    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description();?></small><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    <?php endif; endwhile; ?>

    Note that this code prints out all descendants of a subforum together, not only in subsubforum level. If you need only subsubforums, then please use the code from

    This is quick solution but not perfect. Find <?php while ( bb_forum() ) : ?> in front-page.php and replace it with

    <?php while ( bb_forum() ) : global $forum; if ($forum->forum_parent != 0) continue;?>

    It only hides the subforums, so visitors have to click on a top level forum to see if there is any subforum within the top level forum.

    There are two if blocks in front-page.php, one for $super_stickies, another for $topics. Remove first one(about 8 lines) and replace second with

    $stickyIdx = 0; $topicIdx = 0;
    while ($stickyIdx < count($super_stickies) && $topicIdx < count($topics)) {
    if ($super_stickies[$stickyIdx]->topic_time > $topics[$topicIdx]->topic_time)
    array_splice($topics, $topicIdx, 0, array($super_stickies[$stickyIdx++]));
    if ($stickyIdx < count($super_stickies))
    array_splice($topics, count($topics), 0, array_slice($super_stickies, $stickyIdx));

    if ( $topics ) : foreach ( $topics as $topic ) : ?>
    <tr<?php topic_class(); ?>>
    <td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
    <td class="num"><?php topic_posts(); ?></td>
    <td class="num"><?php topic_last_poster(); ?></td>
    <td class="num"><small><?php topic_time(); ?></small></td>
    <?php endforeach; endif; // $topics ?>

    Actually, the replacement is equivalent to inserting 8 lines of code.

    I have no idea which file you meant. Please just paste the code about how you query for something from your database and how you process the data for the visitors.

    You don’t have to check the existence of the table you need

    Just create a table with IF NOT EXISTS.

    Could you paste your test.php?

    Here is an example for deactivation hook

    //bb_register_deactivation_hook(__FILE__, 'GADeactivate'); // Bug in bbPress 0.8.3, do same thing using next line
    add_action('bb_deactivate_plugin_' . bb_plugin_basename(__FILE__), 'GADeactivate');

    just remove “de” from above, that should work. For example,

    bb_register_activation_hook(__FILE__, 'hook_fct');

    However, I haven’t used activation hook, therefore I don’t know is there a problem with it.

    Sorry, my mistake

    echo '(<a href="' . get_profile_tab_link(bb_get_current_user_info('id'), 'edit') . '">edit</a>)';

    login_form() uses logged-in.php of current active theme if current user is logged in.

    Strange. Doesn’t your profile page in this official forum show your profile information?

    Are you using a theme other than Kakumei on your forum?

    You can put this at proper place in your logged-in.php

    echo '(<a href="' . get_profile_tab_link(0, 'edit') . '">edit</a>)';

    In reply to: tags linked to users?

    Check this screenshot out, is this what you want?

    If so, please continue to read

    In reply to: Plugin: Gravatar

    New Version, 0.2. Download the zipped file.

    • Two Gravatar Email Source

      • Use registered email
      • Use additional Gravatar Email field

    • Email Verification – Users need to verify Gravatar Emails which they input
    • Options page (screenshot)
    • Default Image – Supports displaying Default Image

      • Also supports displaying different Default Image based on user’s role

    • Display Name – Shows Display Name instead of Login name if available
    • Customize Size, Rating of avatar
    • Complete Deactivation – Removes options and data in usermeta

    Plugin’s page

    Use this code as a plugin.

    function Hook_get_profile_info_keys($keys) {
    return $keys;

    add_filter('get_profile_info_keys', 'Hook_get_profile_info_keys');

    I checked 0.8 in svn. You can simply comment out or remove those capabilities in capabilities.php.

    Did you activate it? and did you use a normal user to try posting? (keymaster remains all permissions)

    I noticed you probably use WP and bbPress together (by your recent posts), I have no idea if this code can work under that condition.

    * Sorry! I just realized that you meant 0.8. Well, I started to use bbPress from 0.8.3, so I don’t know is this compatible to 0.8. You need to check capabilities.php if available in 0.8.

    In reply to: Show login name

    Replace line 194 in bb-avatar-upload.php

    $felidenticon = $identicon->identicon_build( $user->user_login, '', false, '', false );


    $felidenticon = $identicon->identicon_build( (($user->display_name) ? $user->display_name : $user->user_login), '', false, '', false );

    PS. Just a quick guessing solution and I haven’t used this plugin.

    Have you tried to search one in Extend?

    If you find no plugin and you can do code, I think you can check line 18 in /bb-post.php, line 479 in /bb-includes/capabilities.php.

    You need to check current user’s is allowed to start a new topic in specific forum or not in your filter hook.

    Just thoughts, but should work.

    PS. I think it’s better not to do too much that bbPress can’t by default, or you could suffer more after upgrading unless you completely know what you do.

Viewing 25 replies - 101 through 125 (of 145 total)