Stats outside the main CPG script *unsupported* Stats outside the main CPG script *unsupported*
 

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]

Main Menu

Stats outside the main CPG script *unsupported*

Started by DefenceTalk.com, July 08, 2004, 04:24:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DefenceTalk.com

I have on www.defencetalk.com/pictures the CPG stats on home page and on top of the gallery page.
Someone PM me to find out how was it accomplished.

Well first of: I didn't do nothing new. I just used the features provided with the gallery script and Gaugau's SSI.php mod. The SSI.php MOD is avaiable on the download page.

Files to edit:
index.php

New files?
stats.php

First make a  new file using the anycontent.php that is provided with the script:

The file content should look something like this:

<?php
[color=Blue]include_once("/web path/to your website/public_html/coppermine/ssi.php");[/color]
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.2.0                                            //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003 Gregory DEMAR <gdemar@wanadoo.fr>                 //
// http://www.chezgreg.net/coppermine/                                       //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify      //
// it under the terms of the GNU General Public License as published by      //
// the Free Software Foundation; either version 2 of the License, or         //
// (at your option) any later version.                                       //
// ------------------------------------------------------------------------- //
starttable("100%""Stats");

?>


<tr><td class="tableg" >

<b>Gallery Stats:</b>
<?php
print "Total Pictures: ";
print 
cpg_total_pics("");
print 
" | Total Albums: ";
print 
cpg_total_albums();
print 
" | Total Categories: ";
print 
cpg_total_cats(); print cpg_search(12,"search gallery","go");
?>

</center>
</td></tr>
</td></tr>
<?php
endtable
();

?>


Open your INDEX.PHP file and FIND THIS:

            case 'anycontent':
                if ($cat == 0) {
                    include('anycontent.php');
                }
                flush();
                break;


ADD AFTER:

case 'stats':
                if ($cat == 0) {
                    include('stats.php');
                }
                flush();
                break;


Save and upload your files(both index.php and stats.php).

Go to your config options in admin menu and edit the The content of the main page options as needed.

Remember to backup all files when editing or adding new modifications.

I hope this helps.

Thanks!
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

seros

Great mod, another question: how to include the "Who is online?" from your page?

DefenceTalk.com

Well, for that you will need phpbb integration. If you have that the rest of the process is similar but I wouldn't mind posting "how to..." for that also. ;)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

seros


Joachim Müller

stop discussing another mod on this thread, please. Your discussion should go into the mod thread you're refering to. If there is no such thread, post on the support board - I'll move it to the mods section then if it actually is a mod.

GauGau

snork13

thanks for the mod, I adjusted a little, got some parse error because of the [-- fixed and working great

snork