The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
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:
That's it, have fun. Show Your Support
|
Comments |
#32
|
|||
|
|||
Quote:
|
#33
|
|||
|
|||
how would you make this user of the week?
|
#34
|
||||
|
||||
Quote:
where is it on the forum? |
#35
|
||||
|
||||
Nice!
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. |
#36
|
||||
|
||||
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.
|
#37
|
|||
|
|||
Quote:
|
#38
|
||||
|
||||
Quote:
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. |
#39
|
|||
|
|||
Quote:
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') ?? thanks for the help |
#40
|
||||
|
||||
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. |
#41
|
||||
|
||||
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. Any ideas? Chris |
#42
|
|||
|
|||
Quote:
But I am learning my friend, jsut at a slow pace (lots of other stuff going on in life) I shall amaze you one day |
#43
|
||||
|
||||
It looks like the Order by RAND() function is not available for mysql versions 3.22 or lower. Any way of getting the sql rewritten to work with 3.22?
Thanks Chris |
#44
|
||||
|
||||
What version is your MySQL? I know that the ability to order by RAND() was only added in a certain version... I'll dig up see if I can find the older way to get a random row.
|
#45
|
||||
|
||||
I'm running 3.22.32. I looked and the order by rand() does only seem to be available to 3.23 and up.
I am trying to talk myself into upgrading the mysql version, but I'm chicken. |
#46
|
||||
|
||||
Ok my book tells me you should change the query to this:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|