This is a simple attachment info still in developement.
Any suggestion and comments are welcome !
But haven't writing the MODX file.
It now just add the total size uploaded and per attachment max. filesize.

OPEN function_posting.php
<a href="http://ipost2host.com/viewtopic.php?f=13&t=1947#" target="_blank">
</a>
Code:
<?php

function attachments_get_total($mode = 0, &$user = null)
{
    global $db, $template, $user, $config;
    
    $attachments_size = 0;
    $sql = &#39;SELECT SUM(filesize) AS attachments_size
        FROM &#39; . ATTACHMENTS_TABLE .
        &#39; WHERE poster_id = &#39; . $user->data[&#39;user_id&#39;];
    $result = $db->sql_query_limit($sql, 1);
    $row = $db->sql_fetchrow($result);
    $attachments_size = (int)$row[&#39;attachments_size&#39;];
    $filesize = (int)$config[&#39;max_filesize&#39;];
    $db->sql_freeresult($result);

    $fileunit = array(&#39;B&#39;, &#39;KB&#39;, &#39;MB&#39;);
    
    $template->assign_vars(array(
        //&#39;ATTACHMENT_SIZE&#39; => &#39;Attachment(s) used spaces: &#39; . (int)($attachments_size / 1024) . &#39; kb&#39; , allowed 
        &#39;L_ATTACHMENT_SIZE&#39; => &#39;Spaces used : &#39; . $attachments_size . &#39;&#39; ,
        &#39;L_FILESIZE&#39; => &#39;Max. per file: &#39; . $filesize . &#39;&#39;,
        &#39;ATTACHMENT_SIZE&#39; => $attachments_size,
        &#39;FILESIZE&#39; => $filesize,
        &#39;FILEUNIT&#39; => &#39;<option>B</option><option>KB</option><option>MB</option>&#39;,
        ));
}
?>

OPEN posting.php
FIND
Code:

if ($auth->acl_get(&#39;f_attach&#39;, $forum_id) && $auth->acl_get(&#39;u_attach&#39;) && $config[&#39;allow_attachments&#39;] && $form_enctype)
AFTER ADD
Code:


    attachments_get_total();
OPEN posting_attach_body.html
FIND
<a href="http://ipost2host.com/viewtopic.php?f=13&t=1947#" target="_blank">
</a>
Code:
    

{L_ADD_ATTACHMENT_EXPLAIN}</p>
AFTER ADD
Code:

attachment_info.html
<a href="http://ipost2host.com/viewtopic.php?f=13&t=1947#" target="_blank">
</a>
Code:
 <script type="text/javascript" defer="defer">
    // <!CDATA[ 
    function change_unit(idx, elem)
    {
        var kb_unit = 1024;
        var mb_unit = 1048576;

        var t = document.getElementById(elem);
        var default_value = document.getElementById(elem + &#39;h&#39;).value;

        var new_value = 0;