$('.fa-comment').css("color",badge["facomment"]);
$('.fa-comment').css("cursor","pointer").attr("title", badge["facommentval"] + " Posts in the Last Month");
$('.fa-comment').closest('div').find('.fa-circle').css("color",badge["facomment"]);
$('.fa-terminal').css("color",badge["faterminal"]);
$('.fa-terminal').css("cursor","pointer").attr("title", badge["faterminalval"] + " Discussions Started in the Last Month");
$('.fa-terminal').closest('div').find('.fa-circle').css("color",badge["faterminal"]);
$('.fa-rocket').css("color",badge["farocket"]);
$('.fa-rocket').css("cursor","pointer").attr("title", badge["farocketval"] + " Thanks in the Last Month");
$('.fa-rocket').closest('div').find('.fa-circle').css("color",badge["farocket"])
Thanks a TON Neo for coding all these badges,sorry I am not having proper access in office(only IE is there so not able to perform anything).
For writing logic for consecutive days one,is it ok if I first present logic rather than code(as I know php which I learnt from you in last few days, I know I could write logic for it. Please do give me an hour or so I will write it here.
EDIT: Also request you to edit string so that it will be clear that people received THANKS from others, may be as follows. Ahhh if I would have access in office today I would have tried to write 1 of them.
$('.fa-rocket').css("cursor","pointer").attr("title", badge["farocketval"] + " Thanks received in the Last Month");
Following will be my approach in order to get consecutive days BADGE's creation.
Step 1st: Create a field named daily_login_count in user TABLE(mysql).
Step 2nd: Now whenever user logs in to forum then check condition if (TODAY's date-1)==lastvisit(fied value) then add 1 in daily_login_count.(I know this method should be invoked when user is clicking on LOGIN button and able to successfully login )
Step 3rd:
i- Now check if value of daily_login_count>=1 && daily_login_count<14 then BADGE color should be orangered.
ii- Check if value of daily_login_count>=14 && daily_login_count<30 then BADGE color should be darkorange.
iii- Check if value of daily_login_count>=30 && daily_login_count<60 then BADGE color should be lightgray.
iv- Check if value of daily_login_count>=60 && daily_login_count<90 then BADGE color should be limegreen.
v- Check if value of daily_login_count>=90 && daily_login_count<120 then BADGE color should be blue.
vi- Check if value of daily_login_count>=120 && daily_login_count<150 then BADGE color should be indigo.
vii- Check if value of daily_login_count>=150 && daily_login_count<180 then BADGE color should be black.
Step 4th: In case condition 2nd is NOT TRUE means user is logging after some days then make daily_login_count=1 and change BADGE color to red.
No, I have taken care of consecutive days, if condition 2nd is NOT TRUE means (today's date - 1) != lastlogin) then it again sets daily_login_count to 1 rather than adding 1 to its count, hence taken care of consecutive thing.
Now coming to logging out logic(I have a question here), whenever we see Who is Online page then after 29 mins I see people will not be seen isn't it they are logged out now from forum(sorry till now I thought this only that user's sessions have 30 mins expiring time)?
WOL based on session activity is not the same as logging in and out; otherwise, every time you when to have tea or go for dinner and come back to your computer you would have to login again.
Obviously, you don't have to login every time you go away from an hour. At least for me, I rarely login to the forums, even when I wake up in the morning and turn on my Mac Pro; my login is still valid when I visit the forums.
It is not an issue, there are many ways to invoke a script, we do not need to invoke on login, like I said.
I will run the script on "showthread" page, so you need to take that into account and check that you only increment the day++ count IFF it has not already been incremented for that day.
You can do that in many ways.... but you cannot do it solely based on login.
Ravinder is working on the logic for a "consecutive days or forum activity" badge, which sounds cool, so that would be number 42 I guess, which will leave 6 "Reserved" badges left to do.
If one of those "Reserved" badges is allocated for the the mod system of member ranking; then that means:
41 Badges Done
1 Badge Under Development (Ravinder)
1 Badge for Mod Scoring / Points (Reserved)
Thanks Neo for letting us know the status. 1 more badge name came into my mind just now so posting it here. How about a badge for sharing experience on any projects/any story(may be WAR stories forum things). It could be awarded by MODs/Admins to person who shared nice experiences in that forum?(It is not a system generated one).
Kindly do let me know your thoughts on same, till then I am thinking more badges. Let me know if you like it.
EDIT: Ok, got 1 more in just now, how about if a person newly joins if get a THANKS within a week of joining forums we could give him/her "enthusiast" BADGE etc, how about this one?
I like your idea about a Mod issues badge to anyone who has posted some outstanding project or story. That badge can be nominated by a Mod and discussed in the Mod forum and when we approve it; I can add that user's userid to the array and it's done, easy.
Regarding, making a badge based on "getting a thanks within a week", the problem for that badge is that few people will achieve it and so that badge will remain "lightgray" forever for some number greater than 99% of the forum members and after a week passes, they will never have a chance to get that badge; so I think I'll pass on that one.. but that's for the idea!
1- Whoever gets HIGHEST THANKS in a month gets BADGE,(applicable only for TOP 5 or so and visible only for TOP 5 people NOT seen by any other people). May be we could add HIGHEST THANKS badges for 1 week, 1 month and 1 year. Then after a year competition starts again?
.
2- Whoever joins forum and within a week gets at least 1 THANKS BUT only he gets that badge others will NOT be able to see that(I mean enable this badge only for that person who achieves it bu this way others will NOT regret that they didn't get this BADGE and new members will be encouraged too?).
Regarding your other two ideas, I need to think about them... But off the top of my head, we have enough badges related to thanks and do not need more "thanks" badges
I think it quite easy to do the "sequential days active" badge. This simple logic came to me in my sleep. We simply use a query like this:
mysql> SELECT UNIX_TIMESTAMP()/(60*60*24);
+-----------------------------+
| UNIX_TIMESTAMP()/(60*60*24) |
+-----------------------------+
| 17900.1528 |
+-----------------------------+
1 row in set (0.00 sec)
to give us the number of days since the beginning of unixtime.
We store this value, rounded down in a new lastdayactive field in the user table;
Then we insert a 1 in the in the daysinsequence field in the same table.
Then we compare UNIX_TIMESTAMP()/(60*60*24) with lastdayactive and if this is one day greater (and less than two) than before, we update lastdayactive and increment daysinsequence .
If UNIX_TIMESTAMP()/(60*60*24) - lastdayactive is greater than 1 day we update lastdayactive and reset daysinsequence to 1.
It's quite simple, I think.
Hence, you get a D on this one (for implementation logic, sorry for that) because it is very simple to do but you could not do it after many days ... but an A for a great idea
I will implement this badge when I am back from my trip upcountry.
Please take a look and let me know what you think Ravinder!
Thanks
PS: I have not debugged that code above yet and realize that we need to add logic to not query the DB after we reset; because we already have the value (1) so no reason to do the extra query, etc.
OK I have come up with an easy way to implement alerts when the badge beta is done.
Will take the array of badge colors and convert that array to a JSON string and then take the cryptographic hash of that string and store that string in the user table.
Then it is easy to check when a new threshold badge has been reached without tracking values that change often.
Then when the state changes .. will issue a simple dismissable Bootstrap alert which states the user has a new badge but not the actual badge (in first beta) and will have a link to the badge page.
Later will add the actual details of the status changes to the alert message.