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
  #212  
Old 05-26-2003, 02:40 PM
Djidane Tribal Djidane Tribal is offline
 
Join Date: May 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://foros.animeko.com.mx/memberofday" target="_blank">http://foros.animeko.com.mx/memberofday</a>[1].hack.php

What Happen !
Reply With Quote
  #213  
Old 06-19-2003, 06:45 PM
reismarktq2 reismarktq2 is offline
 
Join Date: Feb 2003
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm trying to figure out the code necessary to make the words "Member of the Day" appear in the postbit of the MOTD, and I'd appreciate a little help...

I know the code needs to go somewhere in showthread.php. I'm not sure exactly where in the file it should go, but at the very least, I know it needs to start with the same code that the index.php uses:
Code:
$getdaytemplate=$DB_site->query_first("SELECT template FROM template WHERE title='memberoftheday' AND templatesetid=-2");
$daytemplate=$getdaytemplate['template'];
$daybits=explode('||vb||',$daytemplate);
The next logical step from there would be an if statement that would run if $daybits[1] and the poster ID (what would the variable be?) matched up. That would be followed by a line establishing the variable $motd with the HTML code (properly slashed, of course) I want. Once that's done, then put $motd in the postbit template where I want it to go.

Can someone help make this vision work? I love the idea for the hack but I don't want to install it if I can't have this postbit thing... Boofo?
Reply With Quote
  #214  
Old 06-19-2003, 09:55 PM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're trying to make it so that when a member is Member of the Day, it says so in that member's postbit? That would be pretty cool.
Reply With Quote
  #215  
Old 06-24-2003, 07:27 PM
reismarktq2 reismarktq2 is offline
 
Join Date: Feb 2003
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured it out!

Click here to see...

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

How many queries will that add, though? Won't it add a query for each member?
Reply With Quote
  #217  
Old 06-24-2003, 08:43 PM
reismarktq2 reismarktq2 is offline
 
Join Date: Feb 2003
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ooo... yeah, you're right, Boofo. Is there some other way I can code it so that it'll only perform one query?
Reply With Quote
  #218  
Old 06-24-2003, 08:51 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not really sure how to pull this one off. Give me some time to see what I can come up with.
Reply With Quote
  #219  
Old 06-24-2003, 09:09 PM
reismarktq2 reismarktq2 is offline
 
Join Date: Feb 2003
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Never mind... I figured something out myself. Here's what I did... (This assumes you have it installed.)

1. Run the following query:
Quote:
ALTER TABLE user ADD motd SMALLINT(6) DEFAULT '0' NOT NULL;
2. Find this comment in index.php:
Quote:
/* This template is either outdated or the admin wants to reset it.
Either way, we need to choose a new member of the day. Aren't you excited?! */
Add directly below it:
Code:
$DB_site->query("UPDATE user SET motd='0' WHERE userid=$daybits[1]");
3. Still in index.php, find:
Code:
$DB_site->query("UPDATE template
                        SET template='".addslashes($newtemplate)."'
                      WHERE templatesetid=-2
                        AND title='memberoftheday'");
Add directly below it:
Code:
$DB_site->query("UPDATE user SET motd='1' WHERE userid=$newmember[userid]");
4. In admin/functions.php, find:
Code:
eval("\$post[profile] = \"".gettemplate("postbit_profile")."\";");
Add directly ABOVE it:
Code:
if ($post[motd]) {
$motd = "<smallfont><b>Member of the Day!</b></smallfont><br>";
}
5. Add $motd to your postbit template.

This not only adds two queries to the home page (which is not good, but better than 25+ more queries on each showthread page) but it allows the Member of the Day to be recorded as a variable in the user table. This might be useful if, say for instance, one wanted to have multiple Members of the Day for some reason.
Reply With Quote
  #220  
Old 06-24-2003, 09:15 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What? Now I'm interested in what I missed.
Reply With Quote
  #221  
Old 06-24-2003, 10:41 PM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work?
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 07:40 PM.


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.14324 seconds
  • Memory Usage 2,315KB
  • Queries Executed 27 (?)
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
  • (6)bbcode_code
  • (2)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
  • (3)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_postinfo_query
  • fetch_postinfo
  • 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