Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,051 through 12,075 (of 32,521 total)
  • Author
    Search Results
  • #145468

    In reply to: bbcode

    Robin W
    Moderator

    if 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.

    Nomi
    Participant

    Hi.

    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 3245

    I 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.3

    #145456

    Topic: bbcode

    in forum Installation
    ww_hoax
    Participant

    Is there any simple solution to delete default bbcodes. In which file the default bbcodes defined. Many thnaks for any hint.

    #145445

    In reply to: Forum reply background

    Robin W
    Moderator

    Try

    #bbpress-forums  input[type='text'], textarea{ 
    background : blue !important ; 
    }
    
    #145437
    WARTORIOUS
    Participant

    Theme: 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-ready

    Credits:

    Portfolio was built on the solid foundation of Toolbox:
    https://wordpress.org/extend/themes/toolbox

    Reset 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.

    #145429
    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.php in your plugins folder πŸ™‚

    #145428
    Jakob Langlois
    Participant

    If 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…

    #145421
    Stephen Edgar
    Keymaster

    I am not sure how Register Plus Redux registers the new profile fields though an alternate way would be to use user_contactmethods

    https://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

    #145418
    carterlongbeach
    Participant

    I 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.

    #145417
    Stephen Edgar
    Keymaster

    Looks 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.php to get some good ideas on adding your stats .

    #145410
    Stephen Edgar
    Keymaster

    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?

    Correct, with the example you posted you would only be able to add an a anchor HTML element with a class CSS class eg. <a class="my-css-class">description</a> note as you removed href from 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 πŸ™‚

    #145404

    In reply to: Showing Sub-SubForums

    Stephen Edgar
    Keymaster

    Not 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 Area

    To: (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 Area

    #145403
    Stephen Edgar
    Keymaster

    Maybe use some other bbPress/BuddyPress conditional tags

    bbPress Conditional Tags

    Template Tag Reference

    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/)

    #145402
    Stephen Edgar
    Keymaster

    You 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.

    https://wordpress.org/plugins/bp-avatar-suggestions/

    nirgalo
    Participant

    Hi, 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.

    #145393
    Robin W
    Moderator

    ok,

    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

    #145386
    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.

    #145385
    Robin W
    Moderator

    do you know how to add some code to your functions file – if I gave you the code?

    #145380
    Stephen Edgar
    Keymaster

    I 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.

    #145377

    In reply to: Sidebar formatting

    Robin W
    Moderator

    oh and sorry – see

    Step by step guide to setting up a bbPress forum – part 2

    for how to add this -several options.

    #145371
    Stephen Edgar
    Keymaster

    Here is a custom plugin for custom KSES, specifically it adds support for tables and class names for a and img though 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.

    #145365
    tharsheblows
    Participant

    Thank 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,
    		)
    	) );
    }
    #145364
    Matoca
    Participant

    Update. 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, matoca

    ryanric
    Participant

    Hello 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 plugin

    Thanks in advance for your help!
    -Ryan

    #145357
    DietPipsi
    Participant

    Hello. 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

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