![]() |
The idea is from SitePoint Forums.
I think a lot of people really want this hack, and I've even seen a released version of it here, but it used cronjobs and stuff like that I'm sure not all of use want to mess with. :) So, here's my version of the hack, completely crobjob-less and 100% working. :D The hack also includes an easy way for the admins to change the member of the day at any given time. (see note below) You can see it in action in this board, on the main page in the stats box. To install this hack download the attached file (memberofday.hack.php), upload to your /admin folder and use vbHacker. A couple of notes:
That's it, have fun. :D |
If anyone would like to know how this hack works, here you go.
Every time index.php is accessed, the current date (in a yyyy-mm-dd format) is generated (according to the server time, like I mentioned above). Then the data is pulled from a special template ("memberoftheday") and the date in the template is checked against the date that was just generated. If the dates match, then the data is ok (since it was created today, otherwise the date would be different), and nothing special needs to be done (other than assigning the data to new, easy-to-understand variables). If the dates do not match, the current member of the day is from a different day (probably yesterday, unless no one visited your forum for more than a day ;)). A new random user is selected from the database, while making sure it's not the same one that is already selected, a new data template is created and the database is updated. The above procedure also occurs if $resetmember is set to 1 (through the URL) and the user is an admin. So, the member of the day is only updated once a day, by the first member that visits your forum on a new day. Quite nice, no? :) |
Very nice, well done. :up:
|
Great hack! Thanks mate :D
|
very good! easy install and worked a charm!!
|
Awesome Chen, I'll put this up on my forums when I get a few more members! :)
|
Nice hack, I'm using it on my Forums. :D
|
I just installed and my first member of the day is someone who has not visited yet...
|
Sounds suspiciously like how birthdays work ;)
|
another wonderful release!
|
All times are GMT. The time now is 03:11 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:
|