Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,701 through 9,725 (of 32,511 total)
  • Author
    Search Results
  • #157010

    In reply to: Group Forums

    eVersatile
    Participant

    I apologize I should have been a little more specific.
    It is actually the actual content of the single forum that I would like to be different.
    This little piece of code <?php bbp_get_template_part( 'form', 'topic' ); ?> is what adds the topic form to the forum. For the main forum I would like to remove that and for the group forums, the topic form should still show.
    The form to add a topic to the main forums would be on a separate page.

    You’re funny.

    #156994
    golpilolz
    Participant

    Hi,

    I have a forum and i would like use wowhead for item link.
    I can’t find a plugin for that and i decided to code one. But when i post with the keymaster all is okay, but when it’s au simple user they can’t use the html tag.

    How allowed participant to use this html tag <item>item id</item>

    this is my code


    function add_tags(){
    add_filter( 'bb_allowed_tags', 'wow_item_allowed_tags',9);
    add_filter( 'bbp_get_reply_content', 'wow_item',9);
    add_filter( 'bbp_get_topic_content', 'wow_item',9);
    }
    function wow_item( $text ) {
    $text = preg_replace('|(<item>)(.*?)(</item>)|', '$2', $text);
    return $text;
    }
    function wow_item_allowed_tags() {
    return array(
    'item' => array(),
    'a' => array(
    'href' => array(),
    'title' => array(),
    'class' => array(),
    'rel' => array()
    )
    );
    }
    add_action( 'after_setup_theme', 'add_tags' );

    Thank you for your responses šŸ™‚

    #156992

    In reply to: Group Forums

    tharsheblows
    Participant

    Ok — again, I think this is what you mean. It might not be! I’ve left in some bits that will show you exactly what’s happening.

    <?php while ( bbp_forums() ) : $forum = bbp_the_forum();
       // if it's a group forum, then this is true
       if(  bbp_is_forum_group_forum( bbp_get_forum_id() )){
          echo '<strong>The following *is* a group forum:</strong>';
          // this is the bit you would change to your new template. And take out those echos, they're just something I find useful and thought you might too! :)
          bbp_get_template_part( 'loop', 'single-forum' );
       }
       // if it's not a group forum, do this
        else{
          echo '<strong>The following *is not* a group forum:</strong>';
          bbp_get_template_part( 'loop', 'single-forum' ); 
       }
    ?>

    Slightly off topic, I think that winky icon in my previous post looks a bit creepy. It might be just me though.

    #156991

    In reply to: Group Forums

    tharsheblows
    Participant

    So what you want is if a forum is in a group, it gets one template and if it’s not in a group, it gets another? eg in loop-forums.php you want something like:

    <?php while ( bbp_forums() ) : bbp_the_forum(); ?>
    
      if( this is a group forum ){
       <?php bbp_get_template_part( 'loop', 'single-group-forum' ); ?>
      }
      else{
        <?php bbp_get_template_part( 'loop', 'single-forum' ); ?>
      }
    
    <?php endwhile; ?>

    where bpp_get_template_part( ‘loop’, ‘single-group-forum’ ); gets a template part named “loop-single-group-forum.php” that you’ve created, probably by copying and modifying “loop-single-forum.php”.

    I’d think that’d be possible but while I’m looking for whatever goes in that if statement, want to check that that’s what you mean! No worries if not, one of my core competencies is misreading and misunderstanding posts. šŸ˜‰

    #156990
    tharsheblows
    Participant

    In some cases, it might be because the subscription emails are now being sent with all subscribers bbc’ed in rather than individually from a created no-reply address. The reason for the change is that posting new replies or topics was taking too long as it cycled through sending those emails. However, for some people (myself included), that wasn’t an issue.

    You can go back to the previous way as outlined here (as I mentioned, I have similar code in a plugin) but it should work if you put it in a file called bbp-functions.php in your bbpress theme.

    Actually, you might — after doing all the things you would do before you install a new plugin — try going back to the previous way with this: MJJ bbP 2.5.3 Subs. It does what it says on the tin, just uses the old functions from bbPress 2.5.3 to send subscription mails. Again, it might slow down new replies or topics. It doesn’t for me but just keep an eye on it.

    #156983

    In reply to: Post New Thread

    Robkk
    Moderator

    here i explain how to put a link to a page using the new topic form shortcode.

    bbpress.org/forums/topic/new-topic-button-at-top-of-topic-and-topic-creation-on-separate-page/

    here i explain the drop-link way, and a bunch of other things that are pretty cool

    bbpress.org/forums/topic/how-to-make-similar-bbpress-forum-to-quicsprout-one/#post-149112

    #156982

    In reply to: Post New Thread

    productiontrends
    Participant

    Hey,

    I did actually search and couldn’t find the thread about this. Do I need to add a shortcode to every topic? Is the shortcode below?

    [new topic form jump-link]

    Thanks for your time

    #156981

    In reply to: Post New Thread

    Robkk
    Moderator

    its not suppose to be there by default

    alot of people ask for this type of thing and there is two ways to do it

    create a topic form with a shortcode/new topic form jump-link

    search the forums and you will find it answered by many people

    #156973

    In reply to: shortcodes to sign out

    Robkk
    Moderator

    you can put this function in your child themes functions.php file

    function iweb_logout_url_shortcode() {
    	return wp_logout_url( home_url() );
    }
    add_shortcode( 'bbp-logout', 'iweb_logout_url_shortcode' );

    then use [bbp-logout]

    or use this plugin

    https://wordpress.org/plugins/log-out-shortcode/

    #156970
    Robkk
    Moderator

    i dont think the normal WordPress reset password redirects either. (bbPress is built off of WordPress)

    so i think its normal??

    you could add this to your functions.php in your child to redirect to your homepage after a reset password though.

    function wpse_lost_password_redirect() {
        wp_redirect( home_url() ); 
        exit;
    }
    add_action('password_reset', 'wpse_lost_password_redirect');

    or try this for a custom page

    function wpse_lost_password_redirect() {
        wp_redirect( 'http://yoursite.com/allowed-password-recovery/' ); 
        exit;
    }
    add_action('password_reset', 'wpse_lost_password_redirect');
    #156963
    Robkk
    Moderator

    you can use the bbpress views, and put the views widget in your sidebar

    see if this works , put this function into your functions.php

    function rkk_register_custom_views() {
    bbp_register_view( 'desc', __( 'Z-A' ), array('orderby'=> 'title', 'order' => 'DESC'), false );
    bbp_register_view( 'asc', __( 'A-Z' ), array('orderby'=> 'title', 'order' => 'ASC'), false );
    bbp_register_view( 'date-asc', __( 'Date ASC' ), array('orderby'=> 'date', 'order' => 'ASC'), false );
    bbp_register_view( 'date-desc', __( 'Date DESC' ), array('orderby'=> 'date', 'order' => 'DESC'), false );
    }
    add_action( 'bbp_register_views', 'rkk_register_custom_views' );
    #156962
    Robkk
    Moderator

    thats the right file , as long as you copied the file to a bbpress folder in your child theme it should work.

    here is an example of the code of the label renamed and without :

    <div class="bbp-username">
    			<label for="user_login"><?php _e( 'Name', 'bbpress' ); ?> </label>
    			<input type="text" name="log" value="<?php bbp_sanitize_val( 'user_login', 'text' ); ?>" size="20" id="user_login" tabindex="<?php bbp_tab_index(); ?>" />
    		</div>

    could also be a cache issue maybe clearing the cache on your site should fix it

    #156957
    Robkk
    Moderator

    check and see if creating a bbpress.php file could fix this

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    if not see if its a plugin issue

    Deactivate all but bbpress and see if this solves the issue. if not , re-enable one at a time to see which is causing the issue

    #156956
    Robkk
    Moderator

    it should work well on a self hosted site. (WordPress.org)

    for better integration its recommended that you create a bbpress.php though.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    i dont know for sure why you posted a link to your wordpress.com site though??

    unless you are doing a blog on a wordpress.com site and a forum using bbPress and WordPress(self hosted) site??

    you should use the same theme for both if you are doing that

    wordpress.org/themes/book-lite

    #156948
    mvaneijgen
    Participant

    Why do widgets have not enclosing container around them?

    Here is the Widgets for recent replies I was expecting a <div class="bbpress-widget-recent">code</div> or at least a <h1></h1> around the title

    
    "Recente Reacties"
    
    <ul>
    <li>
    <a href="/members/" title="Bekijk profiel" class="bbp-author-avatar" rel="nofollow"><img src="http://gravatar.com/avatar/b24c3f45ce107cd64af84ff792df90da?d=mm&s=14&r=G" class="avatar user-4-avatar avatar-14 photo" width="14" height="14" alt="Profile photo of user"></a>&nbsp;<a href="/members/" title="Bekijk profiel" class="bbp-author-name" rel="nofollow">User</a> op <a class="bbp-reply-topic-title" href="/onderwerp/link" title="link">link</a>
    </li>
    <li>
    <a href="/members/" title="Bekijk profiel" class="bbp-author-avatar" rel="nofollow"><img src="http://gravatar.com/avatar/b24c3f45ce107cd64af84ff792df90da?d=mm&s=14&r=G" class="avatar user-4-avatar avatar-14 photo" width="14" height="14" alt="Profile photo of user"></a>&nbsp;<a href="/members/" title="Bekijk profiel" class="bbp-author-name" rel="nofollow">User</a> op <a class="bbp-reply-topic-title" href="/onderwerp/link" title="link">link</a>
    </li>		
    </ul>
    #156935
    Nicolas Korobochkin
    Participant

    One more thing. I found some “bug” in my solution. If you use wp_signup_location in MU Plugins directory you need to pass three arguments to add_filter, because mu-plugins loaded before plugins or themes.

    1. MU Plugins
    2. Plugins
    3. Themes

    In MU Plugins:

    add_filter ('wp_signup_location', 'selena_signup_page', 99);
    // You can set up any number greater than 10 (default value).
    // Otherwise your WordPress will be redirect users to wrong page.

    In Theme or Plugin:

    add_filter ('wp_signup_location', 'selena_signup_page');
    // or
    // add_filter ('wp_signup_location', 'selena_signup_page', 99);
    #156934
    jkohler344
    Participant

    I was trying to change the CSS file to make the font more readable on my forums. I messed up the file and lost my original. Could someone post some code I could copy that is either the original bbpress.css file or one modified to have good readable font? Thanks for any help

    #156933
    dansearle
    Participant

    I have isolated the exact post content that causes the BBCode::Parse to hang. I can’t post the original content, but I made this version replacing the text with lorem ipsum, and it also hangs:

    $field =<<<EOD
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dictum ligula sit amet massa condimentum gravida. Quisque qutris imgdper diet dolor. Nulla quis ante id elit lacinia commodo. Maecenas convallis felis at libero fringilla, feiat.<br><br><br><i><b>[EDIT: Aenean aliquet velit est, ac sodales "tortyor aliquoam vitae" urna sit amet dui rutr "OpenGL Uiot" Tenentis in faucibus orci luctus et ultrices posuere cubilia Curae Donec fringilla velit non too much
    EOD;
    

    If you remove the words “too much” from the end then it parses ok.

    This is the full code that I put into a theme page template to run this test in isolation:

    echo "<h2>Begin the parser test</h2>";
    
    require_once( WP_PLUGIN_DIR . '/bbpress/bbpress.php' );
    
    $field =<<<EOD
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dictum ligula sit amet massa condimentum gravida. Quisque qutris imgdper diet dolor. Nulla quis ante id elit lacinia commodo. Maecenas convallis felis at libero fringilla, feiat.<br><br><br><i><b>[EDIT: Aenean aliquet velit est, ac sodales "tortyor aliquoam vitae" urna sit amet dui rutr "OpenGL Uiot" Tenentis in faucibus orci luctus et ultrices posuere cubilia Curae Donec fringilla velit non too much
    EOD;
    
    require_once( bbpress()->includes_dir . 'admin/parser.php' );
    $bbcode = BBCode::getInstance();
    echo  html_entity_decode( $bbcode->Parse( $field ) );
    
    #156924
    pahroblem
    Participant

    Hi guys, so ive followed this function from the bbpress codex webpage…

    // Filter wp_nav_menu() to add profile link
    add_filter( ‘wp_nav_menu_items’, ‘my_nav_menu_profile_link’ );
    function my_nav_menu_profile_link($menu) {
    if (!is_user_logged_in())
    return $menu;
    else
    $current_user = wp_get_current_user();
    $user=$current_user->display_name;
    $profilelink = ‘

  • Edit Profile
  • ‘;
    $menu = $menu . $profilelink;
    return $menu;
    }

    Its working great. the problem im having though is if the user has a space in their name it will produce a invalid link.. for example

    if the users name was Adam John

    the link will be http://www.example/forum/users/adam john/ and it wont work..

    any ideas? thank you in advance!

#156922

In reply to: New replies first

Robin W
Moderator

If I needed to control when the replies are asc or desc, what would you recommend? I’m using a custom post type; could I just add a meta box that calls the change_reply_order if checked for desc?

No you really woul;d need to use filters. These work with some shortcodes.

Where they don’t, you’d need to create a new shortcode, but if you need that come back with which and I’ll work on that.

#156921

In reply to: New replies first

hamncheez
Participant

It works great with the shortcodes I used ([bbp-single-topic id=whatever]), not sure which shortcodes SandyRig used. If I needed to control when the replies are asc or desc, what would you recommend? I’m using a custom post type; could I just add a meta box that calls the change_reply_order if checked for desc?

#156916

In reply to: New replies first

Robin W
Moderator

Let me know which shortcodes you are looking to use, and try the

function change_reply_order() {
$args['order'] = 'DESC';
 return $args;
}
add_filter('bbp_before_has_replies_parse_args', 'change_reply_order');

first to see if it works

#156913

In reply to: New replies first

hamncheez
Participant

@Robin W

Is the shortcode method something that could be edited? I could really use this functionality, but only on certain sub-forums/topics.

#156910
dansearle
Participant

Hi, I’m trying to import a Vanilla forum db into my new BBPress install (2.5.4 on WP 4.0.1) and it silently hangs during the conversion of topics.

I’ve debugged the code and I suspect it’s getting stuck when it tries to parse the HTML into BBPress. Is this a known issue at all? Is there something I can do to prep the incoming data perhaps?

I’m open to hacking the core of the importer here, I only need to get it working once.

#156899
EmilieMarie
Participant

Hello,

It’s my first time on this forum…
This is my problem :
I don’t want to insert a Connection widget on a side bar.I’d rather like to use short codes.
I already know these following shortcodes :
[bbp-login] – Display the login screen.
[bbp-register] – Display the register screen.
[bbp-lost-pass] – Display the lost password screen.
But I’d like a shortcode to sign out. I didn’t find it. Does it exist ?
Thank you very much for your help…

Viewing 25 results - 9,701 through 9,725 (of 32,511 total)
Skip to toolbar