Version: 1.00, by Admin (Coder)
Developer Last Online: Nov 2024
Version: 2.2.x
Rating:
Released: 02-03-2002
Last Update: Never
Installs: 103
No support by the author.
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.
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:
The member of the day will reset every day at 12:00am server time.
It is possible for the admins to re-choose the member of the day at any given time, by adding "?resetmember=1" when visiting index.php. (only logged in admins can use this; for regular users it won't do anything)
The only check in the code is to prevent the same member of the day two days in a row. It is possible, however, that the same member will be chosen two days after he was already a member of the month.
I don't recommend using this hack on a small forum (with not-so-many members) because of the above.
That's it, have fun.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by xiphoid About 5 members here said they installed it, I visited their site, but couldn't see the hack installed..guys: where can I find an installed version? ..
Sounds like a great hack
yea I couldnt find it either
where is it on the forum?
I was going to do something like this and I like the way you handled it. It's exactly how I handled it for my ubb homepage except you've taken advantage of the templates table, which I love.
Used it to store random member id and random link id of the day and calling them to my homepage instead of the forum homepage.
Featured link is already working. need to make a tiny profile summary box for the featured member.
Will probably expand this for of features of the day like random trivia question of the day. I'll just add 2 more fields with todays trivia id and yesterdays trivia id. that way I can have todays question and the answer to yesterdays. (before you ask about the trivia. it's not a real hack. just added a table with 3 fields, id, question, & answer. then just grabbing the text. No admin form to edit them or anything. just phpmyadmin for now.)
thanks again, it will get used alot.
PS - was trying to think of a nice way to make it member of the week instead of day. I mean I know I could change it every 7 days, but it seems like I'd eventally knock it off by reseting it in the middle of the week or something. plus you'd need a check for end of the month / end of the year. anybody got a nice idea?
the easy answer would be to just make it feature of the month bu that would be too long of a time period.
It's possible to make this member of the week, just use the date() function (http://www.us2.php.net/manual/en/function.date.php) with W as the format... unless your forum won't be visited for a year () you should be fine.
Originally posted by FireFly It's possible to make this member of the week, just use the date() function (http://www.us2.php.net/manual/en/function.date.php) with W as the format... unless your forum won't be visited for a year () you should be fine.
Originally posted by xiphoid About 5 members here said they installed it, I visited their site, but couldn't see the hack installed..guys: where can I find an installed version? ..
Sounds like a great hack
Though I am still using my original design and it uses a cronjob and doesn't store it in the text file. Though if I wanted to I could use my Member of the Day anywhere and it could automatically generate MOTD, MOTW, MOTM, and MOTY in one run. Also it isn't tied into any user accessing the forum so it happens when I want it to.
Originally posted by FireFly It's possible to make this member of the week, just use the date() function (http://www.us2.php.net/manual/en/function.date.php) with W as the format... unless your forum won't be visited for a year () you should be fine.
I sure hope so althu it might be close
and hey about the memeber of the week thing, I am a little confused (beging to leran php) would I change it to something like this date('Y-m-W') ??
No, change it to date('W') only, and also only store that number (should give you a number from 1-52). Then compare the number in the template with the number you just got from the date() call.
If you want I can post the modified code here, but you should give it a try, it's not very hard.
Apparently, I have done something wrong. I keep getting an SQL error. It seems to be on the "Order by RAND()" line.
I did the insert with no problems. Added the hack below the correct section and now index.php crashes. Even tried the reset for member of the day and it still crashed.