Parašė Lordcraft· 2010 Bir. 10 17:06:02
#1
Vnz niekaip negaliu pasidaryti pasidaryti pinigu_sistema kad banerius rodytu ant laiko, tiesa sakaint i servers.php faila bandau iklijuoti kad leistu ikelti bannerius bet vis meta error. vnz kodo istraukos:
kodo pradzia:
if($_POST['do'] == "doadd"){
$_POST["dien"] = round($_POST["dien"], 0);
$severiai = dbcount("(*)", "money_servers2", "tipas='".$_POST[planas]."'");
if($_POST[planas] == 0){
$srv = $goldsettings[showmaxservers];
}else if($_POST[planas] == 1){
$srv = $goldsettings[showmaxserversbig];
}
if(!$_POST[http]){
showmessage($lang_servers[9]);
}else
if ($error == "") {
$sndyra = mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));
$newavatar = $_FILES['reklama'];
if (!empty($newavatar['name']) && is_uploaded_file($newavatar['tmp_name'])) {
$avatarext = strrchr($newavatar['name'],".");
$avatarname = substr($newavatar['name'], 0, strrpos($newavatar['name'], "."));
if (preg_match("/^[-0-9A-Z_\[\]]+$/i", $avatarname) && preg_match("/(\.gif|\.GIF|\.jpg|\.JPG|\.png|\.PNG)$/", $avatarext) && $newavatar['size'] <= 1024*10000) {
$avatarname = $avatarname."[".$userdata['user_id'].$sndyra."]".$avatarext;
$set_avatar = $avatarname;
move_uploaded_file($newavatar['tmp_name'], "banners/468x60/".$avatarname);
chmod("banners/468x60/".$avatarname,0644);
if ($size = @getimagesize("banners/468x60/".$avatarname)) {
if ($size['0'] > 468 || $size['1'] > 60) {
unlink("banners/468x60/".$avatarname);
$set_avatar = "";
}
} else {
unlink("banners/468x60/".$avatarname);
$set_avatar = "";
}
}
}
if($set_avatar == ""){
showmessage("IMAGE ERROR");
}else if($severiai >= $srv){
showmessage($lang_servers[30]);
}else if(!$_POST[dien]){
showmessage($lang_servers[12]);
}else if($_POST[dien] <= "0"){
showmessage($lang_servers[13]);
}else{
$moneyuser = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_users WHERE userid = '".$userdata[user_id]."'"));
if($_POST[planas] == 0){
$kaina = $goldsettings[serveriokaina];
}else if($_POST[planas] == 1){
$kaina = $goldsettings[serveriokainabig];
}
if($kaina*$_POST["dien"] > $moneyuser[pinigai]){
showmessage($lang_servers[14]);
}else{
$nuskaitom = $kaina*$_POST[dien];
$result = dbquery("UPDATE ".$db_prefix."money_users SET `pinigai` = `pinigai`-'".$nuskaitom."' WHERE `userid` = '".$userdata[user_id]."' LIMIT 1 ;");
$busiki = mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$_POST[dien],date("Y"));
$result = dbquery("INSERT INTO ".$db_prefix."money_servers2 (http, serveroprt, owner, galiojaiki, tipas) VALUES('".$_POST[http]."', '".$_POST[port]."', '".$userdata['user_id']."', '".$busiki."', '".$_POST[planas]."')");
showmessage($lang_servers[15]);
}
}
}
}
ten poto eina funkcijos do del, do edit ir t.t.
kodo pabaiga:
opentable($lang_servers[1]);
$paprasto = $goldsettings[serveriokaina]/100;
$goldo = $goldsettings[serveriokainabig]/100;
echo '
<form method="POST" action="servers2.php" enctype="multipart/form-data">
<input type="hidden" name="do" value="doadd">
<table border="0" cellpadding="1" cellspacing="1" align="center">
<tr>
<td colspan="2" align="center" class="small2">'.$lang_servers[16].' '.$paprasto.' '.$goldsettings[valiuta].' '.$lang_servers[17].'<br>'.$lang_servers[18].' '.$goldo.' '.$goldsettings[valiuta].' '.$lang_servers[19].'</td>
</tr>
<tr>
<td>'.$lang_servers[2].'</td>
<td><input type="text" name="http" class="textbox" size="20"></td>
</tr>
<tr>
<td>'.$lang_servers[3].'</td>
<td><input type="file" name="reklama" class="textbox" size="20"></td>
</tr>
<tr>
<td>'.$lang_servers[4].'</td>
<td><input class="textbox" type="radio" value="0" checked name="planas">'.$lang_servers[5].'<br>
<input class="textbox" type="radio" value="1" name="planas">'.$lang_servers[6].'</td>
</tr>
<tr>
<td>'.$lang_servers[7].'</td>
<td><input type="text" class="textbox" name="dien" size="20"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" class="button" value="'.$lang_servers[8].'" name="B1"></td>
</tr>
</table>
</form>';
closetable();
bet va man vis niekaip nepavyksta ikelti banerio, raso IMAGE ERROR ten kur pradzioj prie lang yra.
as tiesiog bandau vietoj server ip rasyti http o vietoj server oprt kad ikeltu image bet neikeliai img padekit!
Parašė utx· 2010 Bir. 11 19:06:34
#2
Nežinau ar taip supratau, bet įmesk tą nuotrauką į banners folderį, o gale kodo pervadink taip:
unlink("banners/468x60/".$bannerio_pavadinimas);
Redagavo utx· 2010 Bir. 11 19:06:05