ich ich habe nun einen Counter gefunden. Jedoch hat er nur die funktion, dass die Hits in text ausgegeben werden. Habe nun aber selber ein Counterbild mit PHP generieren lassen. Der code sieht so aus:
<?php header("Content-Type: image/jpeg"); $bg = imageCreateFromJPEG("olde/background.jpg"); $null = imageCreateFromJPEG("olde/0.jpg"); $eins = imageCreateFromJPEG("olde/1.jpg"); $zwei = imageCreateFromJPEG("olde/2.jpg"); $drei = imageCreateFromJPEG("olde/3.jpg"); $vier = imageCreateFromJPEG("olde/4.jpg"); $funf = imageCreateFromJPEG("olde/5.jpg"); $sechs = imageCreateFromJPEG("olde/6.jpg"); $sieben = imageCreateFromJPEG("olde/7.jpg"); $acht = imageCreateFromJPEG("olde/8.jpg"); $neun = imageCreateFromJPEG("olde/9.jpg"); imageCopy($bg, $null, 20, 23, 0, 0, 14, 19); imageCopy($bg, $eins, 35, 23, 0, 0, 14, 19); imageCopy($bg, $zwei, 50, 23, 0, 0, 14, 19); imageCopy($bg, $drei, 65, 23, 0, 0, 14, 19); imageCopy($bg, $vier, 80, 23, 0, 0, 14, 19); imageCopy($bg, $funf, 95, 23, 0, 0, 14, 19); imageCopy($bg, $sechs, 110, 23, 0, 0, 14, 19); imageCopy($bg, $sieben, 125, 23, 0, 0, 14, 19); imageCopy($bg, $acht, 140, 23, 0, 0, 14, 19); imageCopy($bg, $neun, 155, 23, 0, 0, 14, 19); imageJPEG($bg,null,100); ?>
Nunja das funktioniert. Jedoch muss ich das Bild passend in dem Counter Generieren lasse, jedoch funktioniert das nicht ganz...
Code vom Counter
<?php /******************************************************************************* * Title: PHP graphical hit counter (PHPGcount) * Version: 1.1 @ October 26, 2007 * Author: Klemen Stirn * Website: http://www.phpjunkyard.com ******************************************************************************** * COPYRIGHT NOTICE * Copyright 2004-2007 Klemen Stirn. All Rights Reserved. * * This script may be used and modified free of charge by anyone * AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT. * By using this code you agree to indemnify Klemen Stirn from any * liability that might arise from it's use. * * Selling the code for this program, in part or full, without prior * written consent is expressly forbidden. * * Obtain permission before redistributing this software over the Internet * or in any other medium. In all cases copyright and header must remain * intact. This Copyright is in full effect in any country that has * International Trade Agreements with the United States of America or * with the European Union. *******************************************************************************/ // SETUP YOUR COUNTER // Detailed information found in the readme file // URL of the folder where script is installed. INCLUDE a trailing "/" !!! $base_url = 'Mein URL'; // Default image style (font) $default_style = 'olde'; // Default counter image extension $default_ext = 'gif'; // Count UNIQUE visitors ONLY? 1 = YES, 0 = NO $count_unique = 0; // Number of hours a visitor is considered as "unique" $unique_hours = 24; // Minimum number of digits shown (zero-padding). Set to 0 to disable. $min_digits = 0; ############################# # DO NOT EDIT BELOW # ############################# /* Turn error notices off */ error_reporting(E_ALL ^ E_NOTICE); /* Get page and log file names */ $page = input($_GET['page']) or die('ERROR: Missing page ID'); $logfile = 'logs/' . $page . '.txt'; /* Get style and extension information */ $style = input($_GET['style']) or $style = $default_style; $style_dir = 'styles/' . $style . '/'; $ext = input($_GET['ext']) or $ext = $default_ext; /* Does the log exist? */ if (file_exists($logfile)) { /* Get current count */ $count = trim(file_get_contents($logfile)) or $count = 0; if ($count_unique==0 || $_COOKIE['gcount_unique']!=$page) { /* Increase the count by 1 */ $count = $count + 1; $fp = @fopen($logfile,'w+') or die('ERROR: Can\'t write to the log file ('.$logfile.'), please make sure this file exists and is CHMOD to 666 (rw-rw-rw-)!'); flock($fp, LOCK_EX); fputs($fp, $count); flock($fp, LOCK_UN); fclose($fp); /* Print the Cookie and P3P compact privacy policy */ header('P3P: CP="NOI NID"'); setcookie('gcount_unique', $page, time()+60*60*$unique_hours); } /* Is zero-padding enabled? */ if ($min_digits > 0) { $count = sprintf('%0'.$min_digits.'s',$count); } /* Print out Javascript code and exit */ $len = strlen($count); for ($i=0;$i<$len;$i++) { echo 'document.write(\'<img src="'.$base_url . $style_dir . substr($count,$i,1) . '.' . $ext .'" border="0">\');'; } exit(); } else { die('ERROR: Invalid log file!'); } /* This functin handles input parameters making sure nothing dangerous is passed in */ function input($in) { $out = htmlentities(stripslashes($in)); $out = str_replace(array('/','\\'), '', $out); return $out; } ?>
Wäre einer so nett und würde mir helfen, das das richtig ausgegeben wird?
mfg: oLde