problem to add a counter problem to add a counter
 

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

problem to add a counter

Started by meisterroda, February 25, 2004, 12:31:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

meisterroda

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:

include("PFAD_ZUM_SCRIPT/counter.php");

for the phpbb-forum i use

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

hmmm, works for me :wink:

GauGau

Widi

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.

Joachim Müller

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

GauGau

meisterroda

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

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

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

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


maybe it helps

Joachim Müller

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

meisterroda

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

problem solved

im such a big idiot

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

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

works fine now

Widi

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:

meisterroda

search in theme.php for

function pageheader($section, $meta = '') {
..
..
..
}


and edit it like this:

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

{CUSTOM_HEADER}

meisterroda

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:

ob_start()

danach einfügen:

$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

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

meisterroda

sorry,

a try in english:

for chCounter version 2.3 do the following:

in include/init.inc.php search:

ob_start()

inser tafter:

$chCounter_visible = "0";
include("path to counter/counter.php");


let visible always on "0", because the thing will be loaded befor all other contents