Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,326 through 6,350 (of 32,505 total)
  • Author
    Search Results
  • #175325
    Robkk
    Moderator

    I say edit Robin’s code and change

    if ($role == 'subscriber' ) $new_role = 'bbp_spectator' ;

    To this.

    if ($role == 'subscriber' ) $new_role = 'bbp_participant' ;

    And in my opinion you should not auto-assign moderators and just manually update the users roles for each of the users you trust to moderate the forums. Also I am not sure there is a visitor WordPress role.

    https://codex.wordpress.org/Roles_and_Capabilities#Summary_of_Roles

    Robin W
    Moderator

    Not really sure what you are doing.

    Can you give us a link to a page showing the issue, and post the content of that page – ie the shortcodes etc. that is creating it.

    #175320
    Robin W
    Moderator

    not tested, but the following in your functions file should do it

    you’ll need to edit the code for which role does what

    add_action('wp_login', 'rew_assign_role_on_login', 10, 2);
    
    //this function assigns user to bbp roles on login
    function rew_assign_role_on_login($user_login, $user) {
    	$user_id = $user->ID ; 
    	$role = get_role($use_id) ; 
    	if (empty ($role)) return ; //has no role in the database
    	if ($role == 'administrator' )  $new_role = 'bbp_keymaster' ;
    	if ($role == 'editor' )  $new_role = 'bbp_moderator' ;
    	if ($role == 'author' )  $new_role = 'bbp_moderator' ;
    	if ($role == 'contributor' )  $new_role = 'bbp_participant' ;
    	if ($role == 'visitor' )  $new_role = 'bbp_blocked' ;
    	if ($role == 'subscriber' )  $new_role = 'bbp_spectator' ;
    	bbp_set_user_role( $user_id, $new_role) 
    	}
    #175317
    Robin W
    Moderator

    it would be code-able, but I don’t know of anything that does this already

    #175288
    Robkk
    Moderator

    Here is some CSS to float the forum subscribe link to the right. You can also just display in block to make the link just have its own row.

    https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#17-move-subscribe-to-right-hand-side

    This css will fix some padding issues for lists in your bbPress forum.

    #bbpress-forums li {
      padding-bottom: 0;
    }

    Since I couldn’t really read what was in the red oval I hope this helps.

    Steve Keller
    Participant

    Hey Rob…

    I figured it out…hadn’t realized that it was a matter of using short code on a Forums page. It is crazy that there are so many aspects one can customize when you have the bbp Style Pack.

    Thanks,
    Steve

    #175280
    Brandon Allen
    Participant

    The unit tests are passing, so my guess is that it’s a problem with a plugin, or (less likely) your PHP setup. The $_SERVER['SERVER_NAME'] doesn’t include the protocol (http:// or https:// in most cases), so that shouldn’t be an issue.

    My guess is that there is some other plugin that’s filtering bbp_get_do_not_reply_address incorrectly. Maybe even some code in your theme’s functions.php file. Could provide a list of the plugins you’re using. Specifically, bbPress or email related plugins?

    #175261
    Brandon Allen
    Participant

    You can use either of these to disable subscriptions.

    Forum Subscriptions
    add_filter( 'bbp_get_forum_subscribe_link', '__return_false' );

    Topic Subscriptions
    add_filter( 'bbp_get_topic_subscribe_link', '__return_false' );

    #175256
    Robkk
    Moderator

    Yeah I think it is better for profiles.

    Add this hook to the function.

    add_action( 'bbp_template_after_user_profile', 'rkk_add_register_date' );

    #175251
    Robkk
    Moderator

    Try some plugin and theme troubleshooting since this is the most common.

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

    #175248
    Robkk
    Moderator

    Add && !bbp_is_topic_closed() to the functions if statements after the zero and before the ).

    #175247
    Robkk
    Moderator

    This plugin might work for terms and conditions.

    This is an example of adding inputs for contacts in their profile.

    https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#9-adding-social-media-contacts-to-bbpress-profile

    #175243
    Robkk
    Moderator

    I do see them, they seem oddly big though.

    This CSS is causing that issue. This class is used throughout bbPress for its avatars.

    a.bbp-author-avatar {
      background-size: cover;
      padding: 35px;
      display: block;
      max-width: 100px;
    }
    #175242
    Robkk
    Moderator
    #175241
    u_Oi
    Participant

    @Robkk thanks, actually It works!

    But I realized that if a topic is marked as closed without replies, the code you posted replaced the CLOSED label.

    Is there a way to avoid label no-reply replace the closed label?

    I mean, how i can make closed label the priority?

    Regards,

    #175236
    Robkk
    Moderator

    @arutam to make the function work, counting the replies is exactly what you need to do.

    Try this amd see if it works.

    function rkk_empty_topics() {
        $topic_reply_count =  bbp_get_topic_reply_count();
        if ( $topic_reply_count == 0 )
            echo '<span class="empty">[No Replies]</span>';
    }
    add_action( 'bbp_theme_before_topic_title', 'rkk_empty_topics' );
    #175234
    Robkk
    Moderator

    This is a common theme related issue, where avatars are displayed in block instead of inline or inline-block. Add this CSS anywhere you can add your custom CSS like a child themes style.css file or a seperate custom css plugin.

    #bbpress-forums p.bbp-topic-meta img.avatar, 
    #bbpress-forums ul.bbp-reply-revision-log img.avatar, 
    #bbpress-forums ul.bbp-topic-revision-log img.avatar, 
    #bbpress-forums div.bbp-template-notice img.avatar, 
    #bbpress-forums .widget_display_topics img.avatar, 
    #bbpress-forums .widget_display_replies img.avatar {
      float: none;
      margin-bottom: 0;
      vertical-align: middle;
      border: 1px solid #ddd;
      display: inline-block;
    }
    #175224
    Robkk
    Moderator

    Also, even after the plug in is deleted the roles (Keymaster and Participant) still appear in the user list under the “Role” column, but I thought they were only associated with bbpress. Is that correct?

    This is a known bug, there is some code in the codex here to use to remove the user roles whenever you are resetting your user roles. Removing the roles and reinstalling bbPress might fix this issue, if it does not, you can use this plugin to switch to another Admin temporarily and then edit your user and switch its forum role. Make sure to edit the user by clicking the edit link by the users avatar. I think there is still an issue bulk changing a users forum role from the users list.

    https://wordpress.org/plugins/user-switching/

    Make sure that your default role for users are Participant in Settings > Forums. Also make sure that the default blog role for your users is Subscriber in Settings > General.

    If this developer only did a short job and is done, I recommend not keeping their account as Admin/Keymaster. If they are hired for a project that is not finished or is like say doing maintenance for your site for awhile, okay keep them, but you know just be cautious since this happened to your site.

    Just to be sure, make sure to check out this link for more help.
    https://codex.wordpress.org/FAQ_My_site_was_hacked

    #175222
    andrew55
    Participant

    Got it! This seems to work:

    <?php
    $reply_user_id = bbp_get_reply_author_id();
    global $wp_roles;
    $reply_user = new WP_User( $reply_user_id );
    $roles = $reply_user->roles;
    $role = array_shift($roles);
    if  ($role == 'graduate' ){
    echo "<a href='http://www.mysite.com/page2/'>Graduate</a>";
    }
    ?>
    #175218
    andrew55
    Participant

    This also seems like it should work to me:

    <?php
    $user = new WP_User( bbp_get_reply_author_id() );
    if  ($role == 'Graduate' ){
    echo "<a href='http://www.mysite.com/page2/'>Graduate Link</a>";
    }
    ?>

    But it’s still not showing link in replies for uses who have “graduate” role. Any suggestions?

    #175215
    andrew55
    Participant

    This is the best I’ve come up with so far, but it’s not working yet. Seems like this should work properly. It’s still getting printing the link in profile area in the replies:

    <?php
    $reply_user_id = bbp_get_reply_author_id();
    global $wp_roles;
    $reply_user = new WP_User( $reply_user_id );
    $roles = $reply_user->roles;
    $role = array_shift($roles);
    if ($user_role == 'graduate') {
    echo "<a href='http://www.mysite.com/page2/'>Graduate Link</a>";
    }
    ?>

    Thanks for any suggestions on how to get it right.

    #175212
    kavehmovahedi
    Participant

    Hi,
    I have the latest version of wordpress running (4.5.2) and latest version of bbPress.
    Everything was working just fine before i moved my host from windows to Linux server.
    Now i can see the forums and topics in each forum. but when i open a topic the content and replies are not shown in the pages, only the reply form shows up.
    I can see the replies in the admin panel but clicking view from back end opens the front end reply to … without the reply content.

    I have already tried these :
    1) disabling all other plugins
    2) switching to wordpress default themes
    3) creating a new page with bbPress shortcode
    4) copying the php code provided in other forums
    5) removing and re-installing bbPress

    it’s driving me crazy ! i have tried all 2 links on google’s 2 first pages for search results of “bbPress content not showing up”, “bbPress topic content not showing”, “bbPress replies not shown”,…

    Best Regards,
    Kaveh

    #175209
    Robkk
    Moderator

    Yeah this makes sense since you are only editing the page you created with the forum index shortcode, the forum index shortcode only displays the forum index not embed bbPress entirely.

    I say just create a bbPress.php file and add the content you want to the template.

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

    #175207
    Robkk
    Moderator

    Did you check and see if this is possibly created by a function you might have used/created that is causing an error for that piece of bbPress, check to see if it is a custom bbPress theme related, or check to see if it is cache related.

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

    #175204
    Robkk
    Moderator

    Where exactly in the forums do you want to display this.

    In the default description area this might be a little too much for the default layout in bbPress. I say hire a designer and make the forum page title for each forum display nice and gold like how it is displayed, use the same font you chose to style the forum titles in bbPress (maybe in topic titles too for consistency), and keep the description similar to how you have it and just style it in bbPress using CSS. You might have to have heavily style and customize the bbPress templates to achieve a good looking layout like this. Place any bbPress templates in your child theme or custom made theme so they can easily be customized.

    https://codex.bbpress.org/themes/theme-compatibility/

Viewing 25 results - 6,326 through 6,350 (of 32,505 total)
Skip to toolbar