Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,976 through 5,000 (of 32,481 total)
  • Author
    Search Results
  • #186087
    abernreiter
    Participant

    wordpress version. 4.8.1
    bbPress version 2.5.11
    BuddyPress version 2.9.0

    Website: http://forum.epp-forum.com/

    We use the shortcode [bbp-topic-index] on our homepage. In this listing are also displayed topics, to which one has access only if one is logged in.
    These topics should not be displayed if you are not logged in. How can we prevent it?

    Show only if logged

    Click on Zeppy then this screen comes. So a blocked contribution

    Thank you for help

    #186086
    jagdishtechnostacks
    Participant

    Hi, you can use this in functions.php or somewhere where you initialize your code
    /* Redirect to Splash screen if Non Admin */
    function loginRedirect( $redirect_to, $request, $user ) {
    return ( is_array( $user->roles ) && in_array( ‘administrator’, $user->roles ) ) ? admin_url() : site_url(“home/”);
    }
    add_filter( ‘login_redirect’, ‘loginRedirect’, 10, 3 );
    /* Ends */

    #186079
    Dave
    Participant

    I’m confused by the logic in this system, and it’s likely because I don’t know what I’m doing.

    I have a page titled, “Team Discussions” with the shortcode [bbp-forum-index] in the editor.

    On the Forum Settings page, are the following settings:

    Forum Root Slug > Forum Root = forums

    Single Forum Slugs > Forum = forum

    I have a site-wide navigation menu link from that same Team Discussions page (http://…/team-discussions/”. When I click on it, this takes me to a page that shows the forum index. Awesome!

    But when in a sub forum for example, “Closing the Sale” (http://…/forums/forum/closing-sale/), and I click on the breadcrumb, “Home, Forums” specifically “Forums,” it redirects to a page URL of http://…/forums/”.

    What am I doing wrong?

    #186077

    In reply to: bbp-forum-index issues

    lhexy
    Participant

    after add the code,
    function bbp_increase-forum-per-page( $args = array() ) {
    $args[‘posts_per_page’] = get_option( ‘_bbp_forums_per_page’, 100 );
    return $args;
    }
    add_filter( ‘bbp_before_has_forums_parse_args’, ‘bbp_increase-forum-per-page’ );

    I got an error

    /clickandbuilds/…/wp-content/themes/…./functions.php on line 207

    As a result, I cannot open any page. Please help.

    #186062
    SimonScott
    Participant

    I was removing the BBPRESS plugin from my wordpress install, following these instructions:

    Deleting bbPress

    But after I deleted, the screen locked up, and now my website will not load.

    Please try http://www.kambocleanse.com

    Can anybody help me – can pay $$$ to get my site back up.

    Thanks

    Simon
    inbox@simon-scott.com

    #186060

    In reply to: Cant access forum

    Robin W
    Moderator

    Suspect you are using php 7.1
    so 3 fixes
    1. downgrade to a lesser version of php
    2. upgrade to bbpress 2.6rc3
    3. in bbpress 2.5.13 in includes/forums/functions.php
    change line 1851 from
    $meta_query = $posts_query->get( ‘meta_query’ );
    to
    $meta_query = $posts_query->get( ‘meta_query’, array() );
    and change line 1796 from

    $post_stati = $posts_query->get( 'post_status' );
    

    to

    $post_stati = $posts_query->get( ‘post_status’ ); 
    if (!is_array($post_stati)){
        			$post_stati = array($post_stati);
    }
    
    #186056
    michent1
    Participant

    I ended up having to dig this snippet backup for a new project and made some tweaks.


    @struth
    Updated to only output if user is logged in.

    
    	/**
    	 * Generate BBpress Edit Profile Link in a shortcode
    	 *
    	 * @param $atts, text|class
    	 * @example [bbp_edit_profile text="Edit My Profile" class"my-link-style"]
    	 * @return string|void
    	 *
    	 */
    	function bbp_edit_profile_link( $atts ) {
    		
    		//If user isn't logged in, return nothing
    		if(!is_user_logged_in()) {
    			return;
    		} else {
    			
    			extract( shortcode_atts( array(
    				                         'text'  => "",  // default value if none supplied
    				                         'class' => "" //Style class for link
    			                         ), $atts ) );
    			
    			if ( $text ) {
    				$current_user = wp_get_current_user();
    				$user         = $current_user->user_login;
    				
    				return '<a class="' . $class . '" href="/forums/users/' . $user . '/edit">' . $text . '</a>';
    				
    			}
    		}
    	}
    	
    	add_shortcode( 'bbp_edit_profile', 'bbp_edit_profile_link' );
    
    #186053
    Robin W
    Moderator

    kicked it round some more, and got to this as a better answer

    add_filter( 'bbp_get_caps_for_role', 'rew_moderator', 10, 2);
    
    function rew_moderator ($caps, $role) {
    	if ($role == bbp_get_moderator_role() ) {
    		$caps['edit_others_forums'] = true ;
    		$caps['delete_forums'] = true ;
    		$caps['delete_others_forums'] = true ;
    	}
    return $caps ;
    }
    
    add_filter ('bbp_map_forum_meta_caps', 'rew_mod', 10,4) ;
    
    function rew_mod ( $caps, $cap, $user_id, $args) {
    	switch ( $cap ) {
    	
    	case 'bbp_forums_admin'  :
    		if ( user_can( $user_id, 'moderate' ) ) {
    				$caps = array( 'moderate' );
    		}
    		
    	case 'edit_forums'         :
    	case 'edit_others_forums'  :
    	
    		if ( user_can( $user_id, 'moderate' ) ) {
    				$caps = array( 'moderate' );
    		}
    	
    	}
    	
    return $caps ;
    }
    #186039
    Robin W
    Moderator

    ok, I’ve been kicking this around for the last 3 hours!!

    Capabilities are spread all over the files in bbpress, so it’s taken a while to get to something.

    But I’ve learnt some good stuff along the way !!

    This is close to a perfect solution, and seems workable

    add_filter ('bbp_register_forum_post_type', 'rew_change') ; 
    
    function rew_change () {
    	$rew = array(
    				'labels'              => bbp_get_forum_post_type_labels(),
    				'rewrite'             => bbp_get_forum_post_type_rewrite(),
    				'supports'            => bbp_get_forum_post_type_supports(),
    				'description'         => __( 'bbPress Forums', 'bbpress' ),
    				'capabilities'        => bbp_get_topic_caps(),
    				'capability_type'     => array( 'forum', 'forums' ),
    				'menu_position'       => 555555,
    				'has_archive'         => bbp_get_root_slug(),
    				'exclude_from_search' => true,
    				'show_in_nav_menus'   => true,
    				'public'              => true,
    				'show_ui'             => current_user_can( 'moderate' ),
    				'can_export'          => true,
    				'hierarchical'        => false,
    				'query_var'           => true,
    				'menu_icon'           => ''
    			) ;
    	return apply_filters( 'rew_change', $rew );
    }
    
    add_filter( 'bbp_get_caps_for_role', 'rew_moderator', 10, 2);
    
    function rew_moderator ($caps, $role) {
    	if ($role == bbp_get_moderator_role() ) {
    		$caps['edit_others_forums'] = true ;
    		$caps['delete_forums'] = true ;
    		$caps['delete_others_forums'] = true ;
    		$caps['publish_forums'] = true ;
    		$caps['read_private_forums'] = true ;
    		$caps['read_hidden_forums'] = true ;
    		$caps['edit_forums'] = true ;
    				
    	}
    
    return $caps ;
    	
    }

    The line

    'capabilities' => bbp_get_topic_caps(),

    should say

    'capabilities' => bbp_get_forum_caps(),

    and my 2nd filter should then make that work, but for whatever reason it doesn’t.

    But as it gives the topic permissions which for a moderator are what you want for forums, it should be fine.

    #186038
    JC
    Participant

    Hello all, I’m using WordPress 8.0 and bbPress2.5.13.

    I have added this function to add the visual tab to the editor:

    function enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'enable_visual_editor' );

    When I signed in as admin is everything OK, the editor tab is selected by default and I can start to type. However, when I do as a participant no tabs are selected and I have to select one of them in order to start to type. This is not intuitive at all for participants that want to write a post in the forum and eventually they will leave.

    Why is happening that? Can anyone give me support? Thank you in advance 🙂

    Robin W
    Moderator

    try this in the additional css of the theme

    dashboard>appearance>customise>additional css

    .entry-header, .entry-content, .entry-summary, .entry-meta {
        max-width: 604px;
       }

    and amend max width to whatever you want

    #186035
    Robin W
    Moderator

    you need to get bbpress to use the correct theme template

    see

    Step by step guide to setting up a bbPress forum – Part 1

    item 8

    #186027

    In reply to: group forum slug

    Georgio
    Participant

    If you find a solution, i take ! I need similare slug

    Just a workaround:

    //This function changes the text wherever it is quoted

    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'x' ) {
    	$translated_text = 'y';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    Give it a try only if you have slugs that are not ordinary words. Unfortunately I cannot use it for forum, since everytime a user writes “forum” it will be translated.

    #186025
    mrapino
    Participant

    I’d say this is an appropriate article on how to properly enqueue jQuery:

    How to Properly Add jQuery Scripts to WordPress

    Also, if you know what script is inserting itself above jQuery, and you have control over how it is enqueued, make sure you enqueue to the footer:

    wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );

    Make sure your ‘$in_footer’ is TRUE:

    wp_enqueue_script('script-handle', plugins_url('js/script.js' , __FILE__ ),'','1.0',true);

    #186023
    mrapino
    Participant

    dwinn,

    I just checked your website, and you have an error in the console:

    Uncaught ReferenceError: jQuery is not defined
        at (index):17

    jQuery not being define can have very negative effects on a website.

    Hope this helps!

    #186022
    mrapino
    Participant

    Robin,

    As far as Release 2.6 Candidate 3, the line of code in reply.js on/near line 18 is still the same:

    reply.parentNode.appendChild(respond);

    I changed it to:

    reply.parentNode.appendChild(respond, reply);

    Which seemed to do the trick.

    However, I am unsure what else would be affected by this change, as I am unfamiliar with the core code of this plugin.

    Please submit any or all of my comments about this here. My issue is fixed, and I hope it helps others.

    Cheers!

    #186018
    Robin W
    Moderator

    @mrapino

    I wish a plugin developer would chime in here, but that doesn’t seem likely.

    I’m not sure how often they visit, but looks like you done some great stuff here.

    I’ve made a note of this thread and I’ll post a trac ticket (bug report) shortly

    Can you just confirm what version of bbpress you are using, and if not bbPress 2.6 Release Candidate 3, can you just check that the code is not improved in this – you’ll do this much faster than me.

    #186001

    In reply to: group forum slug

    Robin W
    Moderator

    silly question, but why not just change it in

    Dashboard>settings>forums>etc.

    and you are using a buddypress hook, not a bbpress one – bbpress is bbp_init and all your code refers to buddypress.

    #185998
    mrapino
    Participant

    Actually, I figured out what line 18 does.

    I made a change. Instead of commenting it out, I edited it to be:

    reply.parentNode.insertBefore(respond, reply);

    I added “reply” as the second argument being called.

    After I did this, the response box, where you put your comment now moves to right under the post where you click reply.

    Check it out, and let me know if oyu get it working.

    Cheers!

    #185997
    mrapino
    Participant

    Hey there … I got mine working.

    There is a file in the bbPress plugin folder

    plugins > bbpress > templates > default > js > reply.js

    On line 18, there is a line of code that is throwing a JavaScript error every time the “reply” link is clicked.

    reply.parentNode.insertBefore(respond);

    I basically commented this line of code out, and threaded replies are working again.

    I have no idea if this line is needed, but it got rid of the error, and there are no new errors to speak of.

    I wish a plugin developer would chime in here, but that doesn’t seem likely.

    I hope this helps you.

    If anyone else reading this know what this line does, and why it was causing the error, please let us know.

    #185993
    Georgio
    Participant

    Hi,
    I am trying to change the group forum slug. E.g.
    from
    ‘mysite.com/groups/mygroup/forum’
    to
    ‘mysite.com/groups/mygroup/discussion’

    I am using this code:

    function gi_rename_group_slug() {
      global $bp;		
      if (isset($bp->groups->current_group->slug) && $bp->groups->current_group->slug == $bp->current_item) {
        $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['slug'] = 'discussion';
      }
    }
    add_action('bp_init', 'gi_rename_group_slug');

    Unfortunately, nothing happens. What is the error? Thanks in advance.
    —-
    WP 4.8
    bbpress 2.5.12

    #185992
    Robin W
    Moderator

    it’s do-able but would require some code

    in essence you need to hook to an action

    ‘bbp_template_after_topics_loop’

    install bbp-style-pack

    and then code to [bsp-display-topic-index show=’5′ forum =’10’] with a list of forum ID’s for each category.

    I’m out of time to attempt this before my holidays, but above to remind me if you want to bump this topic in a few weeks time, I’ll see if I can fund some time to code

    #185991
    Robin W
    Moderator

    It’s all tied up with the theme’s page code

    This all gets very code oriented, hence suggestion to go to theme provider

    however if you’re a bit into code try

    Getting Started in Modifying the Main bbPress Template

    sapstudent
    Participant

    Hi Team,

    Here is my situation. I have bbpress installed in my site(sapstudent.com/community). I am displaying it under ‘Community’ page using following two short codes.
    [bbp-forum-index]
    [bbp-topic-index]

    Here SAP HANA, SAP Data Services & SAP BO Business Intelligence are categories, everything else are forums.

    Now when I click on lets say ‘SAP HANA'(https://www.sapstudent.com/community/forum/sap-hana), it only displays forums under this category, however I would like to have recent topics below forums section as I have in ‘Community’ page.

    The other issue I have is, if I use both [bbp-forum-index], [bbp-topic-index] shortcodes on my main forum page, I am getting two search boxes(one above forum list and other one above topics list). To avoid this, I have disabled ‘Allow forum wide search’.Ideally how can I disable seachbox for [bbp-topic-index] shortcode, so that I will have only one search box on my main page which is above forum list.

    #185984
    cobitts15
    Participant

    Okay so I copied the code from my page.php and made a bbpress.php

    <?php get_header(); ?>
    	<div class="content">
    		<!-- Sidebar With Content Section-->
    		<?php 
    			$ultimate_kickoff_wrapper = 'container';
    			$ultimate_kickoff_theme_option = get_option('ultimate_kickoff_admin_option', array());
    			if(isset($ultimate_kickoff_theme_option['enable-boxed-style']) && $ultimate_kickoff_theme_option['enable-boxed-style'] == 'wide-style'){
    				$ultimate_kickoff_wrapper = 'container-fluid';
    			}else{
    				$ultimate_kickoff_wrapper = 'container';
    			}
    			if( !empty($ultimate_kickoff_content_raw) ){ 
    				echo '<div class="vc-wrapper '.esc_attr($ultimate_kickoff_wrapper).'">';
    				while ( have_posts() ){ the_post();
    					if( has_shortcode( get_the_content(), 'vc_row' ) ) {
    						echo ultimate_kickoff_content_filter(get_the_content(), true); 
    					}
    				}
    				echo '</div>';
    				
    				echo '<div class="pagebuilder-wrapper">';
    				ultimate_kickoff_show_page_builder($ultimate_kickoff_content_raw);
    				echo '</div>';
    				
    				
    			}else{
    				echo '<div class="'.esc_attr($ultimate_kickoff_wrapper).'">';
    					$default['show-title'] = 'enable';
    					$default['show-content'] = 'enable'; 
    					echo ultimate_kickoff_get_default_content_item($default);
    				echo '</div>';
    			}
    		
    		?>
    	</div><!-- content -->
    <?php get_footer(); ?>

    My theme options aren’t showing when I try to edit the forum.

Viewing 25 results - 4,976 through 5,000 (of 32,481 total)
Skip to toolbar