Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

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.

Comments
  #162  
Old 02-15-2003, 09:45 PM
SouledOut SouledOut is offline
 
Join Date: Nov 2002
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #163  
Old 02-18-2003, 01:52 PM
mheinemann's Avatar
mheinemann mheinemann is offline
 
Join Date: May 2002
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #164  
Old 02-19-2003, 09:07 PM
mheinemann's Avatar
mheinemann mheinemann is offline
 
Join Date: May 2002
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I found a fix if you're having this problem

find
PHP Code:
if ($daybits[0]!=$thisdate or ($resetmember==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"
); 
Reply With Quote
  #165  
Old 02-19-2003, 10:49 PM
Mike Gaidin's Avatar
Mike Gaidin Mike Gaidin is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll try that! Thanks!
Reply With Quote
  #166  
Old 02-19-2003, 10:57 PM
mheinemann's Avatar
mheinemann mheinemann is offline
 
Join Date: May 2002
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let me know if it works for you.
Reply With Quote
  #167  
Old 02-19-2003, 11:30 PM
Mike Gaidin's Avatar
Mike Gaidin Mike Gaidin is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, will do. It might take a few days to make sure it's not going to use the same two names.
Reply With Quote
  #168  
Old 02-19-2003, 11:36 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #169  
Old 02-19-2003, 11:42 PM
suzannev's Avatar
suzannev suzannev is offline
 
Join Date: Dec 2002
Location: Pennsylvania
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone figured out how to allow for the member of the day's avatar to show and/or a link to their profile?

Thanks.
Reply With Quote
  #170  
Old 02-20-2003, 12:53 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack provides a link to their profile.

Quote:
+-------------------------------------------------------------------------------------------------+
| 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?

Thanks.
Reply With Quote
  #171  
Old 02-20-2003, 01:52 PM
suzannev's Avatar
suzannev suzannev is offline
 
Join Date: Dec 2002
Location: Pennsylvania
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

My test page

and a screen shot too. I hope I didn't screw anyting else up, I guess time will tell. This is more fun then I thought
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:05 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09349 seconds
  • Memory Usage 2,333KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete