View Full Version : counterrrrrrr (roll your r's)
nobody
February 4th, 2003, 04:55 PM
im not sure what forum this should be in so i put it in random.
what im lookin for is a hit counter that displays hits in roman numerals.. i dont know if there is a website that would have this or if there is some way to code this in flash or some other thing i dont know how to use.. but if anyone knows of anything id appreciate it
thanks
[xxviii]
[Legoman]
February 4th, 2003, 05:22 PM
I have no idea, but I just wanted to lavish praise on your avatar. Strongbad rocks.
nobody
February 4th, 2003, 05:30 PM
damn it i thought this was gonna be a helpful post.. but yes, strongbad is the most amazing thing ever
Marz
February 4th, 2003, 06:13 PM
YEah yeah.. Chill man..
For starters.. You can do a counter in roman numerals... Now.. Why you'd want that is beyond me.. But.. If you give me a list of roman numerals again.. I totally forget.. Don't they go...
X - 10
V - 5
I - 1
II - 2
III - 3
VI - 4
And so on and so forth.. If you give me like.. 100 which I forget.. And 1000.. 10,000.. 100,000.. Blah blah blah..
C - 100 ??
Mr. Flash
February 4th, 2003, 06:37 PM
Originally posted by playamarz
YEah yeah.. Chill man..
For starters.. You can do a counter in roman numerals... Now.. Why you'd want that is beyond me.. But.. If you give me a list of roman numerals again.. I totally forget.. Don't they go...
X - 10
V - 5
I - 1
II - 2
III - 3
VI - 4
And so on and so forth.. If you give me like.. 100 which I forget.. And 1000.. 10,000.. 100,000.. Blah blah blah..
C - 100 ??
Your right on all of them except 4. 4 is IV the I has to come before the V or else it would be 6, which you have it as.
Marz
February 4th, 2003, 07:23 PM
DOLP!
*lmao*
I screw up one of the easy ones... :)
nobody
February 4th, 2003, 08:53 PM
umm yeah i have really have no clue what the numerals are past like 49.. but ill go look them up real quick.. hang on
hangin on?
gooooooooooooood
50 is L
100 is C
500 is D
1000 is M
5000 is V
thats as far as i can figure out
so yeah its like year MMIII right now.. i think.. so if someone wants to make me one that would be tremendous
nobody
February 4th, 2003, 08:56 PM
found more
V is 500 actually
X is 10,000
L is 50,000
C is 100,000
D is 500,000
M is 1,000,000
i think thats about it
nobody
February 4th, 2003, 08:58 PM
i think the underline means its the normal numer times 1000..
[example.. more for me that u..]
V is 5
5 times 1000 is 5000
5000 is V
yeaaaaah... i think thats how its done
Jubba
February 4th, 2003, 09:02 PM
Why do you need to have the counter displayed in roman numerals? Its not really that practical since:
1) Not many people know all of the roman numerals so not that many people will understand the function.
2) You would have to make an array for each of the symbols and then some functions to test what the value is and to plug the right roman numerals in...
The whole idea really isn't worth the effort.
nobody
February 4th, 2003, 09:09 PM
cuz its puuuuuuuuuuuuuuuuurdy
and if ppl dont know the roman numerals they can go look them up like i did.. and they probably wont even realize its a counter anyways.. so its all good
lostinbeta
February 4th, 2003, 11:30 PM
Seems someone has a roman numerals fetish ;)
But a counter in roman numerals could be difficult because when you get to higher numbers don't the symbols change. Like the way it is read is different or something. Not sure.
Mik3
February 5th, 2003, 12:35 AM
STRONGBAD IS COOL! HOMESTAR IS BETTER!!!! MARCYPENNY SUX! :*(
nobody
February 5th, 2003, 03:20 PM
thanks.. thank u mike that helps.. at least lost in betas post was semi-constructive.. wee im bein cylindrical or cynical or something.. maybe cuz im all pissy.. anywho.. does anyone know how to make one yet?
lostinbeta
February 5th, 2003, 03:29 PM
Yeah you were being cynical.
I still think the counter is a bit too advanced (at least for me)
I mean, think about it...
9 = IX
but 91 = XCI and not IXI
So you will have to have some way of detecting and calculating and converting the math from regular numbers to roman numerals. You can't just convert a number to a roman numeral and use that numeral whenever a number is used.
lostinbeta
February 5th, 2003, 04:50 PM
I doubt this will help, but I took a script from javascript.internet.com and converted it to AS form and created a Number to Roman Numeral converter script.
You can take a look at it if you want. It MIGHT help.
nobody
February 5th, 2003, 08:31 PM
thats awesome lost.. but i know nothing about actionscript.. so yeah i dont have a clue what to do but if someone is good at actionscript maybe they could whip somethin up using that? i dunno
Jubba
February 5th, 2003, 08:47 PM
we aren't here to make things for people. We are here to assist.
nobody
February 5th, 2003, 08:58 PM
oh.. well i kinda have no clue.. so if someonen wants to highly assist me that would be cool.. ill make it i just need to know some stuff.. so yeah, ill make it
dont hate the new guy
lostinbeta
February 5th, 2003, 10:43 PM
Well with the script I gave you you could target a variable instead of a textbox. And that variable will be where you store your page hits (through PHP)
But it still has the problem of only going up to 3999 :-\
nobody
February 6th, 2003, 03:33 PM
so basically i wanna know if anyone thinks this is doable or should i just scrap it and randomly think of some other semi-cool thing to do
lostinbeta
February 6th, 2003, 04:48 PM
It is up to you whether you want to scrap it or press on.
I found this CGI Roman Numeral Hit Counter
http://www.xav.com/scripts/roman/
Perhaps you can try loading the variable from the cgi file (with loadVars) and displaying it in flash instead of having it type it on the page.
nobody
February 6th, 2003, 05:10 PM
first off, it doesnt have to be in flash... that was just a thought
secondly, i have absolutely no coding knowledge except for basic html.. so if you guys think its too hard for a complete n00b(i didnt just say n00b) do you think you could point out some stuff.. or better yet, how about i just try it and then tell you where im stuck... derrrr
nobody
February 6th, 2003, 05:14 PM
wow.. this is how far i got.. i d/led the zip file.. then i looked at it (contains an empty folder called data, roman.pl and a help site link)
ok i dont even know what .pl is so umm help?
lostinbeta
February 6th, 2003, 05:16 PM
Well in the link I sent on the same page there is a part that says..
<B>Installation and Configuration</B>
That should tell you how what you have to do.
As for doing it in Flash... for a complete n00b I am not sure, because I didn't try getting it to work in Flash so I don't know if it is as easy as just pulling a loadVars on the cgi file.
Oh, and .pl is a Perl file.
nobody
February 6th, 2003, 05:18 PM
ok well im just gonna attempt to do what it says on the site
thanks for all the help lost
i really appreciate it
lostinbeta
February 6th, 2003, 05:18 PM
No problem, I hope you get it working.
nobody
February 6th, 2003, 05:19 PM
i read what it said.. its like a foreign language to me.. it says to set the variables.. whats that about? and once i get this all up and running how do i actually put it on my page and wow i am so lost (no pun intended)
nobody
February 6th, 2003, 05:22 PM
ok i get some parts now, i put it on the page by useing the execute cgi tag right? but i still dont get what im supposed to edit in the code
nobody
February 6th, 2003, 05:23 PM
#!/usr/bin/perl --
use strict;
# Roman Numeral Counter, Version 1.0.0.0003
# Copyright 1997-2001 by Zoltan Milosevic. Please adhere
# to the copyright notice and conditions of use which are described
# in the attached help file and hosted at the URL below.
#
# For latest version and help files, visit:
# http://www.xav.com/scripts/roman/
# __________________________________________________ ________________
# Instructions:
# -------------
# Below, in the $directory variable, write in the path to a writable
# directory on your system:
my $directory = 'data';
# Make this directory writable by typing "chmod 777 data".
#
# Include the following in your web pages:
#
# <B>You are visitor number <!--#exec cgi="roman.pl" -->.</B>
#
# __________________________________________________ ___________________
print "Content-Type: text/html\015\012\015\012";
my $err = '';
Err: {
unless (chdir($directory)) {
$err = "unable to chdir to \$directory folder '$directory' - $!";
next Err;
}
unless ($ENV{'DOCUMENT_URI'}) {
$err = "environment variable DOCUMENT_URI is not defined (script must be called as SSI)";
next Err;
}
my $Document = $ENV{'DOCUMENT_URI'};
$Document =~ s/\//_/g;
my $Hits = 0;
if (-e $Document) {
unless (open(COUNT,"<$Document")) {
$err = "unable to read file '$Document' - $!";
next Err;
}
$Hits = <COUNT>;
close(COUNT);
}
$Hits++;
unless (open(COUNT,">$Document")) {
$err = "unable to open file '$Document' for writing - $!";
next Err;
}
print COUNT $Hits;
close(COUNT);
my ($Ones,$Tens,$Hundreds) = split(//, reverse $Hits);
print 'M' x int($Hits/1000);
print (('','C','CC','CCC','CD','D','DC','DCC','DCCC','CM ')[$Hundreds]);
print (('','X','XX','XXX','XL','L','LX','LXX','LXXX','XC ')[$Tens]);
print (('','I','II','III','IV','V','VI','VII','VIII','IX ')[$Ones]);
last Err;
}
continue {
print "<P><B>Roman TextCounter Error:</B> $err.</P>\n";
}
theres the code
nobody
February 6th, 2003, 05:25 PM
Make this directory writable by typing "chmod 777 data".
thats the part i dont get
where do i type that? is that like another file or what?
lostinbeta
February 6th, 2003, 05:26 PM
To edit the variables you must open the .pl file in a regular text editor or in dreamweaver or some other HTML editor.
The chomodding. Now that is one thing I had trouble with starting out on the web. CHMOD is setting the permission of your file. Your server MUST support this option. Usually if you access your files through FTP, chmodding is allowed (but not all the time). If you use a free host (tripod, geocities, etc) you most likely will not be allowed to do this, so the script won't work :(
But if you use an FTP program to access your site, there should be an option in there that allows you to chmod your files on your server. If not, you will have to contact your host and find out how.
If your server does not support chmodding of files, then you will not be able to have a counter, a counter requires the opening and writing to another file to save the information.
And the #exec cgi="roman.pl" part they talk about, that includes the cgi file on your HTML page you want it displayed on.
nobody
February 6th, 2003, 05:29 PM
ok well im using iwarp.com which is a sub-thinger of freeservers.com and i just use the manage files utility, so i have no idea how to use ftp.. i think it supports ftp.. it has cute_ftp and some other thing on there.. so should is there like a free ftp thing i could get?
lostinbeta
February 6th, 2003, 05:30 PM
Well if they have a User Control Panel there, they most likely would have the CHMOD ability somehwere in there.
Maybe check their help files and see what you can find on it.
nobody
February 6th, 2003, 05:35 PM
i cant find a search box anywhere on the site.. and i looked pretty much everywhere and there wasnt mention of CHMOD.. so im not entirely sure what to do.. im guessing you dont have any knowledge of the freeservers.com stuff do you? maybe i could tell you my account and password or something and you could dig around in there? i dunno what to do
lostinbeta
February 6th, 2003, 05:41 PM
Hmm, wow... Freeservers help files only gives you a few things if you are not logged it.
It says to view more you must log in then view this page...
http://help.freeservers.com/cgi-bin/help/
Im not going to root through those links for you man, besides, I gotta go now.
Later, and good luck!
nobody
February 6th, 2003, 05:42 PM
thanks for all your help lost.. by the time you get there should be a million more questions for you.. thanks again
Marz
February 6th, 2003, 07:47 PM
Let's see here... Actually.. let's stand back and actually think about how Roman Numerals are set up before we move to bigger things...
1 - 5 : I, II, III, IV, V
5-10 : V, VI, VII, VIII, IX, X
Okay.. So you see this much.. Then Let's say we want to do 10,20,30,40 then 50...
X, XX, XXX, XL, L
That's assuming if the L is actually correct... Well then.. This is easy to figure out.. 50,60,70,80,90,100 would be..
L, LX, LXX, LXXX, XC, C
It has a pattern... A basic pattern that will be settled throughout this whole thing... So we can set up a bunch of functions in flash to handle each setting... Depending on how high you wnat to go.. I'll make this easier on me by saying 9,999 hits.
First.. let's handle all the arryays you will need to complete this...
1to10 = ("","I","II","III","IV","V","VI","VII","VIII","IX","X");
10to100 = ("","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","C");
100to1000 = ("","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","M");
1000to10000 =
("","M","MM","MMM","MV","V","VM","VMM","VMMM","MX","X");
Since we are only going up to 9,999 or in RN state :
MXCMXCIX
::: Marz Roman Numeral Lesson :::
Let's see here.. You see the V as 5000? That's actually suppose to have a bar over the number... But I can't really show you that using the tools I have here.. Soo.. Just think that I know what I'm talking about *lmao*
::: End Marz RN Lesson :::
Now.. Back to the Flash Tutorial Lesson... Woooohooooo...
Let's make a hugely main Roman Numeral Number Converter...
intToRN(intNum, yourTextBox)
{
strNum = new String();
strNum.concat(intNum);
storedNums = new Array();
storedNums = strNum.split("");
placesLeft = storedNums.length;
// This makes a string.. Places the hitNum in the string
// then it splits the big number 9999 for instance..
// into "9","9","9","9".... That way we can see how it
// is really handled.. placesLeft is a variable that tells
// how many places are in the number... 867 = 3, 24 = 2
finalRN = new Array();
x = 0;
// finalRN will hold the actual RN's used in this
// and x is just sitting there.. being able to be used..
// just like the little slut letter it is.
if(placesLeft == 4)
{
finalRN[x] = 1000to10000[storedNums[x]];
x++;
}
if(placesLeft == 3)
{
finalRN[x] = 100to1000[storedNums[x]];
x++;
}
if(placesLeft == 2)
{
finalRN[x] = 10to100[storedNums[x]];
x++;
}
if(placesLeft == 1)
{
finalRN[x] = 1to10[storedNums[x]];
x++;
}
// Basically says.. Well If there are this many places
// left in this thing.. Then convert this portion to
// the correct Roman Numeral
strNum = finalRN.join("");
yourTextBox = strNum;
//Put the thing back into a string.. and display it
}
Wow... Basically to just clal this.. Say...
intToRN(9678, counterText);
It'll take 9678.. Make it MXDCLXXVIII and place that into the dynamic text box known as counterText..
Wow.. This was a bit harder than I thought.. But doesn't it make sense when you split it apart? hehe...
Well Hope this works for you.. Have Fun!
lostinbeta
February 6th, 2003, 07:51 PM
Wow man... great script.
Couldn't test it, but I am sure you wouldn't post it if it didn't work :crazy:
I couldn't do much with mine because I am horrible with Roman Numerals. Numbers and Math of any kind hates me, and I hate it.
nobody
February 6th, 2003, 08:09 PM
wow, took me a min to notice that.. so do you want to tell me what exactly to do with that script.. i know how to make a dynamic text box but thats about it.. and i dont i need a cgi file or something like that to store the data in.. idk im new to this.. but if i need the cgi im gonna have to wait until i purchuse xxviii.net in a couple months..
lostinbeta
February 6th, 2003, 08:11 PM
You will need to use CGI, Perl, PHP, ASP, or mySQL when creating a counter.
nobody
February 6th, 2003, 08:13 PM
ok so im gonna have to wait a little while.. i guess once i get xxviii.net ill do it.. u guys dont mind if i bring this up again in like 2 months do you? but hopefully by then ill me slightly more knowledgeable.. this weekend im gonna go out and buy an actionscript book and maybe a cgi book? do they make cgi books? if they do, do you have a recomendation.. or what was that code that playa wrote.. like what language? cuz i really need to learn this stuff
both of you guys rule by the way
Marz
February 6th, 2003, 08:13 PM
cgi sucks now... Just use php..
*lol*.. It's alot easier to use and you can pretty much perform the same amount of **** with less code!
Alls you'd need would be a text file counter.txt for instance.. And then in your php file.. Everytime someone comes in.. Just increment the count.txt file in a hidden manner...
Then... In your flash mx file load up that variable.. using loadVariables.. And then BAM!.. Plop that ho in your new function and put the little ***** in a text handler...
nobody
February 6th, 2003, 08:16 PM
do free hosting server-y places support php? mine doesnt support cgi so idk what it will do with php... and do u have a recommendation on a php book so i can get all smart like?
Marz
February 6th, 2003, 08:22 PM
I use Read Less, Learn More PHP... It's a really good small time book that'll teach you the basics really quickly.. Plus some...
If you really need someplace to throw up a textfile and a php script.. I can throw up one on my server...
nobody
February 6th, 2003, 08:30 PM
well i dont know how to code php or do the text file thing at all.. so i wont waste the space on your site.. im gonna start drawin up some plans for my site at school tomorrow and stuff... and since the counter isnt necessary until i have my site up (even tho it wont be necessary then either) ill just have my own space.. so its not biggie.. thanks a lot for the offer tho.. im amazed with how patient and helpful you guys are
Marz
February 6th, 2003, 08:32 PM
Ahh Don't be amazed..
Me and lost are losers :crazy:
Well.. more like crazy.. *lmao*
Just.. keep us informed.. Do you have AIM, MSN, or Yahoo?
nobody
February 6th, 2003, 08:35 PM
i have aim and msn.. do u want my sn's?
well since u cant answer me while im writing this and since u probably wouldnt ask if u didnt wanna know here they are
AIM:otnes28
MSN:otnes28@hotmail.com
nobody
February 6th, 2003, 08:36 PM
haha.. thats funny.. i used a colon then an O on those.. i confused it.. tryin again
AIM [colon] otnes28
MSN [colon] otnes28@hotmail.com
Jubba
February 6th, 2003, 09:07 PM
Originally posted by playamarz
I use Read Less, Learn More PHP...
http://www.amazon.com/exec/obidos/ASIN/0764535617/qid%3D1044583614/sr%3D11-1/ref%3Dsr%5F11%5F1/002-5090716-6056822
Is that the book? If it is then its freakin awesome... Thats the one I have. Its great for the basics. For the more advanced stuff check out the WROX php books... good stuff..
nobody
February 6th, 2003, 09:13 PM
that books looks pretty cool.. i think ill get it
lostinbeta
February 6th, 2003, 10:30 PM
I haven't the money for a book right now, but PHP doesn't seem that hard (basic PHP for now), it is definitely MUCH easier than CGI and more efficient. Goodbye CGI!!!!!!
Marz
February 7th, 2003, 10:17 AM
Yeah lost.. That's the book I have...
I also have the ASP version of that book as well.. They are handy little guides.. And they only teach you.. Instead of drilling you on ****...
:)
lostinbeta
February 7th, 2003, 01:04 PM
Cool. I will look into that. It is recommended by 2 great scripters so it must be good :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.