Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

Badge and Icon Depository

This discussion is related to the Peregrine Badges addon.
135

Comments

  • @qbauer said:
    How difficult would it be to allow an admin or moderator to assign a custom unique badge to a user? Great job with this. This looks awesome!

    Pretty easy without modifying table if its just a few ids. do you want a way to do it via changing config.php

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

    vrijvlinder
  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited March 2013

    A plugin that only mods can use to give certain badges , AdminRewards , maybe modifying the pBadges to give permissions only to admin ? that would be cool I think it involves more people input than just points earned a badge.

  • GaryFunkGaryFunk Senior Application Developer ✭✭
    edited March 2013

    @peregrine said:
    Pretty easy without modifying table if its just a few ids. do you want a way to do it via changing config.php

    Today it's a few; tomorrow it's hundreds.

    peregrineUnderDog
  • The config option is ready now, but I'll wait so as not to complicate.

    I'll get this addition sooner or later, probably less than a month.

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

    vrijvlinderGaryFunkUnderDog
  • I'm working on a rolepromotion plugin first :).

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

    vrijvlinderUnderDog
  • qbauerqbauer
    edited March 2013

    @peregrine said:
    Pretty easy without modifying table if its just a few ids. do you want a way to do it via changing config.php

    Yeah. I'd love to know how to do that. I don't mind getting into the code and adding a few customizations. I'm looking at the code right now and trying to figure out how to do it. Another thing that I'm thinking, to circumvent adding to the database tables...this may be messier, maybe doing this with a flat file (adding names to a txt file in the plugin folder for customized badges)?

  • I'll post a new version with config.php mod option.

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

    UnderDog
  • Wow, thanks for such a fast response, peregrine. I like the idea of the rolepromotion as well. I'm guessing that would allow doing things like assigning a "noob" role to someone just signing up, then promoting them to "Member" after a certain number of posts, along with a badge, among other possibilities.

  • hgtonighthgtonight ∞ · New Moderator

    @qbauer said:
    ...to circumvent adding to the database tables...this may be messier, maybe doing this with a flat file...

    A configuration is a flat file :D

    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.

  • qbauerqbauer
    edited March 2013

    @hgtonight said:
    A configuration is a flat file :D

    Thanks hgtonight. I probably should have wrote “a flat file separate from the config file, dedicated to storing usernames.”

  • peregrineperegrine MVP
    edited March 2013

    A flat file would be easy too. just read file line by line. But, i chose to put in config.php

    and its done in version 1.6

    examples for special badges red herring, red herring 100 and coffee with V's images are included. All you need to do is read the read me and add 3 config statements.

    Maybe a better way is add it to usermeta table. but here it is, and it is what it is.

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

    vrijvlinderUnderDog
  • http://vanillaforums.org/addon/peregrinebadges-plugin

    version 6 available - see the readme.

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

    vrijvlinderUnderDog
  • qbauerqbauer
    edited March 2013

    That is awesome! Thanks so much.

    I was playing around with one of the files, and this was something really easy to do (hope you don't mind peregrine): I wanted a user to be able to click on a badge in the "My Badges" panel, and go directly to an explanation of that badge.

    This is a really simple tweak. Say, for instance, that I have won the "like" badge, and I want a user to be able to go to my profile and click on the badge image to read about the badge type. I used the Custom Pages plugin, then created a page called "Badges" (or "Achievements", whatever). I then went in to the class.peregrinemodule.php and found:

    echo Img($prelink . $counter . "hb.png", array('alt' => 'Likes', 'title' => sprintf(T('Likes %s'), $HBArray[$counter]), 'class' => "PeregrineBadgesSmall"));

    and changed this to:

    echo '<a href="/vanilla/badges#like">' . Img($prelink . $counter . "hb.png", array('alt' => 'Likes', 'title' => sprintf(T('Likes %s'), $HBArray[$counter]), 'class' => "PeregrineBadgesSmall")) . '</a>';

    In my "badges" html page, I added some commentary for each badge type. To link directly to the "Like" badge explanation, I just added something like:

    <h2 id="like">Like Badge</h2> <p>Users are awarded the Like badge for blah blah blah...</p>

    Your link may be a bit different, obviously, based on your url structure (and I changed the route and target on my Custom Pages), but this worked really well to create clickable badges in the My Badges panel.

    You could add an html link to each of the different badge types this way.

    (I can't link to my forum because I'm working on a localhost, but when I put it up on my server, I can add a link to it, if anyone wants to see how it works).

    GaryFunkvrijvlinderUnderDog
  • @qbauer said:
    That is awesome! Thanks so much.

    I was playing around with one of the files, and this was something really easy to do (hope you don't mind peregrine): I wanted a user to be able to click on a badge in the "My Badges" panel, and go directly to an explanation of that badge.

    great - this what the forum is for, sharing your ideas and code.

    This is a really simple tweak. Say, for instance, that I have won the "like" badge, and I want a user to be able to go to my profile and click on the badge image to read about the badge type. I used the Custom Pages plugin, then created a page called "Badges" (or "Achievements", whatever). I then went in to the class.peregrinemodule.php and found:

    echo Img($prelink . $counter . "hb.png", array('alt' => 'Likes', 'title' => sprintf(T('Likes %s'), $HBArray[$counter]), 'class' => "PeregrineBadgesSmall"));

    and changed this to:

    echo '<a href="/vanilla/badges#like">' . Img($prelink . $counter . "hb.png", array('alt' => 'Likes', 'title' => sprintf(T('Likes %s'), $HBArray[$counter]), 'class' => "PeregrineBadgesSmall")) . '</a>';

    In my "badges" html page, I added some commentary for each badge type. To link directly to the "Like" badge explanation, I just added something like:

    <h2 id="like">Like Badge</h2> <p>Users are awarded the Like badge for blah blah blah...</p>

    Your link may be a bit different, obviously, based on your url structure (and I changed the route and target on my Custom Pages), but this worked really well to create clickable badges in the My Badges panel.

    You could add an html link to each of the different badge types this way.

    (I can't link to my forum because I'm working on a localhost, but when I put it up on my server, I can add a link to it, if anyone wants to see how it works).

    cool. an easier way is just to change the title in echo statement and hover - if its under 128 characters or so - depending on browser.

    But your way would be superior for more detailed info.

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

    UnderDog
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Like this? or in it's own array ?

    echo Img($prelink . $counter . "hb.png", array('alt' => 'Likes', 'title' => sprintf(T('Likes %s The Like Badge
    Users are awarded the Like badge for blah blah blah...'), $HBArray[$counter]), 'class' => "PeregrineBadgesSmall"));
    
    UnderDog
  • cool. an easier way is just to change the title in echo statement and hover - if its under 128 characters or so - depending on browser.

    But your way would be superior for more detailed info.

    Either way. I do like the idea of a separate page dedicated to a listing of all of the potential badges (and maybe even showing their uniqueness, so that the user that won the trophy that no else has gets bragging rights as the collector of the badge with a 'unique' stamp, just as the charter group badge would show 'only 100 awarded'). As new badges get added, the page grows and shows user what they can shoot for, kind of a key to all of the trophies available. I know the Vanilla hosting solution also shows the users that have been awarded specific badges, but this to me feels a bit of an unnecessary load on the database. A link to one html page with all the available trophies may be a cool alternate solution.

    UnderDog
  • qbauerqbauer
    edited March 2013

    version 6 available - see the readme.>

    Worked like a charm. Really simple solution! I imagine it would be easy to add more unique badges using the template you provided...

    I'm already thinking of ways to implement this. For instance, we could have a contest of illustration submissions on the site, and the top three winners get a badge. We could do something for Halloween, and award certain users a 'collectible' Halloween badge. Fun stuff.

    vrijvlinderUnderDog
  • Some friends of mine and fellow illustrators: http://boardgaming.com/ (they used Buddypress, but peregrine's solution with Vanilla is a lot cooler!)

    I'm only posting because I wanted to share the badges they created; some are really inspirational. I'm getting some ideas.

    UnderDogperegrine
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    If you want the badges to be animated and push the limit of your bandwidth here is a cool free tool that you can use to make or edit animated images, or any image really.

    http://www.online-image-editor.com

    qbauerUnderDog
Sign In or Register to comment.