The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
top poster during certain period of time
I'm trying to run my forum's promotion and in need to get top most poster during April.
I started to look at db structure and attempted to use "post" table, but "dateline" column is mystery to me.. Could anyone explain how dateline columns works? Is it possible to pick the most top poster during Aprial per say in vb? Thanks! |
#2
|
|||
|
|||
I'd be interested in knowing how to see this too, I was a fool and ran a 2 wk giveaway but I dont know how to tell now
|
#3
|
|||
|
|||
I think this should work:
Code:
SELECT username, COUNT(*) as count FROM prefix_post WHERE dateline BETWEEN UNIX_TIMESTAMP(YYYYMMDD) AND UNIX_TIMESTAMP(YYYYMMDD) AND visible = 1 GROUP BY userid ORDER BY count DESC (of course you have to insert your own table prefix, and the dates you want in place of the YYYYMMDD) ETA: ...and you probably need "AND visible = 1" in there to eliminate deleted posts (so I went ahead and added it). |
#4
|
|||
|
|||
Hmm I am a bit of a noob, what do I do exactly lol sorry, do I go into phpmyadmin and execute that and then for dates put in the date period?
|
#5
|
|||
|
|||
Right. If you have a table prefix you'd add it in place of prefix_ (if you don't know already, it should be obvious by looking at the table names in your db), then change the two YYMMDD's to real dates, so if you were interested in the first two weeks of Dec. they'd be 20101201 and 20101214.
|
#6
|
|||
|
|||
thanks I'll give it a try, rly appreciate it
--------------- Added [DATE]1293468430[/DATE] at [TIME]1293468430[/TIME] --------------- prefix_post should be prefix_table names? hmmm what is this though for user sor forum? Ill pull it up and see if ic an tell --------------- Added [DATE]1293468639[/DATE] at [TIME]1293468639[/TIME] --------------- Hmm prefix_post so prefix is that like _forum db name or whatever? or is it forum DB NAME_post |
#7
|
|||
|
|||
Sorry. The name of the table is 'post' but if you have a TABLE_PREFIX defined in includes/config.php, then that gets added to the beginning of the name. So, you can either look at includes/config.php, or if you can use phpmyadmin to list the tables in your database you should see that, if you have a prefix defined, they all begin with the same thing.
It's possible you don't have a prefix defined, in which case you'd just use 'post' as the table name. I guess if you're confused about this then you probably don't have a prefix, so just try 'post' and see if that works. |
#8
|
|||
|
|||
OK I will check the file not sure I have a prefix defined what does prefix mean?
--------------- Added [DATE]1293469091[/DATE] at [TIME]1293469091[/TIME] --------------- // ****** TABLE PREFIX ****** // Prefix that your vBulletin tables have in the database. $config['Database']['tableprefix'] = ''; So its default? --------------- Added [DATE]1293469132[/DATE] at [TIME]1293469132[/TIME] --------------- so it should be prefix_post? sorry thanks |
#9
|
|||
|
|||
Prefix just means a string that is at the beginning. I think it's so you can have multiple vBulletin installations (or vbulletin and something else) in the same database without worrying about the table names being the same.
Like I said above, if it's not obvious what I mean from lookig at the list of tables in your database, then you probably just need to use 'post'. --------------- Added [DATE]1293469271[/DATE] at [TIME]1293469271[/TIME] --------------- no, just post. Forget all about the prefix stuff, just use this: Code:
SELECT username, COUNT(*) as count FROM post WHERE dateline BETWEEN UNIX_TIMESTAMP(YYYYMMDD) AND UNIX_TIMESTAMP(YYYYMMDD) AND visible = 1 GROUP BY userid ORDER BY count DESC |
#10
|
|||
|
|||
thank you im going to try it!
--------------- Added [DATE]1293470357[/DATE] at [TIME]1293470357[/TIME] --------------- You are awesome!!!! Thank you so so so so so so so so very much, this worked wonderfully! Repped oops dont know how to give reps here but I would |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|