Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Scripto perdarymas.

Parašė Poker· 2008 Kov. 5 15:03:37
#1

Norejau paklaust kur cia reik keist jog perdaryt scripta y 400x60 reklama is 120x60.

Pats scriptas:


<?php
/*-------------------
|dariuszz123@gmail.com
|http://dariuszz.lt
|GOLD sistema :-]
*-------------------*/
require_once "../../maincore.php";
require_once "../../subheader.php";
require_once "../../side_left.php";
$goldsettings = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_settings"));
include INFUSIONS."pinigu_sistema/includes/functions.php";
include INFUSIONS."pinigu_sistema/lang_banners120.php";
if(iMEMBER){
include INFUSIONS."pinigu_sistema/includes/newuser.php";

if($_POST['do'] == "doadd"){
$reklamos120 = dbcount("(*)", "money_banners", "tipas='1'");
$moneyuser = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_users WHERE userid = '".$userdata[user_id]."'"));
$planas = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_banners_kainos WHERE id = '".$_POST['planas']."' and tipas = 1"));
if($reklamos120 >= $goldsettings[showmax120x60]){
showmessage($langbanners[17]);
$error = 1;
}else if(!$_POST[http]){
showmessage($langbanners[18]);
$error = 1;
}else if(!$_POST[planas]){
showmessage($langbanners[20]);   
$error = 1;
}else if($planas[kaina] > $moneyuser[pinigai]){
showmessage($langbanners[22]);   
$error = 1;
}
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*$goldsettings[maxbanner120x60size]) {
         $avatarname = $avatarname."[".$userdata['user_id'].$sndyra."]".$avatarext;
         $set_avatar = $avatarname;
         move_uploaded_file($newavatar['tmp_name'], "banners/120x60/".$avatarname);
         chmod("banners/120x60/".$avatarname,0644);
         if ($size = @getimagesize("banners/120x60/".$avatarname)) {
            if ($size['0'] > 120 || $size['1'] > 60) {
               unlink("banners/120x60/".$avatarname);
               $set_avatar = "";
            }
         } else {
            unlink("banners/120x60/".$avatarname);
            $set_avatar = "";
         }
      }
   }

if($set_avatar == ""){
showmessage($langbanners[21]);
}else{
$result = dbquery("UPDATE ".$db_prefix."money_users SET `pinigai` = `pinigai`-'".$planas[kaina]."' WHERE `userid` = '".$userdata[user_id]."' LIMIT 1 ;");
$result = dbquery("INSERT INTO ".$db_prefix."money_banners (tipas, imgas, adresas, kiekis, owner) VALUES('1', '".$set_avatar."', '".$_POST['http']."', '".$planas[kiekis]."', '".$userdata['user_id']."')");
showmessage($langbanners[23]);
}
}
}

if($_POST['do'] == "del"){
$banneris = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_banners WHERE id = '".$_POST['id']."' and owner = '".$userdata['user_id']."'"));
$qery = dbquery("DELETE FROM ".$db_prefix."money_banners WHERE owner = ".$userdata['user_id']." and id = ".$_POST[id]."");
unlink("banners/120x60/".$banneris[imgas]);
showmessage($langbanners[24]);   
}

if($_POST['do'] == "edit"){
$banneris = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_banners WHERE id = '".$_POST['id']."' and owner = '".$userdata['user_id']."'"));
if(!$banneris){
showmessage($langbanners[25]);
}else{
opentable($langbanners[26]);
echo '
<form method="POST" action="banners120.php" enctype="multipart/form-data">
<input type="hidden" name="do" value="doedit">
<input type="hidden" name="id" value="'.$banneris[id].'">
<table border="0" cellpadding="1" cellspacing="1" align="center">
  <tr>
    <td>'.$langbanners[28].'</td>
    <td><input class="textbox" type="file" name="reklama" size="20"></td>
  </tr>
  <tr>
    <td>'.$langbanners[27].'</td>
    <td><input class="textbox" type="text" name="http" value="'.$banneris[adresas].'" size="20"></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input class="button" type="submit" value="'.$langbanners[29].'" name="B1"></td>
  </tr>
</table>
</form>';
closetable();
}
}

