Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,226 through 5,250 (of 32,518 total)
  • Author
    Search Results
  • #184057
    pre55
    Participant

    Hi,

    Just wanted to share a newly released plugin available called bbPress User Ranks and it allows you to create user ranks, star ranks, RPG ranks, user badges and month badges which display on forums and user profiles. It also has widgets and shortcodes.

    You can view all the features and screenshots here:

    http://pre55.com/downloads/bbpress-user-ranks/

    You see the free lite version here:

    https://wordpress.org/plugins/bbp-user-ranks-lite/

    The plugin was created as I had been using the brilliant bbp user ranks plugin created by Robin W and although this worked great for what I initially wanted I eventually needed something a little more custom.

    I have therefore built my plugin from scratch incorporating lots of great features I think will increase engagement for any bbPress forum.

    Let me know what you guys think, if you have any suggestions please let me know.

    #184056
    Robin W
    Moderator

    ok, closest without code would be :

    1. go into

    dashboard>settings>bbp style pack>breadcrumbs

    Leave Disable all forums breadcrumbs UNTICKED

    but tick disable on 1, 2, & 3

    then put this into

    dashboard>settings>bbp style pack>Custom css

    
    .bbp-breadcrumb-forum {
    
      border-radius: 28px;
      padding: 7px 15px;
      text-decoration: none;
      background: #3498db linear-gradient(to bottom, #3498db, #2980b9) repeat scroll 0 0
    
    }
    
    .bbp-breadcrumb-forum::before {
    
    content: "Back to ";
    
    }

    you may need to play with the background color to get it to suit your website – I’ve given you a blue gradient

    #184004
    Robin W
    Moderator

    seems like that will be fixed in bbpress 2.6

    so 3 fixes

    1. downgrade to a lesser version of php
    2. upgrade to bbpress 2.6beta-2
    3. in bbpress 2.5.12 change line 1851 from

    $meta_query   = $posts_query->get( 'meta_query' );
    

    to

    $meta_query = $posts_query->get( 'meta_query', array() );

    Since the next upgrade will fix that anyway, no issue in changing the bbpress file

    best I can offer I’m afraid

    #183983
    virusek89
    Participant

    I also need something like that.
    Is there any plugin or code?

    Stephen Edgar
    Keymaster

    I was going to suggest renaming you’re plugins folder, you’ve done that already.

    Try renaming the directory of your theme, or the entire themes directory if that doesn’t work

    Strange, I tried hitting some URLs direct, e.g.

    http://restomod101.com/test/wp-admin/edit.php?post_type=page
    http://restomod101.com/test/wp-login.php

    I’d also suggest taking a look at any custom functions you have in a functions.php file

    What about rewrite rules, have you any custom rules in your .htaccess file?

    #183905
    dominikb
    Participant

    I realized, that i used another code mentioned in this forum, to change the original names of the roles, so i deleted this code and afterwards it just worked.

    #183904
    dominikb
    Participant

    I put the code into a custom plugin.

    #183898
    realnsleo
    Participant

    Hi Robin,
    I have just tried your code with BBPress 2.5.12 and I can not see the “trash” links. I hope it’s not a lot to ask, but could you know why it might be broken?

    From what I could test, it has something to do with the lines where the capabilities are given, for example this line:

    //allow any reply to be deleted
    if ($post_type == bbp_get_reply_post_type()) $caps = array('delete_replies');

    I appreciate any response.

    Regards,

    #183896
    xelota
    Participant

    Wordpress : WordPress 4.7.4 avec le thème BlackFyre.
    bbpress : Version 2.5.12
    http://www.vieuxetmechants.com/

    Hello i’ve created custom and i don’t understand the role MembreVetM can’t edit or delete their own post

    function add_new_roles( $bbp_roles )
    {
        $bbp_roles['bbp_gamer'] = array(
            'name' => 'Gamer',
             'capabilities' => custom_capabilities( 'bbp_gamer' )
            );
     
    	$bbp_roles['bbp_membrevetm'] = array(
            'name' => 'MembreVetM',
             'capabilities' => custom_capabilities( 'bbp_membrevetm' )
            );
    		
        $bbp_roles['bbp_veteran'] = array(
            'name' => 'Vétéran',
            'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
            );
    	
    	$bbp_roles['bbp_officier'] = array(
            'name' => 'Officier',
            'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
            );
    	
        return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );
     
    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_gamer' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_membrevetm' )
            $caps = custom_capabilities( $role );
     
        return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )
    {
        switch ( $role )
        {
     
            case 'bbp_gamer':
                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'   => false,
                    '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'   => false,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => false,
                    'delete_others_replies' => false,
                    'read_private_replies'  => false,
     
                    // Topic tag caps
                    'manage_topic_tags'     => false,
                    'edit_topic_tags'       => false,
                    'delete_topic_tags'     => false,
                    'assign_topic_tags'     => false,
                );
     
    			case 'bbp_membrevetm':
                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'         => true,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => true,
                    'delete_others_replies' => false,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => false,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }
    #183889
    negi15
    Participant

    where did you put that code?

    #183888
    blengine
    Participant

    Another solution for those interested. This makes use of the “Shortcodes in Menus” plugin to easily place the bbpress “View Profile” and “Edit Profile” links in your WordPress nav menus. Instructions:

    1 – Install the free plugin “Shortcodes in Menus”
    2 – Place the following code in your theme’s functions.php file:

    function menu_profile_link() { 
    		$current_user = wp_get_current_user();
    		$profile_menu_item = '<li><a href="' . home_url('forums/users/') . $current_user->user_nicename . '">View Profile</a></li>';
    		return $profile_menu_item;
    }
    add_shortcode('bbp-profile', 'menu_profile_link');
    
    function menu_edit_profile_link() { 
    		$current_user = wp_get_current_user();
    		$profile_menu_item = '<li><a href="' . home_url('forums/users/') . $current_user->user_nicename . '/edit">Edit Profile</a></li>';
    		return $profile_menu_item;
    }
    add_shortcode('bbp-edit-profile', 'menu_edit_profile_link');

    3 – In WordPress go to your Menus and go to the new Shortcodes panel. Type in “View Profile” as the title and underneath that type in [bbp-profile] to place the profile link in your menu. Click “Add to Menu”. Repeat this process using the shortcode [bbp-edit-profile] to add the “Edit Profile” link.

    4 – I’d also recommend the free plug-in “Nav Menu Roles” to restrict your menu items to logged in or logged out users.

    Hope this is useful!

    #183886
    Alex Stine
    Participant

    Hello,

    I’m using a plugin to integrate Amazon CloudSearch on my site. Whenever I exclude private topics from search results or private forums from search results, I might use some code like this.

    function exclude_private_topics_search() {
    	$topic_id = bbp_get_topic_id();
    	if(gdbbx_is_topic_private($topic_id) ) {
    		add_post_meta($topic_id, 'acs_exclude', 1, true );
    	} else {
    		delete_post_meta($topic_id, 'acs_exclude');
    	}
    }
    add_action('bbp_new_topic', 'exclude_private_topics_search' );
    add_action('bbp_edit_topic', 'exclude_private_topics_search' );
    
    function exclude_private_forums_search() {
    	$forum_id = bbp_get_forum_id();
    	if (get_post_status($forum_id) == 'private') {
    		add_post_meta($forum_id, 'acs_exclude', 1, true );
    	} else {
    		delete_post_meta($forum_id, 'acs_exclude');
    	}
    }
    add_action('bbp_new_forum', 'exclude_private_forums_search' );
    add_action('bbp_edit_forum', 'exclude_private_forums_search' );

    The problem is this does not update pagination counts. For example if 2 topics that are private are hidden and there are 5 topics in the forum, it will still display a total of 5 topics instead of 3 topics. How can I update the pagination values if there are less topics displaying AKA private ones?

    Thanks.

    #183885
    Alex Stine
    Participant

    Hello,

    I have a plugin that is used to index search results in to Amazon CloudSearch. I’ve written the below code to exclude private forums from search results. Now I need some code to automatically exclude all topics inside a private forum.

    function exclude_private_forums_search() {
    	$forum_id = bbp_get_forum_id();
    	if (get_post_status($forum_id) == 'private') {
    		add_post_meta($forum_id, 'acs_exclude', 1, true );
    	} else {
    		delete_post_meta($forum_id, 'acs_exclude');
    	}
    }
    add_action('bbp_new_forum', 'exclude_private_forums_search' );
    add_action('bbp_edit_forum', 'exclude_private_forums_search' );

    Is there anyway I can get a list of topic IDs inside a forum ID?

    Running latest version of bbPress and WordPress.

    Thanks.

    #183882

    In reply to: Only one forum showing

    dram2017
    Participant

    OK – I think I’ve solved it.
    In my theme (Vellum) the [bbp-forum-index] shortcode entered on the new forum page seems to be deleted every time I add a forum. Adding the shortcode again rebuilds the forum list and displays them in the specified order. Weird, but at least it is a workaround.

    #183877
    Robin W
    Moderator

    one will be from your theme and one from bbpress.

    if you have a link, I can give you code to hide the other

    #183871
    Dan
    Participant

    View post on imgur.com

    main theme has breadcrumbs that don’t match forum breadcrumbs. In a perfect world I’d like

    Home / Forum / Feedback / Marginally Clever Site Questions/Comments

    I think I can hide the breadcrumbs with

    div.bbp-breadcrumb { display: none; }

    but that won’t fix the upper breadcrumb.

    Please: what do you advise?

    #183863
    dominikb
    Participant

    ok, resolved.
    It was a conflict with another code, that renames the roles.

    malcolmpaulpearson
    Participant

    Hi all

    Shared Windows hosting.
    WordPress 4.6.5 running Karma theme.

    Hosting provider will not change the IIS config for just me, they recommend me adding a Linux shared hosting and host the bbpress on that server, external to the site.

    When I search with one word – it works fine. When I search with two words it gives the error:

    HTTP Error 404.11 – Not Found
    The request filtering module is configured to deny a request that contains a double escape sequence.

    Most likely causes:
    The request contained a double escape sequence and request filtering is configured on the Web server to deny double escape sequences.

    Things you can try:
    Verify the configuration/system.webServer/security/requestFiltering@allowDoubleEscaping setting in the applicationhost.config or web.confg file.

    Detailed Error Information:
    Module RequestFilteringModule
    Notification BeginRequest
    Handler ExtensionlessUrlHandler-Integrated-4.0
    Error Code 0x00000000
    Requested URL https://www.ciproza.co.za:443/forums/search/annual+returns/
    Physical Path D:\Websites\ciproza.co.za\httpdocs\forums\search\annual+returns\
    Logon Method Not yet determined
    Logon User Not yet determined

    More Information:
    This is a security feature. Do not change this feature unless the scope of the change is fully understood. You should take a network trace before changing this value to confirm that the request is not malicious. If double escape sequences are allowed by the server, modify the configuration/system.webServer/security/requestFiltering@allowDoubleEscaping setting. This could be caused by a malformed URL sent to the server by a malicious user.
    View more information »

    Anybody got a solution for me?

    #183828
    denrocs
    Participant

    Not tested this yet (I know this is nearly 3 years old – looking for something I’m currently working on) but I noticed that the code doesn’t have an opening PHP tag, just a closing one.
    I added the opening tag, installed as shown above, and not had this above error.

    Again, not tested but will confirm either way once I have set up a test post 🙂

    #183822
    Robin W
    Moderator

    ok, appreciate it is frustrating – I am currently fighting another IT corporate system that is annoying the hell out of me !

    It is a theme/bbpress issue, so we need to try stuff to work out what works

    so can you set up a page called community forum and have it’s permalink end in ‘communityforum’ and into the content of that page put

    [bbp-topic-index]

    #183817

    In reply to: Catchable Error

    codyrauh
    Participant

    so from what I have read it is something to do with the “echo” and that forums to have categories.

    }
    endif;
    function simplenotes_get_breadcrumbs(){
    	global $wp_query; 
    	if ( !is_home() ){
    		echo '<ul>';
    		echo '<li><a href="'. home_url() .'">'. get_bloginfo('name') .'</a></li>';
    		if ( is_category() ) 
    		{
    			$catTitle = single_cat_title( "", false );
    			$cat = get_cat_ID( $catTitle );
    			echo "<li> &nbsp; ► ". get_category_parents( $cat, TRUE, " ► " ) ."</li>";
    		}
    		elseif ( is_archive() && !is_category() ) 
    		{
    			echo "<li> &nbsp; ► Archives</li>";
    		}
    		elseif ( is_single() ) 
    		{
    			$category = get_the_category();
    			$category_id = get_cat_ID( $category[0]->cat_name );
    			echo '<li> &nbsp; ► '. get_category_parents( $category_id, TRUE, "</li><li> &nbsp; ► " );
    			echo the_title('','', FALSE) ."</li>";
    		}
    		elseif ( is_page() ) 
    		{
    			$post = $wp_query->get_queried_object(); 
    			if ( $post->post_parent == 0 ){ 
    				echo "<li>&nbsp; ► ".the_title('','', FALSE)."</li>";
    			} else {
    				$title = the_title('','', FALSE);
    DragoWeb
    Participant

    Hi, the apostrophe (simple quote) was displayed as &#039 ; in the email subject so I fixed this by adding this line:

    $topic_title = mb_convert_encoding($topic_title, 'UTF-8', 'HTML-ENTITIES');

    in myrsite\wp-content\plugins\bbpress\includes\common\functions.php, lines 1094 and 1252 (bbpress 2.5.12). Between these 2 lines:

    $topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
    $topic_title   = mb_convert_encoding($topic_title, 'UTF-8', 'HTML-ENTITIES');
    $topic_content = strip_tags( bbp_get_topic_content( $topic_id ) );

    I’m a beginner with php so maybe there is a better way to achieve this, but worked great for me 🙂

    #183794
    panda666uk
    Participant

    Any idea on this error ? Thanks

    WordPress database error: [Unknown column 'users.id' in 'field list']
    SELECT convert(users.id USING "utf8mb4") AS id,convert(users.password USING "utf8mb4") AS password,convert(users.username USING "utf8mb4") AS username,convert(users.email USING "utf8mb4") AS email,convert(kunena_users.websiteurl USING "utf8mb4") AS websiteurl,convert(users.registerDate USING "utf8mb4") AS registerDate,convert(users.name USING "utf8mb4") AS name,convert(kunena_users.aim USING "utf8mb4") AS aim,convert(kunena_users.yim USING "utf8mb4") AS yim,convert(kunena_users.gtalk USING "utf8mb4") AS gtalk,convert(kunena_users.icq USING "utf8mb4") AS icq,convert(kunena_users.msn USING "utf8mb4") AS msn,convert(kunena_users.skype USING "utf8mb4") AS skype,convert(kunena_users.twitter USING "utf8mb4") AS twitter,convert(kunena_users.facebook USING "utf8mb4") AS facebook,convert(kunena_users.myspace USING "utf8mb4") AS myspace,convert(kunena_users.linkedin USING "utf8mb4") AS linkedin,convert(kunena_users.delicious USING "utf8mb4") AS delicious,convert(kunena_users.friendfeed USING "utf8mb4") AS friendfeed,convert(kunena_users.digg USING "utf8mb4") AS digg,convert(kunena_users.blogspot USING "utf8mb4") AS blogspot,convert(kunena_users.flickr USING "utf8mb4") AS flickr,convert(kunena_users.bebo USING "utf8mb4") AS bebo,convert(kunena_users.websitename USING "utf8mb4") AS websitename,convert(kunena_users.location USING "utf8mb4") AS location,convert(kunena_users.signature USING "utf8mb4") AS signature FROM jos_users AS users LEFT JOIN jos_kunena_users AS kunena_users ON kunena_users.userid = users.id LIMIT 0, 100
    abkrim
    Participant

    Hi.

    According Enable visual editor I put on my child theme’s functions.php code

    `// Additional Functions
    // =============================================================================

    // bbPress Visual Editor
    function bbp_enable_visual_editor( $args = array() ) {
    $args[‘tinymce’] = true;
    $args[‘teeny’] = false;
    return $args;
    }
    add_filter( ‘bbp_after_get_the_content_parse_args’, ‘bbp_enable_visual_editor’ );`

    But not work.

    Also I try to install plugin TinyMCE Advanced but not work.

    I’m using X Theme (Theme.co)

    #183772
    Robin W
    Moderator

    that text is in

    \templates\default\bbpress\form-topic.php

    and you’ll probably also want

    \templates\default\bbpress\form-reply.php

    for replies

    you’ll probably want to put revised versions in your child theme

    Functions files and child themes – explained !

    You can copy all the templates across, but you only need to copy those that you want to change, and it is better just to do this, as then you know which you have altered.

    so if you wanted to amend form-topic.php you would do the following

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-topic.php
    bbPress will now use this template instead of the original
    and you can amend this

Viewing 25 results - 5,226 through 5,250 (of 32,518 total)
Skip to toolbar