vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Daily Activity (https://vborg.vbsupport.ru/showthread.php?t=322878)

grey_goose 06-19-2016 02:52 PM

Daily Activity
 
So I whipped this up a plugin which spits out the total new threads, new posts, and new social group message counts -- which all works fine and dandy.

Does anyone know the URL/link for searching for new threads? Not getdaily, because I don't want to include 'bumps' or old threads with new replies. I've searched high and low and every time the question is asked it seems to get answered with ways that include old threads.

Also, including the plugin code just in case anyone else wanted to display this stuff and have vb:raw variables to drop in. :)
  • {vb:raw newactivity.threadcount}
  • {vb:raw newactivity.postcount}
  • {vb:raw newactivity.groupmessagecount}

PHP Code:

if (THIS_SCRIPT == 'index')
{
$newactivity $db->query_read("SELECT COUNT(post.dateline) AS postcount, COUNT(thread.dateline) AS threadcount, COUNT(groupmessage.dateline) AS groupmessagecount FROM post JOIN postlog ON (postlog.postid = post.postid) LEFT JOIN thread ON (thread.dateline = postlog.dateline) LEFT JOIN groupmessage ON (groupmessage.dateline = postlog.dateline) WHERE UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 DAY)) <= postlog.dateline"); 

$newactivity $db->fetch_array($newactivity);

vB_Template::preRegister('FORUMHOME', array(
'newactivity' => $newactivity
));




All times are GMT. The time now is 05:05 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.01065 seconds
  • Memory Usage 1,710KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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