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: Stats outside the main CPG script *unsupported*  (Read 15928 times)

0 Members and 1 Guest are viewing this topic.

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Stats outside the main CPG script *unsupported*
« on: July 08, 2004, 04:24:59 am »

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:

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

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

ADD AFTER:

Code: [Select]
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!
« Last Edit: May 05, 2006, 05:03:50 pm by GauGau »
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

seros

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: Stats outside the main CPG script
« Reply #1 on: July 08, 2004, 10:40:32 pm »

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

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Re: Stats outside the main CPG script
« Reply #2 on: July 09, 2004, 05:06:37 am »

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. ;)
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

seros

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: Stats outside the main CPG script
« Reply #3 on: July 09, 2004, 10:11:17 am »

:) Then lets go, please.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Stats outside the main CPG script
« Reply #4 on: July 09, 2004, 10:50:12 am »

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
Logged

snork13

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 260
  • Internet! Is that thing still around?
    • Gallery
Re: Stats outside the main CPG script
« Reply #5 on: August 27, 2004, 06:02:04 am »

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

snork
Logged
Pages: [1]   Go Up
 

Page created in 0.035 seconds with 20 queries.