Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create new topic in index


  • pre20
    Participant

    @pre20

    Hi

    I have the Forum root should show – Topics by freshness

    But, how can I add a New topic button there? I installed the bbp style but it adds the button in the forums view, not in the topics/index videw.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

  • Robin W
    Moderator

    @robin-w

    good point !

    I’ve just released bbp style pack version 3.6.0

    bbp style pack

    if you go into

    dashboard>settings>bbp style pack>forum dispay and check item 5 Add “Create New Topic” link O(and change text if you wish)

    it will add a link at the top and a form at the bottom.

    Sorry – about to go on holiday so haven’t time to style this as a button !


    wshades
    Participant

    @wshades

    Hi Robin, the link #bsptopic takes me to the home URL -which has to do with the .htaccess, I guess, as I have WordPress in a subfolder- so I changed it to https://mysite/../#bsptopic in bbp-style-pack/includes/functions.php which works just fine but will be destroyed when updating the plug-in. How can I get #bsptopic to work properly or where do I put the URL https://mysite/../#bsptopic where it’s safe. Adding to the child theme functions.php doesn’t work, of course, and trying a new-topic.php with snippets from the functions.php in a mu-plugin directory gave me the white screen 🙁


    Robin W
    Moderator

    @robin-w

    as it’s very near xmas and I’m pretty tied up, can you show the altered function that you created, which will save me time in finding it.

    thanks


    wshades
    Participant

    @wshades

    Hi, thanks, but I didn’t change a function, I just changed 2 links in functions.php

    327. function bsp_new_topic_button () {
    global $bsp_style_settings_buttons;
    if (!empty ($bsp_style_settings_buttons[‘new_topic_description’] )) $text=$bsp_style_settings_buttons[‘new_topic_description’] ;
    else $text=__(‘Create New Topic’, ‘bbp-style-pack’) ;
    if ($bsp_style_settings_buttons[‘button_type’] == 2) $class=$bsp_style_settings_buttons[‘Buttonclass’] ;
    else $class=’bsp_button1′ ;
    if ( bbp_current_user_can_access_create_topic_form() && !bbp_is_forum_category() ) {
    echo ‘https://mysite/leden/forum/ledenforum/#bsptopic”>’.$text.’‘ ;
    }
    }

    And

    400. function bsp_create_new_topica () {
    global $bsp_forum_display ;
    if (!empty ($bsp_forum_display[‘Create New Topic Description’])) $text=$bsp_forum_display[‘Create New Topic Description’] ;
    else $text=__(‘Create New Topic’, ‘bbp-style-pack’) ;
    if ( bbp_current_user_can_access_create_topic_form() && !bbp_is_forum_category() ) echo ‘<div class=”bsp-new-topic”> https://mysite/leden/forum/ledenforum/#bsptopic”>&#8217;.$text.’</div>’ ;
    }

    Both links were #bsptopic and an update will erase my URL’s. But #bsptopic leads to the homepage, unfortunately.

    Merry Xmas!


    Robin W
    Moderator

    @robin-w

    thanks, that was exactly the help I needed to get to the right code 🙂

    I’ve just released version 3.7.0 which has a filter you can use to change that link.

    If you update and then you add this code to your child theme‘s functions file

    add_filter ('bsp_new_topic_button', 'rew_change_button' ) ;
    add_filter ('bsp_create_new_topica', 'rew_change_button' ) ;
    
    function rew_change_button () {
    	$href = 'https://mysite/leden/forum/ledenforum/#bsptopic' ;
    	return $href ;	
    }

    then it won’t be affected.

    Please come back and confirm that it works for you.


    wshades
    Participant

    @wshades

    A charm! Thank you very much, very glad the code is safe now 🙂
    Again: merry Xmas and thanks a lot!

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