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
  #2  
Old 02-04-2002, 04:32 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 02-04-2002, 04:54 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice, well done. :up:
Reply With Quote
  #4  
Old 02-04-2002, 05:38 PM
Matt's Avatar
Matt Matt is offline
 
Join Date: Oct 2001
Location: UK
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack! Thanks mate
Reply With Quote
  #5  
Old 02-04-2002, 05:45 PM
Bald Bouncer's Avatar
Bald Bouncer Bald Bouncer is offline
 
Join Date: Oct 2001
Location: UK
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very good! easy install and worked a charm!!
Reply With Quote
  #6  
Old 02-04-2002, 06:25 PM
Dade's Avatar
Dade Dade is offline
 
Join Date: Jan 2002
Location: California
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome Chen, I'll put this up on my forums when I get a few more members!
Reply With Quote
  #7  
Old 02-04-2002, 08:54 PM
afterlab's Avatar
afterlab afterlab is offline
 
Join Date: Oct 2001
Location: Dallas, TX
Posts: 327
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack, I'm using it on my Forums.
Reply With Quote
  #8  
Old 02-04-2002, 08:58 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just installed and my first member of the day is someone who has not visited yet...
Reply With Quote
  #9  
Old 02-04-2002, 09:40 PM
Freddie Bingham's Avatar
Freddie Bingham Freddie Bingham is offline
 
Join Date: Oct 2001
Posts: 506
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds suspiciously like how birthdays work
Reply With Quote
  #10  
Old 02-04-2002, 11:34 PM
Psychdrone Psychdrone is offline
 
Join Date: Nov 2001
Posts: 525
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

another wonderful release!
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 03:43 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.04603 seconds
  • Memory Usage 2,289KB
  • Queries Executed 23 (?)
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)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
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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