Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
[OzzModz] Attachment Stats Sideblock Details »»
[OzzModz] Attachment Stats Sideblock
Version: 1.0.0, by ozzy47 ozzy47 is offline
Developer Last Online: Dec 2021 Show Printable Version Email this Page

Category: vBulletin Forum Sideblocks - Version: 4.x.x Rating:
Released: 04-16-2013 Last Update: 04-16-2013 Installs: 16
Translations  
No support by the author.

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

Show Your Support

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

Comments
  #2  
Old 04-16-2013, 11:59 PM
mikesafl's Avatar
mikesafl mikesafl is offline
 
Join Date: Mar 2013
Location: Philippines
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey i remember this lol thank you so much
Reply With Quote
  #3  
Old 04-17-2013, 12:07 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem, glad ya like it.
Reply With Quote
  #4  
Old 04-17-2013, 12:17 AM
kapii kapii is offline
 
Join Date: Apr 2008
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice, this will help fill some space on my sideblocks, I like all the info included, same as in the ACP, thanks for sharing.
Reply With Quote
  #5  
Old 04-17-2013, 12:23 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah I figured include it all in there, glad it suits your needs.
Reply With Quote
  #6  
Old 09-09-2013, 06:33 AM
heyzeus909 heyzeus909 is offline
 
Join Date: Jun 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool - thank you!
Reply With Quote
Благодарность от:
ozzy47
  #7  
Old 09-09-2013, 09:13 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad ya like it, and thanks for marking as installed.
Reply With Quote
  #8  
Old 03-24-2014, 09:24 PM
Reef Man Reef Man is offline
 
Join Date: Nov 2006
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be used in a VBadvanced module? how?
Reply With Quote
  #9  
Old 04-21-2014, 09:05 PM
Cusski Cusski is offline
 
Join Date: Feb 2012
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are the unique and total the wrong way around?

Unique / Total Attachments: 2,435 / 2,327
Reply With Quote
Благодарность от:
kushal
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 01:19 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.04361 seconds
  • Memory Usage 2,289KB
  • Queries Executed 22 (?)
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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (2)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete