Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: File Info  (Read 2269 times)

0 Members and 1 Guest are viewing this topic.

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
File Info
« on: March 08, 2007, 07:13:13 pm »

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
« Last Edit: March 08, 2007, 09:47:58 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: File Info
« Reply #1 on: March 08, 2007, 09:34:35 pm »

Try like this:

Code: [Select]
$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.
« Last Edit: March 08, 2007, 09:44:07 pm by Nibbler »
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: File Info
« Reply #2 on: March 08, 2007, 09:41:44 pm »

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
Logged

Nibbler

  • Guest
Re: File Info
« Reply #3 on: March 08, 2007, 09:43:55 pm »

Try now.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: File Info
« Reply #4 on: March 08, 2007, 09:46:33 pm »

Thanks Nibbler, spot on mate ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.