HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Feedback, Pledges, and Feature Requests - add them here.

peregrineperegrine MVP
edited March 2013 in Feedback

@qbauer said:
peregrine, if you have a paypal set up, let us know so we can donate some money to this..

Thank you for the offer to Contribute

  • So far the amount of people offering contributions in the past month for anything I've done is less than $50 total.

  • I've got a couple of people pledged for contributions.

  • If it wouldn't be difficult for you to either pm me with your expected pledge amount, or post it here.

  • If the Totals of individual amounts pledged exceeds a $100 or $200, then i will open a paypal account and hit you up for the pledge, if thats ok. In other words if 20 people offered $10, or 40 people offered $5 it would be worth it or some machination to equal $100 or $200, but if 3 people offer $5 for a total of $15, it's not worth the effort.

  • So thanks, and maybe i will get more pledges, and I will open a paypal account.

  • By the way, I am part way through incorporating a page that display all users who received anniversary badges, like badges, comment badges, etc.

thank you @hgtonight,@qbauer, @phreak, @garyfunk for offering to pledge and any other people in the future tia - I will contact you all when i get things squared away on my end.

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

«134

Comments

  • qbauerqbauer
    edited March 2013

    In my theme, I changed the "Total Points" to "XP" to go with a gaming theme. Two things I'd like to add, which should be fairly doable:

    1. Add a "Total Points" slot next to the author name in the Meta box so it spits out html with a span class (ie span class="TotalPoints" XP 23 /span). If someone is using the Total Posts plugin with this, the meta box, under the author name, might read "XP 23 Total Posts 30" or whatever...

    2. Add a script to award a Level at Total Point markers (after 100 points, the user gets a Level Two designation, for instance) with some CSS hooks in the User's Comment box, so that when the user comments, there would be the ability to add some subtle designs to the user who has a higher level (I was thinking a subtle corner ribbon with the level designation, or maybe a border color around the avatar, or a subtle icon in the corner for the level).

    These would be a few subtle tweaks to allow CSS changes to users in threads without adding dozens of badges in the threads. I'm going to try experimenting with this later.

    Okay, following up a post from yesterday. I hope this is in the right thread now. I've tinkered with the peregrinebadgesmodule.php, attempting to add a "Level Up" to the badges box, and here's what I came up with (I changed around some lines above the //add a charter badge line, so I'm just posting it all here:

           <?php if (!defined('APPLICATION')) exit();
    
    
            class PeregrineBadgesModule extends Gdn_Module {
    
                public function AssetTarget() {
                    return 'Panel';
                }
    
                public function ToString() {
    
    
    
    
                    $UserID = $this->_Sender->User->UserID;
    
                    $Result = PeregrineBadgesModel::GetTotals($UserID);
    
                    $CountAB = $Result[0]['AnniversaryBadge'];
                    $CountCB = $Result[0]['CommentBadge'];
                    $CountTB = $Result[0]['ThankfulBadge'];
                    $CountLB = $Result[0]['LikedBadge'];
                    $Points = $Result[0]['Points'];
                    $Level = $Result[0]['Level'];
                    if ($Points < 1) $Points = 0;
                    if ($Points < 301) $Level = 'Three';
                    if ($Points < 201) $Level = 'Two';
                    if ($Points < 101) $Level = 'One';
    
                    echo "<div id=\"PeregrineBadges\" class=\"Box Levels Level" . $Level . " PeregrineBadgesBox\">";
    
                    echo "<ul class=\"PanelInfo PanelPeregrineBadges\">";
    
                    echo "<h4>";
                    echo T('<a href="/vanilla/badges#info" title="Learn how badges work">My Badges</a>');
                    echo "</h4>";
    
    
                    echo "<dl><dt>" . T('Level ') . "</dt><dd>" . $Level . "</dd></dl>";
                    echo "<dl><dt>" . T('Total XP ') . "</dt><dd>" . $Points . "</dd></dl>";
    
                    $prelink = "plugins/PeregrineBadges/design/images/";
    
                     // add a charter badge
    

    I don't need to add anything to a database; it's just some really basic if/then checks based on the points, and then a CSS hook that looks like this in the final html:

    <div id="PeregrineBadges" class="Box Levels LevelOne PeregrineBadgesBox">

    Now I can style the Badge box on the user profile page, based on whether it has been assigned a class of "LevelOne" or "LevelTwo" and so on. Pretty basic stuff.

    I'm looking at how to add similar CSS hooks to the Discussion page, so each user in a discussion thread has a "LevelOne", "LevelTwo", whatever, attached to their li list. Then I can add a corner ribbon in CSS (or a subtle shade of color, or whatever I want to add) to denote their Level. This is a lot more challenging. I've looked into using a modified helper_functions file in the theme folder, but this should be done through the plugin.

    Hope this helps someone, or gives someone some ideas.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I want to pledge $100 dollars (american) towards all your contributions , I feel it is not even close to what you deserve, but it is a start. You are the gift that keeps on giving and we should all try to support this any way we can.

    Tell me where to send it ok ?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    each user in a discussion thread has a "LevelOne", "LevelTwo", whatever, attached to their li list. Then I can add a corner ribbon in CSS (or a subtle shade of color, or whatever I want to add) to denote their Level.

    If you look at how that sort of thing works on this forum you will notice that those backgrounds are attached to Rank

    li.Item.ItemComment.Rank-Vanilla.Offline.Promoted .CommentsWrap .Item.Rank-Vanilla {

    thats what Todd's box looks like in the css when he posts. It has special colors and they seem to be attached to the rank options. A plugin which attached css class options to their post depending on rank would be cool .

    Kind of like the role plugin that you can alter the colors for each role. In this case it would latch on to the Rank class if Roles could be converted into Rank maybe that would work. Instead of changing the font color it would change the background of their post, or comment ...

    Not sure I would favor having those in the discussion index . It ends up looking like a clown house. In my opinion.

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

    This sounds awesome. I can't wait to see it! I was trying to see how the Purchase Premium Role plugin handles auto role promotion, seeing how difficult it would be to promote a user to a new role based on Total Points awarded. Looks very challenging, but would open up a whole new set of applications for the Badges and Points (like disallowing avatars until a user earns 50 points, as an arbitrary example, after which he/she is promoted to 'Official Member' with the new privileges, then after 100 Points he/she is auto promoted to 'Seasoned Member' which allows File Uploads, and so on). It would also be nice to link a new Badge to a Role, so we could create automatic Roles for points earned with a special Badge awarded for that role. I know that the hosting solution comes with Ranks, which provides a similar functionality, but a solution like this would most likely be pretty equivalent.

  • peregrineperegrine MVP
    edited March 2013

    @qbauer

    I'll be ready your comments and suggestions. But, I may not respond right away - but keep them coming.

    By the way - Thanks you guys - some of you who pledged monetary contributions, have sent me the $$ contributions and I've received them

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

  • SrggamerSrggamer HardCore Gamer ✭✭✭

    @peregrine said:
    qbauer

    I'll be ready your comments and suggestions. But, I may not respond right away - but keep them coming.

    By the way - Thanks you guys - some of you who pledged monetary contributions, have sent me the $$ contributions and I've received them

    I was planing on pledging, but I had a narrow crash with PayPal after my 800$ transaction to a person.

  • qbauerqbauer
    edited March 2013

    Another idea I had last night: awarding a unique badge to all the users of a specific thread. For example, the moderator finds a specific thread really useful to the community and wants to archive it as a "Best Of" thread. Comments get shut off, it gets archived, and the admin posts a last comment that reads: "Participants in this forum were awarded the '?' Badge for an Exemplary and Useful Thread" (and the badge would be a one-off and unique to the thread content; maybe the originator of the thread gets a slightly modded Author version of the badge). This could be done really quickly by surveying the In This Discussion plugin and adding names to the config file using the feature peregrine added to the last version of PeregrineBadges. There may be a way to mod the PeregrineBadges plugin to work with the In This Discussion plugin to add this feature. On the Badges page (I wrote about this earlier), the admin could include a Best Of Forum "Scoreboard" indexing links to the best threads, and the unique badges that were awarded to the participants (each of the best threads listed could have underneath a credited list of the participants). Something like this would be a great way to incentivize people to add useful content (or whatever behavior you want to reward in the forum).

  • here's what I have so far on the badge summary that will appear by clicking on a badge in the profile section

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

  • qbauerqbauer
    edited March 2013

    Note: per peregrine's request, I moved this topic to its own discussion thread http://vanillaforums.org/discussion/23278/auto-updating-user-roles-with-peregrinebadges

    Re: Auto Updating User Roles

    ***Just a quick warning on the following code, test this ONLY in a development/test environment (I'm testing this on my localhost), especially if you don't know what you're doing. It would be possible to overwrite the admin role and lock yourself out of your own forum. But I figured out a simple way to automatically update a role with the following logic (it ends up overwriting the previous roles; if someone knows how NOT to overwrite the preexisting User Role, and instead just add the new role to the preexisting array of User Roles, please let me know; it should be fairly rudimentary, just pulling data out of an array, but my php is really rusty).

    Here's the basic code:

    $UserModel = new UserModel();
    $UserRoles = $UserModel->GetRoles($UserID)->Result(); //I added this as I am trying to remember how to pull data out of an array, and then add a new variable to the end of the array, which would be better than overwriting the User Role
    
    // I added the if statement to check if the user ID is 1, which should be the admin, and not trigger it if it is the admin
    if ($UserID != 1) {
    $UserModel->SaveRoles($UserID,'33',FALSE); //this line overwrites the user role/ALL OF THE USER ROLES to 33, which in my install is the id number for a role I created called Veteran which has the same parameters as the Member role
    }
    

    Here's how I'm thinking about using it...in the class.peregrinebadgesmodule.php, I could trigger this code when Total Points reaches a certain limit, say 100. The logic may be something like: If Total Points equals 100, then make Total Points equal to 105, trigger the User script through the SaveRoles function, and optionally enable a new User Badge (like the 'Veteran Badge').

    This should work, but I'd like some feedback, if anyone has time of course. I'd like to know:

    1. Is this safe to enable this function in a live environment?
    2. Any tweaks to the code to make it safe?
    3. Is there a better way to save the roll ADDITIVELY to an array of roles, instead of replacing the existing roles? (I kind of already answered my own question, but if anyone has a clean implementation of adding a new User Role to the array of roles...)
    4. Is there a better way to implement this code in order to make sure there are no weird loops; maybe something dangerous that I'm missing in the Total Points check. And is using SaveRoles to send this data to the database okay/safe with this method, or does this open the forum up to exploits...that kind of stuff would be useful...?

    Have fun with the code!

    Addendum: to reiterate since this idea was in another thread, this would be used to mimic 'ranks' or automatic role promotion for specific behaviors, ie a user getting promoted from a 'Noob' role to a full-fledged 'Member' role after successfully completing a number of comments, and receiving thanks, thereby opening up new member privileges (uploading avatars, uploading files, and so on)...also, this could be used to attach a new role (working like a rank with certain privileges) AND a badge at a certain Total Points threshold.

  • @qbauer said:
    Re: Auto Updating User Roles

    Just a friendly suggestion, for you to help me.

    Why don't you post your discussion about user roles, on a new discussion. I know I mentioned I was working on a rolepromotion plugin. But that is not really feedback per se on this plugin. And yes my plan was to add a role not replace it. Since roles are additive.

    So role auto update would be a new discussion not posted within this plugin.


    Also any "code changes" you have you on this plugin, you might want to start another discussion topic within this plugin. But, remember any code changes you makewill be made on a plugin that is still changing, and may not pertain anymore.

    But plain discussion feedback on this thread related to PeregrineBaddges Plugin is cool.

    Just some ideas, it will make it easier for me, if you want to make it easier on me.

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

  • Okay, should I delete this and repost to a new thread, or add a note on it that reads "Moved to a different thread?"

  • maybe @Underdog can split your comment out of here.

    give it a day or two for the secret agent to do his handiwork.

    http://vanillaforums.org/discussion/comment/179134/#Comment_179134

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

  • That's some awesome work, peregrine! Take a break.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I have an idea ... a country badge depending if they input their location or automatically based on IP ?

  • It's already done with the world flags plugin and a few others, I don't think it is worth it to duplicate the effort.

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2013

    Oh , my bad then , well @422 , there is one useless badge for ya !! and for any AU folks out there too lol

  • @peregrine

    This plugin is just what I wanted for X-Mas :-) Thanks!

    Also the @qbauer suggestion for auto promotion would be so cool to see working, especially if both plugins included a notification mechanism (PM, e-mail, whatever) when changes take place. That way the incentive function of badges would be boosted.

    I'd like to pledge a fair amount as well, though with one request: can you make it work in the default mobile theme as well? It should show up under its own tab and then have something like one line per badge, including both badge image as the explaining text (as hovering won't work on mobile devices).

  • peregrineperegrine MVP
    edited April 2013

    @martz said:
    peregrine

    This plugin is just what I wanted for X-Mas :-) Thanks!

    Also the qbauer suggestion for auto promotion would be so cool to see working, especially if both plugins included a notification mechanism (PM, e-mail, whatever) when changes take place. That way the incentive function of badges would be boosted.

    I'd like to pledge a fair amount as well, though with one request: can you make it work in the default mobile theme as well? It should show up under its own tab and then have something like one line per badge, including both badge image as the explaining text (as hovering won't work on mobile devices).

    Thanks - I'm working on a promotion thing.

    As far as the mobile can you post a mockup of an image of what you like to see in the mobile theme. and i'll see what I can do.

    And by the way - @martz thank you for the donation, I received it. - another stimulus to enhance it more. So far everyone who has pledged has honored their pledge by sending a contribution. Thank you all.

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2013

    To get this to be seen in mobile by simply adding the Panel asset to your mobile theme and adding some css to adjust the size I did this and it works below the Content asset I added the Panel .

    
    < div id="Content" >
              {asset name="Content"}
            < /div >
            < div id="Panel" >
              {asset name="Panel"}
            < /div >
         < /div >
         < div id="Foot" >
            < div class="FootMenu" >
    
    

    Then I added css so it would be seen right.

    #Panel {
    width:100%;
    float:left!important;
    display:block;
    margin-left:0;
    } 
    

    and add 'MobileFriendly'=>TRUE to the default.php of peregrine badges .

Sign In or Register to comment.