Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Pick 3 badges you're proud of to show with each post

2»

Comments

  • Options

    Yes thanks! Thanks to your array idea I got it to work!

    Now its down to making it look neat. The badge pull down menu does not remember the one you selected, even tho the badge gets displayed correct <3

  • Options
    JanHoosJanHoos
    edited May 2014

    "All" I need to do now, is add three pull down menu's and make the data go to the database. I thought it would be easy but the way I wanted to do it, did not work :P

    Anyway! Heres a screenshot of the result:


    Heres the badge menu, where, at this moment, you can select one badge and display that with each post. Unfortunately, the dropdown goes back to a default setting once you get back to this screen, instead of being on the badges that you have currently selected.

    And here are two posts with the selected badges displayed :)

    So far, I'm happy with the results. I know its not the most friendly way to do it, but I got it to work <3 I did not think I'd get this far. Hopefully I can get three badges to work and then I'll be in the clouds gehehe.

  • Options

    Yes! Got it to work. 3 pull down menu's that send the Badge ID to the database. Another piece of codes gets the Badge ID's and compares it to the Badge ID's of unlocked badges. Where they are the same, they display that badge.

    If a user selects the same badge twice or even three times, it will only display one copy. Going to test it out some more and if it keeps on working I will post it in here :)

  • Options

    The only thing I can't figure out, is how to get them to show after the member role text:

  • Options
    hgtonighthgtonight ∞ · New Moderator

    I suggest you check out the Eventi plugin here: http://vanillaforums.org/addon/eventi-plugin

    It spits out information about every event that gets fired. Super useful for plugin development.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    When I tried that when I wanted to work on this plugin it spat out all bunch of errors it seemed. But I'll give it another go :)

  • Options
    peregrineperegrine MVP
    edited May 2014

    are you using
    public function DiscussionController_AuthorInfo_Handler($Sender) {

    if not what event are you using. and what plugin are you using to display the role. roletitle?

    you can also float and absolute and relative position elements via css.

    e.g. phreak used the symboledit and posted the symbol images so they are tacked on the lower right hand corner of the users avatar.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Thanks for the tips Peregrine, I'll look in to that as well next time I'll start messing around with the plugin

  • Options
    peregrineperegrine MVP
    edited May 2014

    no prob.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    @peregrine‌ Yes its using the AuthorInfo handler. I'm not sure how I can make that check for other functions and make it so the badges display last. After the role titles are being displayed. I could do it with CSS positioning of course, by making the badges display in a div and put that div on the right of the badges. But I think doing it in a way so the badges display after the role titles without the aid of CSS is a better, more neat solution. Or is that not the case?

    public function DiscussionController_CommentInfo_Handler($Sender) {
            if (substr(APPLICATION_VERSION,0,3) < 2.1) 
                   $this->SymbolEdit_Display($Sender);
           }
    
    
    
       public function DiscussionController_AuthorInfo_Handler($Sender) {
         if (substr(APPLICATION_VERSION,0,3) > 2.0)   
               $this->SymbolEdit_Display($Sender);
       }
    
  • Options
    R_JR_J Ex-Fanboy Munich Admin
    edited May 2014

    @JanHoos said:
    When I tried that when I wanted to work on this plugin it spat out all bunch of errors it seemed. But I'll give it another go :)

    Those exclamation marks are no errors but placeholders for where events are fired. Simplified: when you want a text to appear on this site, look for the closest exclamation mark and hover of it. You can also learn where the content that you are seeing is generated. Eventi is the most useful plugin when you start learning how to extend Vanilla!

    You are using "DiscussionController_AuthorInfo_Handler" but you might have more than one plugin that uses this event. As far as I know, plugins work alphabetically. So if plugin with name "A Plugin called A" inserts "aaaa" and plugin "N other plugin" inserts "nnnn" and plugin "Zzzz" inserts "zzzz" it will appear as "aaaa nnnn zzzz". Simply renaming "Zzzz" to "0_Zzzz" will change the order of the inserted text to "zzzz aaaa nnnn".

    But if you are using RoleTitle to show users role title, you'll see that it uses DiscussionController_CommentInfo_Handler and PostController_CommentInfo_Handler. So you will have to use those, too and in order for your badges to appear after the title, your plugin must be named something that is behind RoleTitle in the alphabet.

  • Options

    hmmm interesting! I'll see if I can work with your feedback. Thanks!

  • Options
    hgtonighthgtonight ∞ · New Moderator
    edited May 2014

    @JanHoos said:
    I'm not sure how I can make that check for other functions and make it so the badges display last.

    The plugin manager uses sort() internally when finding plugins, so they will be fired using PHP's sort order.

    EDIT - Doh! @R_J is spot on.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    @R_J‌ Sorry! R_J! Missed the part about the Eventi plugin. Muchas gracias! :D All makes sense to me now gehehe!

  • Options
    peregrineperegrine MVP
    edited May 2014

    you do what you need to do.

    @JanHoos

    btw, I wouldn't call everything SymbolEdit in whatever plugin you are using. Since SymbolEdit refers to just that the SymbolEdit plugin, kind of bad practice in naming conventions and can get confusing for people who are using both SymbolEdit plugins and whatever plugin you are talking about, and perhaps make one break.

    I aslo suggest you or a moderator move this conversation and post your questions, under the plugin you are specifically referring to , as this discussion is in outer space referring to some plugin that I have long forgotten.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Yes, renaming all the functions is on my to do list :)

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.