Counters Code

  Home arrow Counters Code arrow Easily Configurable Counter
COUNTERS CODE

Easily Configurable Counter
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-05-11

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    All you need to do is change the variables at the top of the page to change how the counter looks.

    By : Genshibakudan

    <?php

    //**********************************//
    // My first PHP script! //
    // Author: Alex Walton //
    // E-Mail: genshibakudan@hotmail.com//
    // Date: 26.4.02 //
    //**********************************//

    /*
    Feel free to edit this script as you like but please keep the header (^ ^ ^) intact.
    If you have any questions about this script, e-mail me at genshibakudan@hotmail.com
    */

    // You can edit the variables below \/

    $filename = "count.dat" //name of the file where the data is kept
    $message1 = "There have been"; // first message section \/
    $message2 = " visitors to this page."; // second message section [$message1 $count $message2]
    $bold = "1"; // if 1, the numbers are bold, if 0 nothing is bold
    $font = "verdana"; // The font name
    $fontsize = "2"; // The size of the font
    $textcolor = "#005500"; //The color of the $message1 and $message2 (HEX)
    $numbercolor = "#550000"; //The colour of the numbers (HEX)
    $numberglow = "0"; //If 1, the numbers glow, if 0, they don't.
    $glowcolor = "#0000FF"; //The colour of the glow
    $invisible = "0" //If 1, the counter will not show (it will still count!)

    // Don't edit anything below this line unless you know what you're doing

    $fp = fopen($filename,"r+");
    flock($fp,1);
    $count = fgets($fp,6);
    $count += 1;
    rewind($fp);
    fputs($fp,$count);
    flock($fp,3);
    fclose($fp);
    if ($invisible == "1"){
    //counter does nothing because 'invisible' is on (1)
    } elseif ($invisible == "0"){
    if ($bold == "1"){
    $bold1 = "<b>";
    $bold2 = "</b>";
    } elseif ($bold == "0"){
    $bold1 = "";
    $bold2 = "";
    }
    if ($numberglow == "1"){
    $glow1 = "<table STYLE=width:100%;filter:GLOW(color=$glowcolor,strength=#+9)>";
    $glow2 = "</table>";
    } elseif ($numberglow == "0"){
    $glow1 = "";
    $glow2 = "";
    }
    print "<font face='$font' size='$fontsize' color='$textcolor'> $message1 </font><font face='$font' size='$fontsize' color='$numbercolor'>$glow1$bold1$count$bold2$glow2</font><font face='$font' size='$fontsize' color='$textcolor'> $message2</font>";
    }
    ?>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Counters Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    COUNTERS CODE ARTICLES

    - TG Who's Online
    - Text Based Counter that formats output
    - Counter & visitor statistics
    - Server Uptime Statistics
    - Chris Dingman's Hit Tracker Script
    - Graph Maker Function
    - Simple userOnline class
    - Adv. Log file generator
    - Logwriter
    - time_left()
    - Basic Statistics
    - Easy Counter
    - countCodeLines
    - MySQL Counter
    - bandwidthmeter


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap