Code:
<?php
include("core.php");
include("config.php");
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "</head>";
echo "<body>";
connectdb();
$action = $_GET["action"];
$sid = $_GET["sid"];
if(!isowner1(getuid_sid($sid)))
{
echo "<card id=\"main\" title=\"$sitename\">";
echo "<p align=\"center\">";
echo "U are not a prop
";
echo "
";
echo "<a href=\"index.php\">Home</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
///////////////////////////////////time
$res = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$uid."'"));
$lastact = $res[0];
$atime = time() - $lastact;
if($atime<1800){
$res = mysql_fetch_array(mysql_query("SELECT otime FROM ibwf_users where id='".$uid."'"));
$otime = $res[0] + $atime;
$res = mysql_query("UPDATE ibwf_users SET otime='".$otime."' where id='".$uid."'");
}
///
addonline(getuid_sid($sid),"Add smilies","");
if($action=="main")
{
echo "<form align=\"center\" action=\"emotii.php?action=upload&sid=$sid\" method=\"post\" ENCTYPE=\"multipart/form-data\">";
echo "Code:
<input type=\"text\" name=\"name\" size=\"30\" />
";
echo "File:
<input type=\"file\" name=\"superdat\" size=\"30\"/>
";
echo "Folder:
";
echo "<select name=\"dir\" value=\"\">
<option value=\"emoticons2\">Emoticons</option>
</select>
";
echo "<input type=\"submit\" value=\"Upload File\"/>";
echo "
<a href=\"index.php?action=main&sid=$sid\">";
echo "Home</a>";
echo "</p>";
}
if($action=="upload")
{
echo "<p align=\"center\">";
if (!eregi("\.(jpeg|jpg|png|wbmp|gif)$",$superdat_name)){
print "[b]Wrong File type, Crackers are not alowed here![/b]";
}else{
$superdat_name = preg_replace(
'/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/'
,'',str_replace(array(' ','%20'),array('_','_'),$superdat_name));
if(strlen($superdat_name)>53){ print "[b]Numele este prea lung![/b]";
}else{
if (empty($superdat)) {
print "[b]Nici un fisier selectat[/b]";
}else{
if (file_exists($superdat_name))
{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>[b]Dont't exist[/b]";
echo "
<a href=\"index.php?action=main&sid=$sid\">";
echo "Home</a>";
print "</p></body></html>";
exit();
}
copy("$superdat", "$dir/$superdat_name") or
die("Couldn't copy file.");
$fsize=round($superdat_size/1024,1);
$rev = strrev ($superdat_name);
$exp = explode (".", $rev);
$true = strrev ($exp[0]);
$trueext = strtolower ($true);
$itemurl = "$dir/$superdat_name";
$res = mysql_query("INSERT INTO ibwf_smilies SET scode='".$name."', imgsrc='".$itemurl."', hidden='0'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Emotie adaugata cu succes";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Eroare in adaugarea emotiei";
}
//
echo "
<img src=\"images/ok.gif\" alt=\".\"/>[b]Succes!![/b]
Code: $name
File: $superdat_name
Link: $dir/$superdat_name
Size: $fsize KB
Format:*.$trueext
";
echo "
<a href=\"index.php?action=main&sid=$sid\">";
echo "Home</a>";
echo "</p>";
}
}
}
}
echo "</body>";
echo "</html>";
?>

Comment