php question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chris
    Too lazy to set a custom title
    • May 2003
    • 27880

    #1

    php question

    here is the source for the thing in my sig

    PHP Code:
    $current="";
    $started="";
    
    $l=@fopen("sig.php",r);
    $self=@fread($l,filesize("sig.php"));
    @fclose($l);
    if($self){
    $l=time()-2629743;
        if(!$current>0 || !$started || $started<$l){
        $self=str_replace("started=\"$started\"","started=\"".time()."\"",$self);
        $self=str_replace("current=\"$current\"","current=\"1\"",$self);
        $current=1;
        $started=time();
        }else{
        $self=str_replace("current=\"$current\"","current=\"".($current+1)."\"",$self);
        $current=$current+1;
        }
    $l=@fopen("sig.php",w);
    @fputs($l,$self);
    @fclose($l);
    }
    Header("Content-type: image/jpeg");
    $image=imagecreate(250,22);
    $white=ImageColorAllocate($image,255,255,255);
    $black=ImageColorAllocate($image,0,0,0);
    $red=ImageColorAllocate($image,255,0,0);
    ImageFilledRectangle($image,0,0,250,22,$white);
    ImageRectangle($image,0,0,249,21,$black); 
    $string="Sig viewed $current times since ".date("M d. H:i",($started-24*3600))."";
    ImageString($image,1,2,1,$string,$red);
    ImageString($image,1,65,11,'Icq - 71462500. I want an Xbox!',$black);
    ImageJPEG($image);
    ImageDestroy($image); 
    

    now i was wonderin if i could spruse it up a bit and make it say how many clicks i have had or could i make another button to say how many clicks i have gotten
    [email protected]
  • jasonir
    Confirmed User
    • Aug 2002
    • 1887

    #2
    Yes, you certainly could.
    ICQ: 61689996

    Comment

    • Chris
      Too lazy to set a custom title
      • May 2003
      • 27880

      #3
      Originally posted by jasonir
      Yes, you certainly could.
      well how about you tell me how or tell me how much you will charge
      [email protected]

      Comment

      • jasonir
        Confirmed User
        • Aug 2002
        • 1887

        #4
        Originally posted by JupZChris
        well how about you tell me how or tell me how much you will charge
        That's an interesting idea... I think I will have my guy make a free hosted service for that.
        ICQ: 61689996

        Comment

        • Chris
          Too lazy to set a custom title
          • May 2003
          • 27880

          #5
          Originally posted by jasonir


          That's an interesting idea... I think I will have my guy make a free hosted service for that.
          this script was already posted for free by repetive monkey
          [email protected]

          Comment

          • Repetitive Monkey
            Confirmed User
            • Feb 2004
            • 3505

            #6
            Hey, it's cool to see the script gets some use.

            As far as counting sig clicks go, I could change the script to do that also. I'll do it for $10 PayPal or 4k clickys. Hehe.

            By the way, change the "65" in
            ImageString($image,1,65,11,'Icq - 71462500. I want an Xbox!',$black);
            to a lower number to make the second line center more properly.

            Comment

            • Repetitive Monkey
              Confirmed User
              • Feb 2004
              • 3505

              #7
              Done. Now it also counts clicks.

              Comment

              Working...