Back to Modification Graveyard

[OzzModz] Attachment Stats Sideblock
Mod Version: 1.0.0, by ozzy47

This thread is in the Modification Graveyard.
vB Version: 4.x.x Rating: (7 votes - 5.00 average) Installs: 16
Released: 17 Apr 2013 Last Update: 17 Apr 2013 Downloads: 13
Not Supported Translations  

Another mod brought to you by,


This mod will add a attachment statistics block to your forum sideblocks.

-------------------------------------------------------------------------------------------

If you like this mod please hit the button to the right ---->

Please remember to click the, button to the right if you installed the mod ---->

What does 'Marking As Installed' do ?

* It helps you to stay on top of updates - members who have installed modifications will be notified whenever new updates are available.

* For security issues - vbulletin.org will contact all members who have installed a modification whenever a security issue is brought to their attention.

* Marking a modification as installed also helps me know how many people are using my work, giving me extra incentive to provide more features and new modifications.

I appreciate the support!
-------------------------------------------------------------------------------------------

Go to ACP / Forums & Moderators / Forum Blocks Manager and click on Add New Block, and in the next screen choose Custom HTML/PHP then click Continue.

Set it up the following way.

Title: Attachment Stats (or what ever you want)

Description: Leave blank or fill it in if you wish.

Cache Time (in minutes): I set mine to 10 but you can set it to what ever you want.

Display Order:Any order you want to get the proper order.

Content Type: Choose the PHP one.

In the field Content add this code:

PHP Code:
$astats $this->registry->db->query_first("
        SELECT COUNT(*) AS count, SUM(filesize) AS totalsize, SUM(counter) AS downloads
        FROM " 
TABLE_PREFIX "attachment AS a
        INNER JOIN " 
TABLE_PREFIX "filedata AS fd ON (a.filedataid = fd.filedataid);
    "
);

    
$fstats $this->registry->db->query_first("
        SELECT COUNT(*) AS count, SUM(filesize) AS totalsize
        FROM " 
TABLE_PREFIX "filedata AS fd
    "
);
    
    if (
$astats['count'])
    {
        
$astats['average'] = vb_number_format(($astats['totalsize'] / $astats['count']), 1true);
    }
    else
    {
        
$astats['average'] = '0.00';
    }

$stats=
<table width="100%" align="center"> 
    <tr> 
        <td class="" align="left"> 
            <div class="smallfont"> <b>Unique / Total Attachments: </b> '
.vb_number_format($astats['count']) . ' / ' vb_number_format($fstats['count']).'<br /><br /> 
                <b>Attachment File-size Sum: </b>'
vb_number_format(iif(!$astats['totalsize'], 0$astats['totalsize']), 1true).'<br /><br /> 
                <b>Disk Space Used: </b>'
vb_number_format(iif(!$fstats['totalsize'], 0$fstats['totalsize']), 1true).'<br /><br /> 
                <b>Average File-size: </b>'
$astats['average'].'<br /><br /> 
                <b>Total Downloads: </b>'
vb_number_format($astats['downloads']).'
            </div> 
        </td> 
    </tr> 
</table>'

//SideBar = End forum Status 
//echo $stats; 

return $stats
Template to Use: leave it set to block_html

Download

This modification cannot be downloaded.

Screenshots

   

Similar Mods

Add-On Releases v3 Arcade Stats Widget or Forum Sideblock vBulletin 4.x Add-ons
vBa CMPS: Attachment Stats Module vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024