oh wait, sorry about that.
Code: <html>
<head>
<SCRIPT LANGUAGE="JavaScript" src="header.js">
</script>
<title>Cemetech | Programs | Archives</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<script language="javascript" src="toolbar.js"></script>
<script language="javascript" src="sidebar.js"></script>
<TD COLSPAN="8" ALIGN="LEFT" VALIGN="TOP">
<TABLE BORDER="0" CELLPADDING="4"><TR><TD>
<!-- Do not touch above this line - Content -->
<?
# Author name: Kerm Martian
# Creation date: December 15, 2004
# +-----------------------------------------+
# Description: | Proprietary Cemetech Archives Generator |
# +-----------------------------------------+
require 'archdata_pathfind_byname.php';
$rankfind = array(
'10','Outstanding',
'9','Superb',
'8','Excellent',
'7','Commendable',
'6','Very Good',
'5','Good',
'4','Fairly Good',
'3','Mediocre',
'2','Poor',
'1','Bad',
);
if (1 == 1) {
$params = getenv('HTTP_REFERRER');
$params = preg_replace('/^.*\?(.*$)/',"$1",$params);
$mode = $params;
$mode = preg_replace('/^.*mode=(.*)\&.*$/',"$1",$mode);
$path = $params;
$path = preg_replace('/^.*\&path=(.*)$/',"$1",$path);
#print("$path $mode <BR>");
} else {
$mode = 'folder';
$path = '83/basic/games/';
$params = getenv('HTTP_REFERRER');
print("document.write('$params');");
}
if ($mode == 'file') {
$dlpath = $path;
$dlpathzip = $dlpath;
$dlpathzip = "$dlpathzip.zip";
$pathnofile = $dlpath;
$pathnofile = preg_replace('/(.*\/).*$/',"$1",$pathnofile);
$path = '|' . $path . '.zip|';
$progalias = $pathfind[$path];
$LOGFILE = fopen('countdown.txt','r');
$lines = fread($LOGFILE,filesize('countdown.txt'));
$lines = explode("\n",$lines);
fclose($LOGFILE);
$logfilelength = count(@lines);
foreach ($lines as $printline) {
$totaldls = $printline;
$totaldls = preg_replace('/(^\d*|)(|.*$)/',"$1",$totaldls);
$totaldls = preg_replace('/(^.*)\n$/',"$1",$totaldls);
$adlpath = $printline;
$adlpath = preg_replace('/(^\d*|)(|.*$)',"$2",$adlpath);
$adlpath = preg_replace('/\s+$/','',$adlpath);
$dlpathclean = $adlpath;
$dlpathclean = preg_replace('/\|/','',$dlpathclean);
if ($dlpathclean == $dlpathzip) {
$curprogdls = $totaldls;
}
}
$ARCDATA = fopen("archdata.txt",'r');
$arclines = fread($ARCDATA,filesize('archdata.txt'));
$archlines = explode("\n",$arclines);
fclose(ARCDATA);
# \|\|path/mainzip.zip\|\|path/mainzip.zip|altpath.zip|altpath.zip\|\|
# Filename here\|\|description\|\|screenshots|screenshots\|\|ranks|total\|\|review|review|\n
$rating = 0;
$arcdatalength = count($arclines);
$foundcurfileflag = 0;
foreach ($arclines as $printline) {
if ($foundcurfileflag == 0) {
trim($printline,"\x0A..\x0D");
$printline = preg_replace("/\'/","\\\'",$printline);
$curarcdata = $printline;
$arcdata = split("\|\|", $curarcdata);
$mainpath = $arcdata[0];
$altpath = $arcdata[1];
$altpaths = split("\|", $altpath);
$filename = $arcdata[2];
$description = $arcdata[3];
$screenshots = $arcdata[4];
$screenshots = split("\|", $screenshots);
$ranks = $arcdata[5];
$ReviewText = $arcdata[6];
$reviews = split("\|", $ReviewText);
foreach ($altpaths as $curaltpath) {
if ($curaltpath == $dlpathzip) {
$foundcurfileflag = 1;
}
}
}
}
if ($foundcurfileflag == 1) {
list($totalranks,$cumranks) = split("\|",$ranks);
$totalranks = $totalranks + 0;
$cumranks = $cumranks + 0;
if ($totalranks != 0) {
$rating = $cumranks/$totalranks;
$rating = sprintf("%.0f", $rating);
$rank = $rankfind{$rating};
}
}
}
if ($mode == 'folder')
{
# print("document.write('');");
print("document.write('<TABLE BORDER=\"0\" WIDTH=\"100\%\" CELLPADDING=\"0\" CELLSPACING=\"0\"><TR><TD width=\"8\" height=\"8\"><img src=\"..\\/img\\/table\\/ul.gif\"><\\/TD><TD HEIGHT=\"8\" BACKGROUND=\"..\\/img\\/table\\/top.gif\" colspan=\"3\"><\\/TD><TD width=\"8\" height=\"8\"><img src=\"..\\/img\\/table\\/ur.gif\"><\\/TD><\\/TR><TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\" colspan=\"3\">Current Directory\\\: <img src=\"..\\/img\\/stats\\/foldericon.gif\"> $path<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR><TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mm.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR><TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\">Download / Learn More<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/center.gif\"><\\/TD><TD>Program Name and Description<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR>');");
$FOLDERS = fopen('foldsys.txt','r');
$foldersys = fread($FOLDERS,filesize('foldsys.txt'));
$foldersys = explode("\n",$foldersys);
fclose($FOLDERS);
$ARCDATA = fopen('archdata.txt','r');
$arclines = fread($ARCDATA,filesize('archdata.txt'));
$arclines = explode("\n",$arclines);
fclose($ARCDATA);
# path/for/folder||alias
# path/mainzip.zip\|\|path/mainzip.zip|altpath.zip|altpath.zip\|\|
# Filename here\|\|description\|\|screenshots|screenshots\|\|ranks|total\|\|review|review|\n
$folderedatalength = count($foldersys);
$arcdatalength = count($arclines);
$curpathfldrs = split("\/",$path);
$curfldrdepth = count($curpathfldrs);
if ($path == 'root') {} else {
$uppathfldrs = &$curpathfldrs;
$uppathfldrs = array_slice($uppathfldrs,0,$curfldrdepth-2);
$uppath = join("\/",$uppathfldrs);
$uppath = "$uppath\/";
if ($uppath == "\/") { $uppath = 'root'; }
print("document.write('<TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mm.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');");
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\"><a href=\"archives.html?mode=folder\&path=$uppath\"><img src=\"..\\/img\\/stats\\/foldericon.gif\" border=\"0\"><\\/a> <a href=\"archives.html?mode=folder\&path=$uppath\">$uppath<\\/a><\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/center.gif\"><\\/TD><TD>Parent Directory<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR>');");
}
foreach ($foldersys as $printline) {
trim($printline,"\x0A..\x0D");
$printline = preg_replace("/\'/","\\\'",$printline);
$curarcdata = $printline;
$arcdata = split("\|\|", $curarcdata);
$mainpath = $arcdata[0];
$alias = $arcdata[1];
$mainpathfldrs = split("\/",$mainpath);
$fldrdepth = count($mainpathfldrs);
if (($mainpath = preg_match('/$path/',$mainpath)) && ($fldrdepth == ($curfldrdepth + 1))){
print("document.write('<TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mm.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');");
$hrefpath1 = "$mainpath";
$hrefpath1 = preg_replace('/^root\/(.*$)/',"$1",$hrefpath1);
$hrefpath = $hrefpath1;
$hrefpath1 = "$hrefpath\/";
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\"><a href=\"archives.html?mode=folder\&path=$hrefpath1\"><img src=\"..\\/img\\/stats\\/foldericon.gif\" border=\"0\"><\\/a> <a href=\"archives.html?mode=folder\&path=$hrefpath1\">$hrefpath<\\/a><\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/center.gif\"><\\/TD><TD>$alias<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR>');");
}
}
rtrim($path);
foreach ($arclines as $printline) {
trim($printline,"\x0A..\x0D");
$printline = preg_replace("/\'/","\\\'",$printline);
$curarcdata = $printline;
$arcdata = split("\|\|", $curarcdata);
$mainpath = $arcdata[0];
$dlpathnozip = $mainpath;
$dlpathnozip = preg_replace('/(^.*)\.zip$/',"$1",$dlpathnozip);
$altpath = $arcdata[1];
$altpaths = split("\|", $altpath);
$filename = $arcdata[2];
$description = $arcdata[3];
foreach ($altpaths as $curaltpath) {
$pathnozip = $curaltpath;
$pathnozip = preg_replace('/(.*\/).*$/',"$1",$pathnozip);
chop($pathnozip);
if ($path == $pathnozip) {
print("document.write('<TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mm.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');");
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\"><a href=\"archives.html?mode=file\&path=$dlpathnozip\"><img src=\"..\\/img\\/stats\\/pageicon.gif\" border=\"0\"><\\/a> <a href=\"http:\\/\\/doorscs.tripod.com\\/cgi-bin\\/counter3\\/countdown.cgi?$mainpath&path=archives\">$mainpath<\\/a><\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/center.gif\"><\\/TD><TD><span style=\"font-size: 1.25em;\"><b>$filename<\\/B><\\/span><BR><span style=\"font-size: 0.9em;\">$description</span><\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR>');");
}
}
}
print("document.write('<TR><TD width=\"8\" height=\"8\"><img src=\"..\\/img\\/table\\/bl.gif\"><\\/TD><TD HEIGHT=\"8\" BACKGROUND=\"..\\/img\\/table\\/bottom.gif\"><\\/TD><TD width=\"8\" height=\"8\"><img src=\"..\\/img\\/table\\/bm.gif\"><\\/TD><TD HEIGHT=\"8\" BACKGROUND=\"..\\/img\\/table\\/bottom.gif\"><\\/TD><TD width=\"8\" height=\"8\"><img src=\"..\\/img\\/table\\/br.gif\"><\\/TD><\\/TR>');");
}
if ($mode == 'file')
{
if ($foundcurfileflag != 1 ) {
$description = 'File was found, but filename was not found in archives! Contact <a href=\"mailto:Kerm_Martian@yahoo.com\">Kerm Martian<\/A>.';
$filename = 'Invalid Filename!';
$progalias = $filename;
$screenshots = '';
$reviews = '';
$rating = '';
$rank = 0;
}
print("document.write('<TABLE BORDER=\"0\" WIDTH=\"100\%\" CELLPADDING=\"0\" CELLSPACING=\"0\"><TR><TD width=\"8\" height=\"8\"><img src=\"..\\/img\\/table\\/ul.gif\"><\\/TD><TD HEIGHT=\"8\" BACKGROUND=\"..\\/img\\/table\\/top.gif\"><\\/TD><TD width=\"8\" height=\"8\"><img src=\"..\\/img\\/table\\/ur.gif\"><\\/TD><\\/TR><TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\"><B>$progalias<\\/b><\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR><TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');\n");
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\">Download\: <a href=\"http\:\\/\\/doorscs.tripod.com\\/cgi-bin\\/counter3\\/countdown.cgi\?$dlpath.zip\&location\=archive\">');\n");
$FOLDERS = fopen('foldsys.txt','r');
$foldersys = fread($FOLDERS,filesize('foldsys.txt'));
$foldersys = explode("\n",$foldersys);
fclose($FOLDERS);
$foldermatch = array();
for ($count=0; $count<=count($foldersys); $count++) {
$arg1 = split("\|\|",$foldersys[$count]);
$foldermatch[$arg1[0]] = $arg1[1];
}
$dlpathnozip = $mainpath;
$dlpathnozip = preg_replace('/(^.*)\/.*\.zip$/',"$1",$dlpathnozip);
$folderalias = $foldermatch[$dlpathnozip];
trim($folderalias,"\x0A..\x0D");
print("document.write('<img src=\"..\\/img\\/icon\\/compressed.gif\" border=\"0\"> $progalias<\/a><BR><img src=\"..\\/img\\/icon\\/dl.gif\" border=\"0\"> $curprogdls downloads<BR><a href=\"archives.html\?mode=folder\&path=$pathnofile\"><img src=\"..\\/img\\/stats\\/foldericon.gif\" border=\"0\"><\\/a> <a href=\"archives.html\?mode=folder\&path=$pathnofile\">$folderalias<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR><TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');\n");
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\">$description<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR><TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');\n");
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\"><center>');\n");
$sscount = 0;
foreach ($screenshots as $curss) {
print("document.write('<img src=\"..\\/img\\/ss\\/$curss.gif\" style=\"border-color:#000000; border: 1px solid;\"> ');");
$sscount = $sscount + 0.5;
if ($sscount == int($sscount)){
print("document.write('<BR>');");
}
}
print("document.write('<\\/center><\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR><TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');\n");
print("var LoggedIn = GetCookie('CemetechLI');");
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\"><form name=\"rateprog\" method=\"post\" action=\"http:\\/\\/doorscs.tripod.com\\/cgi-bin\\/counter3\\/ratefile.cgi\" style=\"margin:0px\">');\n");
if ($rating != 0) {
print("document.write('Current Rating: $rating\\/10 ($rank)');\n");
} else {
print("document.write('<I>Not yet ranked<\\/I>');\n");
}
print("if (LoggedIn) {\ndocument.write('<img src=\"..\\/transp.gif\" height=\"1\" width=\"16\"><select name=\"rating\" onChange=\"javascript:document.rateprog.submit();\"><option selected value=\"null\">Rate this program...<\\/option><option value=\"10\">10 - Outstanding<\\/option><option value=\"9\">9 - Superb<\\/option><option value=\"8\">8 - Excellent<\\/option><option value=\"7\">7 - Commendable<\\/option><option value=\"6\">6 - Very Good<\\/option><option value=\"5\">5 - Good<\\/option><option value=\"4\">4 - Fairly Good<\\/option><option value=\"3\">3 - Mediocre<\\/option><option value=\"2\">2 - Poor<\\/option><option value=\"1\">1 - Bad<\\/option><\\/select><input type=\"hidden\" name=\"progurl\" value=\"$dlpathzip\">');\n}\ndocument.write('<\\/form><\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR><TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/ml.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/middle.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/mr.gif\"><\\/TD><\\/TR>');\n");
print("document.write('<TR><TD BACKGROUND=\"..\\/img\\/table\\/left.gif\" width=\"8\"><\\/TD><TD VALIGN=\"TOP\"><B>Reviews<\\/B><BR>');");
foreach ($reviews as $curreview) {
print("document.write('$curreview<BR><BR>');");
}
print("if (LoggedIn) {\ndocument.write('<a href=\"review.html\?path=$dlpath.zip\&alias=$progalias\">Write a review<\\/a>\');}");
print("document.write('<\\/TD><TD width=\"8\" background=\"..\\/img\\/table\\/right.gif\"><\\/TD><\\/TR><TR><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/bl.gif\"><\\/TD><TD HEIGHT=\"3\" BACKGROUND=\"..\\/img\\/table\\/bottom.gif\"><\\/TD><TD WIDTH=\"8\" HEIGHT=\"3\"><IMG SRC=\"..\\/img\\/table\\/br.gif\"><\\/TD><\\/TR>');\n");
}
exit;
?>
<!-- Do not touch below this line -->
</TD></TR></TABLE>
</TD></TR>
</TABLE>
</body></html>