Look at your page - tags are in lowercase - look into code - tags in reg. expressions are in uppercase - change them to lowercase (in code) or to uppercase (in template).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Because Turoq is offline, i made some changes on my own (i am using PS 1.8 with PHP) and you can download my version here: http://darkzone.cz/~cs/
This version work with PHP template too but genindex not work with index.php!!! This version is only modifying player pages with PHP template!!! Genindex with HTML template can work.
It is not official version and is without any support!!! Don't send any messages and questions to Turoq about this version!!!
I'am sorry, Turoq, that I make public my changes without your permission, i believe, that it help many people in this two weeks, when you are offline.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used your code and got a little bit further. The player.xml file is now being generated with data.
However, when I run genindex.pl it does not work. It will make the rank column header, but the players lines are not being shifted over to the right. So they do not line up with the column headers and the rank pics do not display. Any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I finally got it working after hours of tweaking the code. I've only tested this with the 1.8 html theme. I don't know if it works with the php themes.
Awesome job whizzer that works wonderfully. I changed your lines a little though taking out the underscore from each line and changed clanpage_ to clan* that way all the neccessary pages are transfered. Now all that we need is something to update the clan pages :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I should move home more often. Then all my problems seem to solve automatically :-)
Just send me examples of erraneous stats and any modifications to COSTA scripts you made to make them work for your example. it should be not too difficult to find the right patterns to safely detect the required data.
Kind regards,
Turoq
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Turoq, can you in Perl make inputs (reading from file) to be in Uppercase (or lowercase) or change reg. expressions to be case insensitive? I don't understand Perl but it must be easy in language for text processing. It will solve problems with that upper/lower case tags in templates.
And welcome home :-)
Kine2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
this is exactly what I am going to do. To replace text patterns in an input stream globally, one can simply use:
while (<INP>) {
s/<old pattern>/<new pattern>/g;
}
I will replace all <td>, </td>, <tr>, </tr>, <br>, <font>, </font> tags by there uppercase counterparts. This would look like this:
s/\<td/\<TD/g;
s/\<\/td/\<\/TD/g;
etc.
Trying to detect the Psycho Stats version seems not very safe and is actually not necessary. So I will remove this part again and just try to detect all patterns that might contain COSTA relevant data.
Kind regards,
Turoq
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now that I can get the players.xml file to update, I'm not seeing any data for the players. All stats are zeros.
- <player nick="-=(i.e.)=-ZaijiaN" rank="civilian">
<score db="0" kt="0" sv="0" kv="0" kh="0" sh="0" pb="0" tk="0" gh="0" bt="0" kc="0" da="0" />
<event date="02-05-30" rank="civilian" />
<update nick="-=(i.e.)=-ZaijiaN" date="02-05-30" />
</player>
- <player nick="JckssI8" rank="civilian">
<score db="0" kt="0" sv="0" kv="0" kh="0" sh="0" pb="0" tk="0" gh="0" bt="0" kc="0" da="0" />
<event date="02-05-30" rank="civilian" />
<update nick="JckssI8" date="02-05-30" />
</player>
- <player nick="ae|The Orb" rank="civilian">
<score db="0" kt="0" sv="0" kv="0" kh="0" sh="0" pb="0" tk="0" gh="0" bt="0" kc="0" da="0" />
After further looking into this, it seems that the Costa is not looking for the right data.
Here's the HTML from a 1.8 page.
<tr class="plrgenrow2">
<td>Killed CTs</td>
<td align="right">127</td>
</tr>
<tr class="plrgenrow1">
<td>Killed VIP</td>
<td align="right">0</td>
</tr>
<tr class="plrgenrow2">
<td>Planted Bomb</td>
<td align="right">4</td>
</tr>
<tr class="plrgenrow1">
<td>Bombed Targets</td>
<td align="right">(100.00%) 4</td>
</tr>
<tr class="plrgenrow2">
<td>Killed Hostages</td>
<td align="right">2</td>
And here's the code to retreive the data.
if (/Killed CTs\<\/TD\>/) {
chomp (my $line=<INP>);
if (!($line =~ /\<\/TD\>/)) {
chomp (my $line2=<INP>);
$line .= $line2;
}
if ($line =~ /\>(\<FONT[^\>]+\>)?(\d+)(\<\/FONT\>)*\<\/TD\>/) {
$kc=$2;
print "Killed $kc CTs.\n";
}
}
if (/Killed VIP\<\/TD\>/) {
chomp (my $line=<INP>);
if (!($line =~ /\<\/TD\>/)) {
chomp (my $line2=<INP>);
$line .= $line2;
}
if ($line =~ /\>(\<FONT[^\>]+\>)?(\d+)(\<\/FONT\>)*\<\/TD\>/) {
$kv=$2;
print "Killed $kv VIPs.\n";
}
}
if (/Planted Bomb\<\/TD\>/) {
chomp (my $line=<INP>);
if (!($line =~ /\<\/TD\>/)) {
chomp (my $line2=<INP>);
$line .= $line2;
}
if ($line =~ /\>(\<FONT[^\>]+\>)?(\d+)(\<\/FONT\>)*\<\/TD\>/) {
$pb=$2;
print "Planted $pb bombs.\n";
}
}
if (/Bombed Targets\<\/TD\>/) {
chomp (my $line=<INP>);
if (!($line =~ /\<\/TD\>/)) {
chomp (my $line2=<INP>);
$line .= $line2;
}
if ($line =~ /[\>|\)]\s*(\<FONT[^\>]+\>)?(\d+)(\<\/FONT\>)*\<\/TD\>/) {
$bt=$2;
print "Bombed $bt targets.\n";
}
}
if (/Killed Hostages\<\/TD\>/) {
chomp (my $line=<INP>);
if (!($line =~ /\<\/TD\>/)) {
chomp (my $line2=<INP>);
$line .= $line2;
}
if ($line =~ /\>(\<FONT[^\>]+\>)?(\d+)(\<\/FONT\>)*\<\/TD\>/) {
$kh=$2;
print "Killed $kh hostages.\n";
}
There's no FONT tags in the 1.8 html. It's done with CSS. I don't think searching for these tags is working.
Look at your page - tags are in lowercase - look into code - tags in reg. expressions are in uppercase - change them to lowercase (in code) or to uppercase (in template).
"FONT" to "font" and "TD" to "td" in code... you must do it in updateranks.pl and in genplayers.pl and genindex.pl too (in section for PS 1.8)
Because Turoq is offline, i made some changes on my own (i am using PS 1.8 with PHP) and you can download my version here: http://darkzone.cz/~cs/
This version work with PHP template too but genindex not work with index.php!!! This version is only modifying player pages with PHP template!!! Genindex with HTML template can work.
It is not official version and is without any support!!! Don't send any messages and questions to Turoq about this version!!!
I'am sorry, Turoq, that I make public my changes without your permission, i believe, that it help many people in this two weeks, when you are offline.
Thx kine2,
I used your code and got a little bit further. The player.xml file is now being generated with data.
However, when I run genindex.pl it does not work. It will make the rank column header, but the players lines are not being shifted over to the right. So they do not line up with the column headers and the rank pics do not display. Any ideas?
same situation here :-(
ah, i forgot to say :
if SOMEONE is able to bring this costa-stuff up correctly, pleeeaaaase contact me
guido.loag@gmx.net
ICQ 84738937
Munich, Germany
I finally got it working after hours of tweaking the code. I've only tested this with the 1.8 html theme. I don't know if it works with the php themes.
http://www.prolanservices.com/junk/mycosta.zip
It still doesn't copy a lot of the 1.8 html pages from the source folder. You'll need to write a batch file to do that. I'm working on that now.
Have the same problem as many others, with only the rank header beeing generated. No I'm wating for whizzers batch-file with high hopes!!
perl -w genranks.pl
perl -w updateranks.pl
perl -w genindex.pl
perl -w genplayers.pl
copy c:\stats-5day\award_*.html c:\stats-5dayout
copy c:\stats-5day\map_*.html c:\stats-5dayout
copy c:\stats-5day\weapon_*.html c:\stats-5dayout
copy c:\stats-5day\clanpage_*.html c:\stats-5dayout
copy c:\stats-5day\srvstats.html c:\stats-5dayout
Awesome job whizzer that works wonderfully. I changed your lines a little though taking out the underscore from each line and changed clanpage_ to clan* that way all the neccessary pages are transfered. Now all that we need is something to update the clan pages :)
Nice!
I should move home more often. Then all my problems seem to solve automatically :-)
Just send me examples of erraneous stats and any modifications to COSTA scripts you made to make them work for your example. it should be not too difficult to find the right patterns to safely detect the required data.
Kind regards,
Turoq
Turoq, can you in Perl make inputs (reading from file) to be in Uppercase (or lowercase) or change reg. expressions to be case insensitive? I don't understand Perl but it must be easy in language for text processing. It will solve problems with that upper/lower case tags in templates.
And welcome home :-)
Kine2
Hi,
this is exactly what I am going to do. To replace text patterns in an input stream globally, one can simply use:
while (<INP>) {
s/<old pattern>/<new pattern>/g;
}
I will replace all <td>, </td>, <tr>, </tr>, <br>, <font>, </font> tags by there uppercase counterparts. This would look like this:
s/\<td/\<TD/g;
s/\<\/td/\<\/TD/g;
etc.
Trying to detect the Psycho Stats version seems not very safe and is actually not necessary. So I will remove this part again and just try to detect all patterns that might contain COSTA relevant data.
Kind regards,
Turoq
Hey!! Turoq is back. Welcome back. After I got Costa to work for me, I stopped checking these forums.
Anywhooo, I basically stripped out the PsychoStats checking and hard coded it for 1.8 html. You can get my code here. http://www.prolanservices.com/junk/mycosta.zip
You may want to just release seperate Costa version for each PsychoStats verion. Just a thought. You can see my stats here.
http://www.prolanservices.com/stats/