Lynq (@lynq)

Forum Replies Created

Viewing 25 replies - 351 through 375 (of 377 total)
  • @lynq

    Participant

    Hi deathbybear,

    The only way I have found to make this happen is to edit the core code provided by bbpress.

    I am not sure if this is the right way to go, so if someone else can suggest another way then let me know.

    Here is what I have done. I replaced the bbp_list_forums function inside forum-template.php and then inside the loops-single-forum I changed the arguments to enable the last poster.

    function bbp_list_forums( $args = '' ) {

    // Define used variables
    $output = $sub_forums = $topic_count = $reply_count = $counts = '';
    $i = 0;
    $count = array();

    // Defaults and arguments
    $defaults = array (
    'before' => '<ul class="bbp-forums">',
    'after' => '</ul>',
    'link_before' => '<li class="bbp-forum">',
    'link_after' => '</li>',
    'count_before' => ' (',
    'count_after' => ')',
    'count_sep' => ', ',
    'separator' => ', ',
    'forum_id' => '',
    'show_topic_count' => true,
    'show_reply_count' => true,
    'freshness_before' => '<td class="last-posted-box">',
    'freshness_after' => '</td>',
    'show_freshness_link' => true,
    'freshness_author_before' => '<div class="author-box">',
    'freshness_author_after' => '</div>'
    );
    $r = wp_parse_args( $args, $defaults );
    extract( $r, EXTR_SKIP );

    // Bail if there are no subforums
    if ( !bbp_get_forum_subforum_count( $forum_id ) )
    return;

    // Loop through forums and create a list
    if ( $sub_forums = bbp_forum_get_subforums( $forum_id ) ) {

    // Total count (for separator)
    $total_subs = count( $sub_forums );
    foreach ( $sub_forums as $sub_forum ) {
    $i++; // Separator count

    // Get forum details
    $count = array();
    $show_sep = $total_subs > $i ? $separator : '';
    $permalink = bbp_get_forum_permalink( $sub_forum->ID );
    $title = bbp_get_forum_title( $sub_forum->ID );

    // Show topic count
    if ( !empty( $show_topic_count ) && !bbp_is_forum_category( $sub_forum->ID ) )
    $count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );

    // Show reply count
    if ( !empty( $show_reply_count ) && !bbp_is_forum_category( $sub_forum->ID ) )
    $count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );

    // Counts to show
    if ( !empty( $count ) )
    $counts = $count_before . implode( $count_sep, $count ) . $count_after;

    // Show topic count
    if ( !empty( $show_freshness_link ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    $freshness_link = bbp_get_forum_freshness_link( $sub_forum->ID );
    $freshness_author = $freshness_author_before . bbp_get_author_link( array( 'post_id' => bbp_get_forum_last_active_id( $sub_forum->ID ), 'size' => 14 ) ) . $freshness_author_after;
    $freshness_link = $freshness_before . $freshness_link . $freshness_author . $freshness_after;
    }

    // Build this sub forums link
    $output .= $link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . $freshness_link . '</a>' . $show_sep . $link_after;
    }

    // Output the list
    echo $before . $output . $after;
    }
    }

    Let me know how you get on, good luck!

    @lynq

    Participant

    No problem at all, I didn’t like the formatting either lol.

    In reply to: Fatal error, Askinet

    @lynq

    Participant

    Awesome, good news!

    @lynq

    Participant

    Awesome, it works!

    @lynq

    Participant

    I am probably being stupid, but I can not see where I can contribute on any of the codex pages?

    @lynq

    Participant

    Ooooh, cool!

    Can we create more documentation? I notice the same question on the forums over and over again about the bbp_list_forums, removing the commas. I was thinking about explaining the bbp_list_forums function for templating?

    @lynq

    Participant

    Is there any where we can go to help contribute to the list?

    @lynq

    Participant

    I am sure there is a better solution, but you could use something like

    if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 5 ) ) )
    bbp_get_template_part( 'bbpress/loop', 'latest-topics' );

    Then use some css to remove everything except the avatars.

    @lynq

    Participant
    function bbp_list_forums( $args = '' ) {

    // Define used variables
    $output = $sub_forums = $topic_count = $reply_count = $counts = '';
    $i = 0;
    $count = array();

    // Defaults and arguments
    $defaults = array (
    'before' => '<ul class="bbp-forums">',
    'after' => '</ul>',
    'link_before' => '<li class="bbp-forum">',
    'link_after' => '</li>',
    'count_before' => ' (',
    'count_after' => ')',
    'count_sep' => ', ',
    'separator' => ', ',
    'forum_id' => '',
    'show_topic_count' => true,
    'show_reply_count' => true,
    'freshness_before' => '<td class="last-posted-box">',
    'freshness_after' => '</td>',
    'show_freshness_link' => true,
    'freshness_author_before' => '<div class="author-box">',
    'freshness_author_after' => '</div>'
    );
    $r = wp_parse_args( $args, $defaults );
    extract( $r, EXTR_SKIP );

    // Bail if there are no subforums
    if ( !bbp_get_forum_subforum_count( $forum_id ) )
    return;

    // Loop through forums and create a list
    if ( $sub_forums = bbp_forum_get_subforums( $forum_id ) ) {

    // Total count (for separator)
    $total_subs = count( $sub_forums );
    foreach ( $sub_forums as $sub_forum ) {
    $i++; // Separator count

    // Get forum details
    $count = array();
    $show_sep = $total_subs > $i ? $separator : '';
    $permalink = bbp_get_forum_permalink( $sub_forum->ID );
    $title = bbp_get_forum_title( $sub_forum->ID );

    // Show topic count
    if ( !empty( $show_topic_count ) && !bbp_is_forum_category( $sub_forum->ID ) )
    $count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );

    // Show reply count
    if ( !empty( $show_reply_count ) && !bbp_is_forum_category( $sub_forum->ID ) )
    $count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );

    // Counts to show
    if ( !empty( $count ) )
    $counts = $count_before . implode( $count_sep, $count ) . $count_after;

    // Show topic count
    if ( !empty( $show_freshness_link ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    $freshness_link = bbp_get_forum_freshness_link( $sub_forum->ID );
    $freshness_author = $freshness_author_before . bbp_get_author_link( array( 'post_id' => bbp_get_forum_last_active_id( $sub_forum->ID ), 'size' => 14 ) ) . $freshness_author_after;
    $freshness_link = $freshness_before . $freshness_link . $freshness_author . $freshness_after;
    }

    // Build this sub forums link
    $output .= $link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . $freshness_link . '</a>' . $show_sep . $link_after;
    }

    // Output the list
    echo $before . $output . $after;
    }
    }

    This will give you more control over creating a theme which looks like Invision or PHPBB.

    You will have to customize your theme as well to make sure it is compatible.

    @lynq

    Participant

    Hi Scheena,

    Would you be able to expand on that a little, I don’t quite understand the following:

    “There is that link between an author and his post” ?

    @lynq

    Participant

    I just commented out the sidebar from all my bbpress template files, worked perfectly.

    In reply to: Fatal error, Askinet

    @lynq

    Participant

    Are you fully using Akismet on the rest of your wordpress blog?

    @lynq

    Participant

    I think bbp-forum-template is a core file?

    You would be better off using something like this inside loop-single-forum:

    bbp_list_forums(array ('count_sep' => ''));

    Good luck.

    @lynq

    Participant

    Great, glad to be of help!

    @lynq

    Participant

    No problem, glad to be of help.

    @lynq

    Participant

    http://teamoverpowered.com/

    The forum is still WIP though, but I am liking how it is coming along :)

    @lynq

    Participant

    Hey guys,

    I have been searching for this myself aswell, but couldn’t find anything anywhere.

    If anyone is interested I modified the bbp_list_forums function to have a flag for freshness (last poster) to be displayed or not.

    function bbp_list_forums( $args = '' ) {

    // Define used variables
    $output = $sub_forums = $topic_count = $reply_count = $counts = '';
    $i = 0;
    $count = array();

    // Defaults and arguments
    $defaults = array (
    'before' => '<ul class="bbp-forums">',
    'after' => '</ul>',
    'link_before' => '<li class="bbp-forum">',
    'link_after' => '</li>',
    'count_before' => ' (',
    'count_after' => ')',
    'count_sep' => ', ',
    'separator' => ', ',
    'forum_id' => '',
    'show_topic_count' => true,
    'show_reply_count' => true,
    'freshness_before' => '<td>',
    'freshness_after' => '</td>',
    'show_freshness_link' => true
    );
    $r = wp_parse_args( $args, $defaults );
    extract( $r, EXTR_SKIP );

    // Bail if there are no subforums
    if ( !bbp_get_forum_subforum_count( $forum_id ) )
    return;

    // Loop through forums and create a list
    if ( $sub_forums = bbp_forum_get_subforums( $forum_id ) ) {

    // Total count (for separator)
    $total_subs = count( $sub_forums );
    foreach ( $sub_forums as $sub_forum ) {
    $i++; // Separator count

    // Get forum details
    $count = array();
    $show_sep = $total_subs > $i ? $separator : '';
    $permalink = bbp_get_forum_permalink( $sub_forum->ID );
    $title = bbp_get_forum_title( $sub_forum->ID );

    // Show topic count
    if ( !empty( $show_topic_count ) && !bbp_is_forum_category( $sub_forum->ID ) )
    $count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );

    // Show reply count
    if ( !empty( $show_reply_count ) && !bbp_is_forum_category( $sub_forum->ID ) )
    $count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );

    // Counts to show
    if ( !empty( $count ) )
    $counts = $count_before . implode( $count_sep, $count ) . $count_after;

    // Show topic count
    if ( !empty( $show_freshness_link ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    $freshness_link = bbp_get_forum_freshness_link( $sub_forum->ID );
    $freshness_link = $freshness_before . $freshness_link . $freshness_after;
    }

    // Build this sub forums link
    $output .= $link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . $freshness_link . '</a>' . $show_sep . $link_after;
    }

    // Output the list
    echo $before . $output . $after;
    }
    }

    Let me know if you would like any help with I am currently customising my theme to work with it, you will need to add an extra th to your forum tables other you just have a blank in place.

    Hope someone finds this helpful!

    p.s. you can also specify a before and after in the arguments of bbp_list_forums.

    All the best.

    Lynq.

    @lynq

    Participant

    Inside loop-single-forum in the theme files I changed the bbp_list_forums function.

    In the array inside the parameter just change the separator to
    or nothing.

    Good luck!

    @lynq

    Participant

    I use this in my main theme page loop.

    <?php if ( is_front_page() ) { ?>
    // Main homepage H1.
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php } else if (get_post_type() == 'forum') { ?>
    // Forum H1
    <h1 class="entry-title">Forum Title</h1>
    <?php } else { ?>
    // Fallback
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php } ?>

    Let me now if this helps, good luck!

    @lynq

    Participant

    You have the following css, which is positioning the element absolutely. Just remove it. Line 862 on style.css

    .reply {
    bottom: 15px;
    line-height: 1.2em;
    position: absolute;
    right: 15px;
    }

    Good luck!

    @lynq

    Participant

    This is what happened to me… it my help someone else.

    I deactivated all of my plugins by accident trying to hunt down a piece of code inside a custom plugin.

    This caused my forum to disappear and continually 404, although everything was still there.

    By changing my Permalinks and then changing them back to what they were originally this issue is fixed.

    Good luck to anyone who reads this!

    Settings > Permalinks > Save (Try just saving first, if that doesn’t work, then change them, save them and then change them and save them again).

    @lynq

    Participant

    Great, good job!

    @lynq

    Participant

    I am not sure but there is a large answer to this question on the akismet website.

    http://akismet.com/support/#ht9

    The one in particular which is interesting and means you could of changed nothing your end but your hosting did change something is the load balancing.

    Good luck!

    @lynq

    Participant

    There must be some other CSS which is taking over control of it then.

    If you add the fixed width and then add css rules to the headings of the table to control the width of them aswell, then you can get the exact look that you want.

    @lynq

    Participant

    You could set a fixed width on the table rather than a percent, to make sure it doesn’t go any wider…

    table { width: 535px; }

    Edit: I did test in firebug and adding the width onto the table seemed to be fine, you may want to use the actual classes though, like .bbp-replies etc…

Viewing 25 replies - 351 through 375 (of 377 total)