Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,801 through 12,825 (of 32,521 total)
  • Author
    Search Results
  • #141949
    Stephen Edgar
    Keymaster

    Closing this thread also as it is 3+ years old.

    I moved @tazogamer reply and code to it’s own topic:

    My customized sub-sub-forums

    #141948
    Stephen Edgar
    Keymaster

    Nice and thanks for sharing your code. 🙂

    (I moved this to it’s own topic rather than at the bottom of an old topic)

    #141944
    Stephen Edgar
    Keymaster
    Stephen Edgar
    Keymaster

    Are you wanting something like this?

    forums/membership-services/view-profile/{username}

    If so we already have a support ticket opened:
    https://bbpress.trac.wordpress.org/ticket/2496

    #141940

    In reply to: bbPress 2.5.3

    Stephen Edgar
    Keymaster

    @@mariz_p This is not a ‘standard feature’ of WordPress or bbPress, I presume you are using a plugin to enable this. What plugin is it?

    Depending upon how the plugin implements this it ‘might’ be something bbPress could add support for in the bbPress login widget and form-user-*.php templates, but most likely this we be difficult to do for compatibility of ‘all the plugins’ that enable this feature.

    Most likely you will need to customize the form-user-*.php templates to match the plugin you are using.

    #141938

    Topic: bbp_new_forum hook

    in forum Plugins
    Laviic
    Participant

    Hello,

    I am trying to write a plugin that adds some meta-information to a forum when it gets created. I can see that bbPress has a “bbp_new_forum” and a “bbp_edit_forum” hook, yet those never appear to fire, no matter what i do. I even added a php-die directly in front of their respective “do_action” calls inside the bbPress source code just to find out, that the part of the code that should call the new_forum hook appears to never actually be executed. What are those hooks for then, and what hooks DO get called when you create/edit a bbPress forum?

    Thank you for your help!

    My Version of WordPress is 3.8.1
    My Version of bbPress is 2.5.3

    #141937
    tazogamer
    Participant

    I HAVE DONE THAT, but you need to read all these instruction and do a customization:

    
    
    //using add_filter, i have changed one original bbPress function (named bbp_list_forums, created from bbpress\includes\forums\template.php function)
    // copied  that function, and inserted the additional code (you can easily see my added extra code)
    //so, after some time, someone, who will work on this website, may have to update the below "bbp_list_forums" function (according from the new version of bbPress package,as now its 2013-14 year), and insert again my added code in its place..
    
    add_filter('bbp_list_forums','bbp_list_forumsNEWWWW',10);
    function bbp_list_forumsNEWWWW( $args = '' ) {
    
    	// Define used variables
    	$output = $sub_forums = $topic_count = $reply_count = $counts = '';
    	$i = 0;
    	$count = array();
    
    	// Parse arguments against default values
    	$r = bbp_parse_args( $args, array(
    		'before'            => '<ul class="bbp-forums-list">',
    		'after'             => '</ul>',
    		'link_before'       => '<li class="bbp-forum">',
    		'link_after'        => '</li>',
    		'count_before'      => ' (',
    		'count_after'       => ')',
    		'count_sep'         => ', ',
    		'separator'         => ', ',
    		'forum_id'          => '',
    		'show_topic_count'  => true,
    		'show_reply_count'  => true,
    	), 'list_forums' );
    
    	// Loop through forums and create a list
    	$sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
    	if ( !empty( $sub_forums ) ) {
    
    		// Total count (for separator)
    		$total_subs = count( $sub_forums );
    		foreach ( $sub_forums as $sub_forum ) {
    			$i++; // Separator count
    
    			// Get forum details
    			$count     = array();
    			$show_sep  = $total_subs > $i ? $r['separator'] : '';
    			$permalink = bbp_get_forum_permalink( $sub_forum->ID );
    			$title     = bbp_get_forum_title( $sub_forum->ID );
    
    			// Show topic count
    			if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    				$count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
    			}
    
    			// Show reply count
    			if ( !empty( $r['show_reply_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    				$count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
    			}
    
    			// Counts to show
    			if ( !empty( $count ) ) {
    				$counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];
    			}
    
    			
    			
    			
    			
    			
    			
    			
    				//------------------------------------------------------------------------------------------------	
    		//------------------------------------------------------------------------------------------------
    		// ------------------------------------------------ HERE WHAT I HAVE ADDED ------------------------
    		//------------------------------------------------------- START -------------------------------
    		//------------------------------------------------------------------------------------------------
    		$fresnhesss=bbp_get_forum_last_topic_title( $sub_forum->ID );
    		if(empty($fresnhesss))	{$fresnhesss='NO TOPICS';}
    		else {$fresnhesss='<a href="'. bbp_get_forum_last_topic_permalink( $sub_forum->ID ) .'">'. $fresnhesss .'</a>';}
    		
    			// Build this sub forums link
    			$output .= $r['link_before'] . '
    				<li class="forumsSUUB">
    					<div class="s_LINe"><a  href="' . esc_url( $permalink ) . '" class="bbp-forum-link">__' . $title . $counts . '</a></div>' .
    					$show_sep . '
    					<div class="bbp-forum-lastactivee">'.$fresnhesss.'</div> 
    					<div class="bbp-forum-contenttt-descr">'. bbp_get_forum_content($sub_forum->ID) .'</div> 
    				</li>' . $r['link_after'];
    			
    
    		// sub-sub-forums list
    		$sub_forums2 = bbp_forum_get_subforums( $sub_forum->ID );
    		if ( !empty( $sub_forums2 ) ) {
    		
    		$i = 0;
    			// Total count (for separator)
    			$total_subs = count( $sub_forums2 );
    			foreach ( $sub_forums2 as $sub_forum2) {
    			
    				$i++; // Separator count
    
    				// Get forum details
    				$count     = array();
    				$show_sep  = $total_subs > $i ? $r['separator'] : '';
    				$permalink = bbp_get_forum_permalink( $sub_forum2->ID );
    				$title     = bbp_get_forum_title( $sub_forum2->ID );
    
    				// Show topic count
    				if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum2->ID ) ) {
    					$count['topic'] = bbp_get_forum_topic_count( $sub_forum2->ID );
    				}
    
    				// Show reply count
    				if ( !empty( $r['show_reply_count'] ) && !bbp_is_forum_category( $sub_forum2->ID ) ) {
    					$count['reply'] = bbp_get_forum_reply_count( $sub_forum2->ID );
    				}
    
    				// Counts to show
    				if ( !empty( $count ) ) {
    					$counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];
    				}
    
    			//fresnhess		
    			$fresnhesss2=bbp_get_forum_last_topic_title( $sub_forum2->ID );
    			if(empty($fresnhesss2))	{$fresnhesss2='NO TOPICS';}
    			else {$fresnhesss2='<a href="'. bbp_get_forum_last_topic_permalink( $sub_forum2->ID ) .'">'. $fresnhesss2 .'</a>';}
    			
    				// Build this sub forums link
    				$output .= '
    				<li class="bbp-forum forumsSUUB">
    					<div class="subsub_LINe"><a  href="' . esc_url( $permalink ) . '" class="bbp-forum-link">__' . $title . $counts . '</a></div>' .
    					$show_sep . '
    					<div class="bbp-forum-lastactivee">'.$fresnhesss2.'</div> 
    					<div class="bbp-forum-contenttt-descr">'. bbp_get_forum_content($sub_forum2->ID) .'</div> 
    				</li>';
    			}
    		}
    		//------------------------------------------------------------------------------------------------
    		//------------------------------------------------------------------------------------------		
    		//----------------------------- END of my inserted code (then continues normally)-----------
    		//------------------------------------------------------------------------------------------	
    		////------------------------------------------------------------------------------------------------	
    			
    			
    			
    			
    			
    			
    		
    			
    		}
    
    		// Output the list
    		echo apply_filters( 'bbp_list_forumss', $r['before'] . $output . $r['after'], $r );
    	}
    }	
    #141934
    tazogamer
    Participant

    i am editing the code, and will post soon..

    #141916
    barnabe
    Participant

    Hello,

    Thanks for the answer! In fact, this is no a display problem in admin menu, but rights (user capabilities). When I set the URL “edit.php?post_type=forum” directly in the addresses’ bar, WordPress says to me I have not the right to access this page.

    After a “very” long debug, I found why this behavior appends. The qTranslate plugin is loaded before bbPress and sets up the WP_User via the function wp_get_current_user() and so sets its allcaps. So when WordPress object is init in wp-settings.php file to sets up current user, wp_get_current_user() returns the existing user and not reloads capabilities.

    I fixed this problem in adding a param to wp_get_current_user():

    function wp_get_current_user($new_user = false){}

    and the same param to get_currentuserinfo() and wp_set_current_user(). I also modified the condition in get_currentuserinfo():

    if ( ! empty( $current_user ) && $new_user === false ) {

    and the condition in wp_set_current_user():

    if ( isset( $current_user ) && ( $current_user instanceof WP_User ) && ( $id == $current_user->ID ) && $new_user === false )

    Then I added the true value in param to the call of wp_get_current_user() in init method of WP class.

    Maybe this bug appears because I installed qTranslate before bbPress. Maybe this bug not appears if bbPress is installed before qTranslate. I’ll try an another install to test that. It would be nice not to change the core of WordPress.

    #141912
    #141907
    gastronomicslc
    Participant

    Hi all.

    My apologies if this is a fairly rudimentary query, or one covered elsewhere, I did search but managed to only confuse myself more 😉

    My site is:
    http://www.gastronomicslc.com/

    Running latest WP and a Genesis based theme from Studiopress. I installed bbPress but am having issues generating a coherent main page, I guess the forum root if you will. I followed the install instructions and made my forum root slug (foodie-talk), I also then made the foodie-talk page, however that doesn’t seem to work:

    http://www.gastronomicslc.com/foodie-talk/

    I have created two test sub-forums

    http://www.gastronomicslc.com/foodie-talk/forum/general-talk/
    http://www.gastronomicslc.com/foodie-talk/forum/ask-expert/

    with a test post in each. I have yet to link to the bbPRess directly from my site while I work on this. On the foodie-talk page I have the [bbp-forum-index] code right now.

    I imagine I have made some simpleton fault, appreciate anyone pointing it out 🙂

    #141904
    Prometheus Fire
    Participant

    In BBPress, is there an equivalent to WP’s next_post_link() and previous_post_link() functions to create navigation to the next topic?

    Reference:
    http://codex.wordpress.org/Function_Reference/next_post_link
    http://codex.wordpress.org/Template_Tags/previous_post_link

    If not, can anyone think of a custom way to create one, or do something similar?

    #141903

    There are a few plugins that jumpstart WordPress’s roles and capabilities, which can cause permissions issues with bbPress (and any other plugin that relies on roles and capabilities.) These plugins are __doing_it_wrong() in the conventional sense, and there’s not much bbPress can do about that other than throw debug notices when WP_DEBUG is turned on.

    #141900

    It looks to me like bbPress isn’t finding its default CSS. You could try reinstalling bbPress; it’s possible you have an incomplete installation, with only some non-essential assets were caught missing.

    Otherwise, it could be a plugin conflict, or some other code might just be getting in the way of bbPress’s CSS loading. You could also try deactivating plugins one at a time, and seeing if something new you’ve added recently is causing this to happen.

    #141899

    Sounds to be like qTranslate is accidentally stomping out bbPress’s top level menu locations. WordPress’s code in regards to navigation has a tendency to be pretty fickle in this regard.

    bbPress even takes measures to try and avoid this from happening on its own, but it looks like it’s still not enough anymore.

    We’ll see if there’s anything we can do on our end to avoid any of these kinds of menu collisions again. If so, improvements will come in a future version of bbPress.

    Shmoo
    Participant

    I don’t think it’s possible by default but you could fake it and make your own ‘fake-loops’ inside the templates files.

    It takes some work and you’re probably will have to call most of your forum_ids by it’s number which is very static.

    This for example maks a clean link to forum_id 98 + adds the forum title as a link-text.
    You could make your custom HTML Lists like that but remember if you delete or add a forum you have to change your template files also. It’s very static.

    
    <a class="button" href="<?php bbp_forum_permalink( 98 ); ?>"><?php bbp_forum_title( 98 ); ?></a>
    
    #141894
    Shmoo
    Participant

    – Yes the plugin is 100% sure active and working because you can see ( red border ) the topic is reported , I’ve even deactivated & activated it again to make sure when I saw that error.

    – It’s a clean copy-/paste from the plugin’s functions file. I’ve even added echo in front of it to check if there was a difference but both with & without echo have the same error.

    Why I ask if a plugin function can be private or protected is, when I take a look inside the plugin function-file I see all functions wrapped inside a class which is pretty standard for making plugins I’ve seen online.

    But I also see something like this:

    
    	protected $version = '1.0.0';
    	protected $plugin_slug = 'bbpress-report-content';
    	protected static $instance = null;
    	protected $plugin_screen_hook_suffix = null;
    	protected $plugin_path = null;
    ____
    	private function __construct() { ....
    
    ____
    	public static function get_instance() {
    
    		// If the single instance hasn't been set, set it now.
    		if ( null == self::$instance ) {
    			self::$instance = new self;
    		}
    
    		return self::$instance;
    	}
    
    

    Most functions have public function function_name() and the function I would like to use has only function function_name()

    That made me think maybe my function it’s protected, so I started testing and searching online and did this inside my page template.

    
    <?php if(function_exists('get_topic_report_link')) {
    echo get_topic_report_link( $args = '' );
    } else {
    echo 'Function does not exists..';
    }
     ?>
    

    It takes the ELSE option so there is something wrong right.

    ___

    This is what I did to kill for example the Merge link from the admin_links, preventing it would show up something else when called upon.

    
    function shmoo_kill_topic_merge_link( $r ) {
    	$r = null;
    	return $r;
    }
    add_filter( 'bbp_get_topic_merge_link', 'shmoo_kill_topic_merge_link' );
    

    I’m a Check Norris fan, when I change stuff it has to be NULL 😉

    I know, I probably add and write too much functions-/codes of my own to alter the bbPress core but at least I’m getting it done right now and starting to understand how it works a little. In a few years I will be better ( hopefully ) and add more logic to my projects.

    #141888
    Shmoo
    Participant

    If you know a little CSS and you’re not afraid the change the bbPress templates a little you can make this happen with through the forum_id(); which is unique for each forum.

    Take a look inside loops-forums.php ( the template that starts the forums loop ) you’ll find this. <?php bbp_forum_id(); ?>

    Copy that, next open your loop-single-forum.php and paste that code where you would like your image to show up.
    For example something like this could be possible.

    
    <img class="bbp-featured-img" src="http://example.org/images/forums/featured_forum_<?php bbp_forum_id(); ?>.png" alt="<?php bbp_forum_title(); ?>" /><a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>
    

    All you have to do now is make sure you call your forum images featured_forum_[ID].png and upload them to the path you set in the image tag.

    If you Hover over the forum names at the WP back-end you’ll see where the URL-page is pointing to if you would’ve clicked it, this link has a number like 88 or something, each forum has an unique number so your could pick that number and call it in your images, featured_forum_88.png >> upload the image and it will show up next to the forum title.

    Change-/position it a little by CSS ( img.bbp-featured-img { } ) and you’re done.

    I’ve done this myself the same way only with icon-fonts in front of the forum titles.
    It’s a little bit of customization and it has a static feeling but it’s not that difficult and works perfect.

    Edit

    Almost forgot to say, don’t change the bbPRess template files inside your plugins directory but copy those files to your theme directory.
    https://codex.bbpress.org/theme-compatibility/

    #141887
    beaulahsmithzeiler
    Participant

    Hi guys. I am using the forum list widget to display the different forums. Can anyone help me with some code so that the number of topics under each forum is listed as well in the sidebar?

    #141884
    Kris35
    Participant

    Hi. Is there a way to add mandatory custom fields in the BBPress registering process? I did get someone to add a text field for the location but it wasn’t mandatory and for the UK, they were adding variations like England, Britain etc so in my user directory and search, people looking for people in the UK would only find people in the UK and not in England or the United Kingdom etc. So I had to go and edit their profiles to say United Kindom so they would come up in the search. Sooo…what I really need is not a text field but a drop down or other thingy where new members have to choose where they are from from the options they are given. So I need a list of all countries and then for now, a list for US states and UK counties. I have a coder to do this for me (Ive not got a clue)….is it possible to do this by configuring BBpress or is a custom code thingy needed? If I can do it, I will show it here maybe so others can see?

    #141875
    black_lady
    Participant

    Hi,
    I have the same issue.
    Tip: I try use the shortcode and then pagination is ok.
    But I really need the solution..anyone?

    Best regards!

    #141872
    Stephen Edgar
    Keymaster

    If you have a ‘Private’ forum the title will include PRIVATE: PRIVATE: as a title prefix.

    Eg. This is a private forum titled PRIV and becomes PRIVATE: PRIVATE: PRIV

    The plugin above will remove the PRIVATE: PRIVATE: title prefix.

    #141871
    Stephen Edgar
    Keymaster

    @sarau Download the plugin here https://gist.github.com/ntwb/8662354

    Or add the code to your own custom plugin or child themes functions.php

    #141868
    Tearstone
    Participant

    It has been about two weeks since I converted my vBulletin forum over to BBPress. The existing forum has been around since 2008 and since the conversion, we have been receiving emails over entire history of the site that topics have been replied to. These are notifications that have been sent non-stop since the conversion.

    I installed Buddypress and BBPress at the same time, so I’m not sure exactly what is causing all of these emails to continue to be sent out. How do I stop these notification emails from going out? I’ve already attempted to add the following code to my site specific plug-in, but it does not seem to have helped much. I guess it helped with mentions but not the replies.

    remove_action( ‘bp_activity_posted_update’, ‘bp_activity_at_message_notification’, 10, 3 );
    remove_action( ‘bp_groups_posted_update’, ‘groups_at_message_notification’, 10, 4 );

    What are the BBPress hooks to stop reply notifications? I just want them to stop for awhile without disabling email site wide.

    #141865

    Sure did; thanks. I ways able to create an account easily enough, but it looks like logins are completely broken on your site; they do not even work through WordPress’s traditional wp-login.php directly (which is what bbPress sends login data to.)

    Something else is wrong, outside of bbPress, though it’s difficult to troubleshoot on this end. It might be the case-sensitive URL (with “Install” in there) or it could be any other server config, plugin, theme, or random cookie issue.

    Sorry I can’t be much more help, but hopefully this helps you sniff it out.

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