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)

SouledOut 02-15-2003 09:45 PM

ok, now I'm running into some problems, lol. I don't have the MySQL access to the directory, so it's a coding problem (vBHacker added the query correctly, I wish all hacks where like this) anyway, it tells me it can't find
Code:

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

yet its on line 10 of index.php on vb2.2.8. I chose not to modify templates, because they use a modded design, and layout wise it belongs in the header. Anyway, I've done everything I'm supposed to, but vBHacker still won't reconize the changes! I found the only instance of the code, and added the code after ('require global.php') and no, the varible part isn't there twice. I just either A) want to get this thing working, or B) get vBHacker to work right. I'll try deleting the .hack.php file to get vBhacker to work again, and add the template manually and see what happens. Since everything is // ed out, I don't think it'll effect index.php.

mheinemann 02-18-2003 01:52 PM

Quote:

Originally posted by J-OST
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?
I've been having this problem recently, didn't use to do it though.

mheinemann 02-19-2003 09:07 PM

I think I found a fix if you're having this problem

find
PHP Code:

if ($daybits[0]!=$thisdate or ($resetmember==and $bbuserinfo['usergroupid']==6)) { 

below that put
PHP Code:

$seed rand(); 

then find
PHP Code:

$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"
); 

replace with
PHP Code:

$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(
$seed)
                                       LIMIT 1"
); 


Mike Gaidin 02-19-2003 10:49 PM

I'll try that! Thanks!

mheinemann 02-19-2003 10:57 PM

Let me know if it works for you.

Mike Gaidin 02-19-2003 11:30 PM

Ok, will do. It might take a few days to make sure it's not going to use the same two names.

Boofo 02-19-2003 11:36 PM

Quote:

Originally posted by mheinemann
I think I found a fix if you're having this problem


Just changing RAND() to RAND(NOW()) will do the same thing with less code and you don't have to do the $seed= part of it. That's what NOW does automatically. :)

suzannev 02-19-2003 11:42 PM

Has anyone figured out how to allow for the member of the day's avatar to show and/or a link to their profile?

Thanks.

Boofo 02-20-2003 12:53 AM

This hack provides a link to their profile. :)

Quote:

+-------------------------------------------------------------------------------------------------+
| In the "forumhome" template, replace this code: |
+-------------------------------------------------------------------------------------------------+
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername </a>
+-------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------------+
| With this code: |
+-------------------------------------------------------------------------------------------------+
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername </a><br>
The $bbtitle member of the day is <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$memberoftheday[userid]">$memberoftheday[username]</a>
+-------------------------------------------------------------------------------------------------+
Quote:

Originally posted by suzannev
Has anyone figured out how to allow for the member of the day's avatar to show and/or a link to their profile?

Thanks.


suzannev 02-20-2003 01:52 PM

I am very new to this hacking thing, but I spent some time trying to do this myself, and I shocked myself! I added this to the boardstat.php hack so I could put it on a non-vb page. I hope I do not confuse anyone, but here is what I did and a screen shot. I am very pleased with the results.

in the boardstat.php file I added this to the end of the "member of the day stuff":

if ($memberoftheday[userid]!=0) {
$avatarurl2=getavatarurl($memberoftheday[userid]);
if ($avatarurl2=='') {
$avatarurl2='images/avatars/noavatar.gif' ;
}
$avatarimage2='<img src="http://www.cacfriends.com/shareacard/forums/upload/ '.$avatarurl2.'" border="0" height=38>';
}

And at the bottom of the page just before the ?> I placed this (right HTML output):

</td>
<td width=40% align=right>
<font size=1 face=verdana>Newest member <a href=\"http://www.cacfriends.com/shareacard/forums/upload /member.php?s=&action=getinfo&userid=$newuserid\">$ newusername</a><br>
<font size=1 face=verdana>Member of the day is: <font color=yellow><b>$memberoftheday[username]</font></b><br>
<font size=2 face=verdana><b><a href=\"http://www.cacfriends.com/shareacard/forums/upload /member.php?s=&action=getinfo&userid=$memberoftheda y[userid]\">$avatarimage2</b></a><br></td></table>";

WITH THE BLUE ITEMS NEEDING TO BE CHANGED TO YOUR SITE SPECS

Everything is working just fine, here is a link to the testpage I have it on:

My test page

and a screen shot too. I hope I didn't screw anyting else up, I guess time will tell. This is more fun then I thought :D

