Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by badmeetsevil- badmeetsevil- is offline
Developer Last Online: Jul 2002 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 10-10-2001 Last Update: Never Installs: 24
 
No support by the author.

New Threads Today

Summary of Hack
A simple little hack that is very interesting to have on your forums. If installed correctly, it will show how many threads were started that present day, and reset at midnight. If a thread is deleted, it will be taken off the thread count.

Demo
http://www.soaped-up.com/bbs

Installation

Very simple installation. Download, and open index.php from your forums directory. Find a nice spot anywhere in the file, (maybe under // get total posts) and copy + paste the following:

PHP Code:
// number of threads today
$datecut mktime(0,0,0,date("m"), date("d"), date("y"));
$getthreadstoday=$DB_site->query_first("SELECT count(*) AS count FROM thread WHERE dateline>='$datecut'");
$threadstoday=$getthreadstoday[count]; 
Close the file, and re-upload it to your server.

Go into your Admin Control Panel, open the template "Forum Home" and find the following:

Code:
Total Posts: <b>$totalposts</b>
Immediately following that, paste the following..

Code:
| New Threads Today: <b>$threadstoday</b>
Go to your forum main, and you'll see it in action! If it's not working, please reply to this stating what's wrong.

Enjoy.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-11-2001, 09:26 PM
treszoks treszoks is offline
 
Join Date: Oct 2001
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did something similar as a change for the "today's active topics" link. I noticed how it didn't actually show today's active topics, but rather showed the topics from the last 24 hours. Here's the change I made in search.php:

Find this:

$datesql=" AND thread.lastpost>=".(time()-24*60*60);

Replace with this:

$datesql=" AND thread.lastpost>=".(mktime(0,0,0,date("m"), date("d"), date("Y")));
Reply With Quote
  #3  
Old 10-11-2001, 10:06 PM
badmeetsevil-'s Avatar
badmeetsevil- badmeetsevil- is offline
 
Join Date: Oct 2001
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that's the current coding for this hack. Gotta love it.
Reply With Quote
  #4  
Old 10-13-2001, 07:22 AM
mem mem is offline
 
Join Date: Oct 2001
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like it~~~

it's worked.

thank you very much.
Reply With Quote
  #5  
Old 10-14-2001, 11:23 PM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great little hack, I like these sorts. Thanks.
Reply With Quote
  #6  
Old 10-15-2001, 10:37 PM
badmeetsevil-'s Avatar
badmeetsevil- badmeetsevil- is offline
 
Join Date: Oct 2001
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks

I'm trying to make an addon, so it counts how many new posts from individual forums.
Reply With Quote
  #7  
Old 10-27-2001, 06:28 AM
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
Location: Vancouver, BC, Canada
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... doesn't seem to be working right for me...

I copy/pasted it all nice...

And it's half working.

Basically, it doesn't seem to be resetting at midnight. It says we have 903 new threads... less than an hour after midnight. It was at 891 before midnight.
And 856 yesterday.

What's up with it?
Reply With Quote
  #8  
Old 10-27-2001, 01:38 PM
badmeetsevil-'s Avatar
badmeetsevil- badmeetsevil- is offline
 
Join Date: Oct 2001
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, you forum is quite big (post/thread) count wise. It's very possible that you've gotten 900 new threads.

..but if you know this is false, check the coding. Make sure that
Code:
("SELECT count(*) AS count FROM thread WHERE dateline>='$datecut'");
says "thread" and not "post".
Reply With Quote
  #9  
Old 10-29-2001, 09:07 AM
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
Location: Vancouver, BC, Canada
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's copy/pasted verbatim from your post.

And I know it's counting threads... I did a comparison of Total Posts, Total Threads and "New Threads Today"

I posted a new thread, and then a normal reply.

Went back and checked the numbers.

Total Threads and New Threads Today both went up the exact same number.
Total Posts went up about 15 more than the others.

It IS counting threads.

What it is NOT doing is resetting at midnight.

Right now it says we have 6689 total threads... and 900 new today.

The only problem is... It's 4am server time. (Central Standard)

We don't get 900 threads a day in any day, even if we get attacked by a flooder. And this stretch of time is our slowest by far.

50 new threads a day is impressive. We normally get between 150-200 visitors a day. They do not start many new threads, as a rule.

Basically, something's wrong with the date cutoff...
Reply With Quote
  #10  
Old 10-29-2001, 01:06 PM
treszoks treszoks is offline
 
Join Date: Oct 2001
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Isn't there already an option in the cp to find out the number of new threads made each day under the "vb stats" link?
Reply With Quote
Reply


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 02:41 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
  • Page Generation 0.05644 seconds
  • Memory Usage 2,299KB
  • Queries Executed 23 (?)
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
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete