Hey all,
I designed a PHP graphic counter to allow me to customize the graphic numbers being used.
You can see the counter here:
CLICK FOR WORKING COUNTER
See those copper-colored numbers? Well I wanted a different hue of the same graphic, so I pulled them into Draw and quickly rendered them in a specific shade of blue. I uploaded them to my page.
Thinking that my PHP script was editable, I pasted the new graphic titles for the blue version; created a separate ~.dat file for the blue counter to write to; uploaded the whole shebang; made certain to CHMOD the whole bloody mess; and then watched in horror as every attempt to get the blue version of this same counter to work failed.
You can see the dismal results HERE.
The code follows; any ideas on what else is left for me to troubleshoot? I also tried creating fresh PHP's . . . renaming the graphics . . . geez, everything. Thanks for any help you can give me.
Skye
<?php
function Use_Pictures ($pc)
{
$site=".";
$new1="<img src=\"$site/6901BLUE.gif\">";
$new2="<img src=\"$site/6902BLUE.gif\">";
$new3="<img src=\"$site/6903BLUE.gif\">";
$new4="<img src=\"$site/6904BLUE.gif\">";
$new5="<img src=\"$site/6905BLUE.gif\">";
$new6="<img src=\"$site/6906BLUE.gif\">";
$new7="<img src=\"$site/6907BLUE.gif\">";
$new8="<img src=\"$site/6908BLUE.gif\">";
$new9="<img src=\"$site/6909BLUE.gif\">";
$new0="<img src=\"$site/6900BLUE.gif\">";
$comma="<img src='$site/69COMMABLUE.gif'>";
$count=$pc;
$count = ereg_replace ("1","$new1","$count");
$count = ereg_replace ("2","$new2","$count");
$count = ereg_replace ("3","$new3","$count");
$count = ereg_replace ("4","$new4","$count");
$count = ereg_replace ("5","$new5","$count");
$count = ereg_replace ("6","$new6","$count");
$count = ereg_replace ("7","$new7","$count");
$count = ereg_replace ("8","$new8","$count");
$count = ereg_replace ("9","$new9","$count");
$count = ereg_replace ("0","$new0","$count");
$count = ereg_replace (",","$comma","$count");
return $count;
}
if ($hitflag != 1) {
$hitflag = 1;
$filename = "/home/tobeornot2b/public_html/me/xCGRAPHICS/xDATA/YUMYUM.dat";
$filesize = filesize("$filename");
$result = file_exists("$filename");
if ($result != "") {
$fd = fopen( $filename, "r" );
$contents = fread($fd, filesize($filename));
// echo "Contents before = $contents <br> \n";
fclose($fd);
}
else {
$contents = 0;
}
if ($filesize < 5000) {
$fd = fopen( $filename, "w" );
$contents = $contents + 1;
// echo "Contents after = $contents <br> \n";
fputs($fd, "$contents");
$contents=number_format($contents);
$contents1=Use_Pictures($contents);
echo $contents1;
}
}
?>
And PETITE.php (the working one) is here:
<?php
function Use_Pictures ($pc)
{
$site=".";
$new1="<img src=\"$site/one.gif\">";
$new2="<img src=\"$site/two.gif\">";
$new3="<img src=\"$site/three.gif\">";
$new4="<img src=\"$site/four.gif\">";
$new5="<img src=\"$site/five.gif\">";
$new6="<img src=\"$site/six.gif\">";
$new7="<img src=\"$site/seven.gif\">";
$new8="<img src=\"$site/eight.gif\">";
$new9="<img src=\"$site/nine.gif\">";
$new0="<img src=\"$site/zero.gif\">";
$comma="<img src='$site/comma3980.gif'>";
$count=$pc;
$count = ereg_replace ("1","$new1","$count");
$count = ereg_replace ("2","$new2","$count");
$count = ereg_replace ("3","$new3","$count");
$count = ereg_replace ("4","$new4","$count");
$count = ereg_replace ("5","$new5","$count");
$count = ereg_replace ("6","$new6","$count");
$count = ereg_replace ("7","$new7","$count");
$count = ereg_replace ("8","$new8","$count");
$count = ereg_replace ("9","$new9","$count");
$count = ereg_replace ("0","$new0","$count");
$count = ereg_replace (",","$comma","$count");
return $count;
}
if ($hitflag != 1) {
$hitflag = 1;
$filename = "/home/tobeornot2b/public_html/me/xCGRAPHICS/xDATA/COUNTPETITE.dat";
$filesize = filesize("$filename");
$result = file_exists("$filename");
if ($result != "") {
$fd = fopen( $filename, "r" );
$contents = fread($fd, filesize($filename));
// echo "Contents before = $contents <br> \n";
fclose($fd);
}
else {
$contents = 0;
}
if ($filesize < 5000) {
$fd = fopen( $filename, "w" );
$contents = $contents + 1;
// echo "Contents after = $contents <br> \n";
fputs($fd, "$contents");
$contents=number_format($contents);
$contents1=Use_Pictures($contents);
echo $contents1;
}
}
?>