CWP Say. (Fixed)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. /*
  3. Plugin Name: CW Wordpress Sayac
  4. Plugin URI: http://www.cyber-warrior.org/Forum/wordpress-116,0.cwx
  5. Description: Wordpress Ziyaretci Sayac Eklentisi.
  6. Version: 1.4.5.3
  7. Author: CWSuskun (and Serkan Yildiz) Some optimization fixes.
  8. Author URI: http://www.cyber-warrior.org/CWSuskun
  9. */
  10.  
  11. add_action('wp_meta', 'wordpresSayac');
  12.  
  13. function wordpresSayac() {
  14. $veriler = fopen('bilgiler.txt', 'r');
  15. $sayac = fread($veriler, filesize('bilgiler.txt'));
  16. fclose($veriler);
  17.  
  18. $veriler = fopen('bilgiler.txt', 'w');
  19. $sayac_artir = $sayac+1;
  20. fwrite($veriler, $sayac_artir);
  21. fclose($veriler);
  22.  
  23. echo "<br>Bu sayfa $sayac kere goruntulendi.";
  24. }
  25.  
  26.  
  27. /**
  28. * @author Serkan YILDIZ (fixed some optimization issues.)
  29. */
  30. function wordpressSayac()
  31. {
  32. $file = fopen('bilgiler.txt','r+'); // open the file for reading and writing
  33. $iVisitors = fread($file, filesize('bilgiler.txt')); // read the file
  34.  
  35. fwrite($file, (int)$iVisitors + 1); // update visitors count
  36. fclose($file); // close the file
  37.  
  38. echo '<br/> Bu sayfa '.$iVisitors.' kere goruntulendi.';
  39. }
  40.  
  41. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.