apr. 04, 2006 session_start(); if ($_SESSION['membersarea']!="Active") { echo ""; } else { include_once ("config/config.php"); include ("themes/".$setts['default_theme']."/header.php"); header7("$lang[memarea_title]: $lang[memarea_hello] $membername "); include("membersmenu.php"); $_REQUEST['description']=$_POST['description_main']; include ("formchecker.php"); if ($_REQUEST['action']=="submit_wanted_ad") { ### V4 Request: here we calculate the closing date, which can change if the duration is changed. if ($_REQUEST['mode']=="edit") $startDate = getSqlField("SELECT startdate FROM probid_wanted_ads WHERE id='".$_POST['id']."' AND ownerid='".$_SESSION['memberid']."'","startdate"); else $startDate = date( "Y-m-d H:i:s", time() ); $closingdate = closingdate($startDate,$_REQUEST['duration']); $name = titleResize($_POST['name']); $name = remSpecialChars($name); $description = remSpecialChars($_POST['description_main']); $getWordFilter = mysql_query("SELECT * FROM probid_wordfilter"); while ($wordFilter = mysql_fetch_array($getWordFilter)) { $name=eregi_replace($wordFilter['word']," ",$name); $description=eregi_replace($wordFilter['word']," ",$description); } $keywords = $name." ".$description; if ($_REQUEST['mode']=="edit") { $oldMainImage = getSqlField("SELECT * FROM probid_auctions WHERE id='".$_POST['id']."'","picpath"); $updateitem = mysql_query("UPDATE probid_wanted_ads SET itemname='".$name."',description='".$description."', duration='".$_POST['duration']."',country='".$_POST['country']."', zip='".$_POST['zip']."',category='".$_POST['category']."',enddate='".$closingdate."',keywords='".$keywords."', addlcategory='".$_POST['addlcategory']."' WHERE id='".$_POST['id']."' AND ownerid='".$_SESSION['memberid']."'") or die(mysql_error()); addwantedcount ($_POST['category']); addwantedcount ($_POST['addlcategory']); delwantedcount ($_POST['cat_prv']); delwantedcount ($_POST['addlcat_prv']); $auctionid = $_POST['id']; echo "

$lang[aucupdate_success]

 

"; $link = "membersarea.php?page=wanted"; echo ""; } else { ## check for fee. if ($fee['wantedad_fee']>0&&!freeFees($_SESSION['memberid'])) { $payment_status="unconfirmed"; $active=0; } else { $payment_status="confirmed"; $active=1; ## also add the counter addwantedcount ($_POST['category']); addwantedcount ($_POST['addlcategory']); } $additem = mysql_query("INSERT INTO probid_wanted_ads (itemname, description, duration, country, zip, category, startdate, enddate, keywords, addlcategory, active, payment_status, ownerid) VALUES ('".$name."','".$description."','".$_POST['duration']."','".$_POST['country']."', '".$_POST['zip']."','".$_POST['category']."','".$startDate."','".$closingdate."','".$keywords."','".$_POST['addlcategory']."','".$active."','".$payment_status."','".$_SESSION['memberid']."')") or die(mysql_error()); $auctionid=mysql_insert_id(); if ($fee['wantedad_fee']>0&&!freeFees($_SESSION['memberid'])) { ### the function for the auction setup fees wantedAdFee($auctionid); } else { echo "

$lang[aucupdate_success]

 

"; $link = "membersarea.php?page=wanted"; echo ""; } } ### insert the custom fields for the auction (if available) $getFields = mysql_query("SELECT DISTINCT boxid, boxname, boxtype, active FROM probid_wanted_fields") or die(mysql_error()); $isFields = mysql_num_rows($getFields); if ($isFields) { $delFields = mysql_query("DELETE FROM probid_wanted_fields_data WHERE wantedadid='".$auctionid."' AND ownerid='".$_SESSION['memberid']."'"); while ($fields=mysql_fetch_array($getFields)) { $box_value = ""; if ($fields['boxtype']=="checkbox") { for ($i=0; $i qid=881 addon ### this is the saver for the main image $tempNumber = md5(uniqid(rand(2, 999999999))); if ($_FILES['file']['name']!=""||$_POST['mainpicurl']) { $imgMaxSize = $setts['pic_gal_max_size']*1024; if ($_FILES['file']['size']<$imgMaxSize||$_POST['mainpicurl']) { if (!preg_match("/^http:\/\//is",$oldMainImage)) { deleteFile("",$oldMainImage); } if ($_POST['mainpicurl']) { $imageName="http://".str_replace("http://","",$_POST['mainpicurl']); $isUpload=true; } else { $fileExtension = getFileExtension($_FILES['file']['name']); $imageName = "mb".$_SESSION['memberid']."_".$tempNumber."_mainpic.".$fileExtension; $isUpload = uploadFile($_FILES['file']['tmp_name'],$imageName,"uplimg/"); $imageName="uplimg/".$imageName; } if ($isUpload) { $updateAuction = mysql_query("UPDATE probid_wanted_ads SET picpath='".$imageName."' WHERE id='".$auctionid."' AND ownerid='".$_SESSION['memberid']."'"); } } else { echo "$lang[auc_errpicsize1] $setts[pic_gal_max_size] kb
$lang[auc_errpicsize2]
"; } } } else { if ($_REQUEST['mode']=="edit") { $ad = getSqlRow("SELECT * FROM probid_wanted_ads WHERE id='".$_REQUEST['id']."' AND ownerid='".$_SESSION['memberid']."'"); $isAd = getSqlNumber("SELECT * FROM probid_wanted_ads WHERE id='".$_REQUEST['id']."' AND ownerid='".$_SESSION['memberid']."' AND active=1"); } ## delete pictures if (!empty($_REQUEST['deletepic'])) { if (eregi('mainpic', $_REQUEST['deletepic'])) { $isPic = getSqlNumber("SELECT id FROM probid_wanted_ads WHERE picpath='".$ad['picpath']."'"); if (!$isPic) @unlink($_REQUEST['mainpic']); $remPicDb = mysql_query("UPDATE probid_wanted_ads SET picpath='' WHERE id='".$_REQUEST['id']."' AND ownerid='".$_SESSION['memberid']."'"); $ad['picpath'] = ''; ## we also delete all additional pics /*$getAddImages = mysql_query("SELECT i.* FROM probid_auction_images i, probid_auctions a WHERE i.auctionid='".$_REQUEST['id']."' AND a.id=i.auctionid AND a.ownerid='".$_SESSION['memberid']."'"); while ($addImage = mysql_fetch_array($getAddImages)) { deleteFile("",$addImage['name']); } $deleteImages=mysql_query("DELETE FROM probid_auction_images WHERE auctionid='".$_POST['id']."'");*/ } /*else if (eregi('addpic', $_REQUEST['deletepic'])) { $picDets = explode('_',$_REQUEST['deletepic']); $getAP = mysql_query("SELECT i.* FROM probid_auction_images i, probid_auctions a WHERE i.auctionid='".$_REQUEST['id']."' AND a.id=i.auctionid AND a.ownerid='".$_SESSION['memberid']."'"); $addPicRes = @mysql_result($getAP,$picDets[1],'name'); $addPicId = @mysql_result($getAP,$picDets[1],'id'); @unlink($addPicRes); $remAddPicDb = mysql_query("DELETE FROM probid_auction_images WHERE id='".$addPicId."'"); }*/ } if ($_REQUEST['mode']=="edit"&&$isAd==0) { echo "

$lang[editauctionerror1]

\n"; echo "

$lang[editreditectmsg]

"; } else if ($_REQUEST['mode']=="edit"&&$ad['nrbids']>0) { echo "

$lang[editauctionerror2]

\n"; echo "

$lang[editreditectmsg]

"; } else { $adEdit['itemname'] = (trim($_POST['name'])!="") ? $_POST['name'] : $ad['itemname']; $adEdit['description'] = (trim($_POST['description_main'])!="") ? remSpecialChars($_POST['description_main']) : $ad['description']; $adEdit['category'] = (trim($_POST['category'])!="") ? $_POST['category'] : $ad['category']; $adEdit['addlcategory'] = (trim($_POST['addlcategory'])!="") ? $_POST['addlcategory'] : $ad['addlcategory']; $adEdit['duration'] = (trim($_POST['duration'])!="") ? $_POST['duration'] : $ad['duration']; ?>
">




Wanted Ad


http://
";?> "; ?>
KB
"; $getCountries=mysql_query("SELECT * FROM probid_countries"); while ($countryDetails=mysql_fetch_array($getCountries)) { echo ""; } echo ""; ?>
"; $getdurations=mysql_query("SELECT * FROM probid_auction_durations"); while ($row=mysql_fetch_array($getdurations)) { echo ""; } echo ""; ?>