![]() |
Quote:
But I am learning my friend, jsut at a slow pace (lots of other stuff going on in life) I shall amaze you one day:) |
It looks like the Order by RAND() function is not available for mysql versions 3.22 or lower. Any way of getting the sql rewritten to work with 3.22? :)
Thanks Chris |
What version is your MySQL? I know that the ability to order by RAND() was only added in a certain version... I'll dig up see if I can find the older way to get a random row. :)
|
I'm running 3.22.32. I looked and the order by rand() does only seem to be available to 3.23 and up.
I am trying to talk myself into upgrading the mysql version, but I'm chicken. |
Ok my book tells me you should change the query to this:
PHP Code:
|
Works like a champ. Thanks.
Chris |
firefly?
|
Right, sorry. :)
Just change first line of code to this: Code:
$thisdate=date('W'); |
thanks gonna try this 1 out :)
|
How do you run a query? I am new at this, you lost me hehe
|
Yes, how do you run a query? :?:
Double bump this. :) |
Firefly, any way to put a little graphic or something on the MOTD user's post for the day? Something like the birthday hack.
ps...my users really like this. thanks. Chris |
Quote:
|
I installed this but it shows the same member everyday unless I do the reset thing myself. In other words it's not selecting a new member on it's own each day. Any ideas why?
|
Nevermind, I fixed my problem.
|
****bump****
|
Waaaaaay cool.
I just applied 'Who was online today' hack and merged that with the WOL box, I had one blank line left, and this just fit in perfectly! Fnx ;) |
Quote:
I've ran this for about a week now and it's never changed the member of the day. Any reason why it isn't automatically changing daily? |
What version of MySQL are you using?
|
I get this:
Database error in vBulletin 2.2.1: Invalid SQL: SELECT userid,username FROM user WHERE userid<> 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 'AND (usergroupid=5 OR usergroupid=6 ' at line 4 mysql error number: 1064 Date: Sunday 24th of February 2002 03:53:22 PM Script: http://www.gb-mod.net/forums/forums/index.php? Referer: http://www.gb-mod.net/forums/admin/i...hp?action=head And how Do I query that first line? |
By chance did you try the query that FireFly gave me?
PHP Code:
FireFly, any thoughts about my last question? ie....use an image on the MOTD's posts. Something like the birthday hack? Chris |
I would try but how do i run a query?
|
|
DO you have an example of forum has this hacks work on?
|
This forum.
|
sounds like a cool hack. i ran the db queery and modified the index.php then added the code to forumhome template...but i do not see member of the day :(
verion 2.2.2. any idea's on what i should try fellas? Thanx |
umm...DUH!! i swear my own eyes deceive me sometimes. i got it working by following the very easy directions and its working great. thanx again for another cool hack guys.
|
Quote:
|
Quote:
Chen, any idea on how to get the time feature to work with that mysql you gave me? I played with it a bit and couldn't figure it out. Thanks Chris |
What went wrong cditty?
ForKmaN and neal, run the query I gave in the hack instructions. |
I don't know. It's weird. I figured it musta had something to do with the customized sql that you had to give me. Every time I tried it, I got an invalid sql command.
I also just sent you a pm.... Chris |
I have done so, and I still get the error
|
works for me now :)
|
Any ideas on mine FireFly?
Chris |
What's the error you are gettting, Chris?
|
This is the error that I am getting.
[code] Database error in vBulletin 2.2.1: Invalid SQL: -1209600 AND (usergroupid=5 OR usergroupid=6 OR usergroupid=7 OR usergroupid=9 OR usergroupid=10 OR usergroupid=2) ORDER BY randNum LIMIT 1 mysql error: mysql error number: Date: Thursday 07th of March 2002 06:46:03 AM [\code] This is the code as I have it in my index.php3 file. Code:
$newmember=$DB_site->query_first("SELECT userid,username,userid*0+RAND() AS randNum Chris |
I just got it going. I simply replaced the "s with 's. Seems to work like a charm.
Thanks again. Chris |
Thanks, my members love this hack, just need to change it so that the use must still be active on the forum.
|
Quote:
|
try using single quotes instead of double. That was my problem.
Chris |
All times are GMT. The time now is 04:17 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|