Search Results for 'code'
-
AuthorSearch Results
-
Robin W
Moderatorif you mean the bbpress shortcodes, they’re held in
includes/common/shortcodes.php
at the simplest just comment out line 109
ie change to
//add_shortcode( $code, $function );bbpress upgrades will overwrite this, so keep a note to change again as bbpress upgrades are issued.
April 25, 2014 at 7:09 am #145461Nomi
ParticipantHi.
I am getting this error.
Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /home/xxx/public_html/xxx/wp-includes/functions.php on line 3245I saw some of people asked about this question for previous versions. Its supposed to be fixed.
I am using
Debug : True
Wordpress : 3.9
bbPress Version 2.5.3April 25, 2014 at 4:47 am #145456Topic: bbcode
in forum Installationww_hoax
ParticipantIs there any simple solution to delete default bbcodes. In which file the default bbcodes defined. Many thnaks for any hint.
April 24, 2014 at 2:09 pm #145445In reply to: Forum reply background
Robin W
ModeratorTry
#bbpress-forums input[type='text'], textarea{ background : blue !important ; }April 24, 2014 at 11:59 am #145437In reply to: Please help with space after paragraph.
WARTORIOUS
ParticipantTheme: modified portfolio press:
/*
Theme Name: Portfolio Press
Description: Portfolio Press is a responsive theme for showcasing your photography, art, web sites, or other projects. It also works nicely as a regular blog site. An options panel is included for uploading logos and and changing the layout. There’s also support for the image, gallery and quote post formats. Visit the demo site or watch the video screencast for set up instructions.
Author: Devin Price
Author URI: http://wptheming.com/
Theme URI: http://wptheming.com/portfolio-theme/
Version: 1.7
License: GNU General Public License
License URI: license.txt
Tags: white, black, gray, two-columns, left-sidebar, right-sidebar, flexible-width, custom-menu, full-width-template, microformats, post-formats, rtl-language-support, theme-options, translation-readyCredits:
Portfolio was built on the solid foundation of Toolbox:
https://wordpress.org/extend/themes/toolboxReset default browser CSS.
Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/MODERATOR EDIT: I removed the ~1200 lines of code here, use pastebin or a gist on GitHub for big code dumps.
April 24, 2014 at 6:14 am #145429In reply to: Installing in the root directory?
Stephen Edgar
Keymaster@jakoblanglois has it right, to fix the last issue he describes when just need to modify the breadcrumbs behaviour a bit…
Uncheck the ‘Forum Prefix – Prefix all forum content with the Forum Root slug (Recommended)’ in bbPress settings and then the last bit…
Upon further testing, I noticed that this will not edit the breadcrumbs and will show Home > Forums (linking to domain.com/forums).
Tweak the settings of the breadcrumb using some custom arguments, this is based on the code here though what I have below just removes the ‘forums root’ from the breadcrumb…
<?php /* Plugin Name: bbPress - Custom Breadcrumbs Plugin URI: https://gist.github.com/ntwb/7781901 Description: bbPress - Custom Breadcrumbs Version: 0.1 Author: Stephen Edgar - Netweb Author URI: http://netweb.com.au */ add_filter('bbp_before_get_breadcrumb_parse_args', 'ntwb_bbpress_custom_breadcrumb' ); function ntwb_bbpress_custom_breadcrumb() { // Forum root $args['include_root'] = false; return $args; }Copy the above into a file named
ntwb_bbpress_custom_breadcrumb.phpin your plugins folder πApril 24, 2014 at 5:50 am #145428In reply to: Installing in the root directory?
Jakob Langlois
ParticipantIf I understood you correctly this is what you’re after.
When in the dashboard, navigate to Settings > Reading.
Change the option that’s called Front page displays to a static page and choose the home page (assuming you’ve created a page to be the front page).
Now navigate to Pages > All Pages and edit the page you selected to be your home page (usually “home”).
Enter the shortcode [bbp-forum-index] and then publish.
For a full list of available shortcodes, visit https://codex.bbpress.org/shortcodes/
Upon further testing, I noticed that this will not edit the breadcrumbs and will show Home > Forums (linking to domain.com/forums). I also tested this by changing the forum root slug in Settings > Forums to “home” (the page I have set to be my front page) and it now shows Home > Home
I am unsure as to how this would be fixed though…
April 24, 2014 at 12:19 am #145421In reply to: add custom profile field or group as signature?
Stephen Edgar
KeymasterI am not sure how Register Plus Redux registers the new profile fields though an alternate way would be to use
user_contactmethodshttps://codex.wordpress.org/Plugin_API/Filter_Reference/user_contactmethods
So here is an alternate method using that method as a single standalone plugin:
I’m not saying there is anything wrong with the method you used, just an alternate method.
You could add as many or few extra fields as you want π
Source: https://gist.github.com/ntwb/11241301
<?php /* Plugin Name: bbPress - CLB Add user school to reply author details Plugin URI: https://gist.github.com/ntwb/11241301 Description: bbPress - CLB Add user school to reply author details Version: 0.1 Author: Stephen Edgar - Netweb Author URI: http://netweb.com.au */ function clb_user_contact_methods( $user_contact ){ /* Add user contact methods */ $user_contact['school'] = __('School Name'); return $user_contact; } add_filter('user_contactmethods', 'clb_user_contact_methods'); function clb_school_replies_author() { echo get_user_meta(bbp_get_reply_author_id(), 'school', true); } add_action( 'bbp_theme_after_reply_author_details', 'clb_school_replies_author' );As it displays in each reply under the author details

As it displays on a users profile page
April 23, 2014 at 11:06 pm #145418In reply to: add custom profile field or group as signature?
carterlongbeach
ParticipantI don’t know if it is the most efficient solution, but I found something that works.
I created a new profile field with Register Plus Redux (new field called rpr_testfield).
I then modified bbp profile information with the following code, starting on line 26…
$usermeta = get_userdata( $user_id, 'rpr_testfield' ); echo $usermeta->rpr_testfield; if ($usermeta->rpr_testfield == 'school name from profile') echo "<a href="http://www.hyperlink?pID=19" target="_blank">School web page</a>";Now all posts include the name of the user’s school with a hyperlink to the school webpage.
April 23, 2014 at 7:49 pm #145417In reply to: Requesting feedback on forum layout.
Stephen Edgar
KeymasterLooks good, I like that you have the template notices using the colors from your theme, many people miss styling those and it is always the first thing I look for π
Take a look at the shortcode
[bbp-stats]to display the forum statistics.https://codex.bbpress.org/shortcodes/
Also the page template
page-forum-statistics.phpto get some good ideas on adding your stats .April 23, 2014 at 7:40 pm #145410In reply to: Moderator Unable To Post To Forum: iPhone iPad
Stephen Edgar
Keymasterwould I *only* be allowed to add a tags with a class (no, I donβt know why either but just pretendβ¦) and not able to add the default img, blockquote, etc tags?
Correct, with the example you posted you would only be able to add an
aanchor HTML element with aclassCSS class eg.<a class="my-css-class">description</a>note as you removedhreffrom the allowed tags you wouldn’t be able to use<a href="http://example.com">description</a>I had a similar question last year but never really figured it out β gave up when I decided it didnβt matter: https://bbpress.org/forums/topic/using-wp_filter_kses-filter-for-bbpress-posts/
I fully appreciate this highlights how little I know these things! And thank you. π This has been a really interesting discussion.
This highlights how little I knew 12 months ago, if I don’t know I don’t answer a question unless I can provide something that IS helpful, we are all constantly learning π
April 23, 2014 at 7:25 pm #145404In reply to: Showing Sub-SubForums
Stephen Edgar
KeymasterNot at this stage it isn’t ‘out of the box’ you could modify the templates (in a child theme of course) and get the desired effect.
A good starting point for this is the code behind the concept of the following topic:
I have created a bbPress starter theme with a phpBB look and feel
You also reorganize some of your forum structure:
eg.
From:-The Hunt
–Worldwide
—Los Angeles / Orange County
—New York
—Online
—SF Bay AreaTo: (As unless you plan on including other planets and galaxies worldwide is kind of moot π
-The Hunt
–Los Angeles / Orange County
–New York
–Online
–SF Bay AreaApril 23, 2014 at 7:19 pm #145403In reply to: is_bbpress() defined on the BuddyPress profile page
Stephen Edgar
KeymasterMaybe use some other bbPress/BuddyPress conditional tags
Note: The BuddyPress codex page is undergoing some updates. There are a few that are now depreciated, you can find an accurate list here.
I also wrote a plugin that makes it super easy to see what conditional tags are being used on a page π
https://wordpress.org/plugins/query-monitor-bbpress-buddypress-conditionals/
(You first need to install https://wordpress.org/plugins/query-monitor/)April 23, 2014 at 7:08 pm #145402In reply to: Avatar Folders (to choose pre-made avvys?)
Stephen Edgar
KeymasterYou could write some custom code to do it in a child theme though it would probably be quicker to fork an existing plugin that will do it for you with bbPress.
@imath’s BuddyPress plugin comes close to what you want I think and would be a good starting point to convert it from BuddyPress to bbPress.
April 23, 2014 at 1:43 pm #145398Topic: is_bbpress() defined on the BuddyPress profile page
in forum Troubleshootingnirgalo
ParticipantHi, I am using is_bbpress() in page.php to check whether I am in a bbPress context. It seems BuddyPress and bbPress are sharing the same profile page. Therefore, when the latter is being displayed, bbPress is being defined, and this triggers wrong behavior in my code. So, how can I check a bbPress or BuddyPress profile page is being displayed so I can fix my code? thx.
April 23, 2014 at 10:21 am #145393In reply to: bbpress custom user role ?
Robin W
Moderatorok,
so create a file called bbpress-functons.php as above and in to this put
<?php //code to add tutor role function add_tutor_role( $bbp_roles ) { /* Add a role called tutor */ $bbp_roles['bbp_tutor'] = array( 'name' => 'Tutor', 'capabilities' => custom_capabilities( 'bbp_tutor' ) ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_tutor_role', 1 ); function tutor_role_caps_filter( $caps, $role ) { /* Only filter for roles we are interested in! */ if( $role == 'bbp_tutor' ) $caps = custom_capabilities( $role ); return $caps; } add_filter( 'bbp_get_caps_for_role', 'tutor_role_caps_filter', 10, 2 ); function custom_capabilities( $role ) { switch ( $role ) { /* Capabilities for 'tutor' role */ case 'bbp_tutor': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => true, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); break; default : return $role; } }This sets up a role called ‘tutor’ – just change this name everywhere to the one you want, and then edit the capabilities.
the default capabilities for each role are :
https://codex.bbpress.org/bbpress-user-roles-and-capabilities/
you’ll probably want to make delete topics and delete replies true
April 23, 2014 at 8:38 am #145386In reply to: Moderator Unable To Post To Forum: iPhone iPad
tharsheblows
Participant@netweb – with filters, do they only add or modify the function? I mean, can you only add or modify parameters in them, not delete? Eg if I had this:
add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' ); function ntwb_bbpress_custom_kses_allowed_tags() { return array( // Links 'a' => array( 'class' => true, ) }would I *only* be allowed to add a tags with a class (no, I don’t know why either but just pretend…) and not able to add the default img, blockquote, etc tags? I guess I’m asking is it like a child functions.php file (which overwrites) or a child css file (which adds to / modifies)? I am hoping I’ve got my analogies right, hmm.
I had a similar question last year but never really figured it out – gave up when I decided it didn’t matter: https://bbpress.org/forums/topic/using-wp_filter_kses-filter-for-bbpress-posts/
I fully appreciate this highlights how little I know these things! And thank you. π This has been a really interesting discussion.
April 23, 2014 at 7:45 am #145385In reply to: bbpress custom user role ?
Robin W
Moderatordo you know how to add some code to your functions file – if I gave you the code?
April 23, 2014 at 6:36 am #145380In reply to: problem with forum page – [wesf_account_page]
Stephen Edgar
KeymasterI have no idea nor could find a reference to
[wesf_account_page]most likely it is a plugin.All references to it via a Google search appear to all revolve around a page titled
my-account.Most likely it was from either a theme or plugin you no longer use as you see the ‘raw’ shortcode rather than a rendered shortcode. Find what page the shortcode is used on and remove it.
April 23, 2014 at 4:49 am #145377In reply to: Sidebar formatting
Robin W
Moderatoroh and sorry – see
for how to add this -several options.
April 23, 2014 at 2:34 am #145371In reply to: Moderator Unable To Post To Forum: iPhone iPad
Stephen Edgar
KeymasterHere is a custom plugin for custom KSES, specifically it adds support for tables and class names for
aandimgthough you most likely don’t want people adding classes to these normally.https://gist.github.com/ntwb/7797990
And I am glad your up and running now @matoca, TinyMCE v4 is a big upgrade and as you point out there are vast improvements and vast breakages with existing plugins, hopefully the authors of these plugins will get this sorted soon.
I also look forward to seeing and checking out a few of the plugins that really take advantage of TinyMCE 4 as I have already spent a fair amount of time testing it already, specificly pasting from Word, Excel PDF etc and it is pretty awesome what you can throw at it.
April 22, 2014 at 10:34 pm #145365In reply to: Moderator Unable To Post To Forum: iPhone iPad
tharsheblows
ParticipantThank you so much for the update! I’m glad it’s working. π
I have just now finished helping troubleshoot a bug with copying and pasting text from pdfs into the new WP visual editor. The guy thought it was a problem with WP 3.9 but it is an issue with one of his plugins – however, I can see why he thought that. (I didn’t go all the way through to finding out which plugin it is – this is just some guy I follow on twitter.) So it’s happened to someone I’ve come across, too.
I want to use Parsedown in my forums and got as far as making a plugin that got it to work when writing posts but then realised I needed something like “Parseup” (current status: imaginary) to make the editing posts possible and sane. Doh.
Perhaps there will be a plugin in the future that will allow moderators with administrator rights to have these tools directly in the forum, but not have them accessible to the general public?
Your users can still use a limited number of html tags, although they probably don’t know it because now it doesn’t say so anywhere. I think that’s true… it’s in includes/common/formatting.php
Note that they can’t upload images but can simply hotlink them. I was worried about this initially but it hasn’t been a problem so far although now I’ve probably jinxed it./** Kses **********************************************************************/ /** * Custom allowed tags for forum topics and replies * * Allows all users to post links, quotes, code, formatting, lists, and images * * @since bbPress (r4603) * * @return array Associative array of allowed tags and attributes */ function bbp_kses_allowed_tags() { return apply_filters( 'bbp_kses_allowed_tags', array( // Links 'a' => array( 'href' => array(), 'title' => array(), 'rel' => array(), 'target' => array() ), // Quotes 'blockquote' => array( 'cite' => array() ), // Code 'code' => array(), 'pre' => array(), // Formatting 'em' => array(), 'strong' => array(), 'del' => array( 'datetime' => true, ), // Lists 'ul' => array(), 'ol' => array( 'start' => true, ), 'li' => array(), // Images 'img' => array( 'src' => true, 'border' => true, 'alt' => true, 'height' => true, 'width' => true, ) ) ); }April 22, 2014 at 9:54 pm #145364In reply to: Moderator Unable To Post To Forum: iPhone iPad
Matoca
ParticipantUpdate. Monday I asked my iPad, iPhone moderator to see if she could get a keyboard to come up, see what she was typing and actually post to the forum. She reported that it was working perfectly! No kidding! So after the WordPress 3.9 upgrade, the tinyMCE 4 upgrade has improved interaction with iPads and iPhones.
See: http://www.tinymce.com/index.php
Also: tinyMCE 4 has a presentation that explains what is different.
http://www.tinymce.com/presentation/index.html#/I did a little research about tinyMCE because honestly it sounds like the name of a toy. So once I found the name, Tiny Moxiecode Content Editor, it made more sense to me. Wikipedia describes it as “platform-independent web-based JavaScript/HTML WYSIWYG editor control.” So, in a sense, this is the core element of WordPress (and other CMS platforms), giving the user the ability to get content on the blog without having to necessarily understand anything about HTML.
After browsing some forums I better understand that this upgrade of WP and tinyMCE has rendered many previous plugins dead in the water. It means that users need to do some serious spring cleaning and get rid of any plugins that have not been specifically updated for use with WP 3.9.
A lot of plugins have necessarily cropped up over time to add back lost functionality in tinyMCE as functions were removed. So the bbPress plugin I was using in the past that added back the visual tab to the forum message field was just one of many. Luckily I did disable it prior to the release of 3.9 but it clearly was already unstable with 3.8.
I made a mistake when I posted earlier, enabling the tools in the dashboard does give them to everyone who is not registered or logged in, not just those logged in as moderators. So I have rethought having the text editor tools on the open forum. I don’t like the ability of non-registered posters to add images directly nor do I like them adding links. These people don’t register so I have removed all editing tools from the forum in forum>settings. I have asked moderators to use the tools in the dashboard for adding images and links. Perhaps there will be a plugin in the future that will allow moderators with administrator rights to have these tools directly in the forum, but not have them accessible to the general public?
So if you do want your moderators to have undo, redo, add link, remove link and insert/edit image in the forum then enable this in forum>settings, it standard with tinyMCE 4, and looks exactly as it does on this forum
I became interested in more functionality and I installed TinyMCE Advanced plugin this afternoon to play with. I realized the many things I could do just with tables! So it’s a versatile plugin and they claim has been tested with 3.9.
my best, matocaApril 22, 2014 at 7:16 pm #145359Topic: Limit Number of Topics and Replies per Page and RSS
in forum Troubleshootingryanric
ParticipantHello Forum,
My bbPress forum is displaying all of the replies instead of showing just a few replies per page.WHAT I WANT: I’m trying to set up a single-topic forum on my website on this page (http://learn.serve-smart.com/topic/the-secret-to-service-reflection-learner/). Right now I’m using this short code: [bbp-single-topic id=2073]. I want users to get a prompt, see the responses of three or so other users, and respond to the prompt themselves.
WHAT IS HAPPENING NOW: The page is displaying every single reply to the topic on a single page. This is despite changing the bbPress settings to “3” for “Topics per page” and “Replies per page” under the “Topics and Replies Per Page” and Topics and Replies Per RSS Page.”
WHAT I’M RUNNING:
Database: Latest WP
Theme: WP-Forge
Key Plugins: Latest bbPress plugin, Latest LearnDash pluginThanks in advance for your help!
-RyanApril 22, 2014 at 6:37 pm #145357In reply to: Avatar Folders (to choose pre-made avvys?)
DietPipsi
ParticipantHello. Thankyou for the reply. The problem with using the Custom Default Avatar plugin is that users cannot choose which avatar from that list that they want to use. They only have two options, one default or upload their own.
I want them to be able to choose from a list of avatars with a drop-down or radio button. Is there a plugin for this or a snippet of code I can put into my child theme to enable this?
Thanks
-
AuthorSearch Results