vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Attachment Statistics (https://vborg.vbsupport.ru/showthread.php?t=73186)

ericgtr 12-21-2004 10:00 PM

Attachment Statistics
 
This modification will add a new collapsable box thingie just below your forum stats. Great if your site focuses on attachments. Most of this was by request here https://vborg.vbsupport.ru/showthread.php?t=73023

Please backup your database before installing.


Includes:
Total files on the server
Space used by Attachments
Total Downoads
Total Downloaded Today

2 Files to edit: vbroot/index.php, vbtroot/attachment.php
1 Queries: (pulled from cache)
1 Templates to edit: FORUMHOME

Update: The query for Total Downloads Today was not functioning correctly so I had to update it. If you've installed this already, go into your phpmyadmin and remove the timestamp table from attachmentviews then re-edit your attachments.php and add the updated query according to the updated readme.txt

I had this moved to beta as I am still working on the query, keep in mind that I may have to change this again. If you want to help test though, that's great.

See attached file, please click install if you find it useful :)

lasto 12-22-2004 12:45 AM

cheers m8 seen it to late so will install 2morow and report back.
Thanks for all your help on this as well m8

N8 12-22-2004 01:55 AM

great hack

*installs*

ChrisSy 12-22-2004 02:34 PM

thanks for this *install*

dndog 12-22-2004 03:03 PM

Simple and useful.

[high]* dndog clicks install. :)[/high]

PcFreak 12-22-2004 08:43 PM

If you want to show the traffic, too.
Use this query:

PHP Code:

//Traffic            
    
$transfer $DB_site->query("
            SELECT SUM( counter * filesize )
            FROM " 
TABLE_PREFIX "attachment
            "
);        
    
$transferall = @substr($transfer 104857603); 

The var $transferall show you all traffic (download traffic) for the attachments in the database in MB:

PcFreak

ericgtr 12-22-2004 09:17 PM

Thanks! Great addition :)

Anyway I can use that same formatting to get this query to pull the last 24 hours correctly? This is currently not working right, the timestamp is a table I added to the attachmentviews.

Code:

//Total Downloads Today
$total_today = $DB_site->query_first('
SELECT COUNT(*) AS count
FROM ' . TABLE_PREFIX . 'attachmentviews
WHERE timestamp >= "' . strtotime("-1day") . '"
');
$total_today = number_format($total_today['count']);
//Total Downloads today


Snatch 01-18-2005 09:23 PM

The hack do not count the downloads tody. Why this ?


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