vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   top poster during certain period of time (https://vborg.vbsupport.ru/showthread.php?t=79075)

shinstudio 03-30-2005 04:03 PM

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!

lycheepassion 12-27-2010 02:03 PM

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

kh99 12-27-2010 02:33 PM

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).

lycheepassion 12-27-2010 02:41 PM

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?

kh99 12-27-2010 02:44 PM

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.

lycheepassion 12-27-2010 02:45 PM

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

kh99 12-27-2010 02:53 PM

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.

lycheepassion 12-27-2010 02:56 PM

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

kh99 12-27-2010 03:00 PM

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] ---------------

Quote:

Originally Posted by lycheepassion (Post 2139629)
so it should be prefix_post? sorry thanks

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

(but still replace the dates, of course).

lycheepassion 12-27-2010 03:14 PM

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


All times are GMT. The time now is 09:59 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.01000 seconds
  • Memory Usage 1,733KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete