Alice Kaye (@alice-kaye)

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 32 total)
  • In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Hi @robin-w,

    Thanks for the response. Sorry for the slow response, I was away for the weekend.

    I’ll try to replace the code again today, but basically what happens is, when they go to the forums it displays a 404 error as if the page doesn’t exist. They can see the top menu, and the rest of the website’s look, but the forums aren’t visible at all.

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Hi @robin-w!

    Thanks for replying back about this. I’m sorry I failed to mention my troubleshooting. It definitely worked when I set up my husband’s account as a Councilman, and I tested every single rank on his account. He had the same results when set to an Artisan.

    At that point, I came here because I can’t see anything wrong with the code.

    Thanks again for the reply! ๐Ÿ™‚

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Okay, so kind of resurrecting my old thread here, but with good reason, because something has gone wrong with the code. Today, I promoted someone (the first person to be promoted to this rank) Artisan, which I’ve hand coded into my functions.php file.

    The code:

    /* bbPress Custom Roles */
    function add_custom_role( $bbp_roles ) {
    
    $bbp_roles['bbp_craftsman'] = array(
    'name' => 'Craftsman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['bbp_journeyman'] = array(
    'name' => 'Journeyman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['bbp_adept'] = array(
    'name' => 'Adept',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['bbp_artisan'] = array(
    'name' => 'Artisan',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as moderator
    );
    $moderator = bbp_get_moderator_role() ;
    $bbp_roles[$moderator] = array(
    'name' => 'Councilman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as moderator
    );
    $keymaster = bbp_get_keymaster_role() ;
    $bbp_roles[$keymaster] = array(
    'name' => 'Advisor',
    'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster
    );
    $apprentice = bbp_get_participant_role() ;
    $bbp_roles[$apprentice] = array(
    'name' => 'Apprentice',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    return $bbp_roles;
    }
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
    /* bbPress Custom Roles */

    As you can see, the way I’ve written it, I had Artisan and Councilman both as moderator roles. This is really how I need it set up.

    Currently I’ve adjusted Artisan to:

    $bbp_roles['bbp_artisan'] = array(
    'name' => 'Artisan',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );

    Because for whatever reason, when set to moderator, she could not see our forums at all.

    Is there a way to have two moderator ranks, or can there only be one? If so, where have I gone wrong with this? I’m quite confused over it now.

    Thanks in advance, you guys have been so helpful through all of my learning. ๐Ÿ™‚

    In reply to: Forum Page ID's

    Alice Kaye
    Participant

    @alice-kaye

    Thanks so much Robin, I sent an email your way. ๐Ÿ™‚

    In reply to: Forum Page ID's

    Alice Kaye
    Participant

    @alice-kaye

    Haha, that certainly would make things easier on everyone (myself included). The biggest issue here is that, without an account you cannot see the forums due to the way my site’s permission system is set up. So if you need to see code, let me know and I’ll give you the test account login information. ๐Ÿ™‚

    Forum Setup:

    Final Fantasy XIV (FFXIV Background)
    – General Discussion
    – The Forge
    – The Golden Quill
    – Journals
    – Ultima EX
    All of the sub forums currently have the FFXIV handcoded into the CSS section so their backgrounds are also FFXIV. However, whenever a post is made in any of these forums, my base site background is the one showing. If possible, it would be great if any forum posts made in any of these specific forums had the correct corresponding background.

    The same goes with my Guild Wars 2 section which has a Guild Wars 2-based background.

    The thing is, I’m not sure if this is at all possible.

    Hoping that I’ve explained that well. ๐Ÿ™‚

    In reply to: Forum Page ID's

    Alice Kaye
    Participant

    @alice-kaye

    Hi @robin-w & @robkk,

    I tried to reply the other day but every time I hit submit, everything would disappear and it wouldn’t post my reply. Oi.

    So firstly I wanted to say thank you to both of you for all of the help and support with everything. You guys got me on the right track which was GREAT!

    The code that ended up working for me was:

    .postid-37 #fixed-background { background: url('http://www.heartwoodgaming.com/wp-content/uploads/2015/02/gw2-background.jpg') !important; }

    I was hoping that by changing the page ID background for each forum, that the subsequent posts would also have that background, but it didn’t pan out. I’m curious if this is possible in some way? It’s tough to imagine via CSS simply because the pages generate when created, so it would have to be based on a forum ID (in my head), rather than a simple postID.

    Do you guys have any thoughts on this at all?

    Again, thanks for the help and sorry I couldn’t reply sooner. It just wouldn’t let me! ๐Ÿ™


    Alice Kaye
    Participant

    @alice-kaye

    I was actually wondering this myself the other day, so I’m going to post here and watch the topic to see if an answer comes along. ๐Ÿ™‚

    In reply to: Forum Page ID's

    Alice Kaye
    Participant

    @alice-kaye

    Yeah, it’s just very difficult to get it to work the way I want sometimes.

    Anyhoo, I put it in my themes custom css box. Though now in hindsight that seems foolish. I suppose what I really need to do is make a copy of the bbpress stylesheet and then update that with this code and upload it to the bbpress folder inside of my child theme/bbpress.

    Am I on the right track? Sorry for any typos. Writing this on my cellphone.

    In reply to: Forum Page ID's

    Alice Kaye
    Participant

    @alice-kaye

    Hi @robin-w,

    I just realized that you responded to this. I’m not sure how I missed this!

    I just tried to give this a go (man sometimes this stuff isn’t easy to find) and it’s so far not doing what I want. I’ll admit CSS is not always my friend.

    The code I’m using is below:

    .forum bbpress single single-forum postid-20 #fixed-background { background: url('http://www.heartwoodgaming.com/wp-content/uploads/2015/02/ffxiv-background.jpg'); }

    I was hoping that would be how I needed to set it up, but I’m starting to think, not…

    Could you take a look at that and let me know where I might have gone wrong? Let me know if you need access to my site to see my bbPress, I have a test account set up for situations such as this! ๐Ÿ˜›

    Thanks in advance!


    Alice Kaye
    Participant

    @alice-kaye

    Hey @Robkk,

    That code worked well, with one exception, now the top bar with Topic, Post, Freshness, etc. those have become links, oddly.

    Example: http://screencast.com/t/uDncP5v4

    Any idea?

    I used your code:

    /* Forum Description Removal Begin */
    add_filter( 'bbp_get_single_forum_description', 'ja_return_blank' );
    add_filter( 'bbp_get_single_topic_description', 'ja_return_blank' );
    function ja_return_blank() {
        return '';
    }
    /* Forum Description Removal End */

    Alice Kaye
    Participant

    @alice-kaye

    Thanks @Robkk! You’re right, I do have GD Tools and such in there, so I’ll take a look.

    I actually managed to get the avatars all hooked up. Took a bit of doing, but they’re definitely working now, yay!


    Alice Kaye
    Participant

    @alice-kaye

    Figured out the avatar issue itself.

    Basically used the following code (though this may not work for everyone – not sure if it’s based on theme):

    #bbpress-forums div.bbp-forum-author img.avatar, #bbpress-forums div.bbp-topic-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar {
    border: none;
    max-width: 100%;
    padding: 0;
    margin: 12px auto 0 auto;
    float: none;
    }
    
    #bbpress-forums p.bbp-topic-meta img.avatar, #bbpress-forums ul.bbp-reply-revision-log img.avatar, #bbpress-forums ul.bbp-topic-revision-log img.avatar, #bbpress-forums div.bbp-template-notice img.avatar, #bbpress-forums .widget_display_topics img.avatar, #bbpress-forums .widget_display_replies img.avatar {
    float: none;
    margin-bottom: -7px;
    border: 3px double #ddd;
    width: 15px;
    height: 15px;
    }

    Alice Kaye
    Participant

    @alice-kaye

    Follow up, is there also a way to make this avatar smaller?
    Example: http://screencast.com/t/zYGIBeLu

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Just following up on this. It seems to have worked properly after I set it again to Apprentice and re-saved. ๐Ÿ™‚

    All set here! Woot!

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Okay, that was my assumption as well. I’ll be signing up my husband as a user here shortly, so I’ll see what it does when I get him squared away. I’ll post my results here. I try to make sure I always leave a message for anyone who winds up curious about the same topic(s) in the future. ๐Ÿ™‚

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Hey @robin-w,

    Along the same vein as this, I just signed up one of my friends as a user to test privileges and make sure it’s all working as it should be. When I signed him up, he was not automatically assigned a forum role. Is that due to the changes I’ve made or is this normal?

    I want to make sure that I didn’t make a mistake somewhere in all of this. I’d like the base user role to be “Apprentice” so that when they sign up on the site, they have the lowest role.

    If this is something that has to be set for each user, that isn’t a problem, again, I just want to make sure I didn’t muck it up.

    Thanks! ๐Ÿ™‚

    Edit: I see that there is an option, of course, in the Settings ยป Forum, it was set to Advisor (since the others didn’t exist earlier). But it didn’t set him as Advisor. It just set him to None for forum role.

    2nd Edit: (Firstly, I know that I’m nuts, I just keep thinking of other things). I installed a plugin called BuddyPress Registration and I’m wondering since that locks down the entire BuddyPress/bbPress system until users are approved, if maybe that’s why it’s set to none initially, so that they have zero access to the forums. -ponders-

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Yeah, I’ve been using /**/ for all of my commenting, but I really like the // style for one line comments, so I’m going to move everything over to that format.

    I try to label everything both for OCD reasons and simply for the exact reason you mentioned. I don’t want to find myself wondering in the future what the heck the code was placed for! ๐Ÿ˜›

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    You know, I kept seeing that throughout the code and thought that was pretty awesome. I will definitely make use of that! It’s a lot easier and cleaner looking and 9 times out of 10, I don’t need two lines.

    Thank you for the tip! ๐Ÿ˜€

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Oh great! I figured they were just labels but I wasn’t sure. I’m incredibly OCD so I try to mark everything, to make it easier for me in the long term.

    I’m sure I’ll have more thoughts on this whole thing as I go. I’m just so happy to have user roles that are actually functioning the way I want them to. Woot!

    Thanks for all of your help. I’ve truly appreciated every moment of it. ๐Ÿ™‚

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    So, follow-up question to that then…

    Would it have been wrong to modify them to say bbp_craftsman, bbp_journeyman, rather than my-custom-role-1, my-custom-role-2? Does this have some bearing on the code, aside from a name, that I’m not understanding?

    I saw that you had used the original code with my-custom-role-1/2/3/etc, and modified them back to the bbp_name, thinking it was simply just a name. If it’s more than that, I’d love to know.

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    It’s really great to know that you’ve learned this much in two years. I have hope for me yet of understanding this!

    What I see that you did was move return $bbp_roles; from the middle of the code, down to the bottom, while also removing the secondary and unnecessary function and filter, keeping only the 'add_custom_role' portion of the function/filter.

    I am definitely curious as to how it’s working without the 'ntwb_bbpress_custom_role_names' filter, for the renaming of the roles? As I write this, I’m not even sure how to explain the question I have. Haha.

    But I thank you for all of your help. You’ve been absolutely fantastic and I appreciate all of the information.

    This was actually a ton of fun, despite my code not working out without your help. As someone who has a deep interest in web design (I do it for a living, without the code-end of things), I think this has fueled me into wanting to learn more about how this works and delve deeper! ๐Ÿ˜€

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    So basically, am I to understand correctly that you simply removed:

    /* bbPress Custom Role Names */
    add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
    
    function ntwb_bbpress_custom_role_names() {
    	return array(

    Which then left you with one function and one filter, but due to the way the code is written for the base three roles (keymaster, moderator and participants), that code is changing their name, regardless of the function and filter?

    Hope I’m grasping that correctly.

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Oh wow, you got that written up fast! I re-wrote my response to you about 10 times while you were modifying that. I’m going to look through and see what you changed, so that I can learn the differences between the two pieces of code.

    Thank you so much for modifying it! I’ll add it now and see how it pans out.

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Hi Robin,

    Thank you for that link. It does answer some questions, but presents many more, probably since I don’t have any foundation (personally) in PHP. This is the first time I’ve ever tried to write/modify something in PHP and actually have it work.

    I understand having one filter and one function and that they’re essentially both trying to grab the attention of bbp_get_dynamic_roles if both are present. I also now understand that by trying to merge them, that’s impossible because it needs to be 1 v 1, not 1 v 2. But if I can only have 1 function and 1 filter, I’m then left wondering if this can be written in some way to encompass both things that I’m trying to accomplish.

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    @alice-kaye

    Okay, so I tried to modify the function, to merge the two and that didn’t work, so I have a few questions:

    From this:

    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
    
    add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );

    To this:
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 'ntwb_bbpress_custom_role_names' 1 );

    But that didn’t work at all, wound up immediately getting an error.

    Should I perhaps be placing the renaming of the base three roles, before the creation of the new four roles? The filter for the creation of the roles comes after all of them are created but the filter for the role name change comes before the changes, so I wonder if the two filters would still conflict if I moved them around?

    These are really newbie questions, I know, but I am not 100% sure as to how to change these to work in tandem.

    Thanks in advance for any help you can provide!

Viewing 25 replies - 1 through 25 (of 32 total)