vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Member of the Day! (https://vborg.vbsupport.ru/showthread.php?t=34779)

Admin 02-03-2002 10:00 PM

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. :D
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. :D

Admin 02-04-2002 04:32 PM

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? :)

Lesane 02-04-2002 04:54 PM

Very nice, well done. :up:

Matt 02-04-2002 05:38 PM

Great hack! Thanks mate :D

Bald Bouncer 02-04-2002 05:45 PM

very good! easy install and worked a charm!!

Dade 02-04-2002 06:25 PM

Awesome Chen, I'll put this up on my forums when I get a few more members! :)

afterlab 02-04-2002 08:54 PM

Nice hack, I'm using it on my Forums. :D

Lionel 02-04-2002 08:58 PM

I just installed and my first member of the day is someone who has not visited yet...

Freddie Bingham 02-04-2002 09:40 PM

Sounds suspiciously like how birthdays work ;)

Psychdrone 02-04-2002 11:34 PM

another wonderful release!


All times are GMT. The time now is 03:11 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01302 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete