[Solved]: Total Filesize [Solved]: Total Filesize
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: Total Filesize

Started by will, February 19, 2008, 10:51:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

will

I have recently lost the whole of my site and moved to a new host.

Now I'm trying to the same as what I originally asked for in this thread >> http://forum.coppermine-gallery.net/index.php?topic=41174.0

Nibbler helped and it worked a treat but for some reason I cannot get it to work now.

On my home Laptop it shows the info I want:

Total Covers: 903 Total GB: 0

but on my Work system it shows the following:

903 files in [albums] albums and [cat] categories with [comments] comments viewed [views] times

Here's the code from my index.php file:

        $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, 0)
                    ));
        } else {
            $STATS_IN_ALB_LIST = true;
            $statistics = strtr($lang_list_categories['stat3'], array('[pictures]' => $picture_count,
                    '[albums]' => $album_count,
                    '[comments]' => $comment_count,
                    '[views]' => $hit_count));
        }


Here's my code from my English lang file:

$lang_list_categories = array(
  'home' => 'Home',
  'stat1' => '<b>Total Covers:</b> [pictures] <b>Total GB:</b> [total_filesize]GB',
);


Would be great if someone can help me out on where I've gone wrong

Thanks ;D

will


Nibbler

Did you edit the right lang file? Post a link.

will

I must of as it show ok on my Home system but different on my work system, take a look see if you get what I get at work >> http://cdcoverhideout.com/covers ;D

Nibbler

Right. You made your edits to english.php . If you use a browser set to another language (eg. British English) you won't see the change since that's a different lang file. Either change all lang files or delete all except english.php to make it (US) english only.

will

Thanks worked great, Thanks ;)