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.
ok, now I'm running into some problems, lol. I don't have the MySQL access to the directory, so it's a coding problem (vBHacker added the query correctly, I wish all hacks where like this) anyway, it tells me it can't find
Code:
$permissions=getpermissions();
if (!$permissions['canview']) {
show_nopermission();
}
yet its on line 10 of index.php on vb2.2.8. I chose not to modify templates, because they use a modded design, and layout wise it belongs in the header. Anyway, I've done everything I'm supposed to, but vBHacker still won't reconize the changes! I found the only instance of the code, and added the code after ('require global.php') and no, the varible part isn't there twice. I just either A) want to get this thing working, or B) get vBHacker to work right. I'll try deleting the .hack.php file to get vBhacker to work again, and add the template manually and see what happens. Since everything is // ed out, I don't think it'll effect index.php.
Originally posted by J-OST I installed this but it only shows the same two people every other day. I used the text file provided by vbhacker to install it. Are there known issues with this?
I've been having this problem recently, didn't use to do it though.
I think I found a fix if you're having this problem
find
PHP Code:
if ($daybits[0]!=$thisdate or ($resetmember==1 and $bbuserinfo['usergroupid']==6)) {
below that put
PHP Code:
$seed = rand();
then find
PHP Code:
$newmember=$DB_site->query_first("SELECT userid,username
FROM user
WHERE userid<>$daybits[1] AND (usergroupid=5
OR usergroupid=6
OR usergroupid=7
OR usergroupid=2)
ORDER BY RAND()
LIMIT 1");
replace with
PHP Code:
$newmember=$DB_site->query_first("SELECT userid,username
FROM user
WHERE userid<>$daybits[1] AND (usergroupid=5
OR usergroupid=6
OR usergroupid=7
OR usergroupid=2)
ORDER BY RAND($seed)
LIMIT 1");
Originally posted by mheinemann I think I found a fix if you're having this problem
Just changing RAND() to RAND(NOW()) will do the same thing with less code and you don't have to do the $seed= part of it. That's what NOW does automatically.
+-------------------------------------------------------------------------------------------------+
| In the "forumhome" template, replace this code: |
+-------------------------------------------------------------------------------------------------+
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername </a>
+-------------------------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------------------------+
| With this code: |
+-------------------------------------------------------------------------------------------------+
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername </a><br>
The $bbtitle member of the day is <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$memberoftheday[userid]">$memberoftheday[username]</a>
+-------------------------------------------------------------------------------------------------+
Quote:
Originally posted by suzannev Has anyone figured out how to allow for the member of the day's avatar to show and/or a link to their profile?
I am very new to this hacking thing, but I spent some time trying to do this myself, and I shocked myself! I added this to the boardstat.php hack so I could put it on a non-vb page. I hope I do not confuse anyone, but here is what I did and a screen shot. I am very pleased with the results.
in the boardstat.php file I added this to the end of the "member of the day stuff":
if ($memberoftheday[userid]!=0) {
$avatarurl2=getavatarurl($memberoftheday[userid]);
if ($avatarurl2=='') {
$avatarurl2='images/avatars/noavatar.gif' ;
}
$avatarimage2='<img src="http://www.cacfriends.com/shareacard/forums/upload/ '.$avatarurl2.'" border="0" height=38>';
}
And at the bottom of the page just before the ?> I placed this (right HTML output):
</td>
<td width=40% align=right>
<font size=1 face=verdana>Newest member <a href=\"http://www.cacfriends.com/shareacard/forums/upload /member.php?s=&action=getinfo&userid=$newuserid\">$ newusername</a><br>
<font size=1 face=verdana>Member of the day is: <font color=yellow><b>$memberoftheday[username]</font></b><br>
<font size=2 face=verdana><b><a href=\"http://www.cacfriends.com/shareacard/forums/upload /member.php?s=&action=getinfo&userid=$memberoftheda y[userid]\">$avatarimage2</b></a><br></td></table>";
WITH THE BLUE ITEMS NEEDING TO BE CHANGED TO YOUR SITE SPECS
Everything is working just fine, here is a link to the testpage I have it on: