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

NexDog 08-13-2002 06:28 AM

I tried to change the wording on the Member of the day to Member of the Moment (because it seems to picking a new member whenever it wants, lol).

I changed it to:

Quote:

// end of member of the day stuff";i:11;s:9:"forumhome";i:12;s:94:"<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername </a>";i:13;s:253:"<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername </a><br>
The HN Forums Member of the Moment is <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$memberoftheday[userid]">$memberoftheday[username]</a>";i:14;s:114:"INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,-2,'memberoftheday','0||vb||0||vb||0')";}
And uploaded it. But it didn't change on the index page as you can see........

Boofo 08-13-2002 07:30 AM

For the Quick Reply Box, You have mixed up the code for the showthread.php and the code for the showthread_replybox template. Start over and take what you have out of the showthread_replybox and put in the right code for it and then upload the showthtread.php that I fixed for you and it should work fine.

NexDog 08-13-2002 08:43 AM

That's just the problem. Firefly's instruction's said:
Quote:

2. Create a new template, with the name "showthread_replybox": // ##################################################
And that was it! Nothing else as next was the info about number 3 which involved $pagenav. What am I missing?

Sorry to be a pain. :(

Boofo 08-13-2002 09:18 AM

Clear your cache and re-download the instructions in the first post of that thread. It is all there. I checked it.

NexDog 08-13-2002 10:00 AM

Dude, I ain't tripping. Look at what I'm seeing. There are no instructions other than to create the template itself. Then there's an image of the box. Is the html transforming into an image especially for me?

Boofo 08-13-2002 10:20 AM

What are you viewing that in?

NexDog 08-13-2002 11:25 AM

I'm not viewing it in anything. I'm just hitting FireFly's .txt link in his first post and that's what I get. And it isn't just FireFly's either. I'm getting on a few others/

Tell me I'm not crazy! I'm new to hacking vB but not to php and the concept of hacking in general. ;)

NexDog 08-14-2002 03:08 AM

Shameless bump. I know I'm asking about this in the wrong thread but that's just the way it turned out. :)

Boofo 08-14-2002 03:21 AM

Just download the text file and follow the instructions in it and you can't go wrong.

Quote:

Originally posted by NexDog
Shameless bump. I know I'm asking about this in the wrong thread but that's just the way it turned out. :)

NexDog 08-15-2002 05:24 AM

Okay, got that working after someone showed me what FireFly's text doc really looks like. Have no idea why I can't see these files properly.

Also got this hack working the way I want too.

Install has been clicked. :)

Now to find that active users today hack, wher the hell was that.......

NexDog 08-15-2002 05:49 AM

Double post. :tired:

NexDog 08-16-2002 06:38 AM

Quote:

Originally posted by FireFly
Replace:
Code:

                                      WHERE userid<>$daybits[1]
with:
Code:

                                      WHERE userid<>$daybits[1] AND lastactivity>".time()-(86400*14)."
(14 is the number of days)

By the way, I'm not sure myself whether it's lastactivity or lastvisit we need to check, so I'm open for corrections here. :)

Well, that produced this:

Code:

Database error in vBulletin 2.2.6:

Invalid SQL: -1209600
                                        AND (usergroupid=5
                                          OR usergroupid=6
                                          OR usergroupid=7
                                          OR usergroupid=2)
                                      ORDER BY RAND()
                                      LIMIT 1