Boofo 02-20-2003 01:59 PM

Good job! Looks great!

BTW, what is the "boardstat.php hack"? I must have missed that one. :)

suzannev 02-20-2003 02:07 PM

Here is the link:

Boardstat link

Your signature sounds like me at the mall with my kids, I tell my 2 sons (13 and 10) not to walk with me, I don't want anyone to think I am that old. :eek:

Boofo 02-20-2003 02:20 PM

Thank you for the link. ;)

Congratulations on surviving teenagers. :) I have a 5 year old and 3 months old twins (all boys) and 2 grown boys (21 and 22) and I'm not sure I'll survive it all. I think that's why I adopted the signature. :) (But I wouldn't trade any of them for the world).

mheinemann 02-21-2003 07:40 PM

Quote:

Originally posted by Boofo


Just changing RAND() to RAND(NOW()) will do the same thing with less code and you don't have to do the $seed= part of it. That's what NOW does automatically. :)

Thanks for the tip. :)

Mike Gaidin 02-21-2003 07:50 PM

Quote:

Originally posted by mheinemann
Let me know if it works for you.
Looks like it works fine. Thanks for the help. :)

Boofo 02-21-2003 08:05 PM

Quote:

Originally posted by mheinemann


Thanks for the tip. :)

You're very welcome. ;) I found this tip at the mysql site and it seems to make a difference.

Rose 03-06-2003 04:11 PM

:) Thanks Firefly for the hack. And many thanks to Boofo whose previous posts (see page nine) have helped get it working for me.

[high]* Rose pounces on install[/high]

Rose 03-06-2003 08:34 PM

Outta curiosity - If I wanted to limit the usergroups that are eligible for the Member of the Day, I'd simply plug in the appropriate numbers as shown below, right? I mean, the below will pull members from usergroups 5,6,7, & 2, right?

PHP Code:

    $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"
); 


Boofo 03-06-2003 08:48 PM

Yes. ;)

Rose 03-06-2003 08:53 PM

:) I knew you'd be to my rescue. Thanks, Boofo!

Boofo 03-06-2003 09:23 PM

You're very welcome. ;)

Rose 03-08-2003 03:53 PM

I'm having the "member shows up repeatedly 2/3 times" problem and have applied mheinemann and boofo's update to this. But will this limit the number of times a member can be chosen ina specific set of time?

For instance, I do not want the same member of the day more than one time every XX days (thirty, preferably), but I do not want the member's activity level to be a qualifying factor. For ever member of the day who catches themself as the "motd", I will give them a free Sunday Brunch to our restaurant. This is why I don't want the same member showing up but once a month, basically.

I've read through the thread and haven't found a solution for this. Any takers?

Boofo 03-08-2003 04:59 PM

Ok, try this:

Change:

PHP Code:

WHERE userid<>$daybits[1

to:

PHP Code:

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


Rose 03-08-2003 05:36 PM

Thanks, Boofo.
I'm not sure if it works (as it's hard to test, obviously), but I have faith in your code and it gives me no errors. :)

This makes it so that a member can only be MOTD once every 30 days, regardless of activity and such.

Thanks again!

Boofo 03-08-2003 05:48 PM

Keep an eye on it a couple of days and let me know how it goes. I changed it on my site and will also keep an eye on it, although I don't have very many members. It should work fine, though. ;)

It goes by the last site visit so activity should have nothing to do with it.

Rose 03-08-2003 05:50 PM

Quote:

Originally posted by Boofo
Keep an eye on it a couple of days and let me know how it goes. I changed it on my site and will also keep an eye on it, although I don't have very many members. It should work fine, though. ;)
*hehe* Aye aye! I'll keep an eye on it. I don't have many members, either. In all usergroups, I have approximately 125 members and I've limited the "MOTD" to only two usergroups (approximately 106 so far) - so I'm quite small as well. :D

Boofo 03-08-2003 06:06 PM

I mainly use my site for installing and playing with hacks. Kind of a learning center, I guess. I have about 25 users and most of them only show up once in a while. ;)

Zachery 03-08-2003 06:14 PM

.

Rose 03-09-2003 03:17 AM

Ummm, yeah. Boofo? The fix we tried comes up with a great big ol' db error when resetting. :) Try again? Or is it the "rand now" fix I tried? :S

Quote:

Database error in vBulletin 2.2.8:

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

mysql error number: 1064

