vBulletin

Thank you for visiting. This is our website archive. Please visit our main website by clicking the banner above.
vBulletin FAQ is dedicated to helping the forum owner build, manage and profit from his vBulletin Forum
vBulletin Web Hosting - Free skins and styles for your vBulletin - Search Engine Optimization




Upload/Download & Total Upload/Download stats

lily143
08-21-2005, 12:43 PM
Modded by tnguy3n (Thinh Nguyen)
Live Demo: http://www.all4actions.net
+ http://www.efz-tm.net/forums/newpostinthread4973.html

Description: This mod display number of filesize and number of upload/download in postbit.

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

##-----------------------------------------
Run Queries: (in AdminCP or phpMyAdmin)

ALTER TABLE `user` ADD `uploadno` SMALLINT( 4 ) DEFAULT '0' NOT NULL ,
ADD `uploadtotal` INT( 15 ) DEFAULT '0' NOT NULL ,
ADD `downloadno` SMALLINT( 4 ) DEFAULT '0' NOT NULL ,
ADD `downloadtotal` INT( 15 ) DEFAULT '0' NOT NULL


##-----------------------------------------
File Modifications

1. Open, includes/functions_showthread.php (1 change)

FIND:
// format posts number
$post['posts'] = vb_number_format($post['posts']);

BELOW, ADD:

// show user upload/download stats by tnguy3n
$getuserstats = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $post[userid]");
while ($userstats = $DB_site->fetch_array($getuserstats)) {
$numupload = $userstats['uploadno'];
$uploadtotal = $userstats['uploadtotal'];
$numdownload = $userstats['downloadno'];
$totaltotal = $userstats['downloadtotal'];
}
// end userstats

2. Open attachment.php (1 change)

FIND:

else
{
// or doing it once an hour
$DB_site->shutdown_query("
INSERT INTO " . TABLE_PREFIX . "attachmentviews (attachmentid)
VALUES ($attachmentinfo[attachmentid])
");
}


BELOW, ADD:

// 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]
");

3. Open newattachment.php (1 change)

FIND:
eval('$attachments .= "' . fetch_template('newattachmentbit') . '";');

BELOW, ADD:

// update user upload stats by tnguy3n
$filesize = intval($attach['filesize']);
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET uploadno = uploadno + $attachcount
WHERE userid = $bbuserinfo[userid]
");
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET uploadtotal = uploadtotal + $filesize
WHERE userid = $bbuserinfo[userid]
");


##---------------------------------

Template modification:

Open postbit(_legacy): (1 change)

FIND:
$vbphrase[posts]: $post[posts]

BELOW, ADD:

<br />File Upload: $numupload<br />
Total Upload: $uploadtotal KB<br />
File Download: $numdownload<br />
Total Download: $totaltotal KB<br />


<!---------- All done! ---------->

chitan
06-13-2007, 06:05 PM
this is my first post

this hack can resolve a big problem in my bord; if that be costumisate
I am ready to pay somebody for this work


i have problem with downloading attached file in my board
i want restrict number of files to download by usergroup per day
-------------------------------
I
usergroup in admin Cp:
1- restrict attachement download for specified group yes/no
if yes
2- number of attachements to allow for the member of this group to download from board per 24 hours ( 5 files per day - for exemple-)
------------------------
a phrase appears when the member reached the limit ( 5 files )


II
attachement in admincp
restrict for this type of attachement yes/no

for exemple

MP3 files yes/no
RM files yes/no
jpeg files yes/no
etc...

if you can release this hack for me, please let me know your price to do this job


vBulletin

seo book

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum