Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

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
  #122  
Old 08-09-2002, 01:52 PM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It was working before. Then I started to play with it to get it to recognise active members as the first member it picked hadn't posted in months. I did a few steps in vbhacker and screwed it.
Reply With Quote
  #123  
Old 08-09-2002, 02:13 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you run the needed query in the database and insert the code into the index.php?
Reply With Quote
  #124  
Old 08-09-2002, 02:20 PM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I screwed the query by running it again or something

If someone could give me the pure query, I'll run it again in phpmyadmin.
Reply With Quote
  #125  
Old 08-09-2002, 02:22 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[sql]INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,-2,'memberoftheday','0||vb||0||vb||0');[/sql]
Reply With Quote
  #126  
Old 08-09-2002, 02:34 PM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ran the query, no joy. I'm sure I'm missing some code. from my index.php:

PHP Code:
require('./global.php');

$permissions=getpermissions();
if (!
$permissions['canview']) {
    
show_nopermission();
}

//check usergroup of user to see if they can use PMs
//$permissions=getpermissions($forumid);
if ($enablepms==and $permissions['canusepm'] and $bbuserinfo['receivepm']) {
  
$ignoreusers="";
  if (
trim($bbuserinfo['ignorelist'])!="") {
    
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' 'trim($bbuserinfo['ignorelist'])));
  }

  
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
  
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
  
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");

  if (
$newpm['messages']==0) {
    
$lightbulb='off';
  } else {
    
$lightbulb='on';
  }
  eval(
"\$pminfo = \"".gettemplate('forumhome_pmloggedin')."\";");

} else {
  
$pminfo='';
}

$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);

// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);

// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid']; 
Reply With Quote
  #127  
Old 08-09-2002, 02:41 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's your problem. You don't have the needed code for this hack installed.

You need to replace this:

PHP Code:
$permissions=getpermissions();
if (!
$permissions['canview']) {
    
show_nopermission();

with this:

PHP Code:
$permissions=getpermissions();
if (!
$permissions['canview']) {
    
show_nopermission();
}

// start member of the day stuff
$thisdate=date('Y-m-d');
$getdaytemplate=$DB_site->query_first("SELECT template
                                         FROM template
                                        WHERE title='memberoftheday'
                                          AND templatesetid=-2"
);
$daytemplate=$getdaytemplate['template'];
$daybits=explode('||vb||',$daytemplate);
if (
$daybits[0]!=$thisdate or ($resetmember==and $bbuserinfo['usergroupid']==6)) {
/* 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?! */
    
$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"
);
    
$newtemplate=$thisdate.'||vb||'.$newmember['userid'].'||vb||'.$newmember['username'];
    
$DB_site->query("UPDATE template
                        SET template='"
.addslashes($newtemplate)."'
                      WHERE templatesetid=-2
                        AND title='memberoftheday'"
);
    
$memberoftheday['userid']=$newmember['userid'];
    
$memberoftheday['username']=$newmember['username'];
} else {
    
$memberoftheday['userid']=$daybits[1];
    
$memberoftheday['username']=$daybits[2];
}
// end of member of the day stuff 
Reply With Quote
  #128  
Old 08-10-2002, 07:20 AM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, it works! One down about 5 to go. On to the stats panel now. Thanks man, your help has been really appreciated. Any more ideas on the quick reply box? I PMed ya....
Reply With Quote
  #129  
Old 08-10-2002, 07:42 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I PMd you the fix for that earlier. You had your showthtread.php code in the showthread_replybox template. Delete that code and put in the code I PMd you for the showthread_replybox, upload the showthread.php I fixed for you and it will work.

Quote:
Originally posted by NexDog
Yea, it works! One down about 5 to go. On to the stats panel now. Thanks man, your help has been really appreciated. Any more ideas on the quick reply box? I PMed ya....
Reply With Quote
  #130  
Old 08-11-2002, 01:37 PM
proxyMX's Avatar
proxyMX proxyMX is offline
 
Join Date: Jun 2002
Location: Seven of Nine is hot! :do
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cant use this, i used Vbindex,
Reply With Quote
  #131  
Old 08-12-2002, 11:21 AM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo, didn't get that PM for some obscure reason. If you could, please send again as I'm killing myself over this....

TIA
Reply With Quote
Reply

Thread Tools

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 06:16 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.05265 seconds
  • Memory Usage 2,344KB
  • 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
  • (3)bbcode_php
  • (1)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