if($_POST['do'] == "doedit"){
$banneris = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_banners WHERE id = '".$_POST['id']."' and owner = '".$userdata['user_id']."'"));

if(!$_POST[id] or !$_POST[http]){
showmessage($langbanners[35]);
}else if($_FILES["reklama"]["error"] > 0){
$result = dbquery("UPDATE ".$db_prefix."money_banners SET adresas='".$_POST[http]."' WHERE owner='".$userdata['user_id']."' and id='".$_POST[id]."'");
showmessage($langbanners[32]);   
}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*$goldsettings[maxbanner120x60size]) {
         $avatarname = $avatarname."[".$userdata['user_id'].$sndyra."]".$avatarext;
         $set_avatar = $avatarname;
         move_uploaded_file($newavatar['tmp_name'], "banners/120x60/".$avatarname);
         chmod("banners/120x60/".$avatarname,0644);
         if ($size = @getimagesize("banners/120x60/".$avatarname)) {
            if ($size['0'] > 120 || $size['1'] > 60) {
               unlink("banners/120x60/".$avatarname);
               $set_avatar = "";
            }
         } else {
            unlink("banners/120x60/".$avatarname);
            $set_avatar = "";
         }
      }
   }

}   


if($set_avatar == ""){
showmessage($langbanners[36]);
}else{
   $result = dbquery("UPDATE ".$db_prefix."money_banners SET adresas='".$_POST[http]."', imgas='".$set_avatar."' WHERE owner='".$userdata['user_id']."' and id=".$_POST[id]."");
   unlink("banners/120x60/".$banneris[imgas]);   
showmessage($langbanners[33]);
}



}


}

if($_POST['do'] == "cont"){
opentable($langbanners[37]);
if(dbcount("(*)", "money_banners_kainos", "tipas='1'") == 0){
echo "<center>".$langbanners[39]."</center>";
}else{
echo '
<form method="POST" action="banners120.php">
<input type="hidden" name="do" value="docont">
<input type="hidden" name="id" value="'.$_POST[id].'">
<table border="0" cellpadding="1" cellspacing="1" align="center">
<tr>
<td>
';
$sql = dbquery("SELECT * FROM ".$db_prefix."money_banners_kainos WHERE tipas = '1'");
while ($planas = dbarray($sql)){
$planas[kainalt] = $planas[kaina]/100;
echo '<input type="radio" value="'.$planas[id].'" name="planas"> '.$planas[kiekis].' ('.$langbanners[7].' '.$planas[kainalt].' '.$goldsettings[valiuta].') <br>';
}
echo '</tr></tr><tr><td><input type="submit" class="button" value="'.$langbanners[38].'"></td></tr></table></form>';
}
closetable();   
}

if($_POST['do'] == "docont"){
$moneyuser = dbarray(dbquery("SELECT * FROM ".$db_prefix."money_users WHERE userid = '".$userdata[user_id]."'"));
$planas=dbarray(dbquery("SELECT * FROM ".$db_prefix."money_banners_kainos WHERE tipas = '1' and id = '".$_POST[planas]."'"));
if($planas[kaina] > $moneyuser[pinigai]){
showmessage($langbanners[40]);
}else{
$result = dbquery("UPDATE ".$db_prefix."money_users SET `pinigai` = `pinigai`-'".$planas[kaina]."' WHERE `userid` = '".$userdata[user_id]."' LIMIT 1 ;");
$result = dbquery("UPDATE ".$db_prefix."money_banners SET `kiekis` = `kiekis`+'".$planas[kiekis]."' WHERE owner='".$userdata['user_id']."' and id=".$_POST[id]." and tipas=1");
showmessage($langbanners[41]);
}
}
showmoney($userdata[user_id], 2);
include INFUSIONS."pinigu_sistema/includes/smsnumbers.php";

