Skip to:
Content
Pages
Categories
Search
Top
Bottom

subforums and markup

  • @clairecc

    Member

    subforums – I’ve created subforums okay but a couple of things:

    -can I have it so subforums are not shown on the front page?

    – someone else mentioned this but there was no responses about it: when I create a forum and subforums, if I post in the main forum the post automatically goes to the last of the sub forums – how do I correct this?

    markup – can someone give me an idiots guide to using bold etc because I have tried putting it between backticks and it doesnt seem to work.

Viewing 14 replies - 1 through 14 (of 14 total)
  • @_ck_

    Participant

    If you mean so topics in sub-forums do not show up on “latest discussions” I whipped this up to solve that:

    function filter_front_page_topics($where){
    // $exclude_forums=array ("8"); // enable this to manually specify specific forums by id #
    $forums = get_forums(); foreach ($forums as $forum) {if ($forum->forum_parent) {$exclude_forums[]=$forum->forum_id;}} // exclude ALL sub-forums
    if ( is_front()) {foreach($exclude_forums as $forum) { $where.=" AND forum_id != ".$forum." "; }}
    return $where;
    }
    add_filter( 'get_latest_topics_where', 'filter_front_page_topics');
    add_filter( 'get_latest_posts_where', 'filter_front_page_topics');

    @_ck_

    Participant

    If you are trying to use <b> instead of “strong” it won’t work because it’s not the “leet” xhtml standard that bbpress wants to enforce. But you can trick bbpress to allow it with this tweak:

    function allow_extra_tags( $tags ) {
    $tags['del'] = array();
    $tags['strike'] = array();
    $tags['s'] = array();
    $tags['b'] = array();
    $tags['i'] = array();
    $tags['u'] = array();
    $tags['bq'] = array();
    $tags['blockquote'] = array();
    $tags['pre'] = array();
    $tags['hr'] = array();
    return $tags;
    }
    add_filter( 'bb_allowed_tags', 'allow_extra_tags' );

    note as you can see I allow other tags too

    @fel64

    Member

    Yup. Just don’t display the forum if $forum->forum_parent is true. Change the bit in your templates that goes like this:

    <?php foreach( $forums as $forum ) : ?>
    //blaaaaah HTML
    <?php endforeach; ?>

    to this sort of thing:

    <?php foreach( $forums as $forum ) :
    if( !$forum->forum_parent ) { ?>
    //blaaaaaah HTML
    <?php }
    enforeach; ?>

    (ugh colon syntax)

    [Edit] Beat me to it ck (by the way, blockquote is already allowed and you’re overwriting it. Doesn’t really matter but could add conflict problems if someone wants to allow it to have attributes). Claire, worth mentioning that this method means it will ignore any subforums without you having to tell it it’s a subforum.

    Claire, markup is like this:

    <anytag> your text here </anytag>

    so actually HTML tags go between < and >. Actual code, like php code, will be shown as code if you put backticks around it. :)

    You can also use a simplified markup like http://www.loinhead.net/files/felise (just copy that into a plugin file and activate), which means that *this* is bold, _this_ italic and this@someurl turns into <a href="someurl">this</a>, etc. More on that https://bbpress.org/forums/topic/markdown?replies=10

    @_ck_

    Participant

    when I create a forum and subforums, if I post in the main forum the post automatically goes to the last of the sub forums – how do I correct this?

    oooohh! That explains why I keep having to move posts.

    That’s probably somehow associated with this bug I found:

    https://trac.bbpress.org/ticket/704

    It is indeed very annoying. Unfortunately no clue how to fix.

    @fel64

    Member

    Unfortunately no clue how to fix.

    Did this not work?

    @_ck_

    Participant

    fel64, the string is internal to bbpress, not the template loop.

    Look at forum.php template to remind yourself

    <?php while ( bb_forum() ) : ?>
    <tr<?php bb_forum_class(); ?>>

    $forum is being treated as a global and not reset back.

    I could remember and reset $forum I guess before and after the while-loop $temp=$forum; loop-here; $forum=$temp; but that’s an ugly hack. It’s got to be fixed in the core and that’s beyond my knowledge of bbpress.

    @clairecc

    Member

    Thanks guys!!!!

    The subforums not showing on the front page in the forum list works a treat!

    Got the basic markup to work. Will install the plugin for making *this* bold in a minute.

    You guys rock!

    If anyone works out how to stop the posts from going in the subforum when supposed to be in the main forum that would be great. Alternatively, is it possible to disable posts from being made in the main forums and be only allowed in the subforums?

    @_ck_

    Participant

    Sooner or later you may want these other tweaks too:

    http://ckon.wordpress.com/2007/07/12/bbpress-plugin-bb-tweaks/

    1. Get rid of the ?replies=# ugliness in topic links

    2. add nofollow to post links

    3. add target=_blank to post links

    4. auto-close tags – bbPress’s auto-close tags is broken by default

    5. get rid of [closed] on subjects – useful if you have a narrow template

    @clairecc

    Member

    Worked a treat, many thanks!

    @fel64

    Member

    fel64, the string is internal to bbpress, not the template loop.

    Fair enough, shoulda checked that. So I went and looked through the code, you know, to find the problem. bb has quite an interesting structure there. Couldn’t find the problem, though, so I looked at the code in the .8.2.1 version and it’s missing a bit.

    It’s fixed in trunk. Claire, upgrade to the latest version and it’ll work just fine.

    @clairecc

    Member

    Fantastic, Fel64, this worked a treat too!

    Thanks to everyone, this support forum really is second to none!

    @itissue

    Member

    Is there a way to only display sub forums after clicking on the main forum link?

    @livibetter

    Member

    @itissue: Didn’t fel64’s method work?

    @ichimanako

    Member

    It didn’t work for me

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.