## v5.24 -> 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
$lang[editauctionerror1]
\n"; echo ""; } else if ($_REQUEST['mode']=="edit"&&$ad['nrbids']>0) { echo "$lang[editauctionerror2]
\n"; echo ""; } 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']; ?> } } include ("themes/".$setts['default_theme']."/footer.php"); } ?>