News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

File Info

Started by will, March 08, 2007, 07:13:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

will

I currently had help from nibbler on this and was wondering why it has stopped at 2GB, it will not increase, here's the code I'm using

Quote$sql = "SELECT sum(hits), sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']} as p " . 'LEFT JOIN ' . $CONFIG['TABLE_ALBUMS'] . ' as a ' . 'ON p.aid=a.aid ' . 'WHERE 1' . $pic_filter;
        $result = cpg_db_query($sql);
        $nbEnr = mysql_fetch_array($result);
        $hit_count = (int)$nbEnr[0];
        $total_filesize = (int)$nbEnr[1];
        mysql_free_result($result);

        if (count($cat_data)) {
            $statistics = strtr($lang_list_categories['stat1'], array('[pictures]' => $picture_count,
                    '[total_filesize]' => round($total_filesize/1024/1024/1024, 2)
                    ));

Would be great if anyone can help me with this ;D

Nibbler

#1
Try like this:


$sql = "SELECT sum(hits), round(sum(total_filesize)/1024/1024/1024, 1) FROM {$CONFIG['TABLE_PICTURES']} as p " . 'LEFT JOIN ' . $CONFIG['TABLE_ALBUMS'] . ' as a ' . 'ON p.aid=a.aid ' . 'WHERE 1' . $pic_filter;
        $result = cpg_db_query($sql);
        $nbEnr = mysql_fetch_array($result);
        $hit_count = (int)$nbEnr[0];
        $total_filesize = $nbEnr[1];
        mysql_free_result($result);

        if (count($cat_data)) {
            $statistics = strtr($lang_list_categories['stat1'], array('[pictures]' => $picture_count,
                    '[total_filesize]' => $total_filesize
                    ));


I think the number got too large to be an integer.

will

Thanks that got it to increase, but its only showing as 2GB because I took out 1 of the 1024:

Quote/1024/1024/1024

and made it:

Quote/1024/1024

and it was showing as 2250GB

but if I add it again it goes back to 2GB, hope you understand, is there a way of getting it to show as 2.2GB

Thanks

Nibbler


will

Thanks Nibbler, spot on mate ;D