Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 15,126 through 15,150 (of 32,503 total)
  • Author
    Search Results
  • Martin ( Martin_C )
    Participant

    In case a user change his display name to be diffrent from his username, you cannot use @someusername to mention someone since you do not know what the users username is.

    Would be nice to be able to optionally include an @someusername just below the link to a reply or topic authors profile.

    Perhaps the best way of doing this would be to add an extra argument to the args array for the bbp_get_reply_author_link function. The current args are:

    $defaults = array (
    'post_id' => 0,
    'link_title' => '',
    'type' => 'both',
    'size' => 80,
    'sep' => ' ',
    'show_role' => false
    );

    But could be changed to:

    $defaults = array (
    'post_id' => 0,
    'link_title' => '',
    'type' => 'both',
    'size' => 80,
    'sep' => ' ',
    'show_role' => false,
    'show_mention' => true,
    );

    I know having the user name visible is kind of a security issue, but since the user name already is visible in the profile URL…

    Also, a setting for this in the backend would be nice.

    #120551
    spwestwood
    Participant

    Hi Kannued,

    There were 2 queries I posted. There needs to be 2 because previously in v1 bbPress had 2 seperate tables – one table for the initial topic post and then another table for the followup replies. All posts are now contained in wp_posts.

    So the first query takes all the author ids from the forum topics and copies them across to the wp_posts table:

    update wp_posts inner join bb_topics on wp_posts.post_title=bb_topics.topic_title set wp_posts.post_author = bb_topics.topic_poster

    The second then does all the replies:

    update wp_posts inner join bb_posts on bb_posts.post_time = wp_posts.post_date set wp_posts.post_author = bb_posts.poster_ id where wp_posts.post_author = ’1′

    (This is a bit messier. The only way I found to match bb_posts to wp_posts was by the time the post was made. For some reason looking at the text of the actual post didn’t match. Perhaps there was an encoding difference or something.)

    Before running either it might be a good idea to check you are getting the same error I have. If you run the following:

    select topic_title,topic_poster,post_author from wp_posts inner join bb_topics on wp_posts.post_title=bb_topics.topic_title order by bb_topics.topic_id desc

    This doesn’t make any changes. It shows you 3 columns: topic title / author in old bbpress / author in new bbpress.

    For me the 3rd column was all 1s (which is my user id). So all I had to do was copy the second column across, which is what the 2 queries above do.

    #120547

    In reply to: Custom login Page

    innomarkglobal
    Participant

    Shane answer is right you should take a look before any modification.
    https://codex.wordpress.org/Customizing_the_Login_Form#Make_a_Custom_Login_Page

    #120544
    Shane Gowland
    Participant

    An even easier way to call shortcodes is with the do_shortcode() method.

    You can programmatically call the bbp-forum-index shortcode like this:

    <?php echo do_shortcode(‘[bbp-forum-index]‘) ?>

    #120543

    In reply to: Custom login Page

    Shane Gowland
    Participant

    Hi Lesego,

    As a general rule, we strongly advise users not to modify core WordPress/bbPress files under any circumstances. There are a whole host of issues you could be causing.

    I recommend taking a look at “Customizing the Login Form -> Make a Custom Login Page

     

    #120529

    Topic: Custom login Page

    in forum Themes
    #120528
    dyspersion media
    Participant

    For anyone else who comes here trying to programmatically display the forum index list, you can call shortcodes like this:


    echo( bbpress()->shortcodes->display_forum_index() );

    For what it’s worth, I don’t know why a function called “list_forums” would display *sub* forums. I would think that would be a function named “list_sub_forums” but, oh well. At least there’s a work around. It’s also worth noting that this might not be the best way to do this. I haven’t done much testing (I’ve done none).

    Cheers!

    #120527
    Stephen Edgar
    Keymaster
    #120509

    In reply to: User registration

    Stephen Edgar
    Keymaster

    Try creating a page and use the [bbp-register] shortcode or use a login widget in a sidebar.

    #120503

    There’s sekrit codez in the codez.

    #120487
    remike
    Participant

    Thank you for your reply.

    I’m quite surprised to hear that. It looks completely broken for me and my users.The “forum” link from the menu does work fine as I pasted the shortcode on a page.

    What doesn’t work is the link “forums” in the navigation bar http://hosting0948899.az.pl/wp/forums/
    as well as the user profile pages
    http://hosting0948899.az.pl/wp/uzytkownik/bulka_tarta/

    It copies the index form on 30 pages on one after another. It looks really strange,
    http://img4.imageshack.us/img4/8997/forumbroken.png

    #120483
    htz77
    Participant

    Wow! Bingo! THANK YOU JJJ. Super simple fix too. Here’s what I did, if this helps anyone else:

    add_filter('bbp_get_user_role_map','my_bbPress_role_map');
    function my_bbPress_role_map($role_map){
    $role_map['student'] = bbp_get_participant_role();
    return $role_map;
    }

    This is added to my functions.php.

    #120479

    @tzeldin88 – Again, difficult to be confident, but you could filter bbPress’s role mapping, to add custom comparisons for your newly created roles. Then bbPress will just naturally make:

    X site role = Y forum role

    with each new user that visits the site.

    The filter you’d want to use, is bbp_get_user_role_map. It looks like this:

    /**
     * Return a map of WordPress roles to bbPress roles. Used to automatically grant
     * appropriate bbPress roles to WordPress users that wouldn't already have a
     * role in the forums. Also guarantees WordPress admins get the Keymaster role.
     *
     * @since bbPress (r4334)
     *
     * @return array Filtered array of WordPress roles to bbPress roles
     */
    function bbp_get_user_role_map() {
    
    	// Get the default role once here
    	$default_role = bbp_get_default_role();
    
    	// Return filtered results, forcing admins to keymasters.
    	return (array) apply_filters( 'bbp_get_user_role_map', array (
    		'administrator' => bbp_get_keymaster_role(),
    		'editor'        => $default_role,
    		'author'        => $default_role,
    		'contributor'   => $default_role,
    		'subscriber'    => $default_role
    	) );
    }
    #120477

    In reply to: bbPress 2.2.1

    @rossagrant – BuddyPress is a whole different animal. It assumes every user on your site always has a link to their root profile. If you have BuddyPress bolted on top, you’re probably okay.

    What BuddyPress does *not* do yet, and likely won’t for some time, is separate multiple bbPress forums across multiple sites on a multisite network, and give them their own spot in a user profile.

    I’ll end up building something similar to this for WordPress.org/BuddyPress.org/bbPress.org eventually, but until then, it’s only pseudo-code in my imagination.

    #120455

    I’m getting this on all my sites that have upgraded to 2.2.x (tested on 2.2.1 too):

    Uncaught TypeError: Object [object Object] has no method 'suggest'

    This relates to this part of the code added to every page of the WP Admin area:


    jQuery(document).ready(function() {

    var bbp_topic_id = jQuery( '#bbp_topic_id' );

    bbp_topic_id.suggest( ajaxurl + '?action=bbp_suggest_topic', {

    onSelect: function() {
    var value = this.value;
    bbp_topic_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
    }
    } );
    });

    #120447
    sambedingfield
    Participant

    Disabled my cache plugin and re-saved permalink and forum settings with no luck.

    I’ve scanned my custom code to see if there’s a custom hook I’ve played with in the past that’s overwriting it – but can’t find anything.

    Here’s the problem page: http://www.ratsclan.com/users/admin/

    #120445

    In reply to: bbPress 2.2.1

    @rossagrant – The display role is actually a bit different than taking the literal role from the user. It uses capabilities rather than the role, to adjust the output based on the user’s ability.

    See the bbp_get_user_display_role function for more.

    It does this because it needs to handle Inactive users (spam/deleted) as well as anonymous/logged-out users, neither of which have a literal role, but also have different “roles” in the forum, for lack of a better way to put it.

    “Member” is the ambiguous word I used for “user is registered, but does not actually have a literal role on this site in the database.”

    Open to suggestions here, if it’s too confusing.

    #120440
    Sami Keijonen
    Participant

    Thanks Pippin. Justin Tadlock gave me same advice to go into that file. Let me tell you that it’s little out of my head. But I definitely try this out and report here if I find a solution.

    $query->set( 'meta_key', '_bbp_last_active_time' );
    $query->set( 'orderby', 'meta_value' );

    This actually works better because now sticky posts are in their ‘natural’ position, not last.

    Olivier Lettinga
    Participant

    Thnx!

    I just saw this post a bit too late and was already half way rewriting the original twentyten theme files.

    Now this page: https://codex.bbpress.org/theme-compatibility/ is also outdated then.

    What is the proper way to make a child theme now?

    fuzzybee
    Participant

    I’m trying to create a custom forum index page which should look exactly like the default forum index page with forum names, number of topics, number of posts, last active topic etc. but sorted alphabetically based on forum names.

    I’m looking at at bbp_has_forums, bbp_forums and bbp_list_forums inside /wp-content/plugins/bbpress/bbp-includes/bbp-forum-template.php.

    However, I’m puzzled which function to use and
    What arguments/ parameters I should pass?
    the comments in bbp-forum-template.php itself says the same parameters as WP_Query() but would it make sense at all to have something like “post_type” => “forum”
    I’m sure one can be clearer/ more explicit about the parameters here in some form of documentation

    I gave it wild tries as follows
    1) The following gives me fatal error:

    $args = array(

    'orderby' => 'title',
    'order' => 'ASC',

    );

    while (bbp_forums($args)){
    bbp_the_forum();

    echo bbp_get_template_part( 'content', 'archive-forum' );

    }

    The error:
    Fatal error: Call to undefined method stdClass::have_posts() in C:\www\forums.local\wp-content\plugins\bbpress\bbp-includes\bbp-forum-template.php on line 109 Call Stack: 0.0004 333592 1. {main}() C:\www\forums.local\index.php:0 0.0006 337280 2. require(‘C:\www\forums.local\wp-blog-header.php’) C:\www\forums.local\index.php:17 0.3864 38499368 3. require_once(‘C:\www\forums.local\wp-includes\template-loader.php’) C:\www\forums.local\wp-blog-header.php:16 0.3920 38515824 4. include(‘C:\www\forums.local\wp-content\themes\bp-tap\custom-index.php’) C:\www\forums.local\wp-includes\template-loader.php:43 0.4732 38674368 5. bbp_forums() C:\www\forums.local\wp-content\themes\bp-tap\custom-index.php:42

    2) While the following just takes forever to load:

    $args = array(

    'orderby' => 'title',
    'order' => 'ASC',

    );

    while (bbp_has_forums($args)){
    bbp_the_forum();

    echo bbp_get_template_part( 'content', 'archive-forum' );

    }

    I’m using WordPress 3.4.2 and bbPress 2.1.2.
    I’ve copied all files and directories from /wp-content/plugins/bbPress/bbp-themes/bbp-twentyten/ to my theme directory.

    • This topic was modified 13 years, 2 months ago by fuzzybee.
    • This topic was modified 13 years, 2 months ago by fuzzybee.
    • This topic was modified 13 years, 2 months ago by fuzzybee.
    • This topic was modified 13 years, 2 months ago by fuzzybee.
    • This topic was modified 13 years, 2 months ago by fuzzybee.
    • This topic was modified 13 years, 2 months ago by fuzzybee.
    • This topic was modified 13 years, 2 months ago by fuzzybee.
    • This topic was modified 13 years, 2 months ago by fuzzybee.
    fuzzybee
    Participant

    Thanks, John, those are very helpful.

    I managed to insert all the postmeta and I had a successful migration with plain PHP and MySQL a while back.

    I suppose there is not off documentation in place yet and I’m just need to read codes, I think.

    1 thing comes across as odd though: I’m using 2.1.2 and I seem to find the _insert_function‘s inside ...wp-content/plugins/bbpress/bbp-includes/bbp-forum-functions.php and so on instead of what you mentioned?

    Are you speaking in terms of some older version bbPress?

    #120414
    Sami Keijonen
    Participant

    I finally started playing with bbPress. There are lot to learn because I want to display topics totally differently what is the default output.

    First I want to display latest topics by latest activity like usual. I’ve created archive-topic.php in my theme so I can decide output.

    After that I can filter topic post type so that topics are ordered by latest activity.

    add_action( 'pre_get_posts', 'my_filter_topic' );

    function my_filter_topic( $query ) {

    if( $query->is_main_query() && is_post_type_archive( 'topic' ) ) {

    $query->set( 'meta_key', '_bbp_last_active_id' );
    $query->set( 'orderby', 'meta_value_num' );
    $query->set( 'order', 'DESC' );

    }

    }

    But this doesn’t display sticky posts first. They are more like last. Does someone have an idea how I get sticky posts to show first?

    #120402
    Stephen Edgar
    Keymaster

    How about giving our ‘Get Started with bbPress’ document a go?

    https://codex.bbpress.org/getting-started-with-bbpress/

    If you have any problems following this let us know and we will try to improve it.

    fuzzybee
    Participant

    Someone mentioned using loop the bbPress’ way bbp_has_forums()

    Would you like to give it a try?

    #120380
    Stephen Edgar
    Keymaster

    Create a new WordPress page and pick and choose some shortcodes from the following URL and add them to that page… https://codex.bbpress.org/shortcodes/

Viewing 25 results - 15,126 through 15,150 (of 32,503 total)
Skip to toolbar