Return to Snippet

Revision: 39832
at January 21, 2011 11:20 by GeekOfWeb


Updated Code
<?php
/*
Plugin Name: CW Wordpress Sayac
Plugin URI: http://www.cyber-warrior.org/Forum/wordpress-116,0.cwx
Description: Wordpress Ziyaretci Sayac Eklentisi.
Version: 1.4.5.3
Author: CWSuskun (and Serkan Yildiz) Some optimization fixes. 
Author URI: http://www.cyber-warrior.org/CWSuskun
*/

add_action('wp_meta', 'wordpresSayac');

function wordpresSayac() {
$veriler = fopen('bilgiler.txt', 'r'); 
$sayac = fread($veriler, filesize('bilgiler.txt'));
fclose($veriler);

$veriler = fopen('bilgiler.txt', 'w'); 
$sayac_artir = $sayac+1;
fwrite($veriler, $sayac_artir);
fclose($veriler);

echo "<br>Bu sayfa $sayac kere goruntulendi.";
}


/**
* @author Serkan YILDIZ (fixed some optimization issues.)
*/
function wordpressSayac()
{
	$file = fopen('bilgiler.txt','r+'); // open the file for reading and writing
	$iVisitors = fread($file, filesize('bilgiler.txt')); // read the file
	
	fwrite($file, (int)$iVisitors + 1); // update visitors count
	fclose($file); // close the file
	
	echo '<br/> Bu sayfa '.$iVisitors.' kere goruntulendi.';
}

?>

Revision: 39831
at January 21, 2011 11:16 by GeekOfWeb


Initial Code
function wordpressSayac()
{
	$file = fopen('bilgiler.txt','r+'); // open the file for reading and writing
	$iVisitors = fread($file, filesize('bilgiler.txt')); // read the file
	
	fwrite($file, (int)$iVisitors + 1); // update visitors count
	fclose($file); // close the file
	
	echo '<br/> Bu sayfa '.$iVisitors.' kere goruntulendi.';
}

Initial URL

                                

Initial Description

                                

Initial Title
CWP Say.  (Fixed)

Initial Tags

                                

Initial Language
PHP