Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 60
Member
Member
Offline
Joined: Jan 2000
Posts: 60
Counter hacked: "You're visitor number:" add-in!

See it in action: http://www.vietmart.net/cgi-bin/boards/CountBoards.cgi (the link is not a permanent url)


Well well, this hack will display "You're visitor number: ###" under 'You last visited:'. I wrote a small counter script and add it into the Ultimate.cgi! It's very easy to use. Note: This is a beta hack, i am not responsible for any damages on your UBB. But i think its will work fine.

Tested on v5.42a


Ok, now create a "Count.txt" and place it in your ubb directory. Chmod it to 0777.

You may insert any number(this format: |1243) in the Count.txt to begin with or else leave it along.


Open up the Ultimate.cgi

Find:

#combine date/time line
$LastLoginTime = ("You last visited: $FormatDate $FormatTime");
} else {
$LastLoginTime = "";
}



add this code right below it:
Code
code:


Find:

$LastLoginTime

replace it with:

$LastLoginTime
$CounterLine



Noted: $LastLoginTime is appearing two time, so search twice and replace the new code above.


I am so tire working on this hack. I've decided to make it show the count in graphic too, but too lazy [Linked Image]! So if anyone have a little time, please do that for me. Or else, i'll do it then.

Oh, you may notice that when you refresh your page, your counter is changing too. I'll fix it later on. [Linked Image]

***Reminder: Reinstall the Ultimate.cgi will cause the 'Count' to start over again. If that's happen, just go into the Count.txt and put in any number you want to begin with. (this format: |1243)


PS: I am not good in cgi/perl, so it took me the whole day to hack this thing. I hope you might need it/like it. And if you have found a bug or two, please post your re-code here for other to use. Thanks! [Linked Image]

See it in action: http://www.vietmart.net/cgi-bin/boards/CountBoards.cgi (the link is not a permanent url)


<FONT COLOR="blue">
Free UBB Instalation

Contact on AIM: vmnweb
</FONT c>
Sponsored Links
Joined: Jan 2000
Posts: 60
Member
Member
Offline
Joined: Jan 2000
Posts: 60
the number on my board is not a correct number. all i do was insert that number(4161) into the Coun.txt [Linked Image]


Perhaps you can make it, you are visitor number XXX 'today' and maybe have it use the same type of program that creates our daily topics.

Yeah, i'll work on that!


<FONT COLOR="blue">
Free UBB Instalation

Contact on AIM: vmnweb
</FONT c>
Joined: Feb 2000
Posts: 3
Jon Offline
Junior Member
Junior Member
Offline
Joined: Feb 2000
Posts: 3
Has anyone gotten this to work..? I have tried several times.. with no success...What am I missing..?

Joined: Jan 2000
Posts: 64
Member
Member
Offline
Joined: Jan 2000
Posts: 64
I just added this and it took 3 seconds. if you alread have installed the this thread read xxx number of time hack, you can use that same counter for your main page

I looked in Ultimate.cgi for the code that prints the last log in time.

$LastLoginTime

i just added the count code below it

$LastLoginTime



done

this hack is in the db

Mutt

you pick any counter from cgi-resources so if you wanted a graphic, just pick a graphical counter

Joined: Feb 2000
Posts: 3
Jon Offline
Junior Member
Junior Member
Offline
Joined: Feb 2000
Posts: 3
Thanks Mutt... I have been going about it the wrong way...

Thanks again

Sponsored Links
Joined: Feb 2000
Posts: 3
Junior Member
Junior Member
Offline
Joined: Feb 2000
Posts: 3
I've installed the hack and it works fine.

The only potential problem that I can see is that if the user installs the counter on several pages, then they must ensure that Perl can get its hands on the 'DOCUMENT_URI' environment variable.

With my UBB, I can't actually see the contents of that variable, and thus, the Count.txt file always contains: |12345
Its no big deal for me since I currently only have the count hack applied to Ultimate.cgi, but I'd need to make alterations if applying it to other pages.

I guess you could use something else like 'REQUEST_URI' instead. I'll go give that a whirl and see what happens.

Shane

Joined: Feb 2000
Posts: 115
Member
Member
Offline
Joined: Feb 2000
Posts: 115
ok, it works fine !!
For those of all get an internal server error, please remove the space between the '|' pipes, it comes up 3 times !!

this tip is from AA ... tnx a lot !!

Joined: Feb 2000
Posts: 7
Junior Member
Junior Member
Offline
Joined: Feb 2000
Posts: 7
Hmmm... I have mcount.cgi installed and working, but if I try to add



to Ultimate.cgi, it doesn't want to execute the counter.... (it shows up just like the above in the source)... any ideas?

Arie

Joined: Feb 1999
Posts: 1,379
cal Offline
Programmer
Programmer
Offline
Joined: Feb 1999
Posts: 1,379
You're putting an SSI statement in your cgi file? Why don't you just call your counter CGI using a perl call?

Just a thought [Linked Image]

Joined: Jan 2000
Posts: 60
Member
Member
Offline
Joined: Jan 2000
Posts: 60
because at that time i don't know how. i am not good in perl, [Linked Image]

------------------
Free UBB Instalation!


<FONT COLOR="blue">
Free UBB Instalation

Contact on AIM: vmnweb
</FONT c>
Sponsored Links
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
installed the hack as you said, Anonymous
altered all files, created the txt and set the correct chmod
but it doesn't work [Linked Image]
there is just nothing displayed
the whole $CounterLine is not printed
changing the | | didn't help
thx
Sub

------------------
SubWorx

Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
ok i got this thing to work
cool
but one question: it logs every access to the board
is there some way to make an ip block? like in real counters, only unique ips are logged
thx for any help

------------------
SubWorx


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)