Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,426 through 5,450 (of 32,522 total)
  • Author
    Search Results
  • #182427
    Robin W
    Moderator

    deleting replies will redirect to the topic that still exists, so that will work!

    deleting topics redirects to the topic which no longer exists, so gets a 404 error which your site directs to the homepage – not sure how to fix that. A moderator can still view the topic, so that is ok. might be able to do some code with a readtopics capability so that an author can view his own closed topics.

    on admins – Sorry I still don’t quite understand.

    1. so I have a browser tab logged into admin, and showing the dashboard. I then open another tab in the same browser and paste in a forums link and it goes to the homepage – yes ?
    2. if so – I can’t replicate
    3. Why do you need to do this?

    #182416
    sally
    Participant

    Yes, the code on top works, only the redirection seems to be the issue..

    Role Admin

    When code is activated, and I login to the Admin Dashboard, and enter the forums link, I get redirected to the homepage, cannot access / view the forums .

    When I deactivate the code, I can access the forums link as Admin..

    Participant

    Delete Topics

    Topics can be trashed and deleted, but after pressing Trash, Participant Role get redirected to homepage

    Delete Reply’s

    Reply’s can be trashed / deleted without redirection, works fine…

    Thx
    Regards
    Sally

    #182415
    Robin W
    Moderator

    ok, whilst out I think I know what the issue is.

    Firstly can you confirm that apart from redirecting you to home, the code at the top of this thread works? ie redirection to the wrong place is the only outstanding issue.

    If so, the issue is that after you delete a topic, bbpress sends you to back to the topic, which as a moderator you are allowed to see trashed topics, but as a partyicipant you are not. This then will send you to a 404 page, which in your case I think just sends you to home.

    So let me look at ways to get around this.

    #182413

    In reply to: bbp-messages

    russ8523
    Participant

    Hi Samuel,
    First ley me say that I am a beginner, this being my first WP site. I can not handle code. Secondly, my site has now been completely rebuilt online in a sub directory – the Wamp version was messed up! The site is at https://newsite.hampsteadbowmen.com. I can give you Admin access if you give me a private email? I will copy this into the other thread.

    Regards,
    Stewart

    #182411

    In reply to: bbp-messages

    Anonymous User
    Inactive

    Hello everyone,

    Sorry but I just came to discover this thread, I am the author of bbp-messages and there’s now a major update made and it now supports Multisite, the problem that Stewart was reporting.

    Also Stewart, the link wordpress/members1/http:/localhost/wordpress/members1/ pretty much seems messed up, so it’s hard to tell whether it is bbP issue or configuration. I think you did not configure your testing environment quite well and also the bbPress link looks filtered by BuddyPress. Next time I’d suggest you edit your hosts file (c:\System32\drivers\etc\hosts with admin permissions using notepad) and add a new entry 127.0.0.1 bbpress.dev now bbpress.dev will act like a normal domain and you wouldn’t run into issues while testing or migrating (all you can do is replace .dev with .tld in the db SQL file). Also add the virtual host for Apache http://stackoverflow.com/a/25203499/3910932

    Thank you Arutam and Robin you’re very helpful. I just wanted to point that this thread continues in wp-org plugin support forums https://wordpress.org/support/topic/messages-upgrade/

    Best,
    Samuel

    #182410
    sally
    Participant

    Hi Robin,

    Thanks for checking the code. Can you help me to get the open issues fixed with the origin code ?

    Best Regards
    Sally

    #182408
    Robin W
    Moderator

    though re-reading the thread this morning, I think I have not fixed anything, juts done it another way.

    and that doesn’t work either – forget the code above

    #182391
    Robin W
    Moderator

    ok, I’ve taken pity and kicked this round for an hour – I expect to be on your Christmas list !!!

    This seems to work, although please do some testing for all roles, and check it out.

    /*Customize the BBPress roles to allow Participants to trash topics*/
    add_filter( 'bbp_get_caps_for_role', 'ST_add_role_caps_filter', 10, 2 );
    
    function ST_add_role_caps_filter( $caps, $role ){
        // Only filter for roles we are interested in!
        if( $role == bbp_get_participant_role() ) {
    			
    			$caps = array(
    
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    				'delete_topics'         => true,
    				
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    				'delete_replies'        => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
    
    	}
    	
        return $caps;
    }
    /*then only allow participants to trash their own topics*/
    
    add_filter( 'bbp_map_reply_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
    add_filter( 'bbp_map_topic_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
    
    function ST_tweak_trash_meta_caps( $caps, $cap, $user_id, $args ){
    
    	// apply only to delete_reply and delete_topic
    	if ( $cap == "delete_reply" || $cap == "delete_topic" ){
    		// Get the post
    		$_post = get_post( $args[0] );
    		if ( !empty( $_post ) ) {
    
    			// Get caps for post type object
    			$post_type = get_post_type_object( $_post->post_type );
    			//$caps      = array();
    
    			// Add 'do_not_allow' cap if user is spam or deleted
    			if ( bbp_is_user_inactive( $user_id ) ) {
    				$caps[] = 'do_not_allow';
    
    			// Moderators can always edit forum content
    			} elseif ( user_can( $user_id, 'moderate' ) ) {
    				$caps[] = 'moderate';
    
    			// User is author so allow edit if not in admin
                } elseif ( user_can( $user_id, 'participate' ) && ( (int) $user_id === (int) $_post->post_author ) ) {
                    $caps      = array();
    				//$caps[] = $post_type->cap->delete_posts;
    
    			// Unknown so do not allow
    			} else {
    				$caps[] = 'do_not_allow';
    			}
    		}
    	}	
    	// return the capabilities
    	return $caps;
    	}
    #182378
    AiratTop
    Participant

    I can open https://airat.biz/forums/ after delete [] in /plugins/bbpress/includes/forums/functions.php on lines 1800, 1818, 1832

    Old: $post_stati[]
    New: $post_stati

    And line 1854:
    Old: $meta_query[]
    New: $meta_query

    Can you check it out?

    I think this issue with php7 support

    Now i have a warning:
    [Thu Mar 02 20:46:15.572617 2017] [php7:warn] [pid 23849] [client ip] PHP Warning: array_unique() expects parameter 1 to be array, null given in /site_path/wp-content/plugins/bbpress/includes/forums/functions.php on line 1836

    #182377
    AiratTop
    Participant

    I have the same problem.

    I can’t open page https://airat.biz/forums/ and https://airat.biz/wp-admin/edit.php?post_type=forum
    Error 500

    I saved Permalinks, reinstalled plugin, but pages still don’t working.

    bbPress tools also don’t help
    /wp-admin/tools.php?page=bbp-repair

    Error log:

    [Thu Mar 02 20:33:57.235075 2017] [php7:error] [pid 16265] [client ip] PHP Fatal error: Uncaught Error: [] operator not supported for strings in /site_path/wp-content/plugins/bbpress/includes/forums/functions.php:1800\nStack trace:\n#0 /site_path/wp-includes/class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query))\n#1 /site_path/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)\n#2 /site_path/wp-includes/plugin.php(515): WP_Hook->do_action(Array)\n#3 /site_path/wp-includes/class-wp-query.php(1681): do_action_ref_array('pre_get_posts', Array)\n#4 /site_path/wp-includes/class-wp-query.php(3238): WP_Query->get_posts()\n#5 /site_path/wp-includes/class-wp.php(617): WP_Query->query(Array)\n#6 /site_path/wp-includes/class-wp.php(735): WP->query_posts()\n#7 /site_path/wp-includes/functions.php(955): WP->main('')\n#8 /home/a in /site_path/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800

    bbPress 2.5.12
    BuddyPress 2.8.1
    WordPress 4.7.2
    PHP 7.1.2-3+deb.sury.org~xenial+1

    #182374

    In reply to: Change query

    Robin W
    Moderator

    I am not sure I understand what it is you are asking

    wp-query is a wordpress function

    https://codex.wordpress.org/Class_Reference/WP_Query

    #182372

    Topic: Change query

    in forum Troubleshooting
    yito
    Participant

    In loop-replies.php, I want to change WP_Query.
    But ‘bbp_repliesisbbpress()->reply_query->have_posts();` ,so I don’t know how to change some of WP_Query.

    Please someone teach me how to.

    Wordpress version 4.7.2
    bbPress version 2.5.12

    #182355

    In reply to: User Role

    Robin W
    Moderator

    try this – it should work but is untested

    Please come back and let us know if it does or doesn’t

    add_filter ('kal_get_user_role_map()' , 'bbp_get_user_role_map()' ) ;
    
    function kal_get_user_role_map() {
    
    	// Get the default role once here
    	$default_role = bbp_get_default_role();
    
    	return (array) apply_filters( 'kal_get_user_role_map', array (
    		'administrator' => bbp_get_keymaster_role(),
    		'editor'        => $default_role,
    		'author'        => bbp_get_spectator_role(),
    		'contributor'   => $default_role,
    		'subscriber'    => $default_role
    	) );
    }

    This goes in your function file

    #182341
    russ8523
    Participant

    I simply want to edit the wording in the (Pale Blue), fields in the ‘Edit Profile’ section. an example: to change “Your password should be at least ten characters long. Use upper and lower case letters, numbers, and symbols to make it even stronger.” to “eight characters long”. Also the (Pale Blue), name field is empty, just a ‘period’. Where is the code/file located? I’ve searched high and low!?

    WP 4.7.2 bbpres 2.5.12 newsite.hampsteadbowmen.com

    Any help will be very much appreciated.

    #182320

    Topic: sidebar

    junglejim620
    Participant

    Hi bbPress,

    From the edit page, I used this shortcode [bbp-forum-index].

    Then set full template with no sidebars and from the bottom sidebar I chosen NONE. The page still showing the sidebar?

    The main question is, is there anyway making NOT to show the sidebar on the page?

    Please advise help, thanks

    #182307

    Hi Dominik,

    It’s great that you’re digging around the code to figure out what functions to use! Can you describe a bit about what you’d like to accomplish? Once we know the end result, we can help you work towards it, step by step.

    #182306

    In reply to: User Role

    Use the bbp_get_user_role_map filter, to map WordPress roles to bbPress roles.

    #182296
    hughb1
    Participant

    Ignore this, I found my answer here. Thanks!

    Layout and functionality – Examples you can use

    #182253
    BenM
    Participant

    Hi,

    I use Private status to protect some forums and I would like to have a login page instead of 404 on private posts because it’s very inconvenient for people who have subscribed to a topic and click on the link to read new replies, to see a 404 if they are not logged in. (bbPress Private groups doesn’t work for this too.)

    I tried a lot of things, but I was never able to catch status of topic’s forum with a single function.

    bbp_is_forum_private doesn’t work here (there’s no ID).
    get_queried_object() is empty.

    I can have topic slug ($wp_query->query['topic']) but strangely, get_page_by_path doesn’t work.

    Finaly, I have to make a SQL request to find ID and post_parent (so, forum) from slug, then use bbp_is_forum_private (to post_parent because it doesn’t work witk ID and ancestor)! It’s a little bit… heavy.

    Do you have a best method?

    #182206
    mattdevelop
    Participant

    Same error here, this happens because of this code

    $post_stati = $posts_query->get( 'post_status' );
    
    		// Default to public status
    		if ( empty( $post_stati ) ) {
    			$post_stati[] = bbp_get_public_status_id();
    

    in \includes\forums\functions.php on line 1800

    #182199
    mapofemergence
    Participant

    Hi there,
    while waiting for the github by @casiepa to be updated, I managed to take some time to (partially) clean what I had written so far.
    I published it on a repo, just in case anybody were interested in taking a look and opening a discussion about desirable ways to approach the problem and to structure the code.

    Here it is:
    https://github.com/mapofemergence/BB-REST

    cheers,
    s t e

    #182189
    UgoDimma
    Participant

    Hey guys,

    I have set up my bbpress forum, create a page for it with the name forum, in the description box, I added some description, and featured image for the page. I also added some forums to get started with, but when I share my forum page on social networks, which is https://mydomain.org/forums/ it does not display any featured image, not even the one I added at the page. And again, the description it displayed is that of a forum I created.

    Please, how do I force the page to display the featured image and the description I added to it when shared on social networks.

    #182188
    Kalusha
    Participant

    Hello,

    I need one extra Field where I can put “New Message” with this function:
    <a href="<?php echo fep_query_url('newmessage', array('to' => USER ) ); ?>">Send Message</a>
    CAn anybody help me how and where I must out it in, please.

    Thank you

    #182166
    mikeboltonca
    Participant

    It’s nice to see some activity in this thread.

    Having to choose between dynamic reply forms (our reply.js) and a modern input method (TinyMCE) in 2017 just doesn’t seem right.

    I’ve tried to research potential solutions, but the code is a bit over my head.

    It’s known that the TinyMCE editor doesn’t like being moved around the DOM. Has anyone tried removing it, then re-adding it?
    A couple people in this thread said that worked for them.

    #182116
    Kalusha
    Participant

    Hello from Germany 🙂

    I have an WordPress Role called “Autor”. This Role are on my Site “Premium User” and “Abonnents” are Standard User. Capabilyties for the bbpress are the same. Now I want to under the names in the Forum who is a Premium User and who is a standard User.

    The bbPress Role for both is “participants” so the differents are only in the WordPress Role.

    With this Code I can change the name, but only for participants…
    ##Name ändern Participant in User Standard User
    function my_custom_roles( $role, $user_id ) {
    if( $role == ‘Participants’ )
    return ‘Standard User’;

    return $role;

    Hope anybody understand 🙂 me and can help me

    regards

Viewing 25 results - 5,426 through 5,450 (of 32,522 total)
Skip to toolbar