Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard

Reply
 
Thread Tools
Upload/Download Stats in Postbit Details »»
Upload/Download Stats in Postbit
Version: 1.00, by tnguy3n tnguy3n is offline
Developer Last Online: Sep 2010 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.0.5 Rating:
Released: 01-13-2005 Last Update: Never Installs: 18
DB Changes
 
No support by the author.

Upload/Download & Total Upload/Download stats

Requested here

Modded by tnguy3n (Thinh Nguyen)
Live Demo: http://www.all4actions.net

Description: This mod display total filesize and number of upload/download in postbit.
I've tested it in vb3.0.1, 3.0.3 and 3.0.5.

New queries: 1
File Mod: 3
Template mod: 3
Installation Time: 4-5 mins

Note: make sure to run the query in phpMyAdmin or it will get an error.

Please click "INSTALL" if you use the hack. :nervous:

Show Your Support

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

Comments
  #2  
Old 01-14-2005, 01:26 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

clicked install m8 - all seems fine except for me it wont reg if someone downloads

the stats only update when they upload.Downloads stay at Zero regardless

will see if anyone else has same problems
Reply With Quote
  #3  
Old 01-14-2005, 02:00 AM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lasto
clicked install m8 - all seems fine except for me it wont reg if someone downloads

the stats only update when they upload.Downloads stay at Zero regardless

will see if anyone else has same problems
okie, got that fixed now.
*update one instruction*

To fix your current download stats problem, open attachment.php,
FIND:
Code:
			// update user download stats by tnguy3n
			$filesize = $attachmentinfo['filesize']/1024;
			$DB_site->shutdown_query("
				UPDATE " . TABLE_PREFIX . "user
				SET downloadno = downloadno + 1
				WHERE userid = $bbuserinfo[userid]
			");
			$DB_site->shutdown_query("
				UPDATE " . TABLE_PREFIX . "user
				SET downloadtotal = downloadtotal + $filesize
				WHERE userid = $bbuserinfo[userid]
			");
Then DELETE IT!

FIND:
Code:
		else
		{
			// or doing it once an hour
			$DB_site->shutdown_query("
				INSERT INTO " . TABLE_PREFIX . "attachmentviews (attachmentid)
				VALUES ($attachmentinfo[attachmentid])
			");
		}
BELOW IT, ADD:
Code:
			// update user download stats by tnguy3n
			$filesize = $attachmentinfo['filesize']/1024;
			$DB_site->shutdown_query("
				UPDATE " . TABLE_PREFIX . "user
				SET downloadno = downloadno + 1
				WHERE userid = $bbuserinfo[userid]
			");
			$DB_site->shutdown_query("
				UPDATE " . TABLE_PREFIX . "user
				SET downloadtotal = downloadtotal + $filesize
				WHERE userid = $bbuserinfo[userid]
			");
That's it! and it based on code of vb 3.0.5.
Reply With Quote
  #4  
Old 01-14-2005, 02:23 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works perfect now m8

File Download: 2 - Total Download: 6120 KB

one slight problem but this deffo may be me

if i upload a file and a preview pic - it adds 3 to the count whereas the attachemnts should add 2 only.Noticed this after i did a few uploads of small pic rars.
Reply With Quote
  #5  
Old 01-14-2005, 02:36 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Deffo an Error on counting up the uploaded stats - here goes

ok before i upload here is my stats
File Upload: 5 - Total Upload: 737 KB
File Download: 2 - Total Download: 6120 KB

Now i just uploaded a preview pic which was 160K and a test rar which was 5.10 meg
Now check out the stats afterwards ...................

File Upload: 8 - Total Upload: 901 KB
File Download: 2 - Total Download: 6120 KB

deffo adding an extra one somewhere and not totaling up correct
Reply With Quote
  #6  
Old 01-14-2005, 02:44 AM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lasto
Deffo an Error on counting up the uploaded stats - here goes

ok before i upload here is my stats
File Upload: 5 - Total Upload: 737 KB
File Download: 2 - Total Download: 6120 KB

Now i just uploaded a preview pic which was 160K and a test rar which was 5.10 meg
Now check out the stats afterwards ...................

File Upload: 8 - Total Upload: 901 KB
File Download: 2 - Total Download: 6120 KB

deffo adding an extra one somewhere and not totaling up correct
you can upload a file 5.10 MB on your server? That amazed me. Usually, ppl ai'nt set uploaded filesize > 2 MB. but if your rar file is 5.10 KB, the upload stats seems working correctly. 737 KB + 160 KB + 5.1 KB ~ 902 KB
Reply With Quote
  #7  
Old 01-14-2005, 03:00 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dont figure - as 5.10 meg is not 5.10 kb
maybe its classing them as KB when there cleary not.

the total above in your thread is 902kb which is well below 1 meg yet in the downloads stats its doing em right - 2 files which make up 6 megs

also yep can upload files to a mx of 8 megs as set the max_upload to it.

Ok look at this :

Stats before :File Upload: 8 - Total Upload: 901 KB

Now im just about to upload a rar which is 1.35 MB

File Upload: 9 - Total Upload: 902 KB

so looking at that i think ive solved the problem its only counting the first attachement which in most cases is small preview pics of maps but this time i uploaded the rar without a pic and it never counted it at all
Reply With Quote
  #8  
Old 01-14-2005, 09:28 AM
ChrisSy ChrisSy is offline
 
Join Date: Mar 2002
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does this hack also back date itself? Or do the stat counter only start from when you install this hack?
Reply With Quote
  #9  
Old 01-14-2005, 09:58 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ChrisSy
does this hack also back date itself? Or do the stat counter only start from when you install this hack?
from when counter starts - well is for me anyway
Reply With Quote
  #10  
Old 01-14-2005, 11:07 AM
ChrisSy ChrisSy is offline
 
Join Date: Mar 2002
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lasto
from when counter starts - well is for me anyway
you installed and works fine?
Reply With Quote
Reply

Thread Tools

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 09:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04426 seconds
  • Memory Usage 2,294KB
  • 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
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)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