Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,776 through 12,800 (of 32,503 total)
  • Author
    Search Results
  • #141977
    leromt
    Participant

    For what it’s worth, here is what I ended up doing:

    1. I left my “parent” forum as a category.

    2. Around line 847 of bbpress/includes/forums/template.php, I added “true” to the if statement to force the “category” parent forum to be shown, as follows:

    // No link for categories until we support subscription hierarchy
     // @see https://bbpress.trac.wordpress.org/ticket/2475
    if ( true || bbp_is_forum_category() ) {
    $retval = bbp_get_user_subscribe_link( $r );
    }
    

    3. In bbpress/templates/default/loop-single-forum.php I replaced line 44 with the following:

    
    <?php 
    		
    $subForumList = bbp_forum_get_subforums();
    		
    if(sizeof($subForumList) > 1){
    
       echo "<ul style='margin-left: 20px;'>";
    
       foreach($subForumList as $currForum){
    
       // Create the arguments
       $r = bbp_parse_args( $args, array('forum_id' => $currForum->ID,
            'user_id' => 0,
            'before' => '',
            'after' => '',
            'subscribe' => __( 'Subscribe',   'bbpress' ),
            'unsubscribe' => __( 'x', 'bbpress' )
             ), 'get_forum_subscribe_link' );
    
        $isSubscribed = bbp_get_forum_subscription_link($r);
    
        // see if the returned html has 'is-subscribed' in it
        // if it does, then the user is subscribed to the forum
    
        if(strpos($isSubscribed, 'is-subscribed') != 0){
        echo "<li>" . $isSubscribed . "&nbsp;&nbsp;<a href='" . bbp_get_forum_permalink($currForum->ID) . "'>" . $currForum->post_title . "</a></li>";
        }
    			
       }
    
      echo "</ul>";
      } // end > 1
    ?>
    

    Feel free to criticize, pick apart, or provide feedback as you see fit…it works for me.

    Mike
    Participant

    Well I set the default value for ‘allow global access’ to false in the options file:

    function bbp_allow_global_access( $default = 0 ) {
    	return (bool) apply_filters( 'bbp_allow_global_access', (bool) get_option( '_bbp_allow_global_access', $default ) );
    }

    Hopefully that together with my other changes will have done the trick.

    #141972

    In reply to: Topic Thumbnails?

    Robin W
    Moderator

    Ok, I cracked that code open, and think that putting in the following will work

    add_action( 'bbp_theme_before_topic_title', 'assylumn_insert_thumbnail' );
    function assylumn_insert_thumbnail() {
    	echo('<a href="http://www.mysite.com/wp-content/uploads/2013/09/picture.jpg">') ; 
        echo('<img class="bbp-topic-thumbnail"  width="100%" style="max-width: ' . get_option('thumbnail_size_w') . 'px; max-height: ' . get_option('thumbnail_size_h'). 'px; vertical-align:middle;" src="http://www.mysite.com/wp-content/uploads/2013/09/picture.jpg"/>' .'</a>');
    	}
    
    

    Obviously you’ll need to change the URL to your image

    You’ll need to add this to your functions file, if you don’t know how to do this, come back !

    #141970

    In reply to: Google Authorship

    Denver Prophit Jr.
    Participant

    Google search: Topic Tag: email | - Hosting-4-oscommerce.com The topic tag loop needs meta descriptions.

    Mike
    Participant

    Hi,
    I have multisite WordPress 3.8.1 and Buddypress 1.9.1, and have just set up separate forums using the bbPress plugin, v2.5.3

    Now everyone who is logged in and visits another site in the network is automatically made a ‘Participant’ of the site they are visiting. I don’t want this to happen.

    I have set bbp_allow_global_access( false ) in bbPress includes/admin/settings.php, line 532
    I have also set '_bbp_allow_global_access' => 0, in includes/core/options.php, line 37

    However, when I visit a new site I am still made a participant of it. How can I disable this option in all my sites (there are thousands) without setting Auto Role to unchecked and saving the forum settings page in each individual site?

    Thanks.

    #141963

    In reply to: Google Authorship

    Denver Prophit Jr.
    Participant

    @netweb and @martin_c we’re still plagued by hatom which I believe started from our theme because we used shortcode from a page post.

    #141955

    In reply to: Persistant login form

    baylock
    Participant

    After 3 months and still not a clue, I come back with my question, hoping this time to get a working answer:

    I have installed the forum and created a template page called “forum.php” embedding a shortcode for the login form and another for the forums list to be displayed.
    The thing is that the login form only appears on the first page of the forum (forums list), but if a visitor is in the “topic” or “reply” page, he will not see the login form anymore and will have to go back to the first forums page in order to login.

    I looked into the login widget but this solution displays the login form everywhere on the website, not only on the forum section. Moreover, this solution forces me to have the login form on the header, footer or sidebar when I want it to be inside the forum area.

    I also looked into the shortcode solution but to be able to put that shortcode you need a page template. And, as far as I know, the template “forum.php” applies to the first page of the forum, not to the “topics/replies” pages which are accessed through the forums list (also a short code).

    Three months and still not a clue.
    It would be nice if you could help me on this one.
    Having the login form on each page of a forum system is not an odd request…

    Thank you.

    PS: the external plugin solution is not relevant for me as it is a mutinlingual website with RTL and LTR languages. Finding a plugin which tolerates so many languages is almost not an option and complicates things for no reason as this request is trivial enough. At least, I hope it is…

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

Viewing 25 results - 12,776 through 12,800 (of 32,503 total)
Skip to toolbar