livibetter (@livibetter)

Forum Replies Created

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

    livibetter
    Member

    @livibetter

    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:

    <?php
    if ( bb_forums() ) :
    global $bb_forums_loop;
    $_loop =& $bb_forums_loop;
    bb_forum();
    while ($_loop) :
    if ($_loop->walker->depth == 1) {
    ?>
    <h2<?php bb_forum_class?>><?php forum_name(); ?></h2>
    <table id="forumlist">
    <tr>
    <th><?php _e('Main Theme'); ?></th>
    <th><?php _e('Topics'); ?></th>
    <th><?php _e('Posts'); ?></th>
    </tr>
    <?php
    }
    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>
    </tr>
    <?php
    }
    bb_forum();
    if ($_loop === null || $_loop->walker->depth == 1)
    echo '</table>';
    endwhile; ?>
    <?php endif; // bb_forums() ?>

    In reply to: x-victory.ru exploit?

    livibetter
    Member

    @livibetter

    I suggest you move to other hosting providers.

    I checked few sites on your hosting server (using http://www.myipneighbors.com/ to find out), they are inserted the same code.

    Hope you can get refund!


    livibetter
    Member

    @livibetter

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


    livibetter
    Member

    @livibetter

    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?


    livibetter
    Member

    @livibetter


    livibetter
    Member

    @livibetter

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


    livibetter
    Member

    @livibetter

    <?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

    livibetter
    Member

    @livibetter

    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

    livibetter
    Member

    @livibetter

    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>
    </tr>
    <?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>
    <?php
    bb_forum();
    if ($_loop !== null && $_loop->walker->depth > 2)
    echo ', ';
    endwhile;
    ?>
    </td>
    </tr>
    <?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>
    </tr>
    <?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 http://www.livibetter.com/it/topic/example-3-level-forums-list?replies=1


    livibetter
    Member

    @livibetter

    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.


    livibetter
    Member

    @livibetter

    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

    <?php
    $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++]));
    $topicIdx++;
    }
    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>
    </tr>
    <?php endforeach; endif; // $topics ?>

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


    livibetter
    Member

    @livibetter

    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.


    livibetter
    Member

    @livibetter

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

    http://dev.mysql.com/doc/refman/4.1/en/create-table.html

    Just create a table with IF NOT EXISTS.


    livibetter
    Member

    @livibetter

    Could you paste your test.php?


    livibetter
    Member

    @livibetter

    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.


    livibetter
    Member

    @livibetter

    Sorry, my mistake

    <?php
    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.


    livibetter
    Member

    @livibetter

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

    https://bbpress.org/forums/profile/Lookfab

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


    livibetter
    Member

    @livibetter

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

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

    In reply to: tags linked to users?

    livibetter
    Member

    @livibetter

    Check this screenshot out, is this what you want?

    If so, please continue to read http://www.livibetter.com/it/topic/howto-how-to-?replies=6#post-21

    In reply to: Plugin: Gravatar

    livibetter
    Member

    @livibetter

    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


    livibetter
    Member

    @livibetter

    Use this code as a plugin.

    function Hook_get_profile_info_keys($keys) {
    unset($keys['interest']);
    return $keys;
    }

    add_filter('get_profile_info_keys', 'Hook_get_profile_info_keys');


    livibetter
    Member

    @livibetter

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


    livibetter
    Member

    @livibetter

    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

    livibetter
    Member

    @livibetter

    Replace line 194 in bb-avatar-upload.php

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

    with

    $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.


    livibetter
    Member

    @livibetter

    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)