Date: Sunday 09th of March 2003 12:13:48 AM
Script: http://mysite/forum/
Referer:
[high]* Rose goes to restore.[/high]

Boofo 03-09-2003 09:30 AM

Sorry about that. That isn't going to work. I got the same error. I will dig into the code a little more and get a fix for you shortly. ;)

Kars10 03-09-2003 10:42 AM

I use this hack.
Very cool. But i think i would be much better if it takes only users with min. 1 Post...
Zeroposters are not so good. ;)

mheinemann 03-09-2003 12:47 PM

Quote:

Originally posted by Kars10
I use this hack.
Very cool. But i think i would be much better if it takes only users with min. 1 Post...
Zeroposters are not so good. ;)

https://vborg.vbsupport.ru/showthrea...606#post218606

Kars10 03-09-2003 01:31 PM

Cool thanks Mheinemann! ;)

Rose 03-11-2003 02:00 PM

*hehe* No problems, Boofo. In fact, I've taken out the "fix" from page 9 and now have just the original code, I do believe. It seems to be working fine and hasn't had but one duplicate member in five days. But, I am still interested in the "limit it to once every thirty days" modification if you get to it. :) No worries.

Boofo 03-12-2003 10:32 AM

Ok, Rose, I think I have it now. I tested it and it does not give any errors. Also, this should do the trick for the "limit it to once every thirty days" you asked for. Thanks goes out to Xenon for correcting my missing brackets mistake. ;) Here is the code I use. You can adjust it for whatever you use. I don't have the Admins names show up and the user has to have at least one post to their credit to be picked. Let me know if it does the trick for you.

PHP Code:

    $newmember=$DB_site->query_first("SELECT userid,username
                                        FROM user
                                       WHERE userid<>
$daybits[1]
                                         AND posts>1
                                         AND lastactivity>'.(
$lastposttime[dateline]-(86400*30)).'
                                         AND (usergroupid=5
                                          OR usergroupid=7
                                          OR usergroupid=2)
                                       ORDER BY RAND(NOW())
                                       LIMIT 1"
); 

By the way, the RAND(NOW()) just makes it more random than RAND() does. It seeds it. ;)

Rose 03-12-2003 01:05 PM

:D Sweet. Thanks, Boofo. Even more random than random? Can't beat that! *lol*

[high]* Rose installs fix, edits as needed, and is mucho greatful[/high]

Boofo 03-12-2003 01:14 PM

Rose, you don't need to install the fix with this code I gave you. The $seed part is not necessary with the RAND(NOW()), the way I have it in the code. That takes care of the seed already. If you just install the code (no fix) the way it is and adjust the lines to who you want to include or exclude, that will be all you need to do. With the newer versions of mySQL, they need a seed or otherwise you get a randomizing that is close to the last one. The seed allows for a more random randomizing. Does that make any sense? ;) Anyway, enjoy and let me know if the 30 days feature is working ok. And you're very welcome. ;)

Rose 03-12-2003 02:52 PM

Quote:

Originally posted by Boofo
Rose, you don't need to install the fix with this code I gave you. The $seed part is not necessary with the RAND(NOW()), the way I have it in the code. That takes care of the seed already. If you just install the code (no fix) the way it is and adjust the lines to who you want to include or exclude, that will be all you need to do. With the newer versions of mySQL, they need a seed or otherwise you get a randomizing that is close to the last one. The seed allows for a more random randomizing. Does that make any sense? ;) Anyway, enjoy and let me know if the 30 days feature is working ok. And you're very welcome. ;)

;) Makes enough sense to go over me little head. :D When I said "fix", I meant I changed the chunk of code as you posted previous to mine. I don't mean I went back in the thread and installed any of the rest of it. Just your most recent update. :D Sorry if I mislead/misunderstood.

[high]* Rose sings "It's a small world"
[/high]

That was random. Thanks again and I'll be sure to keep an eye on it and let you know how things go. So far I've had seven MOTD's and not a single one awarded a free Sunday Brunch. :(

Boofo 03-12-2003 03:04 PM

So I guess there's an extra free Sunday Brunch now that needs a home? ;)

raptor260 03-13-2003 12:35 PM

I have Vbulletin 2.2.9, It shows the member of the day, but it never changes. It show the same member all the time every time.

What could my problem be.

http://www.byuboyz.com


All times are GMT. The time now is 03:41 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.01669 seconds
  • Memory Usage 1,867KB
  • 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)bbcode_code_printable
  • (8)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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