Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 03-30-2005, 04:03 PM
shinstudio shinstudio is offline
 
Join Date: Jan 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 12-27-2010, 02:03 PM
lycheepassion lycheepassion is offline
 
Join Date: Aug 2009
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 12-27-2010, 02:33 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #4  
Old 12-27-2010, 02:41 PM
lycheepassion lycheepassion is offline
 
Join Date: Aug 2009
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 12-27-2010, 02:44 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 12-27-2010, 02:45 PM
lycheepassion lycheepassion is offline
 
Join Date: Aug 2009
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 12-27-2010, 02:53 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 12-27-2010, 02:56 PM
lycheepassion lycheepassion is offline
 
Join Date: Aug 2009
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 12-27-2010, 03:00 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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).
Reply With Quote
  #10  
Old 12-27-2010, 03:14 PM
lycheepassion lycheepassion is offline
 
Join Date: Aug 2009
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:23 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.04903 seconds
  • Memory Usage 2,244KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete