require("include/top.php");
unset($submitok);
// check the submitted data
if(is_uploaded_file($nfofile))
{
// check user account
if(!$_SESSION["SESSION"]||!$_SESSION["SCENEID"])
$errormessage[]="you need to be logged in first.";
// check if there is already an nfo file for thid prod
if(file_exists("othernfo/".$which.".nfo"))
{
if($SESSION_LEVEL=='administrator' || $SESSION_LEVEL=='moderator' || $SESSION_LEVEL=='gloperator')
{
unlink("othernfo/".$which.".nfo");
copy($nfofile,"othernfo/".$which.".nfo");
unlink($nfofile);
$errormessage[]="there was already an infofile for this prod but since you're so strong and handsome i allowed you to caress my tail and replace it.";
} else {
$errormessage[]="there is already an nfo file for this prod";
}
}
// check the nfo file
if(filesize($nfofile)>65536) {
$errormessage[]="the size of the infofile must not be greater than 64Kb";
}
// if everything is ok
if(!$errormessage)
$submitok=true;
}
if(!$submitok&&file_exists($nfofile)){
unlink($nfofile);
}
// move the submitted nfo to the appropriate location
if($submitok){
// reward the user
$query ="INSERT INTO othernfos SET ";
$query.="refid=".$refid.",";
$query.="type='".$type."',";
$query.="adder=".$_SESSION["SCENEID_ID"].",";
$query.="added=NOW()";
//print("->".$query."<-");
mysql_query($query);
$lastid=mysql_insert_id();
copy($nfofile, "othernfo/".$lastid.".nfo");
unlink($nfofile);
$which=$lastid;
}
// get data to build the page
$result = mysql_query("DESC othernfos type");
$row = mysql_fetch_row($result);
$types = explode("'",$row[1]);
?>