Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 12,701 through 12,725 (of 14,260 total)
  • @robin-w

    Moderator

    can you post your solution to help others ?

    @robin-w

    Moderator

    @robin-w

    Moderator

    I presume the forums are currently private?

    What code are you using to display the latest 4 topics

    @robin-w

    Moderator

    if it’s not working try

    color: #404040 !important;

    if bbpress loads after your theme, then it’ll overwrite changes made in your css, ie revert them back

    In reply to: Topic Index Shortcode

    @robin-w

    Moderator

    yes, I’ve started a plugin that does some different shortcodes, and at the moment one that does just that is all that’s in there

    bbp additional shortcodes

    @robin-w

    Moderator

    sorry I’m getting confused

    aren’t you using

    bbp_topic_admin_links

    and then filtering this to just display bbp_get_topic_reply_link
    ????

    @robin-w

    Moderator

    try changing

    bbp_is_topic( $r[‘id’])

    to

    bbp_is_topic()

    the template already knows what the id is

    @robin-w

    Moderator

    where are you putting this code – is it in a bbpress template?

    @robin-w

    Moderator

    ok thanks for that, I’ll see what’s needed.

    The original bbpress will group together things, you child theme can then pick and change individuals.

    So for instance if you were describing your family in a style.css you might have

    mother, daughter 1, daughter 2 {
    wearing : dress
    }
    father, son {
    wearing : jeans
    }

    Say you decided that daughter 2 should have tshirt and jeans, so in your child theme you’d put

    daughter 2 {
    Wearing : tshirt&jeans ;
    }

    This will leave mother and daughter 1 as they were and only change daughter 2

    silly example, but hopefully explains !

    @robin-w

    Moderator

    the example is based on you having a page template in your theme that doesn’t display bbpress well, but works for other pages.

    In that example you could use a different class for bbpress pages to get them to render how you would like. So you would have the if/else.

    the article explains the other way, which is to rename a template to bbpress.php or forums.php, and then simply alter that for whatever bbpress display you want.

    Finally if it’s only bbpress display that you want to alter, you can simply change the bbpress styles in your theme style folder.

    Lots more in documentation, if you are trying to achieve something specific come back and detail it, and I’ll try and help

    @robin-w

    Moderator

    great, glad you’ve got most of it working.

    ok, on that last bit

    tried using this function to post a single admin link for a topic
    and also just by replacing return with echo
    but I cant seem to get that to work

    Can you explain a bit more about what you’re trying to do and where?

    @robin-w

    Moderator
    if (is_bbpress()) :
     div class=”abc”
    else :
     div class=”xyz”
    endif;

    translates to

    if you are on a bbpress screen/page/display [as opposed to a wordpress blog post or page, a home page or anything that isn’t bbpress]

    the use div class abc

    if you are on any other type of page use class xyz.

    Many themes use if statements checking against ‘conditional tags’ to style areas for instance the conditional tag is_home() checks whether this is the home or index page.

    @robin-w

    Moderator

    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

    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

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

    @robin-w

    Moderator

    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

    great – glad you’re fixed !

    In reply to: bbbPress performance

    @robin-w

    Moderator

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

    @robin-w

    Moderator

    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

    great, come back if you need further help

    Regards

    Robin

    @robin-w

    Moderator

    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

    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

    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

    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

    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

Viewing 25 replies - 12,701 through 12,725 (of 14,260 total)