opentable($langbanners[1]);
if(dbcount("(*)", "money_banners_kainos", "tipas='1'") == 0){
echo "<center>".$langbanners[2]."</center>";
}else{
echo '
<form method="POST" action="banners120.php" enctype="multipart/form-data">
<input type="hidden" name="do" value="doadd">
<table border="0" cellpadding="1" cellspacing="1" align="center">
  <tr>
    <td>'.$langbanners[3].'</td>
    <td><input type="text" class="textbox" style="width:185px" value="http://" name="http" size="20"></td>
  </tr>
  <tr>
    <td>'.$langbanners[4].'</td>
    <td><input type="file" name="reklama" class="textbox" size="20"></td>
  </tr>
  <tr>
    <td colspan="2" align="center" class="small2">'.$langbanners[5].' '.$goldsettings[maxbanner120x60size].' '.$langbanners[6].'</td>
  </tr>
  <tr>
    <td valign="top">'.$langbanners[8].'</td>
    <td>';
$sql = dbquery("SELECT * FROM ".$db_prefix."money_banners_kainos WHERE tipas = '1'");
while ($planas = dbarray($sql)){
$planas[kainalt] = $planas[kaina]/100;
echo '<input type="radio" value="'.$planas[id].'" name="planas"> '.$planas[kiekis].' ('.$langbanners[7].' '.$planas[kainalt].' '.$goldsettings[valiuta].') <br>';
}
echo  '</td></tr>
  <tr>
    <td colspan="2">
    <p align="center">
  <input type="submit" class="button" value="'.$langbanners[9].'"></td>
  </tr>
</table>
</form>
';
}
closetable();
opentable($langbanners[10]);
if(dbcount("(*)", "money_banners ", "owner='".$userdata[user_id]."' and tipas=1") > 0){
$sql = dbquery("SELECT * FROM ".$db_prefix."money_banners WHERE owner = '".$userdata[user_id]."' and tipas=1");
while ($banner = dbarray($sql)){
$a = $banner[kiekis] - $banner[parodymai];
echo '
<table border="0" cellpadding="1" cellspacing="1" align="center">
  <tr>
    <td class="tbl2" colspan="3" align="center"><img src="'.INFUSIONS.'pinigu_sistema/banners/120x60/'.stripinput(htmlspecialchars($banner[imgas])).'"></td>
  </tr>
  <tr>
    <td class="tbl2" align="center">'.stripinput(htmlspecialchars($banner[adresas])).'</td>
    <td class="tbl2" align="center">'.$langbanners[11].' '.$banner[parodymai].'</td>
    <td class="tbl2" align="center">'.$langbanners[12].' '.$a.'</td>
  </tr>
  <tr>
    <td class="tbl2" align="center"><form method="POST" action="banners120.php"><input type="hidden" name="id" value="'.$banner[id].'"><input type="hidden" name="do" value="edit"><input type="submit" value="'.$langbanners[13].'" class="button"></form></td>
    <td class="tbl2" align="center"><form method="POST" action="banners120.php"><input type="hidden" name="id" value="'.$banner[id].'"><input type="hidden" name="do" value="del"><input type="submit" value="'.$langbanners[14].'" class="button"></form></td>
    <td class="tbl2" align="center"><form method="POST" action="banners120.php"><input type="hidden" name="id" value="'.$banner[id].'"><input type="hidden" name="do" value="cont"><input type="submit" value="'.$langbanners[15].'" class="button"></form></td>
  </tr>
</table>
';
}
}else{
echo "<center>".$langbanners[16]."</center>";
}
closetable();
}else{
showmessage($langbanners[0]);
}
require_once "../../side_right.php";
require_once "../../footer.php";
?>



Redagavo Poker· 2008 Kov. 5 15:03:58