Skip to:
Content
Pages
Categories
Search
Top
Bottom

customizing bbpress admin links


  • Robkk
    Participant

    @robkk

    ok i just need help with creating a function

    if i could use <?php echo bbp_get_topic_reply_link(); ?> to call the topic reply link

    how could i make a function thats

    if post type is topic echo bbp_topic_reply_link else echo bbp-reply-to-link

    and another function that is if keymaster or mod echo trash topic , trash reply etc.

    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)

    while the others are inside of a dropdown menu with an icon to show the menu
    kind of like twitter where it shows other options in the more button on tweets

    if you guys could help me find another way to call the bbpress admin links instead of
    <?php echo bbp_get_name_of_link(); ?>

Viewing 7 replies - 26 through 32 (of 32 total)

  • Robin W
    Moderator

    @robin-w

    dam typo’s –

    great – glad you’re continuing to get there :-)


    Robkk
    Participant

    @robkk

    heres is what i have now , the sticky and super sticky link are still in one li because i dont know how to split the two links

    there is a new problem though with a new css way of displaying a dropdown and working on every post , i have run into some blank lists when i switch to a user with a participant role.

    i thought maybe i could use

    if current_user_can 'moderate'

    to display only the certain lists (<li>)

    and also only show the entire menu if the user is logged in

    but i dont know how to stack three if functions together

    this is the code i have in my loop-single-reply.php

    <?php if (bbp_is_topic(bbp_get_reply_id()) ) { ?>	
    <div id="bbpdropdown">
        <div class="wrapper">
            <div class="content">
                <ul>
    <li> <?php echo bbp_get_user_favorites_link(); ?></li>
    <li> <?php echo bbp_get_user_subscribe_link(); ?></li>
    <li> <?php echo bbp_get_topic_edit_link(); ?></li>
    <li><?php echo bbp_get_topic_close_link(); ?></li>
    <li><?php echo bbp_get_topic_stick_link(); ?></li>
    <li><?php echo bbp_get_topic_merge_link(); ?></li>
    <li><?php echo bbp_get_topic_trash_link(); ?></li>
    <li><?php echo bbp_get_topic_spam_link(); ?></li>
                </ul>
            </div>
            <div class="first">Options</div>
        </div>
    <?php } ?>	
    
    <?php if (bbp_is_reply(bbp_get_reply_id()) ) { ?>
    <div id="bbpdropdown">
        <div class="wrapper">
            <div class="content">
                <ul>
    <li><?php echo bbp_get_reply_edit_link(); ?></li>
    <li><?php echo bbp_get_reply_move_link(); ?></li>
    <li><?php echo bbp_get_topic_split_link(); ?></li>
    <li><?php echo bbp_get_reply_trash_link(); ?></li>
    <li><?php echo bbp_get_reply_spam_link(); ?></li>
                </ul>
            </div>
            <div class="first">Options</div>
        </div>
    <?php } ?>

    This is what i have in my custom css

    #bbpdropdown {
            margin:0;
            font-family:inherit;
        }
        
    #bbpdropdown .wrapper {
        display: inline-block;
        width: 80px;
        margin-right: 10px;
        height: 0px;
        position: relative;
        float: right;
      bottom:5px;
    }
        
    #bbpdropdown .first {
        width: 100%;
        display: inline-block;
        cursor: pointer;
        line-height: 30px;
        height: 30px;
        background: #fff;
        color: #222;
        font-weight: bold;
        z-index: 2;
        position: relative;
        text-align: center;
      border:1px solid #ddd;
    }
        
        #bbpdropdown .first:hover,
        #bbpdropdown .content:hover ~ .parent {
            background: #fff;
            -webkit-transition-delay: 0s, 0s, 0s;
        }
        
        #bbpdropdown .content:hover ~ .parent {
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            z-index: 0;
        }
    
    #bbpdropdown .content {
        position: absolute;
        display: block;
        z-index: 1;
        height: 0;
        width: 80px;
        box-shadow: none);
        padding-top: 30px;
        border: none;
    }
        
        #bbpdropdown .wrapper:active .content {
            height: auto;
            z-index: 3;
            -webkit-transition-delay: 0s;
        }
        
        #bbpdropdown .content:hover {
            height: auto;
            z-index: 3;
            -webkit-transition-delay: 0s;
        }
        
        
        #bbpdropdown .content ul {
            background: #fff;
            margin: 0;
            padding: 0;
            overflow: hidden;
            height: 100%;
        }
        
        #bbpdropdown .content ul a {
            text-decoration: none;
      color:#222;
      font-size:11px;
        }
        
        #bbpdropdown .content li:hover {
            background: #999;
            color: #222;
        }
        
      #bbpdropdown .content li {
        list-style: none outside none;
        text-align: center;
        color: #222 !important;
        font-size: 14px;
        height: 30px;
      line-height:30px;
        border-top: 1px solid #DDD;
    }

    @robin-w you want to try this??


    Robin W
    Moderator

    @robin-w

    yes I’ll give it a go, but may not be for a couple of days – relatives staying !!


    Robkk
    Participant

    @robkk

    totally understand robin


    Robin W
    Moderator

    @robin-w

    ok, stacking can be fun, and I’m sure we can get it to work. lets start with the topics list

    bbp_get_user_favorites_link();
    bbp_get_user_subscribe_link();
    bbp_get_topic_edit_link();
    bbp_get_topic_close_link();
    bbp_get_topic_stick_link();
    bbp_get_topic_merge_link();
    <bbp_get_topic_trash_link();
    bbp_get_topic_spam_link();

    can you tell me when you would like them to display

    eg

    bbp_get_user_favorites_link(); when user is logged in and if they are participant
    bbp_get_user_subscribe_link(); when user is logged in and if they are moderator or keymaster
    bbp_get_topic_stick_link(); anyone whether logged in or not

    etc


    Robkk
    Participant

    @robkk

    turns out there is this theme that has this function working

    check out https://wordpress.org/themes/wp-knowledge-base

    put it on a test site and see that i has what i need in that theme

    now all i need is to scrape that code out and i think wrap it in an if user is logged in function and thats it

    after that this topic should be done.


    Robin W
    Moderator

    @robin-w

    @robkk – yes just saw the other thread. Let us know what the resultant code looks like :-)

Viewing 7 replies - 26 through 32 (of 32 total)

You must be logged in to reply to this topic.