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
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.
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
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?
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.
ok well im just gonna attempt to do what it says on the site
thanks for all the help lost
i really appreciate it
No problem, I hope you get it working.
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)
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
#!/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>
";
}
theres the code
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?
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.
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?
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.
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
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!
thanks for all your help lost… by the time you get there should be a million more questions for you… thanks again
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!
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.
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…