![]() |
[VB3 RC3] Member of the day
Tested in 3.0.1
This hack lets you "elect" a member of the day (member of any period of time actually, but defaults to member of the day). The member of the day is someone randomly picked from all the users in your forum that have certain amount of posts the day before, that have visited the forum and that have at least 50 posts and 10 reputation. You can also change that values. By default it appers in top of the forumhome. It is a nice way for members of the forum to get to know each other. Info for hackers: You may modify, improve, upgrade, redistribute this hack, include it in another hack or yours or translate it provided you do it free of charge and you distribute it in www.vbulletin.org at least, there is no need to pm me asking for permission Some portions of the code are (c) Jelsoft Enterprises Ltd. |
Tu further customize this hack you can edit the memberoftheday.php files, the settings are:
This is a comma separated list of the groups that will not be considered for the member of the day. Banned usergroups should be here. $restrictedGroups = "3,4"; This are the minimum posts a user must have, if a user has less than 50 posts for example he cannot be selected member of the day $posts = 50; Since it makes no sense to make a user that visited the forum a month ago member of the day you can specify the number of days ago the user must have visited the forum. In this example if the user didn't visit the forum yesterday he is not elegible for member of the day $lastactivity = 1; Similar to the last setting only the user not only has to visit the forum but also has to post. $lastpost = 1; Users with less than x reputation will not be selected. $reputation = 10; As soon as a user is selected he cannot be selected again in this number of days. This gives other users a chance to be elected member of the day. In this example once a user was selected member of the day he cannot be selected again in 60 days. $days = 60; The member of the day shows the "favorite forum" of the user. This is the forum the user has more posts in. If by chance it is a private forum the name of the private forum will appear there. You might not want other users to see that because they cannot enter that forums anyway. Put a comma separated list of your private forums. $privateForums = "1,2,3"; |
Looks like a nice idea, a screenshot would be nice aswell incase something goes wrong with your site.
Note the link in your first post isnt even a link to your site ;) (check your spelling in it) |
Would be nice to see proper permissions for the forums. Good to see some use of the datastore and the cron system here.
|
Quote:
PHP Code:
However there is no easy way to do this. Even if the forum is not shown the user can know that since there is no favorite forum it means that the user has 0 posts (not likely) or the forum is a private one. Then he knows that there are private forums. Sometimes you don't even want your users to know that there are private forums. Of course, I could always run the favorite forum check at index.php and if the first forum can't be seen I would go for the second, third or fourth one. But that query is a little heavy and I wouldn't like it to run at the index page. |
The 2nd, 3rd etc forums could be stored during the cron preventing the need to add extra queries on every index.php load then use code similar to what you posted along with some conditionals to display it.
|
is there a way this could be modifed that the member of the moment has like a special title in their profile and postbit? just wondering;)
|
I love this hack... :up:
At my Forum, we call it Camel of the Day :D Great Work! C. |
Tha age part of this hack is way off. It shows 34 for mine and it should be 49. ;)
|
This is great - It could be used on KuraFire's Journal hack as well (hint, hint)
|
Quote:
|
Quote:
|
Quote:
|
|
Quote:
Anyone got a fix for it? |
I have
PHP Code:
PHP Code:
Looks better than this cross |
You could export the limitating settings (group id, post minimum) to the admin cp input boxes so I could change it not connecting with ftp to my page, ok?
|
Quote:
Fixed. Just download the new memberoftheday.php Also, I just tested this hack with RC3, it works fine. |
You might want to change the name of the age variable in the text file, too, since you renamed it in the php file. ;)
|
Quote:
|
You're right. I apologize. I was trying to put it on my forumhome at the bottom so I wasn't using the template. Using mday[age] worked fine. I was looking at the code in the php file and it said memberoftheday[age] which, or course, didn't work. Needless to say, I was confused. But all is well now. ;)
|
What does unserialize actually do? Is that like the RAND() variable or am I missing something?
|
http://uk2.php.net/manual/en/function.serialize.php
http://uk2.php.net/manual/en/function.unserialize.php Quote:
|
Quote:
|
I'll have to look into that more. Thanks for explaining it. ;)
Also, here is what I get for an age for someone who hasn't entered a birthday. (Age: 2004). |
When I try to run the cron I get: "Couldn't elect a member of the day, not enough members"...i have a couple of hundred members and I check to make sure the correct usergroups weren't restricted. Also the member box on FORUMHOME is just showing blank b/c it hasn't selected anybody.
|
Quote:
|
Quote:
|
Quote:
|
kentaurus, can you look at post 25 here and see if you can figure out why this is doing that, please, sir? ;)
|
Quote:
find this: Code:
if ($year > $date[2] AND $date[2] != '0000') Code:
if ($year > $date[2] AND $date[2] != '0000' AND $date[2]) |
Quote:
|
Quote:
Anyway... I am expecting HTL 1.1 before any other hack, I am not releasing HTL hacks until I can make the .txt from there... it is really bothersome to do both an HTL and a TXT |
I'm getting this, do I need to wait for the cron to run or something?
|
Quote:
|
Quote:
and HTL 1.1 will come, I hope soon but I dunno how soon.. it's so much work :( |
They are asking what they get for being MOTD. How can I rig it to give the member of the day 5000 reputation points?
|
Quote:
In the memberoftheday.php Look for this: Quote:
Quote:
|
it is easy to change it to Member of the month? :rolleyes:
|
Quote:
|
All times are GMT. The time now is 04:46 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|