Search Results for 'code'
-
AuthorSearch Results
-
June 2, 2016 at 10:37 am #175325
In reply to: Correlating WP roles with BBPress roles
Robkk
ModeratorI 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
June 2, 2016 at 10:27 am #175323Robin W
ModeratorNot 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.
June 2, 2016 at 9:14 am #175320In reply to: Correlating WP roles with BBPress roles
Robin W
Moderatornot 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) }June 2, 2016 at 8:30 am #175317In reply to: Correlating WP roles with BBPress roles
Robin W
Moderatorit would be code-able, but I don’t know of anything that does this already
June 1, 2016 at 1:03 am #175288In reply to: How to fix avatar and author layout
Robkk
ModeratorHere 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.
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.
May 31, 2016 at 5:08 pm #175281Steve Keller
ParticipantHey 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,
SteveMay 31, 2016 at 4:37 pm #175280In reply to: New topic emails bug on sublevel domains
Brandon Allen
ParticipantThe 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_addressincorrectly. 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?May 31, 2016 at 2:08 am #175261In reply to: move Forum Subscribe link/button to right
Brandon Allen
ParticipantYou 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' );May 31, 2016 at 1:21 am #175256In reply to: Show User/Member Join Date
Robkk
ModeratorYeah I think it is better for profiles.
Add this hook to the function.
add_action( 'bbp_template_after_user_profile', 'rkk_add_register_date' );May 31, 2016 at 12:50 am #175251In reply to: bbPress not on dashboard
Robkk
ModeratorTry some plugin and theme troubleshooting since this is the most common.
May 31, 2016 at 12:36 am #175248In reply to: Show status label for bbPress Topics with No Replies
Robkk
ModeratorAdd
&& !bbp_is_topic_closed()to the functions if statements after the zero and before the).May 31, 2016 at 12:32 am #175247In reply to: Terms and Conditions plus profile
Robkk
ModeratorThis plugin might work for terms and conditions.
This is an example of adding inputs for contacts in their profile.
May 31, 2016 at 12:23 am #175243In reply to: Missing Gravatar images
Robkk
ModeratorI 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; }May 31, 2016 at 12:18 am #175242In reply to: Allow participants to upload media by url only
Robkk
ModeratorYeah use oembed. https://codex.bbpress.org/features/auto-embed-links/
May 31, 2016 at 12:14 am #175241In reply to: Show status label for bbPress Topics with No Replies
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,
May 30, 2016 at 11:53 pm #175236In reply to: Show status label for bbPress Topics with No Replies
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' );May 30, 2016 at 11:17 pm #175234In reply to: How to fix avatar and author layout
Robkk
ModeratorThis 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; }May 30, 2016 at 10:27 pm #175224In reply to: Trouble regaining Keymaster status – help!
Robkk
ModeratorAlso, 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_hackedMay 30, 2016 at 7:15 pm #175222In reply to: add custom link under author link in replies
andrew55
ParticipantGot 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>"; } ?>May 30, 2016 at 4:35 pm #175218In reply to: add custom link under author link in replies
andrew55
ParticipantThis 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?
May 30, 2016 at 3:00 pm #175215In reply to: add custom link under author link in replies
andrew55
ParticipantThis 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.
May 30, 2016 at 5:51 am #175212Topic: Topic content not showing up
in forum Troubleshootingkavehmovahedi
ParticipantHi,
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 bbPressit’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,
KavehMay 30, 2016 at 2:48 am #175209In reply to: Keep static content above forum
Robkk
ModeratorYeah 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.
May 30, 2016 at 2:39 am #175207In reply to: My bbpress topic layout breaks
Robkk
ModeratorDid 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.
May 30, 2016 at 2:07 am #175204In reply to: Content Before Forum Starts
Robkk
ModeratorWhere 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.
-
AuthorSearch Results