Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 7,476 through 7,500 (of 9,023 total)

  • Robin W
    Moderator

    @robin-w

    Hey never apologise for posting interim solutions – great to see your workings and thinking.

    Any plugin that works is good enough to be published, my first was very basic !

    Can you post your final css please, it can be wrapped into the plugin so that it becomes a package.

    In reply to: Remove Private Tag

    Robin W
    Moderator

    @robin-w

    yes put this code in your functions file

    add_filter('protected_title_format', 'ntwb_remove_protected_title');
    function ntwb_remove_protected_title($title) {
    	return '%s';
    }
     
    add_filter('private_title_format', 'ntwb_remove_private_title');
    function ntwb_remove_private_title($title) {
    	return '%s';
    }

    for information on functions files see

    Functions files and child themes – explained !


    Robin W
    Moderator

    @robin-w

    @peter-Hamilton – great, knew someone who is better at css would come along !


    Robin W
    Moderator

    @robin-w

    ok,

    the dots are coming from your style.css line 118

    ul {
    list-style: disc outside none;
    }

    change to

    ul {
    list-style: none outside none;
    }

    although you may need to make this forum specific.


    Robin W
    Moderator

    @robin-w

    great – glad you’re fixed !

    In reply to: bbbPress performance

    Robin W
    Moderator

    @robin-w

    Can you just say what happens if you disable the plugin, does it just return to as before?


    Robin W
    Moderator

    @robin-w

    If you’ve cracked the code for the submenu, then groups are a buddypress thing, so their forum might be better.

    But from total ignorance try….

    If you’ve phpmyadmin access, you could set up a user for a group, and see what changes in the usermeta, and then use this to create your filter

    eg
    if say you found that buddypress_group was what was used for groups, you could set the group using

    $current_user = wp_get_current_user();
    $group=get_user_meta( $current_user , 'buddypress_group', true);
    

    then dependant on group

    if ($group==22) then...
    if ($group==23) then....
    

    Robin W
    Moderator

    @robin-w

    great, come back if you need further help

    Regards

    Robin


    Robin W
    Moderator

    @robin-w

    In essence if I understand it you want to change the

    reply/edit/merge/trash/close/trash/reply links that come up with a topic or reply so that only some show, and others are in a dropdown list.

    is that correct?

    if so then

    my goal with this is to call each admin link individually and make only 2 or 3 to be visible
    (reply,edit,maybe quote link from gd bbpress tools)

    simply requires you to filter for those you want to display

    open up

    bbpress/includes/replies/template.php

    and you’ll see the admin links function line starting at line 1811

    On lines 1840 to 1848 you’ll see the default links are added.

    So lets create a function to just have the first two

    you’ll see a filter in line 1841 (‘apply_filters’) and we can hook to that

    so

    //change admin links displayed
    function change_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_reply_admin_links', array(
    				'edit'  => bbp_get_reply_edit_link ( $r ),
    				'move'  => bbp_get_reply_move_link ( $r )
    			), $r['id'] );
    return $r['links'] ;
    }
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    

    just leaves us with edit and move.

    This also gives you the ability to add a new link, with say your dropdown list.

    You’ll also see that this function checks if it is a topic on line 1825, and you’ll need to similarly create a function for that – I’ll leave you to work that one out.

    Come back if you need more help, and when you crack this, can you post the finished code to this site so we can see what it looks like.


    Robin W
    Moderator

    @robin-w

    no the file is one that belongs to your theme called just functions.php

    you’ll find it at

    wp-content/themes/%yourthemename%/functions.php

    where %yourthemename% is the name of your theme.

    If you don’t have a child theme, then you should create one, see

    Functions files and child themes – explained !


    Robin W
    Moderator

    @robin-w

    yes, drop this into your functions file.

    Functions files and child themes – explained !

    This will send users to the /forums/ page whenever they log out -whether private or public forum or on a topic or reply, or anywhere within bbpress. If you logout, you’re saying your done, so taking you back to the index seems a logical place to end up !

    You can change the $url to say ‘/home/’ if you want the home page,

    //sends the user to $url - in this case '/forums/'  
    function rw_logout ($redirect_to) {
    	$url='/forums/' ;
    	$redirect_to = '<a href="' . wp_logout_url( $url ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>' ;
    	return $redirect_to ;
    	}
    	
    	add_filter ('bbp_get_logout_link', 'rw_logout') ;
    	

    Robin W
    Moderator

    @robin-w

    It could be coded, but it’s not possible at the moment.

    My private groups plugin is probably the closest – it lets you assign users to forums, but as the name suggests keeps the forums private. http://www.rewweb.co.uk/bbp-private-groups/

    I don’t currently have plans to offer that possibility.


    Robin W
    Moderator

    @robin-w

    bbpress has its own roles

    so user not registered would see all public forums but not able to post, but would not see private forums
    registered users with wordpress roles would be able to do all wordpress things but with ‘no role’ in the user profile under forum would not be able to post in the forum.
    registered users with forum roles (eg participant, moderator) would be able to see public and private forums, and if wordpress roles set would be able to carry out wordpress roles
    registered users with spectator role would be able to view both public & private forums but not participate.

    you should be able to achieve whatever you want with a role based solution.

    come back with further details if this is not what you are trying to achieve


    Robin W
    Moderator

    @robin-w

    @saphadmin

    I have now fixed the issue, and posted the new version to my website

    I have posted the new version in

    bbp Private Groups

    I will post this to the wordpress plugins page in the next few days.

    Robin

    In reply to: Content Not Showing

    Robin W
    Moderator

    @robin-w

    not sure quite how threatening to remove something that is free, cost you nothing, and is supported by volunteers who are paid nothing and have tried to help you to get something working that you had working perfectly well at the start, but has somehow got messed up is really s’posed to progress to a resolution.

    I know you are frustrated, but taking it out on here is not really the answer 🙂

    I hope you are able to get it working, but if not find another solution, and wish you the best for the future.


    Robin W
    Moderator

    @robin-w

    bbpress has a separate set of capabilities, so you can set permissions for the wordpress part of your site totally separately to the capabilities for bbpress.

    see

    https://codex.bbpress.org/bbpress-user-roles-and-capabilities/

    and if needbe

    Custom Capabilities

    In reply to: Content Not Showing

    Robin W
    Moderator

    @robin-w

    do you mean the permalink for your topic is

    /edit.php?post_type=topic

    as in example below where the permalink is under the title

    dd


    Robin W
    Moderator

    @robin-w

    long answer I’m afraid and in two parts

    part 1 – setting the user permission to allow delete topic and delete reply

    delete is easy, making it only trash is in part 2 !

    Basically you’ll need to change a couple of capabilities of the participant role

    see

    https://codex.bbpress.org/bbpress-user-roles-and-capabilities/

    you see the abilities delete topics and delete replies (as distinct from delete others topics and delete others replies)

    Whilst you could amend the participant role, I haven’t documented that, so easiest is just for you to create a new role and give it the participant capabilities plus the ‘delete topics’ and ‘delete replies’. This article explains how

    Custom Capabilities

    add this code to your functions file – see

    Functions files and child themes – explained !

    part 2 – changing the function, so that delete is only shown for keymasters

    This code will only allow a keymaster to permanently delete a topic

    add the following to your functions file

    add_filter ('bbp_get_topic_trash_link', 'topic_dont_delete');
    add_filter ('bbp_get_reply_trash_link', 'reply_dont_delete');
    
    function topic_dont_delete( $args = '') {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'sep'          => ' | ',
    			'trash_text'   => esc_html__( 'Trash',   'bbpress' ),
    			'restore_text' => esc_html__( 'Restore', 'bbpress' ),
    			'delete_text'  => esc_html__( 'Delete',  'bbpress' )
    		), 'get_topic_trash_link' );
    
    		$actions = array();
    		$topic   = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
    
    		if ( empty( $topic ) || !current_user_can( 'delete_topic', $topic->ID ) ) {
    			return;
    		}
    
    		if ( bbp_is_topic_trash( $topic->ID ) ) {
    			$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-restore-link">' . $r['restore_text'] . '</a>';
    		} elseif ( EMPTY_TRASH_DAYS ) {
    			$actions['trash']   = '<a title="' . esc_attr__( 'Move this item to the Trash',      'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash',   'topic_id' => $topic->ID ) ), 'trash-'   . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-trash-link">'   . $r['trash_text']   . '</a>';
    		}
    		
    		if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) {
    		if ( bbp_is_user_keymaster()) {
    		$actions['delete']  = '<a title="' . esc_attr__( 'Delete this item permanently',     'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete',  'topic_id' => $topic->ID ) ), 'delete-'  . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-topic-delete-link">' . $r['delete_text'] . '</a>';
    		}
    		}
    
    				// Process the admin links
    		$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
    
    		return $retval ;
    	}
    	
    	function reply_dont_delete( $args = '' ) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'sep'          => ' | ',
    			'trash_text'   => esc_html__( 'Trash',   'bbpress' ),
    			'restore_text' => esc_html__( 'Restore', 'bbpress' ),
    			'delete_text'  => esc_html__( 'Delete',  'bbpress' )
    		), 'get_reply_trash_link' );
    
    		$actions = array();
    		$reply   = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
    
    		if ( empty( $reply ) || !current_user_can( 'delete_reply', $reply->ID ) ) {
    			return;
    		}
    
    		if ( bbp_is_reply_trash( $reply->ID ) ) {
    			$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-restore-link">' . $r['restore_text'] . '</a>';
    		} elseif ( EMPTY_TRASH_DAYS ) {
    			$actions['trash']   = '<a title="' . esc_attr__( 'Move this item to the Trash',      'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash',   'reply_id' => $reply->ID ) ), 'trash-'   . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-trash-link">'   . $r['trash_text']   . '</a>';
    		}
    
    		if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) {
    		if ( bbp_is_user_keymaster()) {
    		$actions['delete']  = '<a title="' . esc_attr__( 'Delete this item permanently',     'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete',  'reply_id' => $reply->ID ) ), 'delete-'  . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-reply-delete-link">' . $r['delete_text'] . '</a>';
    		}
    		}
    
    		// Process the admin links
    		$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
    
    		return $retval ;
    	}
    

    I haven’t fully tested this code as my test site is in some disarray whilst I test something else, so you’ll need to check that it works

    In reply to: Forum Structure error

    Robin W
    Moderator

    @robin-w

    1. go into dashboard>forums and under the title you will see the forum’s permalink. It should read forum-2. change it to forum

    2. go into dashboard>settings>forums and look for forum prefix, and untick

    In reply to: Content Not Showing

    Robin W
    Moderator

    @robin-w

    ok, thanks for that info

    if you go into

    Dashboard>topics>all topics –

    1. can you see and edit the topic?

    2. what is the topics permalink? (just under the heading)

    (this is just for my info)

    then reset the permalinks

    dashboard>settings>permalinks

    see what they are set to, change them to anything else and save, and then change them back and save.

    The come back and tell me what happened !

    In reply to: Content Not Showing

    Robin W
    Moderator

    @robin-w

    just seen you later post – you should have

    dashboard>settings>forums

    have you got that?

    In reply to: Content Not Showing

    Robin W
    Moderator

    @robin-w

    ok, I presume the one topic posted is after you re-installed

    did you have topics before that you are expecting to see?

    In reply to: Content Not Showing

    Robin W
    Moderator

    @robin-w

    Hi, sorry but can you post a screenshot of what it looks like via say photobucket?

    Thanks

    In reply to: Content Not Showing

    Robin W
    Moderator

    @robin-w

    did you install any other plugins in between?

    try

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, switch to a default theme such as twentytwelve, and see if this fixes.

    I know you’ve done themes already, but you need to test if it works on a default theme with just twentyfourteen and the bbpress plugin. If it doesn’t then something in your site is screwed up 🙂


    Robin W
    Moderator

    @robin-w

    presume you removing the titles from

    wp-content/bbpress/templates/default/bbpress/loop-forums

    and renaming as per

    https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-3/ section 3

    then

    wp-content/bbpress/templates/default/bbpress/loop-single-forum

    has the content that you’ll want to take out

Viewing 25 replies - 7,476 through 7,500 (of 9,023 total)