Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 13,476 through 13,500 (of 32,503 total)
  • Author
    Search Results
  • #138648
    #138646
    fatpat76
    Participant

    Hello there, I just went through some problems where the bbPress capabilities were not registered in the wp_user_roles option_name row entry. I don’t know what caused it but I was trying to see if I uninstalled/reinstalled bbPress it might reset the capabilities. It didn’t.

    So I got hunting through the code and I found this function:

    /**
     * Adds capabilities to WordPress user roles.
     *
     * @since bbPress (r2608)
     */
    function bbp_add_caps() {
    
    	// Loop through available roles and add caps
    	foreach ( bbp_get_wp_roles()->role_objects as $role ) {
    		foreach ( bbp_get_caps_for_role( $role->name ) as $cap => $value ) {
    			$role->add_cap( $cap, $value );
    		}
    	}
    
    	do_action( 'bbp_add_caps' );
    }

    But nothing seem to ever call this function. I did a search through all of the plugin code and there aren’t any references to this function. What gives?

    In the end I was able to force the capabilities to be rebuilt by adding this function call inside another function that I knew was being called and it worked (I’ve since removed this).

    BTW, this is on WP 3.7.1, bbPress 2.4.1.

    Thanks!
    Patrick

    #138640

    In reply to: Menu link to Profile

    Robin W
    Moderator

    Strangely this is quite difficult to achieve, as the url for a user profile edit is

    http://mysite.com/forums/users/username/edit/

    where the username is the actual username of the person logged in.

    so you can’t add it as a menu item as far as I can work out.

    2 solutions to this :

    Solution 1 – the harder way !
    One solution and the one I use is adding this as a line in the login widget, so that it appears under the “account” in your sidebar

    I use the (bbpress) Login widget for the sidebar. This widget is set up in

    wp-content/plugins/bbpress/includes/common/widgets.php

    I added this line after line 145

    line 145 reads
    <?php bbp_logout_link(); ?>

    and I add a new line 146 saying

    <p><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Amend Profile/Change password</a></p>
    This then comes up when someone is logged in

    Of course you’ll need to make a note of this change, as it is lost whenever you upgrade bbpress versions

    the advantage (and why I use it ) is it then only gives this line when someone is logged in

    Solution 2 – the easier way

    If you’re not keen to change code, the download the enhanced text widget

    https://wordpress.org/plugins/enhanced-text-widget/

    Then in your sidebar add the enhanced text widget, and put this code in content, check the “don’t display header” and click save

    <p><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Amend Profile/Change password</a></p>

    Much easier to do, but displays whether someone is logged on or not.

    #138635
    dotdatdot
    Participant

    Hello everyone.

    Is there a proper codex site anywhere with all the functions/hooks and all the good stuff properly documented anywhere? For example I found a function called bb_is_home(), and I wanted to know what EXACTLY that checked for, but after researching it, I couldn’t find a single real reference or documentation of it.

    Am I missing something? Because the http://codex.bbpress.org/type/functions/ has only about 5 functions. Surely there is a list of functions somewhere?

    Thanks

    #138631

    In reply to: Custom Import

    connielk
    Participant

    An hour later and it still adding dashes. It says

    ——————————————————— etc etc
    Starting Conversion

    So… I posted my code to github. If you don’t mind taking a look I’d really appreciate it.

    https://gist.github.com/anonymous/7267096

    #138628
    Schaum
    Participant

    Do anybody know where I add these in bbpress:

    
    <?php $prev = get_permalink(get_adjacent_post(false,'',true)); if ($prev != get_permalink()) { ?><a href="<?php echo $prev; ?>">Vorheriger Artikel</a><?php } ?> 
    <?php $next = get_permalink(get_adjacent_post(false,'',false)); if ($next != get_permalink()) { ?><a href="<?php echo $next; ?>">NΓ€chster Artikel</a><?php } ?>
    Robin W
    Moderator

    Another plugin sounds possible – try disabling them one at a time and see if without one it works ok.

    Otherwise, you could try adding this to your functions file

    function pw_bbp_auto_checK_subscribe( $checked, $topic_subscribed  ) {
    
        if( $topic_subscribed == 0 )
            $topic_subscribed = true;
    
        return checked( $topic_subscribed, true, false );
    }
    add_filter( 'bbp_get_form_topic_subscribed', 'pw_bbp_auto_checK_subscribe', 10, 2 );

    That sets it to checked, so presumably if you changed line

    $topic_subscribed = true;to

    $topic_subscribed = false;

    it should uncheck it

    Give it a try

    jazinsa
    Participant

    Is it possible to show a user’s forum topic count(or post count) in the buddypress profile page? It feels like it should be simple enough but hours of googling and reading topics here has left me more confused than when I started.

    I can see its possible on a bbpress profile page, where it’s using:

    <p class="bbp-user-topic-count"><?php printf( __( 'Topics Started: %s',  'bbpress' ), bbp_get_user_topic_count_raw() ); ?></p>
    <p class="bbp-user-reply-count"><?php printf( __( 'Replies Created: %s', 'bbpress' ), bbp_get_user_reply_count_raw() ); ?></p>

    Should I be calling a different function altogether, or is there a specific way to put bbPress functions inside a BuddyPress template page?

    A good example of what I mean is at Tamriel Foundry, where the various counts are listed under the heading Post Details. (The design of that site in general is amazing)

    Any help would be greatly, greatly appreciated! And apologies if you are reading this for a second time, I wasn’t sure whether to post my query at the Buddypress or bbPress forums.

    pekmez
    Participant

    the path is just like for the version 2.4.1

    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php

    As JarretC wrote before

    Change the line 30

    <?php bbp_list_forums(); ?>

    to

    <?php bbp_list_forums( array ( 'separator' => '<br />' ) ); ?>

    Thanx JarretC

    #138611

    In reply to: Remove Sidebar

    Robin W
    Moderator

    ok, try this – I have culled it from varous other posts, in particular

    Full-Width Forum

    Don’t swear it will work, but give it a go

    1. Create a page called “forums”,
    2. make this page a full width page – if your theme doesn’t support this, then you’ll need to create a child theme and add a full page template.
    3. Put this shortcode on the page [bbp-forum-index]
    4. edit the following file
    wp-content/plugins/bbpress/templates/default/css/bbpress.css
    by removing the left float from div.bbp-breadcrumb(line 405)
    5. In your style.css add the following

    .bbPress #primary {
    display: none;
    }
    .bbp-forums {
    width: 100%;
    }

    let us know if that works

    #138610
    FreeWPress
    Participant

    Is not good idea to change core code… And when bbpress is updated you lost all your modifies…

    #138609
    pekmez
    Participant

    as garindan post, pls try this file to edit.

    wp-content/plugins/bbpress/includes/common/template.php

    Line 2249

    change

    // Add the breadcrumb
    // $crumbs[] = '<a href="' . esc_url( $root_url ) . '">' . $r['root_text'] . '</a>';

    to this

    // Add the breadcrumb
    // $crumbs[] = '<a href="' . esc_url( $root_url ) . '">' . $r['root_text'] . '</a>';
    $crumbs[] = '<a href="/forum/">Forum</a>';
    #138602

    In reply to: Remove Sidebar

    Robin W
    Moderator

    you can add this function to your functions.php

    function disable_all_widgets( $sidebars_widgets ) {       
        if ( function_exists('is_bbpress') ) {
            if (is_bbpress()) {
                $sidebars_widgets = array(false);
                remove_all_actions('bp_register_widgets');
                unregister_sidebar( 'bp_core_widgets' );
            }
        }
        return $sidebars_widgets;
    }
    
    add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);

    or this to your style.css

    .bbPress #primary {
    display: none;
    }
    #138599

    In reply to: Custom Import

    Stephen Edgar
    Keymaster

    Where does it say that? πŸ˜‰ I just changed it to MySQL πŸ˜‰

    https://codex.bbpress.org/import-forums/custom-import/

    Take a look at the following for some reading material to help get you going.

    Importing from DotNetNuke Active Forum

    The basis of what ended up being used is here.

    Mix all that in with this on converting from Microsoft SQL to MySQL (This was Access but the same tools should do MSSQL fine)

    Documented import from snitz access database

    Let me know how that all goes for you and I will follow up with more πŸ™‚

    #138593

    In reply to: Persistant login form

    baylock
    Participant

    Thank you for your answer Robin W.
    I would rather use the shortcode as I don’t even use a sidebar.
    How come I can’t see the login form through all the views as they are all part of the same WP page (which has the shortcode) ?

    Thank you.

    #138581
    Rogelio
    Participant

    Hi,

    I managed to create a TinyMCE plugin and add it to wordpress editor (which is the same as bbpress).

    So far so good.

    Using

    $ args ['teeny'] = false;

    config, my tinymce plugin’s button show normal.

    But, I need to be displayed in the default editor for bbpress, in teeny editor.

    Any ideas?

    Thanks a lot.

    #138580
    Button9
    Participant

    I got it to work now! The solution was to put the code you guys gave me in the beginning of the functions.php. I should probably have known that πŸ™‚

    Now one more thing; what can I add to also remove the link that is on your own name/profile after you have logged in to the forum?

    Thank you!

    Best regards,
    Button9

    #138570

    In reply to: bbPress 2.4.1

    Stephen Edgar
    Keymaster

    @unklee Thnaks for your feedback, all great ideas and it is just really a time issue, our 9-5 day jobs get in the way of spending more time with bbPress πŸ˜‰

    Anyone with a WordPress/bbPress/BuddyPress username & password can edit and update the codex so we may not mention this fact as often as we should and are extremely grateful when new contributions occur.

    Just go to https://codex.bbpress.org/ and click ‘login’ and have at it πŸ™‚

    #138569

    In reply to: bbPress 2.4.1

    unklee
    Participant

    Guys, I have been a WordPress user for a couple of years, but just beginning to work out bbpress. It looks great (thanks!) but I’m finding a few difficulties working out a few things.

    I want to suggest that you enlarge the Codex slightly to assist new users, with a section titled something like “Some common issues”. It could include your recommendations and suggestions on the following:

    Getting sidebars the way you want them:
    Outline the various common problems and the recommended approaches/plugins to solving them (there are many threads on this, not all resolved):

    • remove all sidebars
    • Get the same sidebars as your blog
    • Different sidebar to blog

    Styling
    Do we need a special CSS or can we use the CSS from the blog?

    Features of most forums
    Most forums have features that it is sometimes hard for newbies to find the right way to get them, so giving us some good advice would really help:

    • List of forums in sidebar
    • List of recent posts in sidebar
    • Login/register box
    • HTML/BBCode buttons – is a separate plugin useful?
    • Admin & moderation

    I know you probably don’t want to favour some plugins over others, but giving us your best advice, and maybe listing a couple of alternatives, would be very helpful.

    Thanks.

    #138566
    #138563
    unklee
    Participant

    Hi Robin, I tried what you said (exactly, including logging out) and I’m afraid it didn’t work for me. I still see the blog sidebar with about 8 widgets in it, and not the bbpress sidebar with just one (trial) widget in it.

    I note that others talk about changing the permalinks and I haven’t done that because I’m not sure exactly what they mean.

    I really want to get this sorted, and I’d prefer not to have to do it by changing some of the php files, because I’m a very rough php coder! I wonder whether there’s anything else I should do that is so obvious to everyone that they’re not saying it, but it’s not obvious to me.It would be good if we could work out a definitive set of instructions, because a lot of people seem to have this issue.

    #138558
    baylock
    Participant

    Ok, thank you!

    I achieved what I wanted, this way:

    Forums list:

    <p class="bbpx-topic-meta">
        <?php
        $forum_id  = bbp_get_forum_id();
        $last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
        if ( empty( $last_active ) ) {
            $reply_id = bbp_get_forum_last_reply_id( $forum_id );
    	if (!empty( $reply_id)){$last_active = get_post_field( 'post_date', $reply_id );} 
            else 
            {
    	    $topic_id = bbp_get_forum_last_topic_id( $forum_id );
                if (!empty( $topic_id)){$last_active = bbp_get_topic_last_active_time( $topic_id );};
    	};
        };
        $date= date('d/m/Y',bbp_convert_date( $last_active ));
        $active_id = bbp_get_forum_last_active_id( $forum_id );
        $link_url  = $title = '';
    
        //these two next lines are beyond me: same condition, two results for the same variable...
        if (empty($active_id)){$active_id = bbp_get_forum_last_reply_id( $forum_id );};	
        if (empty($active_id)){$active_id = bbp_get_forum_last_topic_id( $forum_id );};
    
        if (bbp_is_topic($active_id)) 
        {
    	$link_url = bbp_get_forum_last_topic_permalink( $forum_id );
    	$title    = bbp_get_forum_last_topic_title( $forum_id );
        } 
        elseif (bbp_is_reply($active_id)) 
        {
    	$link_url = bbp_get_forum_last_reply_url( $forum_id );
    	$title    = bbp_get_forum_last_reply_title( $forum_id );
        };
        $time_since = bbp_get_forum_last_active_time( $forum_id );
        if (!empty($time_since) && !empty($link_url) 
        {
    	$anchor = '<a href="'.esc_url($link_url).'" title="'.esc_attr($title).'">'.$date.'</a>';		
            ?>
            <span class="bbp-topic-freshness-author">
              <?php
                  bbp_author_link(array('post_id'=>bbp_get_forum_last_active_id(),'size'=> 14));
              ?>
            </span>
            <?php	
        }
        else {$anchor = 'esc_html__( 'No Topics', 'bbpress' );};
        ?>
    </p>
    		
    <?php
    echo apply_filters( 'bbp_get_post_time', $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
    ?>

    Topics list:

    <p class="bbp-topic-meta">
        <span class="bbp-topic-freshness-author"><?php bbp_author_link(array('post_id =>bbp_get_topic_last_active_id(),'size'=>14)); ?></span>
            <?php
    	$topic_id   = bbp_get_topic_id();
    	$reply_id   = bbp_get_topic_last_reply_id();
    	$title      = bbp_get_topic_last_reply_title( $topic_id );
    	$link_url   = bbp_get_topic_last_reply_url( $topic_id );
    	$date   = get_post_time( 'd/m/Y', $gmt, $reply_id, true );
    	$anchor = '<a href="'.esc_url($link_url).'" title="'.esc_attr($title).'">'.esc_html($date).'</a>';
    	echo apply_filters( 'bbp_get_topic_freshness_link', $anchor, $reply_id, $result, $link_url, $title );	
    	?>
    </p>

    As you can see, I didn’t hook anything already. So far I just got rid of the “bbp_topic_freshness_link()” in the templates and simply replaced the initial function by these lines, just to make a test. I still have to make a function out of these.

    Not happy with this mess as I’m sure it’s more complicated that it should be, but it works.

    Thank you for your guidance koendb!

    #138553
    FreeWPress
    Participant

    Hi, search this code in css:

    li.bbp-forum-info, li.bbp-topic-title {
        float: left;
        text-align: left;
        width: 49%;
    }

    Set width like 49% and correct visibility problems….

    #138551
    ga13ush
    Participant

    Hi, i dont undertand how to use the profil link. Is it like (its not working) :

    <?php echo '<a href="'.get_profile_tab_link( bb_get_current_user_info( 'id' ), "edit" ).'">edit your profile</a>' ?>

    Thanks for your help

    #138548

    Topic: Head

    in forum Themes
    Schaum
    Participant

    I looked in a lot of template files and try to delete the organge rounded (see picture) area but without any success.
    Could someone please tell me in what template file I can remove the area?

    I try it also here:

    
    <?php ############################################################################################################################ ?>
    
    <?php do_action( 'bbp_template_before_topics_loop' ); ?>
    
    <ul id="bbp-forum-<?php bbp_forum_id(); ?>" class="bbp-topics" style="clear: right;">
    
    	<li class="bbp-body">
    
    		<?php while ( bbp_topics() ) : bbp_the_topic(); ?>
    
    			<?php //bbp_get_template_part( 'loop', 'single-topic' ); ?>
    <?php ############################################################################################################################ ?>
Viewing 25 results - 13,476 through 13,500 (of 32,503 total)
Skip to toolbar