See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: OT again: this time, I need a PHP person's help!  (Read 10914 times)

0 Members and 1 Guest are viewing this topic.

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #25 - 28 March 2003, 11:56:58
Yeah I just noticed that too!!!!  apfa.dat is showing "10", but the graphic image on the webpage
is still at "1".

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #26 - 28 March 2003, 11:57:27

#Abax Hit Counter v1.0, Copyright 2001 By Nathan Dickman, visit http://www.NathanDickman.com/
#This script may be freely distributed providing all copyright headers are kept intact


//Abax Hit Counter configuration//

$datafile="http://www.apfa.ca/counter/apfa.dat";                 //filename for counter datafile
$counterstyle = "image";                  //enter text for text,image for images, or invisible for none
$textcountlength = 4;                     //length of counter in digits if using text option          
$font = "Arial, Helvetica, sans-serif";   //font face style if using text counter
$fontsize = "2";                          //font size if using text counter
$fontcolour = "#999999";                  //font colour use html colour codes
$imagedirectory = "http://www.apfa.ca/counter/images/";  //directory or http location to images
NOTE: use trailing slash
$imagesext = ".gif";                      //file extension for images e.g. .gif .jpg .png              
$initialvalue = 1024;

//MAIN CODE//

if (!file_exists($datafile)) {
   $file = fopen($datafile,"w+");
   fwrite ($file,$initialvalue);
   fclose ($file);
  }
else  {

   $file = fopen($datafile,"r+");
   $hitcount = fread($file,filesize($datafile));
   fclose ($file);

 };



$hitcount++;

$file = fopen($datafile,"w+");
fwrite ($file,$hitcount);


if ($counterstyle != "invisible") {

if ($counterstyle == "text")  {

   echo ""
   .sprintf("%0"."$textcountlength"."d",$hitcount)."
";
  }
else  {

   $longstr = strlen($hitcount);
   for ($x=0; $x < $longstr; $x++)  {

$image = substr($hitcount,$x,1);

echo "\"$image\"";

       }
  }
}

?>

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #27 - 28 March 2003, 11:58:16
Notice, though, that the variable $initialvalue is set to 1024, so apfa.dat should theoretically be
starting out at 1024.  But it's not.

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #28 - 28 March 2003, 12:00:23
replace:
$datafile="http://www.apfa.ca/counter/apfa.dat"; //filename for counter datafile

with

$datafile="apfa.dat"; //filename for counter datafile

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #29 - 28 March 2003, 12:01:03
OK....I tried that earlier, but I'll do it again.  Two seconds, please!

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #30 - 28 March 2003, 12:01:57
Done.  Changed it to simply apfa.dat, and now it's screwed up again.

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #31 - 28 March 2003, 12:07:17
then try replacing by :

$datafile="counter\/apfa.dat"; //filename for counter datafile

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #32 - 28 March 2003, 12:08:03
And :) , it work !

(no ?)

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #33 - 28 March 2003, 12:09:16
WHAAA?  counter\/apfa.dat???

OK, I'll try it *scratching head doubtfully*....but I dno't think it'll work........

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #34 - 28 March 2003, 12:10:07
OH MY GOD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #35 - 28 March 2003, 12:10:12
HYEAAAAAAA

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #36 - 28 March 2003, 12:11:05
Now you just need to edit the abfa.dat file to give it 1024 as a value and you will have your 1024

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #37 - 28 March 2003, 12:12:01
OK now that is just F****** CRAZY!!!!!!!!!!!!!!!!!!!!!!!!!

What the hell??????????????

I've never seen the slashes mixed like that for ANYTHING!!!!!!!

And not to nitpick...but it's STILL not working right....the initialvalue variable seems to have NO
effect....

But I'm NOT COMPLAINING!!!!!  THANK YOU THANK YOU THANK YOU!!!!!!

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #38 - 28 March 2003, 12:12:08
don't be worry if it pass frome 40 to 60 or 80 I click also on it :)

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #39 - 28 March 2003, 12:14:21
curious the initial value doesn't seem to work here also
a small bug but that's not a big problem
edit manually the abfa.dat file with notepad
and replace the ** value with 1024

(or click on your page 1024 time :)  )

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #40 - 28 March 2003, 12:14:30
Oh man....I give up *sigh*

I am not worthy to be in your presence, sir!!!!!  You are a god.  How the hell you figured that out,
I'll never know...and I'm GOOD with computers....

It's 4:15am here, and I'm totally out of it....I will just thank you ONE more time (THANK YOU!) and
now I'm going to go to bed and celebrate by dreaming of web counters all night ;)

THanks again Dan!  As we used to say in New York City, "You da MAN!"

Dave

p.s. does this mean the 600-post thread limit will remain unchallenged? ;)

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #41 - 28 March 2003, 12:15:28
Pouf 1026 :)

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #42 - 28 March 2003, 12:16:14
Yeah...."pouf" because I edited the apfa.dat file like you said ;)

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #43 - 28 March 2003, 12:16:35
have a good night sir :zzz:

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #44 - 28 March 2003, 12:17:17
tomorrow we will give you *REAL* counter
(no headeach don't worry)

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #45 - 28 March 2003, 12:17:38
I am looking at that part of the script you had me correct...and I swear to god, it STILL doesn't
look right.  It looks like it should be broken, and yet it's not.  Why this is, I cannot say *shaking
head in wonderment*

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline canadave

  • Hero Member
  • *****
  • Posts: 531
  • Country: Canada ca
  • Karma: 0
Reply #46 - 28 March 2003, 12:18:02
sounds good man...thanks again!  g'night ;)

Dave

« Last Edit: 28 March 2003, 12:27:27 by canadave »

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #47 - 28 March 2003, 12:27:27
Debugging in real time by a forum thread that was a first experience for me,  Thank to you :)

Now you just need to count sheep to have a nice sleep

1 sheep
2 sheep
3 sheep
4.. :zzz:

« Last Edit: 28 March 2003, 12:27:27 by DanSteph »