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: problem to add a counter  (Read 5569 times)

0 Members and 1 Guest are viewing this topic.

meisterroda

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.snowciety.at
problem to add a counter
« on: February 25, 2004, 12:31:43 pm »

aloha

i use this counter for my portal:

http://www.christoph-bachner.net/php-scripts.php

it works fine with all pages,
but it isnt possible to add this counter to coppermine

is tried everything, but it doesnt work.

this is the code for the counter:
Code: [Select]

include("PFAD_ZUM_SCRIPT/counter.php");

for the phpbb-forum i use
Code: [Select]

ob_start();
INCLUDE_CODE
$chCounter = ob_get_contents();
ob_end_clean();


how should i do for coppermine!


i hope you have a answer

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
problem to add a counter
« Reply #2 on: February 26, 2004, 06:34:07 am »

hmmm, works for me :wink:

GauGau
Logged

Widi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • http://www.widi.tk
problem to add a counter
« Reply #3 on: February 27, 2004, 03:04:39 pm »

Quote from: "meisterroda"
by the way:

http://coppermine.sourceforge.net/faq.php?q=customHeader#customHeader

dont works



hmm doesn't work for me either. i get a blankpage when i try to start my coppermine. if i do  what says in the faq.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
problem to add a counter
« Reply #4 on: February 28, 2004, 08:52:12 am »

does the counter script you were including does have some die function in it?

GauGau
Logged

meisterroda

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.snowciety.at
problem to add a counter
« Reply #5 on: March 09, 2004, 02:49:18 pm »

if found this in some included file: (i write the "die" in capitals)

Code: [Select]
function start()
    {
        if($this->env['mode'] == "show_version")
           DIE("chCounter v2.2.0");

        $this->_get_counter_values();
        $this->_manage_blocked_users_and_logs();
        $this->_manage_online_users();
        if(!isset($this->variables['blocked']) && $this->config['status'] != "inactive")
        {
            if($this->config['activate_referer'] == "1")
                $this->_stat_referer();
            if($this->config['activate_useragents'] == "1")
                $this->_stat_useragent();
            if($this->config['activate_countries'] == "1")
                $this->_stat_country();
            $this->_stat_tages_monats_besuche();
            if($this->config['activate_aufloesung'] == "1")
                $this->_stat_resolution();
            if($this->config['activate_suchwoerter'] == "1")
                $this->_stat_suchwoerter();
            $this->_count_log_block_user();
        }

                 if($this->config['status'] !== "inactive")
        {
                     $this->_stat_hits();
                 if($this->config['activate_seiten'] == "1")
                $this->_stat_seiten();
        }
    }


and

Code: [Select]
function stop($error_msg, $statement, $fnummer, $ftext)
    {
        print "<b>".$error_msg."</b><br>\n";
        print "SQL query:<br>\n";
        print "<ul style=\"margin-top:5px; margin-bottom:5px\">\n";
        print "<li><i>".$statement."</i></li>\n";
        print "</ul>\n<br>\n";
        print "MySQL error: ".$fnummer."<br>\n".$ftext."\n";
        DIE("<br>\n<br>\n<i>-&gt; Script beendet.</i>");
    }


and

Code: [Select]
      if(empty($this->variables['cr']))
            DIE("don't touch the copyright!");


maybe it helps

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
problem to add a counter
« Reply #6 on: March 09, 2004, 11:55:27 pm »

obviously the script you're trying to include doesn't "like" to be included. I won't look into the details of some third-party code that is totally unrelated to coppermine. In other words: not all counters work with coppermine. Look for another "low fat" counter - best bet is still to go for server-sided logs and scripts that can work with it - maybe you'll want to take a look at AW Stats...

GauGau
Logged

meisterroda

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.snowciety.at
problem to add a counter
« Reply #7 on: March 10, 2004, 12:18:17 am »

thank´s for your suggestion but the problem is, my webserver dont write a logfile
and this script works very good and comfortable with every other websites or webapplications - eccept coppermine.
and i like this counter (i tried a lot - but no good stats without logfiles - maybe you know)

open-source is ok, but coppermine is one step too high for me....

i will run coppermine further on my site, but in the future i have to think of another solution for the phpbb (i think of smartor)

but anyway you do one of the best jobs i´ve evver seen - congratulations

maybe  i find a solution and i´ll let you know


seas (austrian slang)
vom roda

meisterroda

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.snowciety.at
problem to add a counter
« Reply #8 on: March 10, 2004, 11:45:27 am »

problem solved

im such a big idiot

----------------------
phppp-config:
server="localhost";

copermine-config:
server="home.mysql.td"
----------------------

works fine now

Widi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • http://www.widi.tk
problem to add a counter
« Reply #9 on: March 10, 2004, 11:48:47 am »

Meisterroda: i'm using het script too, but in javascript mode, i trying to get it to work in php-mode, but don't know how? could you help me? where did you put the code in, in which file? etc...


tnx

 :lol:
Logged

meisterroda

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.snowciety.at
problem to add a counter
« Reply #10 on: March 10, 2004, 12:16:21 pm »

search in theme.php for

Code: [Select]
function pageheader($section, $meta = '') {
..
..
..
}


and edit it like this:

Code: [Select]
function pageheader($section, $meta = '')
{
        global $CONFIG, $THEME_DIR;
        global $template_header, $lang_charset, $lang_text_dir;

        if(empty($custom_header)){
            // chCounter
            $chCounter_visible = "0"; //whatever you want
            //$chCounter_pagetitle = $page_title;
            include("../statistik/counter.php");
        }

        header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        user_save_profile();

        $template_vars = array(
                '{LANG_DIR}' => $lang_text_dir,
                '{TITLE}' => $CONFIG['gallery_name'].' - '.$section,
                '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
                '{META}' => $meta,
                '{GAL_NAME}' => $CONFIG['gallery_name'],
                '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
                '{MAIN_MENU}' => theme_main_menu(),
                '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header
        );

        echo template_eval($template_header, $template_vars);

}


and add to your temlate.html

Code: [Select]
{CUSTOM_HEADER}

meisterroda

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.snowciety.at
problem to add a counter
« Reply #11 on: March 11, 2004, 10:05:48 pm »

ich hab jetz die neue version der statistik eingebaut v2.3
und da kann man das ganze verwerfen!!!


die möglichkeit hier ist folgende:

in include/init.inc.php suchen:

Code: [Select]
ob_start()

danach einfügen:

Code: [Select]
$chCounter_visible = "0";
include("pfad_zum_counter/counter.php");


visible immer auf "0" lassen, weil das teil immer vor allen anderen inhalten geladen werden muss

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
problem to add a counter
« Reply #12 on: March 12, 2004, 07:39:20 am »

please post in english only, so others my benefit from your insight as well - see http://coppermine.sourceforge.net/faq.php?q=nonEnglishPosting#nonEnglishPosting

GauGau
Logged

meisterroda

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.snowciety.at
problem to add a counter
« Reply #13 on: March 12, 2004, 07:57:56 am »

sorry,

a try in english:

for chCounter version 2.3 do the following:

in include/init.inc.php search:

Code: [Select]
ob_start()

inser tafter:

Code: [Select]
$chCounter_visible = "0";
include("path to counter/counter.php");


let visible always on "0", because the thing will be loaded befor all other contents
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 18 queries.