The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
showthread_query hook sql
PHP Code:
As well I would like to setup the query to also not pick the row in the banners table that matches the vistor's userid (so users do not see their own banners being displayed). |
#2
|
|||
|
|||
$vbulletin->userinfo['lastpost']
should give you that info |
#3
|
|||
|
|||
Quote:
|
#4
|
||||
|
||||
PHP Code:
|
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
Quote:
|
#7
|
|||
|
|||
Yea, but if you take a look at the code in my first post you'll see that I don't need to find out if the current visitor of the page has posted in the last 24 hours. Rather I need to find out if the random user that is generated has posted in the last 24 hours.
Basically my code is a random banner rotator built into vbulletin. I want to change my code which uses sql (in my first post) to randomly pick out a userid from the database so that it randomly picks one out that has posted within the last 24 hours. Sorry if I'm wrong and just having a brain fart. |
#8
|
|||
|
|||
Does anyone have any further comments or suggestions? I need this addition to my mod please.
|
#9
|
||||
|
||||
[SQL]SELECT userid FROM user WHERE lastpost > UNIX_TIMESTAMP(NOW())-86400 ORDER BY RAND() LIMIT 1[/sql]
If that is what you want |
#10
|
|||
|
|||
Quote:
Is there a way to do this? Maybe having a query store all members that have posted within the last 24 hours in an array or something. Then another query pick 1 by random (according to calls from the query in my first post) from the array. Basically I need to combine these two sql queries together: [sql]SELECT userid FROM " . TABLE_PREFIX . "user WHERE lastpost > UNIX_TIMESTAMP(NOW())-86400 ORDER BY RAND() LIMIT 1[/sql] [sql]SELECT userid, title, ext, width, height FROM " . TABLE_PREFIX . "banners WHERE status = 'active' AND available >= 1 ORDER BY RAND() LIMIT 1[/sql] |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|