Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,051 through 10,075 (of 32,504 total)
  • Author
    Search Results
  • #155016
    joop.stringer
    Participant

    I just ran a very simple query over the user table
    Update wpusers set user_nicename = REPLACE( user_nicename , ‘ ‘, ‘-‘ ) ;

    This did the trick for me … It must be possible for bbPress to have the space replaced by a hypen in the function to create the userprofile link …

    #154989

    In reply to: mysite.com/forums

    Robin W
    Moderator
    #154988
    Robin W
    Moderator

    easiest way would be to run some code through to correct – since you are asking, I expect this is beyond your skillset so suggest you post a request on

    http://jobs.wordpress.net/

    It should be a fairly cheap solution – code would be less than 20 lines !

    #154987
    Robin W
    Moderator

    ok,

    1. what two plugins did you try that didn’t work?
    2. have you been through https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/
    3. Does it work if you disable s2member – just a test to see if it is a conflict
    4. what permalink are you running – dashboard>settings>permalinks
    5. What bbpress slugs are you running – dashboard>settings>forums

    #154982
    johnmontfx
    Participant

    I’m migrating from a vbulletin forum (3.x) and I’ve figured out how to do a bit of customization, bringing over custom fields in the user table. But one thing I’m having a tough time figuring out is how to bring in the first_name and last_name to the usermeta table.

    For some reason, the following does not work:

    		// fx: last name Stored in usermeta)
    		$this->field_map[] = array(
    			'from_tablename' => 'user',
    			'from_fieldname' => 'lastname',
    			'to_type'        => 'user',
    			'to_fieldname'   => 'last_name'
    		);

    But the following does:

    		// fx: last name Stored in usermeta)
    		$this->field_map[] = array(
    			'from_tablename' => 'user',
    			'from_fieldname' => 'lastname',
    			'to_type'        => 'user',
    			'to_fieldname'   => 'fx_last_name'
    		);

    Simply by changing “last_name” to “fx_last_name” it works. I’d prefer to have it bring it in as the WordPress defaults. I understand I can force a move into the correct field once I import, but as I’ll have about 24 hours on the migration day, i’d love to get it accomplished in the import script.

    Thanks for any insights.

    #154980
    nsbp001
    Participant

    Perhaps this is the solution, found at https://gist.github.com/sc0ttkclark/e5de9d9f2f13964bcecc
    Code to enable having the main bbPress forums on a separate sub-site. Requires: WP Multisite, BuddyPress on main site and network-activated, bbPress on main site and sub-site

    <?php
    /**
    * Remove and add a custom function for bbPress’ BuddyPress activity filter
    */
    function custom_bbp_notifications_fix() {
    if ( !defined( ‘BBPRESS_FORUMS_BLOG_ID’ ) || !BBPRESS_FORUMS_BLOG_ID ) {
    return;
    }
    remove_filter( ‘bp_notifications_get_notifications_for_user’, ‘bbp_format_buddypress_notifications’, 10, 5 );
    add_filter( ‘bp_notifications_get_notifications_for_user’, ‘custom_bbp_format_buddypress_notifications’, 10, 5 );
    add_action( ‘bbp_template_before_user_topics_created’, ‘custom_bbp_switch_to_forums’ );
    add_action( ‘bbp_template_before_user_replies’, ‘custom_bbp_switch_to_forums’ );
    add_action( ‘bbp_template_before_user_favorites’, ‘custom_bbp_switch_to_forums’ );
    add_action( ‘bbp_template_before_user_subscriptions’, ‘custom_bbp_switch_to_forums’ );
    add_action( ‘bbp_template_after_user_topics_created’, ‘custom_bbp_switch_from_forums’ );
    add_action( ‘bbp_template_after_user_replies’, ‘custom_bbp_switch_from_forums’ );
    add_action( ‘bbp_template_after_user_favorites’, ‘custom_bbp_switch_from_forums’ );
    add_action( ‘bbp_template_after_user_subscriptions’, ‘custom_bbp_switch_from_forums’ );
    }
    add_action( ‘init’, ‘custom_bbp_notifications_fix’ );
    /**
    * Format the BuddyBar/Toolbar notifications
    *
    * @since bbPress (r5155)
    *
    * @package bbPress
    *
    * @param string $action The kind of notification being rendered
    * @param int $item_id The primary item id
    * @param int $secondary_item_id The secondary item id
    * @param int $total_items The total number of messaging-related notifications waiting for the user
    * @param string $format ‘string’ for BuddyBar-compatible notifications; ‘array’ for WP Toolbar
    */
    function custom_bbp_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = ‘string’ ) {
    if ( ‘bbp_new_reply’ == $action ) {
    custom_bbp_switch_to_forums();
    $action = bbp_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format );
    custom_bbp_switch_from_forums();
    }
    return $action;
    }
    /**
    * @var boolean $custom_bbp_switch
    */
    global $custom_bbp_switch;
    /**
    * Switch to forums blog, if it’s not the current blog
    */
    function custom_bbp_switch_to_forums() {
    global $custom_bbp_switch;
    $custom_bbp_switch = ( get_current_blog_id() != BBPRESS_FORUMS_BLOG_ID );
    if ( $custom_bbp_switch ) {
    // Switch to forum site
    switch_to_blog( BBPRESS_FORUMS_BLOG_ID );
    }
    }
    /**
    * Switch back to current blog, if not the forums blog
    */
    function custom_bbp_switch_from_forums() {
    global $custom_bbp_switch;
    if ( $custom_bbp_switch ) {
    restore_current_blog();
    }
    $custom_bbp_switch = false;
    }

    #154978
    Doulacare
    Participant

    Hi,
    I am volunteering on a not for profit site running wordpress 4.0.1, bbpress 2.5.4, s2member pro 141007

    I have yet to be able to see any of the forums, topics etc as all I get is a 404 error. I have ready through the info about this issue and tried everything suggested, including the two plugins that are supposed to fix it to no avail.

    I do have pretty links turned on, I do have a “Forums” page and have tried it with and without a shortcode to pull up the forums and it just shows the shortcode and never the forum. The only way I get get anything to show is to use the “ugly” link to the forums but none of the links work from
    http://ontariodoulas.org/?post_type=forum

    Any ideas on where to go from here? Any help would be appreciated! Thank you!

    #154977

    In reply to: phpBB import problem

    Joukku
    Participant

    no.. frustrating. Any clue?

    Repair any missing information: Continue
    Warning: set_time_limit() has been disabled for security reasons in /home/int2000/d/xxxxx/html/wordpress/wp-content/plugins/bbpress/includes/admin/converter.php on line 306
    
    WordPress database error: [Unknown column 'forums.forum_topics' in 'field list']
    SELECT convert(forums.forum_id USING "utf8") AS forum_id,convert(forums.parent_id USING "utf8") AS parent_id,convert(forums.forum_topics USING "utf8") AS forum_topics,convert(forums.forum_posts USING "utf8") AS forum_posts,convert(forums.forum_topics_real USING "utf8") AS forum_topics_real,convert(forums.forum_name USING "utf8") AS forum_name,convert(forums.forum_desc USING "utf8") AS forum_desc,convert(forums.left_id USING "utf8") AS left_id,convert(forums.forum_type USING "utf8") AS forum_type,convert(forums.forum_status USING "utf8") AS forum_status FROM phpbb_3forums AS forums LIMIT 0, 100
    
    No forums to convert
    Warning: set_time_limit() has been disabled for security reasons in /home/int2000/d/xxxxx/html/wordpress/wp-content/plugins/bbpress/includes/admin/converter.php on line 306 Warning: set_time_limit() has been disabled for security reasons in /home/int2000/d/xxxxx/html/wordpress/wp-content/plugins/bbpress/includes/admin/converter.php on line 306 Warning: set_time_limit() has been disabled for security reasons in /home/int2000/d/xxxxx/html/wordpress/wp-content/plugins/bbpress/includes/admin/converter.php on line 306 
    
    No data to clean
    
    Starting Conversion
    #154970
    Joukku
    Participant

    Hi all,

    I’ve been trying to import my forum from phpbb 3.1.1 (no mod or themes) to bbpress 2.5.4.

    I used row limits 50 and delay time 2. Database settings looks to be ok.

    Problem is following code that appears on every line:
    ‘Warning: set_time_limit() has been disabled for security reasons in /home/int2000/d/xxxxx/html/wordpress/wp-content/plugins/bbpress/includes/admin/converter.php on line 306 Warning: set_time_limit() has been disabled for security reasons in /home/int2000/d/xxxxx/html/wordpress/wp-content/plugins/bbpress/includes/admin/converter.php on line 306’

    Conversion goes till end and following message will appear:
    ‘Repair any missing information: Continue’
    ‘SELECT convert(forums.forum_id USING “utf8”) AS forum_id,convert(forums.parent_id USING “utf8”) AS parent_id,convert(forums.forum_topics USING “utf8”) AS forum_topics,convert(forums.forum_posts USING “utf8”) AS forum_posts,convert(forums.forum_topics_real USING “utf8”) AS forum_topics_real,convert(forums.forum_name USING “utf8”) AS forum_name,convert(forums.forum_desc USING “utf8”) AS forum_desc,convert(forums.left_id USING “utf8”) AS left_id,convert(forums.forum_type USING “utf8”) AS forum_type,convert(forums.forum_status USING “utf8”) AS forum_status FROM phpbb_3forums AS forums LIMIT 0, 100’

    What am I doing wrong?

    #154953
    robertosalemi
    Participant

    Resolved.

    function remove_buddypress_admin_bar_init() {
    	echo '<style type="text/css">
    		div#wp-toolbar > ul#wp-admin-bar-top-secondary > li#wp-admin-bar-my-account > div.ab-sub-wrapper > ul#wp-admin-bar-my-account-buddypress {
    			display: none !important;
    		}
    	</style>';
    }
    
    add_action( 'init', 'remove_buddypress_admin_bar_init' );

    Thanks! 😉

    #154942
    Stephen Edgar
    Keymaster

    Just like any normal spam attack, automated scripting, because the codex was “open” to anyone with a wordpress.org account that was all that was needed to create (or edit) any pages on the codex 🙁

    I’ll make sure we add yourself to that said list of users with permissions though 🙂

    izzyian
    Participant

    How can I add a button next to favorite and subscribe buttons on a forum post? Iv searched everywhere and cant find a similar question. Is there a functions code I could add?

    #154934
    Robin W
    Moderator

    @derock299 – sorry I don’t offer Skype support for this plugin, sorry but I have too much else on 🙂

    Private groups would limit them, but you would need to set this manually after registration.

    so you would have sitewide forums and general chats with no restrictions.

    Then you would set the ‘year’ forums up to belong to a ‘year’ group so you would have the 91 forum set up a group name 91.

    A user registering would not have access to or see the existence any of the private group restricted forums, so on registration would just see the [edit] public forums.

    Then after registration you would simply edit that user to add them to say the 91 group, and they would see the 91 forums or forums (and obviously the open forums) and no other restricted ones.

    I would suspect that automating this would allow anyone to register and immediately get access to a ‘year’ forum, or register multiple times and get access to lots of years, defeating the restriction, so manual adding (allowing your to verify) should be fine.

    Howveer if you want this automated, you would need to email me via my website http://www.rewweb.co.uk but it might be expensive to code (I’d need to work that out) or try http://jobs.wordpress.net/

    #154932
    Robin W
    Moderator

    You can set all this in the forum

    So if you go into dashboard>forums>all forums and edit for each forum in turn

    On the right hand side you’ll see

    Parent
    Order

    For your top level forums (eg farm machinery), have no parent and then just type in the order you want, so first top forum will be order 1, second order 2 etc.

    For sub forums, they will have a parent, but again you just set the order, eg Machinery for sale would be order 1 and Machinery wanted order 2

    By the by if you want you subforums to be vertical and/or to take away the (0,0) then see

    Layout and functionality – Examples you can use

    #154931
    robertosalemi
    Participant

    Wordpress 4.0
    bbPress 2.5.4

    Hi,
    in admin toolber, I would disable the section about buddyPress, I detected it by css code:
    ul#wp-admin-bar-my-account-buddypress.

    Can I hide it?

    Thanks.

    #154924
    robertosalemi
    Participant

    Resolved, I was working with wrong function.

    My solution:

    function add_bbp_display_forum_description_2() {
    
    	$custom_msg = '';
    	
    	if ( !is_user_logged_in() )
    	{ 
    		$custom_msg = 'You must be logged in to see all topics.';
    	}
    	
         echo $custom_msg;
    }
    
    add_action( 'bbp_template_before_single_forum', 'add_bbp_display_forum_description_2' );

    Thanks!

    #154919
    robertosalemi
    Participant

    Wordpress 4.0
    bbPress 2.5.4

    Hi,
    in the function ‘bbp_get_single_forum_description’, I would concat a message for user not logged in.

    I wrote:

    add_action( 'bbp_get_single_forum_description', 'msg_for_user_loggedin' );
    add_action( 'bbp_get_single_topic_description', 'msg_for_user_loggedin' );
    
    function msg_for_user_loggedin( $args = '' ) {
    	if ( !bb_is_user_logged_in() )
    	{ 
    		$custom_msg = "You must be logged in to see all topics.";
    	}
    	else 
    	{
    		$custom_msg = "";
    	}
    	
         echo $custom_msg . bbp_get_single_forum_description( $args );
    }

    But it not works, why?

    Thanks.

    #154915
    robertosalemi
    Participant

    Hi,
    in my forum, I created public and private topics.

    I’m using the shortcode:
    [ bbp-forum-index ]
    for show my topics.

    Can I show only the title of private topic, anche when user click on it goes on the 404 error page with login form?

    Thanks.

    #154900
    shabus
    Participant

    Hi,

    I have a problem where pagination is not working in my theme.

    I am doing template redirect in function.php to template file of forum, topic or reply if URL is like http://domain/forums/&#8230;
    Right templates are loaded and right content is shown, but pagination is not working, first page is always shown/loaded.
    Pagination appends …/page/{page}/ to URL when page is selected, but always first page of data loads.
    I have tried to set page manually, among others, $bbpressInstance->forum_query->paged, but no luck.

    My question is, how and where to set page that should be loaded, and how to track where is the problem. Because problem is in my theme, pagination works in WP default themes.
    How to debug this?

    I am on deadline, but stuck on this basic feature and should appreciate some pointers how to debug this.

    BBPress forum is included in my template file through shortcode
    echo do_shortcode('[bbp-single-forum id='.$id.']');
    Topics are included like
    echo do_shortcode ( '[bbp-single-topic id=' . $id . ']' );
    And Replays like
    echo do_shortcode ( '[bbp-single-reply id=' . $id . ']' );

    #154895

    In reply to: Deeper capabilities

    Stephen Edgar
    Keymaster

    All vast majority of your sugestions are already included in bbPress 2.x

    See this codex doc for an overview of bbPress’ roles and capabilities 🙂

    #154883
    Nicolas Korobochkin
    Participant

    @schrully BTW some hosting providers block connects to external SMTP servers (for example – BlueHost) and your Error Type: SMTP show that your server can’t connect to SMTP server.

    #154880
    Robkk
    Moderator

    @izzyian

    you just do it like how i did it.

    by editing the template loop-single-reply.php that was in my bbpress folder in my child theme

    separate the role from the rest of the bbp_reply_author_link

    like this

    <?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => false ) ); ?>

    <?php 
    $displayed_user = bbp_get_reply_author_id() ;
    $role = bbp_get_user_role( $displayed_user);
    if ( bbp_is_user_keymaster($displayed_user)  || $role == 'bbp_moderator'  ) {
    	
    	echo bbp_reply_author_link( array( 'show_role' => true, 'type' => 'role' ) );
    	
             }
    ?>
    #154873

    In reply to: Photo in Latest posts

    Robkk
    Moderator

    in this code you pasted it looks like the exact code to display the avatars is already there.

    maybe you didnt install the template files right??

    wherever you see something like this below , this is what should be displaying the avatar

    ‘size’ => 14

    this is complete started by section showing the started by author avatar

    <?php do_action( ‘bbp_theme_before_topic_started_by’ ); ?>
    
    <?php
    if (class_exists(‘userpro_api’)) {
    /* Integrating UserPro */
    global $userpro;
    $link = preg_replace(“/(?<=href=(\”|’))[^\”‘]+(?=(\”|’))/”, $userpro->permalink( bbp_get_topic_author_id() ),
    bbp_get_topic_author_link( array( ‘size’ => 14 ) ) );
    } else {
    $link = bbp_get_topic_author_link( array( ‘size’ => ’14’ ) );
    }
    ?>
    
    <span class=”bbp-topic-started-by”><?php printf( __( ‘Started by: %1$s’, ‘bbpress’ ), $link ); ?></span>
    
    <?php do_action( ‘bbp_theme_after_topic_started_by’ ); ?>

    this is the complete freshness section showing the author avatar

    <?php do_action( ‘bbp_theme_before_topic_freshness_author’ ); ?>
    <?php
    if (class_exists(‘userpro_api’)) {
    global $userpro;
    $link = preg_replace(“/(?<=href=(\”|’))[^\”‘]+(?=(\”|’))/”, $userpro->permalink( bbp_get_topic_author_id( bbp_get_topic_last_active_id() ) ), bbp_get_author_link( array( ‘post_id’ => bbp_get_topic_last_active_id(), ‘size’ => 30 ) ) );
    } else {
    $link = bbp_get_author_link( array( ‘post_id’ => bbp_get_topic_last_active_id(), ‘size’ => 14 ) );
    }
    ?>
    
    <span class=”bbp-topic-freshness-author”><?php echo $link; ?></span>
    
    <?php do_action( ‘bbp_theme_after_topic_freshness_author’ ); ?>
    #154862
    digiblogger
    Participant

    Hello Everybody.

    I hope you understand my “german Englisch”.

    I tried many many membership and capability plugins to empower bbpress. But with no success.
    This is because bbpress has capabilities, but don´t used them the right way.

    I am not a developer, so I don´t know, if everything I suggest is possible or not. But I know, for some of these features, that it worked for former versions of bbpress with plugins that are outdated for years.

    What bbpress really needs are capabilities in this way (marking new capabilites with (*)):
    When talking about forums, I mean forums and categories.

    Forums/Categories

    can_see_forum
    can_see_thread

    Threads

    can_create_topic_in_forum (*)
    can_edit_owntopic_in_forum (*)
    can_edit_anytopic_in_forum (*)
    can_delete_owntopic_in_forum (*)
    can_delete_anytopic_in_forum (*)

    Replies

    can_create_reply_in_forum (*)
    can_edit_ownreply_in_forum (*)
    can_edit_anyreply_in_forum (*)
    can_delete_ownreply_in_forum (*)
    can_delete_anyreply_in_forum (*)

    Moderators/Admins

    Capabilites to create, edit, delete, move or split forums, threads and replies.

    With these capabilites, bbpres itself or every capability addon could add members or groups to forums and categories.

    This would make bbpress more like full featured forum software (vbulletin, burning board, phpbb and other) than it ever was.

    I asked a developer a long time ago, how long it would take to build an extension or add this to the bbpress core features.

    He said something like: BBPress is well coded. I think, adding these capabilities and rules to forums, adding some metaboxes for assigning groups, members or capabilites to forums post types.. I think a good developer could do this in no time.

    Well… he is specialized in another section of wordpress plugins and not interested in creating for bbpress. But I think, every wordpress user and forum lover would love these features.

    And I think, this is also a great way to prevent spam in forums. on non-english websites, most spam plugins block users that are definetly no spammers, because they search for things, that are not present in non english languages.

    Hoping for feedback and… hope this can be realized.

    Plugins I tried:
    – press permit
    – advanced access manager
    – advanced capabilites manager
    – s3members
    – members
    – and many many more (used keyword in wp repo: bbpress, member, access, restrict, capability, capablites, read, write, permission and more)

    Hope for positive feedback

    Digi

Viewing 25 results - 10,051 through 10,075 (of 32,504 total)
Skip to toolbar