Search Results for 'code'
-
AuthorSearch Results
-
November 13, 2014 at 1:05 pm #154497
In reply to: bbPress homepage customization
Robin W
ModeratorNovember 13, 2014 at 8:51 am #154489biscuitier0
ParticipantNow I just need to hide the toolbar for non-admins (code for this is above – thanks, Robin) and put and edit profile link where I need it to be in the menu to display only when users are logged in.
***Apologies for all the posts I have made but there is a bug with this forum that was stopping me posting (and worse, deleting my posts so I needed to type them again). The only way I could get it to work was to split the post into smaller parts***
November 13, 2014 at 8:47 am #154487biscuitier0
ParticipantOkay I managed to do roughly what I wanted without changing the functions.php. Here’s how:
1) I installed bbP Members Only plugin https://wordpress.org/plugins/bbpress-members-only/, I then created a test forum and topic
2) I created a page called ‘member login’ and put the [bbp-login] shortcode in this page (no menu link for this page)….
November 13, 2014 at 1:35 am #154474Topic: Show topic title top of Each topic
in forum TroubleshootingnM_WP
ParticipantHi,
WP-4.0 & BB-2.5.4 on localhost.
Everything working fine except, I am not able to show the “Topic title” at the top of each topic, as the topic title “Show topic title top of Each topic” appearing above.
I have tried
bbp_get_topic_title()with no luck.November 12, 2014 at 7:48 pm #154472In reply to: Change the color of individual role names
Robkk
Moderatoryou add this to your themes functions.php or a functionality plugin.
you then use css to style the roles from there.
add_filter('bbp_before_get_reply_author_role_parse_args', 'ntwb_bbpress_reply_css_role' ); function ntwb_bbpress_reply_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; } add_filter('bbp_before_get_topic_author_role_parse_args', 'ntwb_bbpress_topic_css_role' ); function ntwb_bbpress_topic_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; }It grabs the topic or reply author role and adds another CSS class with prefix bbp-role- so you now have a new set of CSS classes e.g. bbp-role-keymaster, bbp-role-moderator, bbp-role-participant etc that you can then add your custom CSS styles to.
link this was from
November 12, 2014 at 7:18 pm #154469In reply to: is it possible to allow all users create new forum ?
Robkk
Moderatori dont think this would be great idea to allow participants to create new forums.
i can see a reason why maybe you would want moderators though, but i mean it still isnt a great idea.
there is also a limit on the number of forums i think like 50 or so, so take that into consideration.
think you should have a site suggestion forum on upcoming improvements , and if your users want a specific forum to be added to your site you should post what they want and then you can choose from there.
you can create a page and add this shortcode to display the forum form in the front-end.
[bbp-forum-form]
you can also download @netwebs plugin from this link which will add a forum form for users who can moderate on their profile home
November 12, 2014 at 6:46 pm #154466Topic: Having "Trash" option and not "Spam" for moderators
in forum Troubleshootingkendorama
ParticipantI noticed for Keymasters you are able to “Trash” posts and of course “Spam”. For Moderators there is no “Trash” post.
I had though I could just edit this in the capabilities.php but looking at the code it seems they have the exact same permissions when it comes to Topics. Does the moderator need the “delete” for Forums to be able to Trash topics?
Thanks
November 12, 2014 at 6:40 pm #154465In reply to: Custom link in profile page
akyboy
ParticipantAH,…
user-details.php is file im looking for
So if i can add that custom link below:
<a href="<?php bbp_user_profile_edit_url(); ?>" title="<?php printf( esc_attr__( "Edit %s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php _e( 'Edit', 'bbpress' ); ?></a>So need link to http://wotlabs.net/na/player/%s i guess? 🙂
November 12, 2014 at 6:26 pm #154464In reply to: b-quote to show above post
akyboy
ParticipantLove you more and more! :PPP
Thanks sooooo much sir!!
Also noticed padding
fixi had it top, bottom, right, left 🙂November 12, 2014 at 6:14 pm #154463In reply to: b-quote to show above post
Robkk
Moderatorchange the width from
400pxtoautolike this
blockquote { font-family: Open Sans,sans-serif; font-size: 14px; font-style: italic !important; background-color: #212123; border: 0.5px solid #CCC; border-radius: 6px; box-shadow: 0.5px 0.5px 0.5px #CCC; padding: 15px; width: auto; }November 12, 2014 at 12:57 pm #154455biscuitier0
ParticipantHi Robin
Sorry for disappearing on this. I was so busy with the rest of the site, I had to leave the forum to one side.
Anyway, thanks for your suggestions above. I tried them out and have unfortunately hit a couple of snags
1) I’m finding that once I login using the BBP login form, I’m left with a blue box that says ‘You are already logged in’. Is it possible to make this disappear, once logged in. Or if not, have you redirected to a different page once successfully logged in?
2) Is it possible to say exactly where in the menu the ‘Edit Profile’ goes? I would prefer it not to be a top level menu item and to go into the dropdown menu instead
3) Is the intention that I put the [bbp-forum-index] shortcode underneath the [BBP-login] shortcode? I want people to be taken straight to the forum once they have succesfully logged in. At the moment when I put those two shortcodes on a page together, I am getting a php error along the lines of
Warning: Cannot modify header information - headers already sent by...I think this might be to do with me using the Genesis framework?
I have alreday installed the Genesis Extend BBpress plugin
November 12, 2014 at 12:21 pm #154452In reply to: Topics not appearing in forum
Themes de France
ParticipantHey guys,
As a theme developper I wanted to bring bbPress support and I was facing the same issue.The plugin that @robin-w brought was working but I know something was wrong with my theme.
I managed to make it work without the plugin by deleting this snippet from functions.php :
https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts#Exclude_Pages_from_Search_ResultsThe intent of this snippet is to exclude pages from search results and I guess this was conflicting with WP4.
If you have this problem with your theme, look for “pre_get_posts” actions and if the search query is updated.
Hope that can helps 🙂
November 12, 2014 at 8:21 am #154443Preston
ParticipantThanks, that did the trick. Looking back, I probably should have noticed that was the problem! It was obvious in the error message.
Setting up the role worked, but if I set “spectate” to false, the role can’t see the forum at all to even post.
After searching some more, I found there was a bbPress setting to allow “anonymous” posting without an account. With that enabled, and the forum set to public, I used the following code to hide the list of topics from users who aren’t logged in (I believe they always come back with an ID of 0).
This is in the “loop-single-topic.php” file. I’ll probably also need to add this code to template files that display single topics, in case any sneaky people figure out the URL structure. The concept remains the same, however.
<?php $currentUserID = bbp_get_current_user_id(); if($currentUserID == '0'){ //Display stuff if user's ID is 0 (they aren't logged in) } else { //Put all the topic loop code here, it will display if the user is logged in (has an ID other than 0 } ?>This seems like a pretty secure way to do it, none of the topic information is displaying in the source code or anything like that. I’ll add any other relevant information I find tomorrow. For now, it’s time to sleep.
**EDIT**
I’ll definitely need to set something up with regards to the single topic templates. Creating a new topic as an anonymous user still redirects you to that topic. I’ll have something tomorrow.November 11, 2014 at 6:23 pm #154433Topic: toolbar & buttons not showing in my firefox
in forum Troubleshootingatfpodcast
ParticipantI deactivated these plugins that added bbcode. They worked at first. I did this on a fresh install of wordpress for a new site. It works for ie, chrome etc I have debugging on. What would be the cause? The plugin author says its plugin i dont know… So I thought I would use the bbpress defaults and those dont work.
November 11, 2014 at 5:48 pm #154432In reply to: Adding bbcode like image, you tube etc…
atfpodcast
ParticipantI deactivated the bbcode and white ilst and the default took bar is not showing in firefox. I will open another thread. Why this so hard? blah
November 11, 2014 at 2:50 pm #154431In reply to: Language – Help me please
Nicolas Korobochkin
ParticipantAt https://translate.wordpress.org/projects/bbpress/2.5.x I see 99% translated 🙂 You can translate some missing phrases. After that at the bottom of the page choose
all currentandMachine Object Message Catalog (.mo). Click theExportlink. You download the file with translations.
After that rename downloaded file tobbpress-pt_BR.moand put it in/wp-content/plugins/bbpress/languages/and you done.November 11, 2014 at 1:15 pm #154427In reply to: Adding bbcode like image, you tube etc…
Robkk
Moderator@atfpodcast
i just checked on my side with the latest raindrops theme ,i checked to see if all of the quicktag buttons worked
they did.i checked if some of the bbcodes from gdbbpress and bbpress2 bbcode didnt just process the bbcode out well
they did.i didnt run bbpress2 bbcode with bbpress direct quotes while gdbbpress tools activated at the same time, because i mean they do the same thing.
if you feel like the quicktags toolbar is really causing the problem and you have some error logs to post or images of error logs or any other info you can get while debugging is on, make a new topic with all the information in it.
November 11, 2014 at 8:57 am #154421Robin W
Moderatorsorry, there is a very minor error, a missing _
add_filter( 'bbp_get_dynamic_roles', 'add_new roles', 1 );should read
add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );I’ll update the codex!
November 11, 2014 at 5:28 am #154420Preston
ParticipantI’m just using the code copied right off the page at the moment: http://pastebin.com/qVFx300V
Originally, I edited it to suit my needs, but I thought the error came about because of my editing.
November 11, 2014 at 5:00 am #154419In reply to: How does it choose the files to use
Robin W
ModeratorThe template you choose in the page only applies to that page, you need to set up the file as bbpress.php to get it used throughout (I don’t write bbpress so can’t tell you why!)
November 11, 2014 at 4:55 am #154417Robin W
Moderatorfunctions file should be fine.
Can you post the exact code you put in the file.
November 10, 2014 at 11:11 pm #154412In reply to: Custom Fields not displaying when editing post
Preston
ParticipantOne last follow up for anyone who comes across this later on.
For the select drop downs on the edit page, I decided to “cheat” with jQuery to make sure the correct value is still selected.
This is the code in my functions.php file that creates the select input:
$play_os = get_post_meta( $topic_id, 'bbp_app_character_playos', true); echo '<br><label for="bbp_app_character_playos">Select Input Label</label><br>'; echo '<select id="bbp_app_character_playos" name="bbp_app_character_playos" data-value="' . $play_os . '"> <option value="Yes" class="os-yes">Yes</option> <option value="No" class="os-no">No</option> </select>';I’m displaying the current value in the data-value attribute so I can use it in the jQuery below:
function appEditValues(){ var playOsVal = jQuery('.topic-edit #bbp_app_character_playos').attr('data-value'); if(playOsVal == "Yes"){ jQuery('.topic-edit #bbp_app_character_playos').find('.os-yes').attr('selected','selected'); } else if (playOsVal == "No"){ jQuery('.topic-edit #bbp_app_character_playos').find('.os-no').attr('selected','selected'); } }The jQuery code adds the “selected” attribute to the appropriate option on the edit page, which of course causes that value to be selected and save correctly again when you finish editing.
November 10, 2014 at 11:04 pm #154411Preston
ParticipantI think that might get me to where I want to be. Assuming if I remove the “spectate” ability they can’t view any topics, but still post a topic.
When I implement the second set of code (for Creating New Roles) from this page: https://codex.bbpress.org/custom-capabilities/. I get the following error in the admin area:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘add_new roles’ not found or invalid function name in /wp-includes/plugin.php on line 214I thought it might be a conflict with the plugins I had installed, but disabling them didn’t solve anything. I assume the code is supposed to go into my functions.php file? That’s where I tried it anyway.
Thanks for the help.
November 10, 2014 at 8:26 pm #154406Topic: html entities in notification email
in forum Requests & Feedbackroysmyth
ParticipantbbPress forums play an important part in an outdoor recreation club site I administer. Members make heavy use of notification emails to be informed of changes in scheduled events.
Html entities in notification emails annoy the members. The members are non-technical. They don’t understand why characters such as & ‘ and – are replaced with strange codes in email.
The fix is trivial, apply html_entity_decode() to the subject and message body before sending. I don’t see any security risk in this. (Someone please let me know if there is a risk; I’m using this fix on the site.)
Can this be added to bbPress?
November 10, 2014 at 2:40 pm #154404In reply to: Adding bbcode like image, you tube etc…
Robkk
ModeratorPerhaps it is related to the toolbar in bbPress?
what do you mean??
the toolbar just puts out basic html, i dont have an idea why it would be causing the problem.
if you think adding a bbcode plugin will make that bbpress quicktags toolbar use the bbcode instead that wont happen you need some custom functions.
and just in case you didnt know to use the bbcode you have to manually write something like this
[youtube] https://www.youtube.com/watch?v=lwW_WrAk4Kk [/youtube] -
AuthorSearch Results