forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: will on February 19, 2008, 10:51:18 am

Title: [Solved]: Total Filesize
Post by: will on February 19, 2008, 10:51:18 am
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:

Code: [Select]
Total Covers: 903 Total GB: 0
but on my Work system it shows the following:

Code: [Select]
903 files in [albums] albums and [cat] categories with [comments] comments viewed [views] times
Here's the code from my index.php file:

Code: [Select]
        $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:

Code: [Select]
$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
Title: Re: Total Filesize
Post by: will on February 20, 2008, 10:30:25 pm
No help on this then ???
Title: Re: Total Filesize
Post by: Nibbler on February 20, 2008, 11:00:41 pm
Did you edit the right lang file? Post a link.
Title: Re: Total Filesize
Post by: will on February 21, 2008, 01:29:56 am
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
Title: Re: Total Filesize
Post by: Nibbler on February 21, 2008, 01:55:56 am
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.
Title: Re: Total Filesize
Post by: will on February 21, 2008, 10:20:17 am
Thanks worked great, Thanks ;)