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)

NexDog 08-09-2002 01:52 PM

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.

Boofo 08-09-2002 02:13 PM

Did you run the needed query in the database and insert the code into the index.php?

NexDog 08-09-2002 02:20 PM

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.

Boofo 08-09-2002 02:22 PM

[sql]INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,-2,'memberoftheday','0||vb||0||vb||0');[/sql]

NexDog 08-09-2002 02:34 PM

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']; 


Boofo 08-09-2002 02:41 PM

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 


NexDog 08-10-2002 07:20 AM

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

Boofo 08-10-2002 07:42 AM

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

proxyMX 08-11-2002 01:37 PM

cant use this, i used Vbindex,

NexDog 08-12-2002 11:21 AM

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

TIA


All times are GMT. The time now is 07:18 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.01444 seconds
  • Memory Usage 1,778KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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