mysql error: You have an error in your SQL syntax near '-1209600
                                        AND (usergroupid=5
          ' at line 1

mysql error number: 1064

Date: Friday 16th of August 2002 05:47:34 AM
Script: http://www.hostnexus.com/forum/forum/
Referer:

So I just used the minimum posts requirement instead of last activity....

Boofo 08-16-2002 06:42 AM

Did you try lastvisit?

Quote:

Originally posted by NexDog


Well, that produced this:

Code:

Database error in vBulletin 2.2.6:

Invalid SQL: -1209600
                                        AND (usergroupid=5
                                          OR usergroupid=6
                                          OR usergroupid=7
                                          OR usergroupid=2)
                                      ORDER BY RAND()
                                      LIMIT 1
mysql error: You have an error in your SQL syntax near '-1209600
                                        AND (usergroupid=5
          ' at line 1

mysql error number: 1064

Date: Friday 16th of August 2002 05:47:34 AM
Script: http://www.hostnexus.com/forum/forum/
Referer:

So I just used the minimum posts requirement instead of last activity....


NexDog 08-16-2002 06:44 AM

Not a happy chappie though. ;)

Hack still rocks Chen. To chose an active member from the last 14 days is much better. What is wrong with the syntax in this statement:

Code:

WHERE userid<>$daybits[1] AND lastactivity>".time()-(86400*14)."
???

Boofo 08-16-2002 06:47 AM

Try this and let me know what happens:

Code:

WHERE userid<>$daybits[1] AND lastvisit>".time()-(86400*14)."
Quote:

Originally posted by NexDog
Not a happy chappie though. ;)

Hack still rocks Chen. To chose an active member from the last 14 days is much better. What is wrong with the syntax in this statement:

Code:

WHERE userid<>$daybits[1] AND lastactivity>".time()-(86400*14)."
???


NexDog 08-16-2002 07:08 AM

You mean:
Code:

WHERE userid<>$daybits[1] AND lastvisit>".time()-(86400*14)."
I'm not to keen as it took a while to identify the problem.....

NexDog 08-16-2002 07:10 AM

Ooops, didn't see that post, dude. You want to try it?

Boofo 08-16-2002 07:11 AM

Yes. Did you try it yet? :)

Quote:

Originally posted by NexDog
You mean:
Code:

WHERE userid<>$daybits[1] AND lastvisit>".time()-(86400*14)."
I'm not to keen as it took a while to identify the problem.....


NexDog 08-16-2002 07:15 AM

You won't know until the a new day and a visitor triggers the MOTD query. That's 18 hours for me.

Boofo 08-16-2002 07:20 AM

But did you get an error with that like you did with the other code?

Quote:

Originally posted by NexDog
You won't know until the a new day and a visitor triggers the MOTD query. That's 18 hours for me.

NexDog 08-16-2002 07:24 AM

No errors on FireFly's original code. I won't know if this will bomb until the next day......

NexDog 08-19-2002 06:16 AM

Help!

I used:

Code:

WHERE userid<>$daybits[1] AND posts>99
And the same member has been selected 2 days out of 3!!!

Is there a fix?

NexDog 08-22-2002 01:52 PM

When using:
Code:

WHERE userid<>$daybits[1] AND lastvisit>".time()-(86400*14)."
I get:
Quote:

Fatal error: Call to undefined function: phperror_reporting() in /var/www/vhosts/hostnexus.com/httpdocs/forum/index.php on line 1

a43079 09-21-2002 10:18 AM

does this work with 2.2.7

DarkDraco07 10-16-2002 05:19 AM

problem on newer forums i think. when i enter the query into my database it doesnt save. like, usually if i enter a query twice it says that there is a duplicate column but not for the query here. when i have the hack installed i get an sql error because of this. it there an alternative query to run?

DarkDraco07 10-27-2002 04:15 PM

can anyone help?

javogevp 11-23-2002 02:50 AM

hey dude!
do u know if this hack may be modified for giving some credits for "the LesaneĀ“s Store Hack". But if the guy dosnt log in i that day where he was selected for the member of the day he dost win ay money???
please help, i dunno much about programing

PsyBlast 12-15-2002 09:01 PM

whenever I upload the file to the admin folder and run vbhacker.php it doesnt come up, I have refreshed it about 20 times, I have the newest version of vbhacker also.

Mike Gaidin 01-25-2003 04:08 AM

I installed this but it only shows the same two people every other day. I used the text file provided by vbhacker to install it. Are there known issues with this?

Mike Gaidin 01-25-2003 04:08 AM

I installed this but it only shows the same two people every other day. I used the text file provided by vbhacker to install it. Are there known issues with this?


All times are GMT. The time now is 04:27 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.01539 seconds
  • Memory Usage 1,872KB
  • 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
  • (11)bbcode_code_printable
  • (3)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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