Re: Here are some of the crons that run.
Posted by: john hango
Date: September 06, 2010 11:39PM
Date: September 06, 2010 11:39PM
This cleans up the sites old auctions and starts new ones.
? if (!$manualCron) {
include_once("../config/config.php");
$dir_parent = "../";
} else {
$dir_parent = "";
}
//close the wanted ads.
$getExpiredWanteds = mysql_query("SELECT SQL_CACHE * FROM yspnash_wanted_ads WHERE closed=0 AND enddate<'".$timeNowMysql."'");
$closedWantedDets = array();
while ($expWanted = mysql_fetch_array($getExpiredWanteds)) {
if ($expWanted['closed']==0&&$expWanted['active']==1&&$expWanted['deleted']!=1) {
delwantedcount($expWanted['category']);
delwantedcount($expWanted['addlcategory']);
}
$closeAd[$wntcnt++] = mysql_query("UPDATE yspnash_wanted_ads SET closed=1 WHERE closed=0 AND enddate<'".$timeNowMysql."' AND id='".$expWanted['id']."'");
$closedWantedDets[$expWanted['ownerid']]++;
}
if (count($closedWantedDets)>0) {
$getUserW = mysql_query("SELECT SQL_CACHE id, name, email FROM yspnash_users WHERE active='1'");
while ($userW = mysql_fetch_array($getUserW)) {
$name = $userW['name'];
$email = $userW['email'];
if ($closedWantedDets[$userW['id']]==1) include_once($dir_parent."mails/notifywantedadexpiredcron.php");
else if ($closedWantedDets[$userW['id']]>1) include_once($dir_parent."mails/multiple-notifywantedadexpiredcron.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//close the classifieds
$getExpiredClads = mysql_query("SELECT SQL_CACHE * FROM nash_classified WHERE closed=0 AND enddate<'".$timeNowMysql."'");
$closedCladDets = array();
while ($expClad = mysql_fetch_array($getExpiredClads)) {
if ($expClad['closed']==0&&$expClad['active']==1&&$expClad['deleted']!=1) {
delclassifiedcount($expClad['category']);
delclassifiedcount($expClad['addlcategory']);
}
$closeAd[$wntcnt++] = mysql_query("UPDATE nash_classified SET closed=1 WHERE closed=0 AND enddate<'".$timeNowMysql."' AND id='".$expClad['id']."'");
$closedCladDets[$expClad['ownerid']]++;
}
if (count($closedCladDets)>0) {
$getUserW = mysql_query("SELECT SQL_CACHE id, name, email FROM yspnash_users WHERE active='1'");
while ($userW = mysql_fetch_array($getUserW)) {
$name = $userW['name'];
$email = $userW['email'];
if ($closedCladDets[$userW['id']]==1) include_once($dir_parent."mails/notifyclassadexpiredcron.php");
else if ($closedCladDets[$userW['id']]>1) include_once($dir_parent."mails/multiple-notifyclassadexpiredcron.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//mark expired my messages as expired
$nbExpiredMessages = getSqlNumber("SELECT id FROM my_messages WHERE is_expired=0");
if ($nbExpiredMessages>0) {
$today = date("Y-m-d H:i:s", time());
$timestamp_todayDate = strtotime($today);
$getExpiredMessages = mysql_query("SELECT SQL_CACHE id,expire_date FROM my_messages WHERE is_expired=0");
while ($expiredMessages = mysql_fetch_array($getExpiredMessages)) {
$timestamp_expdate = strtotime($expiredMessages['expire_date']);
if ($timestamp_todayDate>$timestamp_expdate) $markAsExpired = mysql_query("UPDATE my_messages SET is_expired=1 WHERE id='".$expiredMessages['id']."'");
}}
//close the auctions
if ($setts['enable_start_on_first_bid']==1) $getCronAuction = mysql_query("SELECT SQL_CACHE * FROM yspnash_auctions WHERE ((closed=1 AND is_start_on_first_bid=1) OR closed=0) AND active=1 AND deleted!=1 AND enddate<'".$timeNowMysql."' AND auctiontype!='wanted'");
else $getCronAuction = mysql_query("SELECT SQL_CACHE * FROM yspnash_auctions WHERE closed=0 AND active=1 AND deleted!=1 AND enddate<'".$timeNowMysql."' AND auctiontype!='wanted'");
//$markInProgress = mysql_query("UPDATE yspnash_auctions SET close_in_progress='1' WHERE active=1 AND closed=0 AND deleted!=1 AND enddate<'".$timeNowMysql."' AND auctiontype!='wanted' AND close_in_progress='0'");
$counterA = array();
$counterB = array();
while ($cronAuction = mysql_fetch_array($getCronAuction)) {
$daysleft = daysleft($cronAuction['enddate'],$setts['date_format']);
if ($daysleft<=0) {
$closeAuction = mysql_query("UPDATE yspnash_auctions SET closed=1 WHERE id='".$cronAuction['id']."'");
delcatcount($cronAuction['category'],$cronAuction['id']);
delcatcount($cronAuction['addlcategory'],$cronAuction['id']);
$delStarRatings = mysql_query("DELETE FROM nash_starratings WHERE id='auc".$cronAuction['id']."'");
if ($cronAuction['auto_relist']=="Y"&&$cronAuction['auto_relist_nb']>0&&($cronAuction['auto_relist_bids']=="Y"||$cronAuction['nrbids']==0)) {
$relistId = $cronAuction['id'];
$itemListedIn = getSqlField("SELECT listin FROM yspnash_auctions WHERE id='".$relistId."'","listin");
$userStore = getSqlRow("SELECT aboutpage_type, store_active, store_account_type FROM yspnash_users WHERE id='".$cronAuction['ownerid']."'");
$nbStoreItems = getSqlNumber("SELECT id FROM yspnash_auctions WHERE ownerid='".$cronAuction['ownerid']."' AND active='1' AND closed=0 AND deleted!='1' AND listin!='auction'");
$storeActive = FALSE;
if ($userStore['aboutpage_type']==2&&$userStore['store_active']==1) {
if ($userStore['store_account_type']==0) {
$storeActive = TRUE;
} else {
$maxStoreItems = getSqlField("SELECT store_nb_items FROM yspnash_fees_tiers WHERE id='".$userStore['store_account_type']."'","store_nb_items");
if ($maxStoreItems!="n/a"&&$maxStoreItems!=""&&$maxStoreItems>$nbStoreItems) $storeActive=TRUE;
}}
$canList = FALSE;
if ($itemListedIn!="store") {
$canList = TRUE;
} else {
if ($storeActive) $canList = TRUE;
else $canList = FALSE;
}
if ($canList&&!$cronAuction['is_relisted']) {
$today = date("Y-m-d H:i:s", time());
$closingdate = closingdate($today,$cronAuction['duration']);
$relistAuction = mysql_query("INSERT INTO yspnash_auctions (itemname, description, picpath, quantity, auctiontype, bidstart, bidend, bidstart_original, rp, rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, sc,scint, pm, main_category, category, active, payment_status, startdate, enddate, closed, keywords, maxbid, ownerid, hpfeat, catfeat, bolditem, hlitem, private, currency, postage_costs, insurance, type_service, isswap, isverify, subitemname, sc_insurance, sc_type_service, estimated_weight_lbs, estimated_weight_oz, package_size_length, package_size_width, package_size_height, odd_shaped_package, handling_fee, calculated, declVal, combine_shipp, main_region, region_suburbs, template, iconit, counter_style, acceptdirectpayment, addlcategory, shipping_details, hpfeat_desc, listin, accept_payment_systems, apply_vat, auto_relist, auto_relist_bids, endtime_type, videofile_path, listing_type, offer_range_min, offer_range_max, auto_relist_nb, charity_id, charity_gets, chacha, postage_costs_ww, insurance_ww, combine_shipp_ww, type_service_ww, shipping_details_ww, digdel_path, reserveadv_timelimit, itemAddress, itemCity, itemState, myfolder_id, retail_price, postage_costs_ww_specific, postage_costs_ww_country, pa_bidders, return_policy, return_policy_ww, enlpicitem, is_start_on_first_bid, hpfeatplus, catfeatplus, list_till_sold, immediatePayment, crazy_auctiontype, tax_amt, forpickuponly) SELECT itemname, description, picpath, quantity, auctiontype, bidstart, bidend, bidstart_original, rp, rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, sc,scint, pm, main_category, category, active, payment_status, startdate, enddate, closed, keywords, maxbid, ownerid, hpfeat, catfeat, bolditem, hlitem, private, currency, postage_costs, insurance, type_service, isswap, isverify, subitemname, sc_insurance, sc_type_service, estimated_weight_lbs, estimated_weight_oz, package_size_length, package_size_width, package_size_height, odd_shaped_package, handling_fee, calculated, declVal, combine_shipp, main_region, region_suburbs, template, iconit, counter_style, acceptdirectpayment, addlcategory, shipping_details, hpfeat_desc, listin, accept_payment_systems, apply_vat, auto_relist, auto_relist_bids, endtime_type, videofile_path, listing_type, offer_range_min, offer_range_max, auto_relist_nb, charity_id, charity_gets, chacha, postage_costs_ww, insurance_ww, combine_shipp_ww, type_service_ww, shipping_details_ww, digdel_path, reserveadv_timelimit, itemAddress, itemCity, itemState, myfolder_id, retail_price, postage_costs_ww_specific, postage_costs_ww_country, pa_bidders, return_policy, return_policy_ww, enlpicitem, is_start_on_first_bid, hpfeatplus, catfeatplus, list_till_sold, immediatePayment, crazy_auctiontype, tax_amt, forpickuponly FROM yspnash_auctions b WHERE b.id='".$relistId."'");
$newId = mysql_insert_id();
$bidstart_original = getSqlField("SELECT bidstart_original FROM yspnash_auctions WHERE id='".$newId."'","bidstart_original");
if ($bidstart_original!="n/a"&&$bidstart_original!=""&&$bidstart_original>0) mysql_query("UPDATE yspnash_auctions SET bidstart='".$bidstart_original."' WHERE id='".$newId."'");
$markAsRelisted = mysql_query("UPDATE yspnash_auctions SET is_relisted=1 WHERE id='".$relistId."'");
$getItemKeywords = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$newId."'");
$getItemRegionNames = getSqlRow("SELECT * FROM nash_regions_and_suburbs WHERE id='".$getItemKeywords['main_region']."'");
$getItemSuburbNames = getSqlRow("SELECT * FROM nash_regions_and_suburbs WHERE id='".$getItemKeywords['region_suburbs']."'");
$uniteKeywordsAndItemNumber = trim($getItemKeywords['keywords']." ".$newId." ".$getItemKeywords['zip']." ".$getItemKeywords['main_region']." ".$getItemKeywords['region_suburbs']." ".$getItemRegionNames['name']." ".$getItemSuburbNames['name']);
$uptKeywords = mysql_query("UPDATE yspnash_auctions SET keywords='".$uniteKeywordsAndItemNumber."' WHERE id='".$newId."'");
$getCustomFields = mysql_query("SELECT SQL_CACHE * FROM yspnash_fields_data WHERE auctionid='".$relistId."'");
while ($relistFld = mysql_fetch_array($getCustomFields)) $relistCustomFields = mysql_query("INSERT INTO yspnash_fields_data (auctionid,ownerid,boxid,boxvalue,active,boxcaption) VALUES ('".$newId."','".$relistFld['ownerid']."','".$relistFld['boxid']."','".$relistFld['boxvalue']."','".$relistFld['active']."','".$relistFld['boxcaption']."')");
$nbAdditionalPics = getSqlNumber("SELECT id FROM yspnash_auction_images WHERE auctionid='".$relistId."'");
if ($nbAdditionalPics>0) {
$addCnt = 1;
$getAdditionalPics = mysql_query("SELECT SQL_CACHE * FROM yspnash_auction_images WHERE auctionid='".$relistId."'");
while ($relistAddImages = mysql_fetch_array($getAdditionalPics)) {
if (file_exists($dir_parent.$relistAddImages['name'])&&InStrCount($relistAddImages['name'],"http")==0) {
$fileExtension = getFileExtension($dir_parent.$relistAddImages['name']);
$sourceImg = $relistAddImages['name'];
$destinationImg = "uplimg/".date('Y')."_a".$newId."_addpic".$addCnt.".".$fileExtension;
$isCopied = @copy($dir_parent.$sourceImg,$dir_parent.$destinationImg);
$addImage[$addCnt] = mysql_query("INSERT INTO yspnash_auction_images (name, auctionid) VALUES ('".$destinationImg."','".$newId."')");
if ($setts['is_remote_pic_linkage']==1) {
$insertImageID = mysql_insert_id();
$imName = $destinationImg;
$isFTP = ftp_file($imName,$destinationImg);
if ($isFTP) {
//if (file_exists($imName)) unlink($imName);
$remotePicName = $setts['remote_pic_linkage'].$destinationImg;
$updateAuctionPic[$addCnt] = mysql_query("UPDATE yspnash_auction_images SET name='".$remotePicName."' WHERE id='".$insertImageID."'");
}}
} else if (InStrCount($relistAddImages['name'],"http")>0) {
$addImage[$addCnt] = mysql_query("INSERT INTO yspnash_auction_images (name, auctionid) VALUES ('".$relistAddImages['name']."','".$newId."')");
if ($setts['is_remote_pic_linkage']==1) {
$insertImageID = mysql_insert_id();
$imName = $destinationImg;
$isFTP = ftp_file($imName,$destinationImg);
if ($isFTP) {
//if (file_exists($imName)) unlink($imName);
$remotePicName = $setts['remote_pic_linkage'].$destinationImg;
$updateAuctionPic[$addCnt] = mysql_query("UPDATE yspnash_auction_images SET name='".$remotePicName."' WHERE id='".$insertImageID."'");
}}}
$addCnt++;
}}
$mainPicRelist = getSqlField("SELECT picpath FROM yspnash_auctions WHERE id='".$newId."'","picpath");
if ($mainPicRelist!=""&&$mainPicRelist!="n/a") {
if (file_exists($dir_parent.$mainPicRelist)) {
$fileExtension = getFileExtension($dir_parent.$mainPicRelist);
$mainPicName = "cma".$newId."_mainpic.".$fileExtension;
$sourceImg = $mainPicRelist;
$destinationImg = "uplimg/".date('Y')."_cma".$newId."_mainpic.".$fileExtension;
$isCopied = @copy($dir_parent.$sourceImg,$dir_parent.$destinationImg);
$updateAuctionPic = mysql_query("UPDATE yspnash_auctions SET picpath='".$destinationImg."' WHERE id='".$newId."'");
if ($setts['is_remote_pic_linkage']==1) {
$imName = $destinationImg;
$isFTP = ftp_file($imName,$destinationImg);
if ($isFTP) {
//if (file_exists($imName)) unlink($imName);
$remotePicName = $setts['remote_pic_linkage'].$destinationImg;
$updateAuctionPic = mysql_query("UPDATE yspnash_auctions SET picpath='".$remotePicName."' WHERE id='".$newId."'");
}}}}
$videoRelist = getSqlField("SELECT videofile_path FROM yspnash_auctions WHERE id='".$newId."'","videofile_path");
if ($videoRelist!="") {
$fileExtension = getFileExtension($dir_parent.$videoRelist);
$videoName = "a".$newId."_video.".$fileExtension;
$isUpload = uploadFile($videoRelist,$videoName,"uplimg/", FALSE, '', FALSE);
if ($isUpload) $updateAuctionVideo = mysql_query("UPDATE yspnash_auctions SET videofile_path='uplimg/".$videoName."' WHERE id='".$newId."'");
}
$digdelRelist = getSqlField("SELECT digdel_path FROM yspnash_auctions WHERE id='".$newId."'","digdel_path");
if ($digdelRelist!="") {
$tempNumber = md5(uniqid(rand(2, 999999999)));
$thisOwnerid = getSqlField("SELECT ownerid FROM yspnash_auctions WHERE id='".$newId."'", "ownerid");
$fileExtension = getFileExtension($dir_parent.$digdelRelist);
$digdelName = date('Y')."_".$thisOwnerid."_".$tempNumber."_digdel.".$fileExtension;
$isUpload = uploadFile($digdelRelist,$digdelName,"downloads/", FALSE, '', FALSE);
if ($isUpload) $updateAuctionDigdel = mysql_query("UPDATE yspnash_auctions SET digdel_path='downloads/".$digdelName."' WHERE id='".$newId."'");
}
$nbAddImages = getSqlNumber("SELECT * FROM yspnash_auction_images WHERE auctionid='".$newId."'");
$auctionDetails = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$newId."'");
$topay = "";
$category_id = getMainCat($auctionDetails['category']);
$category_id = (getSqlNumber("SELECT category_id FROM yspnash_fees WHERE category_id='".$category_id."'")>0)?$category_id:0;
$destination_type = $auctionDetails['listin'];
if ($destination_type==""||$destination_type=="auction") $destination_type = 0;
else if ($destination_type=="store") $destination_type = 1;
else if ($destination_type=="both") $destination_type = 2;
$destination_type = (getSqlNumber("SELECT destination_type FROM yspnash_fees WHERE destination_type='".$destination_type."'")>0)?$destination_type:0;
$fee = getSqlRow("SELECT * FROM yspnash_fees WHERE category_id='".$category_id."' AND destination_type='".$destination_type."'");
if ($fee['is_setup_fee']=="Y") $topay .= "Auction Setup Fee; ";
if ($fee['is_pic_fee']=="Y"&&$fee['val_pic_fee']>0&&$nbAddImages>0) $topay .= "Image Gallery Fee; ";
if ($fee['is_hlitem_fee']=="Y"&&$fee['val_hlitem_fee']>0&&$auctionDetails['hlitem']=="Y"&&$setts['hl_item']==1) $topay .= "Highlighted Item Fee; ";
if ($fee['is_bolditem_fee']=="Y"&&$fee['val_bolditem_fee']>0&&$auctionDetails['bolditem']=="Y"&&$setts['bold_item']==1) $topay .= "Bold Item Fee; ";
if ($fee['is_enlpic_fee']=="Y"&&$fee['val_enlpic_fee']>0&&$auctionDetails['enlpicitem']=="Y"&&$setts['enlpic_item']==1) $topay .= "Enlarge Picture Item Fee; ";
if ($fee['is_hpfeat_fee']=="Y"&&$fee['val_hpfeat_fee']>0&&$auctionDetails['hpfeat']=="Y"&&$setts['hp_feat']==1) $topay .= "Home Page Featured Fee; ";
if ($fee['is_catfeat_fee']=="Y"&&$fee['val_catfeat_fee']>0&&$auctionDetails['catfeat']=="Y"&&$setts['cat_feat']==1) $topay .= "Category Page Feature Fee; ";
if ($fee['is_hpfeatplus_fee']=="Y"&&$fee['val_hpfeatplus_fee']>0&&$auctionDetails['hpfeatplus']=="Y"&&$setts['ishpfeatplus']=="Y") $topay .= "Home Page Featured-Plus Fee; ";
if ($fee['is_catfeatplus_fee']=="Y"&&$fee['val_catfeatplus_fee']>0&&$auctionDetails['catfeatplus']=="Y"&&$setts['iscatfeatplus']=="Y") $topay .= "Category Feature-Plus Fee; ";
if ($fee['is_rp_fee']=="Y"&&$fee['val_rp_fee']>0&&$auctionDetails['rp']=="Y"&&$auctionDetails['rpvalue']>0) $topay .= "Reserve Price Fee; ";
if ($fee['second_cat_fee']>0&&$auctionDetails['addlcategory']>0) {
$topay .= "Second Category Fee; ";
$issecondcat = "Y";
} else $issecondcat = "N";
if ($fee['bin_fee']>0&&$auctionDetails['bn']=="Y"&&$auctionDetails['bnvalue']>0) $topay .= "Buy It Now Fee; ";
if ($fee['lts_fee']>0&&$auctionDetails['endtime']=="lts"&&$auctionDetails['list_till_sold']==1) {
$topay.="List-Till-Sold Fee; ";
$isltsfee = "Y";
}
if ($fee['digdel_fee']>0&&$auctionDetails['digdel_path']!="") {
$topay .= "Digital Delivery Fee; ";
$isdigdelfee = "Y";
}
if ($fee['counterstyle_fee']>0&&$auctionDetails['counter_style']>1) $topay .= "Counter Style Fee; ";
if ($fee['listingdesigner_fee']>0&&$auctionDetails['template']>0) $topay .= "Listing Designer Fee; ";
if ($fee['subtitleit_fee']>0&&$auctionDetails['subname']!="") $topay .= "Subtitle Fee; ";
if ($fee['iconit_fee']>0&&$auctionDetails['iconit']!="000") $topay .= "Listing Icon Fee; ";
if ($fee['is_dur_fee']=="Y") {
$val_dur_fee = getSqlField("SELECT val_dur_fee FROM yspnash_auction_durations WHERE days='".$auctionDetails['duration']."'","val_dur_fee");
if ($val_dur_fee>0&&$val_dur_fee!="n/a") {
$topay .= "Listing Duration Fee; ";
$durfee = "Y_".$val_dur_fee;
}}
if ($fee['videofile_fee']>0&&$auctionDetails['videofile_path']!="") {
$topay .= "Movie Upload Fee; ";
$ismoviefee = "Y";
}
$hlitem_chg = ($setts['hl_item']==1)?$auctionDetails['hlitem']:"N";
$bolditem_chg = ($setts['bold_item']==1)?$auctionDetails['bolditem']:"N";
$enlpicitem_chg = ($setts['enlpic_item']==1)?$auctionDetails['enlpicitem']:"N";
$hpfeat_chg = ($setts['hp_feat']==1)?$auctionDetails['hpfeat']:"N";
$catfeat_chg = ($setts['cat_feat']==1)?$auctionDetails['catfeat']:"N";
$hpfeatplus_chg = ($setts['ishpfeatplus']=="Y")?$auctionDetails['hpfeatplus']:"N";
$catfeatplus_chg = ($setts['iscatfeatplus']=="Y")?$auctionDetails['catfeatplus']:"N";
$qu_a = $auctionDetails['quantity'];
$qu_b = getSqlField("SELECT SUM(quant_offered) AS quant_o FROM yspnash_winners WHERE auctionid='".$relistId."'", "quant_o");
$qu_total = $qu_a + $qu_b;
$qu_total = ($auctionDetails['auctiontype']=="dutch"||$auctionDetails['auctiontype']=="halfprice")?$qu_total:1;
$listIn = ($storeActive)?$itemListedIn:"auction";
$relistAuctionDets_1 = mysql_query("UPDATE yspnash_auctions SET startdate='".$timeNowMysql."', enddate='".$closingdate."', duration='".$cronAuction['duration']."', closed=0, nrbids=0, maxbid=0, quantity='".$qu_total."', hlitem='".$hlitem_chg."', bolditem='".$bolditem_chg."', enlpicitem='".$enlpicitem_chg."', hpfeat='".$hpfeat_chg."', catfeat='".$catfeat_chg."', hpfeatplus='".$hpfeatplus_chg."', catfeatplus='".$catfeatplus_chg."', listin='".$listIn."', clicks=0, auto_relist_nb=auto_relist_nb-1 WHERE id='".$newId."'");
$isFee = array(
'hpfeat' => $hpfeat_chg,
'catfeat' => $catfeat_chg,
'hpfeatplus' => $hpfeatplus_chg,
'catfeatplus' => $catfeatplus_chg,
'bold' => $bolditem_chg,
'enlpic' => $enlpicitem_chg,
'hl' => $hlitem_chg,
'rp' => $auctionDetails['rp'],
'pic_count' => $nbAddImages,
'secondcat' => $issecondcat,
'bin' => $auctionDetails['bn'],
'lts' => $isltsfee,
'digdelfee' => $isdigdelfee,
'durfee' => $durfee,
'counterstyle' => $auctionDetails['counter_style'],
'listingdesigner' => $auctionDetails['template'],
'subtitleit' => $auctionDetails['subname'],
'iconit' => $auctionDetails['iconit'],
'videofee' => $ismoviefee,
'catfeat_secondcat' => $auctionDetails['addlcategory']
);
if ($topay!=""&&!freeFees($auctionDetails['ownerid'])&&$fee['relist_fee_reduction']<100) {
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$cronAuction['ownerid']."'","payment_mode");
if ($setts['account_mode_personal']==1) {
$account_mode_local = ($tmp)?2:1;
} else $account_mode_local = $setts['account_mode'];
if ($account_mode_local==2) {
setupFee($auctionDetails['bidstart'],$auctionDetails['currency'],$auctionDetails['id'],$isFee,FALSE,FALSE,'',$auctionDetails['category'],FALSE,FALSE,$destination_type);
$payment_status="confirmed";
$active = 1;
} else {
$payment_status="unconfirmed";
$active = 0;
}} else {
$payment_status="confirmed";
$active = 1;
addcatcount($auctionDetails['category'],$auctionDetails['id']);
addcatcount($auctionDetails['addlcategory'],$auctionDetails['id']);
}
$relistAuctionDets_2 = mysql_query("UPDATE yspnash_auctions SET active='".$active."',payment_status='".$payment_status."' WHERE id='".$newId."'");
auctionApproval($newId, $auctionDetails['ownerid']);
$keywords = getSqlField("SELECT keywords FROM yspnash_auctions WHERE id='".$newId."'","keywords");
$getKeywords = mysql_query("SELECT SQL_CACHE * FROM yspnash_keywords_watch");
while ($keywordsW = mysql_fetch_array($getKeywords)) {
if (eregi($keywordsW['keyword'],$keywords)) {
$userId = $keywordsW['bidderid'];
$auctionId = $newId;
$keyword = $keywordsW['keyword'];
include_once($dir_parent."mails/keywordmatch.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
$userId = $auctionDetails['ownerid'];
$auctionId = $newId;
if ($nbRelistedAuctions>3) {
if (!$mailSent) include_once($dir_parent."mails/confirmtosellermultipleauctions.php");
$mailSent = TRUE;
} else {
include_once($dir_parent."mails/confirmtoseller.php");
if ($auctionDetails['chacha']=="Y"&&$setts['enable_charitysys']==1) include_once($dir_parent."mails/copytocharity.php");
}
deleteAuction($relistId);
if ($setts['istwitter']==1&&$setts['twitter_username']!=""&&$setts['twitter_password']!="") {
$curTwitter = new twitter($setts['twitter_username'],$setts['twitter_password']);
$part1 = $setts['siteurl'].processLink('auctiondetails',array('itemname' => $auctionDetails['itemname'],'id' => $auctionDetails['id']))." ";
$part2 = strtoupper($auctionDetails['itemname']);
$part3 = " - ".$lang[nash5331]." ";
$part4 = $setts['siteurl'];
list($a,$b) = explode("://",$part4);
$part4 = substr($b,0,-1);
$count_part2 = strlen($part2);
$count_part3 = strlen($part3);
$count_part4 = strlen($part4);
$count_parts = ($count_part2+$count_part3+$count_part4);
if ($count_parts>140) $part2 = substr($part2,0,-($count_parts-140));
$parts = $part1.$part2.$part3.$part4;
if (strlen($parts)>0) echo ($curTwitter->setStatus($parts)==true)?"":"";
}
$twitterDetails = getSqlRow("SELECT u.istwitter,u.twitter_username,u.twitter_password FROM yspnash_users AS u, yspnash_auctions AS a WHERE u.id=a.ownerid AND a.id='".$auctionDetails['id']."'");
if ($twitterDetails['istwitter']==1&&$twitterDetails['twitter_username']!=""&&$twitterDetails['twitter_password']!="") {
$curTwitter = new twitter($twitterDetails['twitter_username'],$twitterDetails['twitter_password']);
$part1 = $setts['siteurl'].processLink('auctiondetails',array('itemname' => $auctionDetails['itemname'],'id' => $auctionDetails['id']))." ";
$part2 = strtoupper($auctionDetails['itemname']);
$part3 = " - ".$lang[nash5331]." ";
$part4 = $setts['siteurl'];
list($a,$b) = explode("://",$part4);
$part4 = substr($b,0,-1);
$count_part2 = strlen($part2);
$count_part3 = strlen($part3);
$count_part4 = strlen($part4);
$count_parts = ($count_part2+$count_part3+$count_part4);
if ($count_parts>140) $part2 = substr($part2,0,-($count_parts-140));
$parts = $part1.$part2.$part3.$part4;
if (strlen($parts)>0) echo ($curTwitter->setStatus($parts)==true)?"":"";
}
if ($setts['isautoping']==1) doPingOMatic(ucfirst(trim($auctionDetails['itemname'])),$setts['siteurl'].processLink('auctiondetails',array('itemname' => $auctionDetails['itemname'],'id' => $auctionDetails['id'])));
if ($setts['is_tinyurls']==1) tinyurl_builder("a",$auctionDetails['id'],trim($auctionDetails['itemname']));
}}
if ($cronAuction['rpvalue']>$cronAuction['maxbid']) {
$a = mysql_query("SELECT SQL_CACHE bid.bidamount, proxy.bidamount, bid.bidderid FROM yspnash_bids AS bid, yspnash_proxybid AS proxy WHERE bid.auctionid='".$cronAuction['id']."' AND bid.auctionid=proxy.auctionid AND bid.bidderid=proxy.bidderid AND bid.invalid=0 AND bid.outbid=0");
if (mysql_num_rows($a)>0) {
while ($b = mysql_fetch_row($a)) {
if ($b[0]<$cronAuction['rpvalue']&&$b[1]>=$cronAuction['rpvalue']) {
mysql_query("UPDATE yspnash_bids SET bidamount='".$cronAuction['rpvalue']."' WHERE auctionid='".$cronAuction['id']."' AND bidderid='" . $b[2] ."' AND invalid='0' AND outbid='0'");
$cronAuction['maxbid'] = $cronAuction['rpvalue'];
mysql_query("UPDATE yspnash_auctions SET maxbid='".$cronAuction['rpvalue']."' WHERE id='".$cronAuction['id']."'");
}}}}
$itemCategory = getSqlField("SELECT category FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","category");
$itemListin = getSqlField("SELECT listin FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","listin");
$category_id = getMainCat($itemCategory);
$category_id = (getSqlNumber("SELECT category_id FROM yspnash_fees WHERE category_id='".$category_id."'")>0)?$category_id:0;
$destination_type = $itemListin;
if ($destination_type==""||$destination_type=="auction") $destination_type = 0;
else if ($destination_type=="store") $destination_type = 1;
else if ($destination_type=="both") $destination_type = 2;
$destination_type = (getSqlNumber("SELECT destination_type FROM yspnash_fees WHERE destination_type='".$destination_type."'")>0)?$destination_type:0;
$fee = getSqlRow("SELECT * FROM yspnash_fees WHERE category_id='".$category_id."' AND destination_type='".$destination_type."'");
$isWinner = FALSE;
if ($cronAuction['rpvalue']<=$cronAuction['maxbid']) {
$nbWinners = getSqlNumber("SELECT id FROM yspnash_bids WHERE auctionid='".$cronAuction['id']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC");
if ($nbWinners>0) {
$totalQuantity = 0;
$getWinner = mysql_query("SELECT SQL_CACHE * FROM yspnash_bids WHERE auctionid='".$cronAuction['id']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC");
while ($winnerDetails = mysql_fetch_array($getWinner)) {
$auctionWonDetails = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$winnerDetails['auctionid']."'");
$addSale = mysql_query("UPDATE yspnash_users SET items_sold=items_sold+1 WHERE id='".$auctionWonDetails['ownerid']."'");
if ($totalQuantity==0) $totalQuantity = $auctionWonDetails['quantity'];
$amount = $winnerDetails['bidamount'];
if ($cronAuction['rpvalue']>$cronAuction['maxbid']&&$winnerDetails['bidamount']>=$cronAuction['rpvalue']) $cronAuction['maxbid'] = $cronAuction['rpvalue'];
$addPurchase = mysql_query("UPDATE yspnash_users SET items_bought=items_bought+1 WHERE id='".$winnerDetails['bidderid']."'");
$quantityRequested = $winnerDetails['quantity'];
if ($setts['ref_crt_amt_on_refee_item_win_switch']==1) {
$getRefee = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'");
$getRefer = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$getRefee['username']."'");
if ($getRefer) {
$updReferMainBalance = mysql_query("UPDATE yspnash_users SET balance=balance-'".$setts['refer_crt_amt_on_refee_item_win']."' WHERE id='".$getRefer['referrerid']."'");
$updReferCreditBalance = mysql_query("UPDATE yspnash_users SET ref_credit_balance=ref_credit_balance+'".$setts['refer_crt_amt_on_refee_item_win']."' WHERE id='".$getRefer['referrerid']."'");
$updRevTotal = mysql_query("UPDATE nash_referrals SET refer_rev_total=refer_rev_total+'".$setts['refer_crt_amt_on_refee_item_win']."' WHERE referredusern='".$getRefer['referredusern']."'");
}}
if ($quantityRequested>0) {
$quantityOffered = $totalQuantity;
$totalQuantity -= $quantityRequested;
}
$payerId = (eregi('s',$fee['endauction_fee_applies']))?$cronAuction['ownerid']:$winnerDetails['bidderid'];
if ($fee['is_endauction_fee']=="Y"&&!freeFees($payerId)) {
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$payerId."'","payment_mode");
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
if ($account_mode_local==2) {
$newBalance = 0;
$endauctionFee = getSqlRow("SELECT * FROM yspnash_fees_tiers WHERE fee_from<='".$amount."' AND fee_to>'".$amount."' AND fee_type='endauction' AND category_id='".$category_id."' AND destination_type='".$destination_type."'");
if ($endauctionFee['calc_type']=="percent") $newBalance += ($endauctionFee['fee_amount']/100)*$amount;
else $newBalance += $endauctionFee['fee_amount'];
$auctionType = getSqlField("SELECT auctiontype FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","auctiontype");
if ($auctionType=="dutch") {
$totalQuant = getSqlField("SELECT SUM(quant_offered) AS total_quant FROM yspnash_winners WHERE auctionid='".$cronAuction['id']."'","total_quant");
$add_desc = " x ".$totalQuant;
} else {
$totalQuant = 1;
$add_desc = "";
}
$newBalance = $newBalance*$totalQuant;
$prefSeller = "N";
if ($setts['pref_sellers']=="Y") {
$prefSeller = getSqlField("SELECT preferred_seller FROM yspnash_users WHERE id='".$payerId."'","preferred_seller");
$newBalance = calcReduction($newBalance,$prefSeller);
}
$payment_status = "confirmed";
$active = 1;
$currentBalance = getSqlField("SELECT balance FROM yspnash_users WHERE id='".$payerId."'","balance");
$updateSellerBalance = mysql_query("UPDATE yspnash_users SET balance=balance+".$newBalance." WHERE id='".$payerId."'");
$currentTime = time();
$currentBalance += $newBalance;
$insinv = mysql_query("INSERT INTO yspnash_invoices (userid,auctionid,feename,feevalue,feedate,balance)VALUES ('".$payerId."','".$winnerDetails['auctionid']."','End of Item Fee".$add_desc."','".$newBalance."','".$currentTime."', '".$currentBalance."')");
if ($endauctionFee['shared_percent']>0) {
$todayn = date("Y-m-d H:i:s", time());
$refee5 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'");
$referid4 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee5['username']."'");
if ($referid4) {
$refee4 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid4['referrerid']."'");
$num = 1;
$referid3 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee4['username']."'");
}
if ($referid3) {
$refee3 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid3['referrerid']."'");
$num = 2;
$referid2 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee3['username']."'");
}
if ($referid2) {
$refee2 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid2['referrerid']."'");
$num = 3;
$referid1 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee2['username']."'");
}
if ($referid1) {
$refee1 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid1['referrerid']."'");
$num = 4;
}
if (!$num||$num==0||$num=="") $num=1;
$endauction_commission = (($newBalance/100)*$endauctionFee['shared_percent'])/$num;
if ($num==1) {//level 4 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}}
if ($num==2) {//level 3 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}
$newComTotal3 = $refee3['endauction_commission']+$endauction_commission; //----------
if ($referid3['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee3['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal3."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee3['id']."'");
}}
if ($num==3) {//level 2 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}
$newComTotal3 = $refee3['endauction_commission']+$endauction_commission; //----------
if ($referid3['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee3['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal3."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee3['id']."'");
}
$newComTotal2 = $refee2['endauction_commission']+$endauction_commission; //----------
if ($referid2['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee2['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal2."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee2['id']."'");
}}
if ($num==4) {//level 1 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}
$newComTotal3 = $refee3['endauction_commission']+$endauction_commission; //----------
if ($referid3['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee3['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal3."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee3['id']."'");
}
$newComTotal2 = $refee2['endauction_commission']+$endauction_commission; //----------
if ($referid2['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee2['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal2."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee2['id']."'");
}
$newComTotal1 = $refee1['endauction_commission']+$endauction_commission; //----------
if ($referid1['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee1['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal1."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee1['id']."'");
}}}} else {
$payment_status = "unconfirmed";
$active = 0;
}} else {
$payment_status = "confirmed";
$active = 1;
}
$saveWinner = mysql_query("INSERT INTO yspnash_winners (sellerid,buyerid,amount,quant_req,quant_offered,auctionid,auctiontype,payment_status,purchase_date) VALUES ('".$auctionWonDetails['ownerid']."','".$winnerDetails['bidderid']."','".$amount."','".$quantityRequested."','".$quantityOffered."','".$winnerDetails['auctionid']."','".$auctionWonDetails['auctiontype']."','".$payment_status."','".time()."')");
$addPurchase = mysql_query("UPDATE yspnash_users SET items_bought=items_bought+1 WHERE id='".$winnerDetails['bidderid']."'");
$sellerUsername = getSqlField("SELECT username FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","username");
$buyerUsername = getSqlField("SELECT username FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","username");
$prepareSellerFeedback = mysql_query("INSERT INTO yspnash_feedbacks (userid,usernick,fromid,submitted,auctionid,type) VALUES ('".$auctionWonDetails['ownerid']."','".$sellerUsername."','".$winnerDetails['bidderid']."',0,'".$winnerDetails['auctionid']."','sale')");
$prepareBuyerFeedback = mysql_query("INSERT INTO yspnash_feedbacks (userid,usernick,fromid,submitted,auctionid,type) VALUES ('".$winnerDetails['bidderid']."','".$buyerUsername."','".$auctionWonDetails['ownerid']."',0,'".$winnerDetails['auctionid']."','purchase')");
$sellerId = getSqlField("SELECT id FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","id");
$buyerId = getSqlField("SELECT id FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","id");
$auctionId = $winnerDetails['auctionid'];
$auctionName = getSqlField("SELECT itemname FROM yspnash_auctions WHERE id='".$auctionId."'","itemname");
$maxBid = $amount;
$email = getSqlField("SELECT email FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","email");
$name = getSqlField("SELECT name FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","name");
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","payment_mode");
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
include_once($dir_parent."mails/notifysellercron.php");
if ($auctionWonDetails['chacha']=="Y"&&$setts['enable_charitysys']==1) include_once($dir_parent."mails/copytocharity_solditem.php");
$email = getSqlField("SELECT email FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","email");
$name = getSqlField("SELECT name FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","name");
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","payment_mode");
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
include_once($dir_parent."mails/notifybuyercron.php");
$isWinner = TRUE;
}}} else if ($cronAuction['rpvalue']>$cronAuction['maxbid']) {
$highBidderId = getSqlField("SELECT bidderid FROM yspnash_bids WHERE auctionid='".$cronAuction['id']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC LIMIT 0,1","bidderid");
$email = getSqlField("SELECT email FROM yspnash_users WHERE id='".$highBidderId."'","email");
$name = getSqlField("SELECT name FROM yspnash_users WHERE id='".$highBidderId."'","name");
$isHighBidder = getSqlNumber("SELECT id FROM yspnash_users WHERE id='".$highBidderId."'");
$auctionId = $cronAuction['id'];
if ($isHighBidder>0) include_once($dir_parent."mails/notifyhighbiddercron.php");
}
if (!$isWinner) {
$sellerId = getSqlField("SELECT ownerid FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","ownerid");
$counterA[$sellerId] = $cronAuction['id'];
$counterB[$sellerId]++;
}}}
if (count($counterB)>0) {
$getUserNB = mysql_query("SELECT SQL_CACHE id, name, email, mail_auctionclosed FROM yspnash_users WHERE active='1'");
while ($seller = mysql_fetch_array($getUserNB)) {
$name = $seller['name'];
$email = $seller['email'];
$auctionId = $counterA[$seller['id']];
if ($counterB[$seller['id']]==1) include_once($dir_parent."mails/notifysellernobids.php");
else if ($counterB[$seller['id']]>1) include_once($dir_parent."mails/multiple-notifysellernobids.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//$unmarkInProgress = mysql_query("UPDATE yspnash_auctions SET close_in_progress='0' WHERE active=1 AND closed=0 AND deleted!=1 AND auctiontype!='wanted' AND close_in_progress='1'");
$getWinners = mysql_query("SELECT SQL_CACHE * FROM yspnash_winners WHERE emailsent=0");
while ($winner = mysql_fetch_array($getWinners)) {
if (($winner['payment_status']=="confirmed")||($fee['is_endauction_fee']=="N")) {
$sellerId=$winner['sellerid'];
$buyerId=$winner['buyerid'];
$auctionId=$winner['auctionid'];
$winnerId=$winner['id'];
mysql_query("UPDATE yspnash_winners SET emailsent=1 WHERE id='".$winner['id']."'");
include_once($dir_parent."mails/buyerdetails.php");
include_once($dir_parent."mails/sellerdetails.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//delete auctions older than certain number of days
$getAllAuctions = mysql_query("SELECT SQL_CACHE id,enddate FROM yspnash_auctions WHERE closed=1");
while ($oldAuction = mysql_fetch_array($getAllAuctions)) {
$datenow=time();
$arrDateTime = explode(" ", $oldAuction['enddate']);
$arrDate = explode("-", $arrDateTime[0]);
$arrTime = explode(":", $arrDateTime[1]);
$daysleft = mktime($arrTime[0],$arrTime[1],$arrTime[2],$arrDate[1],$arrDate[2],$arrDate[0]);
$daycount = intval($datenow-$daysleft);
$dayspassed = $daycount/86400;
if ($dayspassed>$setts['auction_deletion']) {
$inAdmin = FALSE;
if ($s_adminarea=="Active") $inAdmin = TRUE;
if (!$inAdmin) $s_adminarea = "Active";
deleteAuction($oldAuction['id'],TRUE);
if (!$inAdmin) $s_adminarea = "";
//start of updating sessions
$_SESSION[$setts['pk']."_sessionera"] = base64_encode(nash_cc_encrypt($s_adminarea."[XAX]".$s_adminid."[XAX]".$s_adminusername."[XAX]".$s_adminlevel."[XAX]".$s_adminlastaccess."[XAX]".$s_usertype,$setts['myprivatekey']));
//end of updating sessions
}}
$delinvkw = mysql_query("DELETE FROM yspnash_keywords_watch WHERE keyword=''");
//start scheduled auctions
$today = date("Y-m-d H:i:s");
$getCatCounts = mysql_query("SELECT SQL_CACHE id,category,addlcategory FROM yspnash_auctions WHERE startdate<'".$today."' AND enddate>'".$today."' AND closed=1 AND active=1 AND deleted!=1 AND swapped!=1");
while ($catid = mysql_fetch_array($getCatCounts)) {
addcatcount($catid['category'],$catid['id']);
addcatcount($catid['addlcategory'],$cat['id']);
}
$startAuctions = mysql_query("UPDATE yspnash_auctions SET active=1,closed=0 WHERE startdate<'".$today."' AND enddate>'".$today."' AND closed=1 AND active=1 AND deleted!=1 AND swapped!=1");
$delAuctionWatch = mysql_query("DELETE FROM yspnash_auction_watch WHERE userid=0");
$deleteWonItems = mysql_query("DELETE FROM yspnash_winners WHERE s_deleted=1 AND b_deleted=1");
//check for expired active stores, and if account mode = 2, charge the fee, otherwise suspend the store
$currentTime = time();
$getCronStores = mysql_query("SELECT SQL_CACHE u.id, u.store_account_type, f.fee_amount, f.store_recurring, f.store_nb_items, f.store_condition FROM yspnash_users u, yspnash_fees_tiers f WHERE u.store_active='1' AND u.aboutpage_type='2' AND f.store_recurring>0 AND f.fee_type='store' AND u.store_nextpayment<'".$currentTime."' AND u.active=1 AND u.store_account_type=f.id");
while ($cronStore = mysql_fetch_array($getCronStores)) {
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$cronStore['id']."'","payment_mode");
$nbStoreItems = 0;
if ($cronStore['store_condition']==2) $nbStoreItems = getSqlNumber("SELECT id FROM yspnash_auctions WHERE ownerid='".$cronStore['id']."' AND closed=0 AND active=1 AND deleted!=1 AND listin!='auction'");
if ($cronStore['store_condition']==1||($cronStore['store_condition']==2&&$nbStoreItems<$cronStore['store_nb_items'])) {
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
if ($fee['is_store_fee']=="Y"&&$cronStore['fee_amount']>0&&!freeFees($cronStore['id'])) {
if ($account_mode_local==1) $updateStore = mysql_query("UPDATE yspnash_users SET store_active=0 WHERE id='".$cronStore['id']."'");
else if ($account_mode_local==2) storeSetupFee($cronStore['id'],$cronStore['store_account_type'],TRUE);
} else {
$store_nextpayment = 0;
if ($cronStore['store_recurring']>0) $store_nextpayment = $currentTime+($cronStore['store_recurring']*24*3600);
$updateStore = mysql_query("UPDATE yspnash_users SET store_active=1, store_lastpayment='".$currentTime."', store_nextpayment='".$store_nextpayment."' WHERE id = '".$cronStore['id']."'");
}} else {
$store_nextpayment = 0;
if ($cronStore['store_recurring']>0) $store_nextpayment = $currentTime+($cronStore['store_recurring']*24*3600);
$updateStore = mysql_query("UPDATE yspnash_users SET store_active=1, store_lastpayment='".$currentTime."', store_nextpayment='".$store_nextpayment."' WHERE id = '".$cronStore['id']."'");
}}
//check if a change of username has passed 30 days and remove the change of username icon from his listings
$getCronChangeOfUsername = mysql_query("SELECT SQL_CACHE * FROM yspnash_users WHERE is_username_changed='1'");
while ($cronChangeOfUsername = mysql_fetch_array($getCronChangeOfUsername)) {
$last_time_changed_username = $cronChangeOfUsername['changeusername_date'];
$todayDate = date("Y-m-d H:i:s",time());
$timestamp_last_time_changed_username = strtotime($last_time_changed_username);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_last_time_changed_username;
$DCCIconverted = (60*60*24*30); //30 days before user can change his username
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE yspnash_users SET is_username_changed='0' WHERE id='".$cronChangeOfUsername['id']."'");
}
//check if phone verification has passed XX days and unverify whoever applicable
if ($setts['pc_reverify']==1) {
$getCronPhoneConfirm = mysql_query("SELECT SQL_CACHE * FROM yspnash_users WHERE isphone_verified='1'");
while ($cronPhoneConfirm = mysql_fetch_array($getCronPhoneConfirm)) {
$isphone_verified_date = $cronPhoneConfirm['isphone_verified_date'];
$todayDate = date("Y-m-d");
$timestamp_isphone_verified_date = strtotime($isphone_verified_date);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_isphone_verified_date;
$DCCIconverted = (60*60*24*$setts['pc_reverify_days']);
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE yspnash_users SET isphone_verified='0' WHERE id='".$cronPhoneConfirm['id']."'");
}}
//check if myfolders has passed XX days and lock them back to whoever applicable
if ($setts['is_myfolders_fee_recurring']==1) {
$getCronMyFolders = mysql_query("SELECT SQL_CACHE * FROM yspnash_users WHERE is_myfolders_paid='1'");
while ($cronMyFolders = mysql_fetch_array($getCronMyFolders)) {
$ismyfolders_paid_date = $cronMyFolders['is_myfolders_date_paid'];
$todayDate = date("Y-m-d");
$timestamp_ismyfolders_paid_date = strtotime($ismyfolders_paid_date);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_ismyfolders_paid_date;
$DCCIconverted = (60*60*24*$setts['myfolders_fee_days']);
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE yspnash_users SET is_myfolders_paid='0' WHERE id='".$cronMyFolders['id']."'");
}}
//check if memorium has passed XX days and lock them back to whoever applicable
if ($setts['ismemorium_hp_fee_recurring']==1) {
$getCronMemorium = mysql_query("SELECT SQL_CACHE * FROM nash_memorium WHERE ispaid='1'");
while ($cronMemorium = mysql_fetch_array($getCronMemorium)) {
$ismyfolders_paid_date = $cronMemorium['date_paid'];
$todayDate = date("Y-m-d");
$timestamp_ismyfolders_paid_date = strtotime($ismyfolders_paid_date);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_ismyfolders_paid_date;
$DCCIconverted = (60*60*24*$setts['memorium_hp_fee_days']);
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE nash_memorium SET ispaid='0' WHERE id='".$cronMemorium['id']."'");
}}
//delete star ratings that are still at 0 rate
$delZeroStarRatings = mysql_query("DELETE FROM nash_starratings WHERE total_votes=0 AND total_value=0");
//delete bids that still have auctionid = 0
$delBids = mysql_query("DELETE FROM yspnash_bids_history WHERE auctionid=0");
//delete searched keywords which have no results
$delZeroCountSearches = mysql_query("DELETE FROM nash_searchitemkeywords WHERE counter=0");
//delete saved list items that no longer in auctions table
$getSavedItems = mysql_query("SELECT SQL_CACHE * FROM nash_saved_lists ORDER BY item_id ASC");
$nbSavedItems = mysql_num_rows($getSavedItems);
if ($nbSavedItems>0) {
while ($savedItem = mysql_fetch_array($getSavedItems)) {
if (getSqlNumber("SELECT id FROM yspnash_auctions WHERE id='".$savedItem['item_id']."'")==0) $delMissingItem = mysql_query("DELETE FROM nash_saved_lists WHERE id='".$savedItem['id']."'");
}}
//notify winners of the give-aways
$currentTime = date("Y-m-d");
$getCronGiveAways = mysql_query("SELECT SQL_CACHE * FROM nash_giveaway_items WHERE item_end_date<'".$currentTime."' AND winners_notified='0' ORDER BY item_end_date ASC");
$nbCronGiveAways = mysql_num_rows($getCronGiveAways);
if ($nbCronGiveAways>0) {
while ($cronGiveAways = mysql_fetch_array($getCronGiveAways)) {
$getWinner = mysql_query("SELECT SQL_CACHE * FROM nash_giveaway_entries WHERE giveaway_id='".$cronGiveAways['id']."' ORDER BY cust_nb_entries DESC LIMIT 1");
$nbWinner = mysql_num_rows($getWinner);
if ($nbWinner>0) {
while ($winner = mysql_fetch_array($getWinner)) {
$updWinnerNotified = mysql_query("UPDATE nash_giveaway_items SET winners_notified='1',winner_id='".$winner['cust_id']."' WHERE id='".$winner['giveaway_id']."'");
$winnerID = $winner['cust_id'];
$winnerUsername = $winner['cust_username'];
$winnerScore = $winner['cust_nb_entries'];
$posterID = $cronGiveAways['giver_id'];
$posterUsername = $cronGiveAways['giver_username'];
$giveAwayTitle = addSpecialChars($cronGiveAways['item_name']);
$giveAwayEndedTime = $cronGiveAways['item_end_date'];
$giveAwayPicpath = $cronGiveAways['item_picpath'];
if ($setts['enable_giveaways']==1) {
include_once($dir_parent."mails/alert_giveways_winner.php");
include_once($dir_parent."mails/alert_giveways_poster_about_winner.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}}}}
//notify first time sellers
$getFirstTimeSellers = mysql_query("SELECT SQL_CACHE id FROM yspnash_users WHERE items_sold=1 AND congrats_first_item_sold=0 ORDER BY items_sold ASC");
$nbFirstTimeSellers = mysql_num_rows($getFirstTimeSellers);
if ($nbFirstTimeSellers>0) {
while ($firstTimeSellers = mysql_fetch_array($getFirstTimeSellers)) {
$userid = $firstTimeSellers['id'];
$markAsSent = mysql_query("UPDATE yspnash_users SET congrats_first_item_sold=1 WHERE id='".$userid."'");
include_once($dir_parent."mails/congrats_to_first_time_seller.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//hide outdated spotlight items
$nbSpotlightItems = getSqlNumber("SELECT id FROM nash_spotlight_items WHERE hidden=0");
if ($nbSpotlightItems>0) {
$getReckon = mysql_query("SELECT SQL_CACHE * FROM nash_spotlight_items WHERE hidden='0'");
while ($reckon = mysql_fetch_array($getReckon)) {
$enddate = getSqlField("SELECT enddate FROM yspnash_auctions WHERE id='".$reckon['item_id']."'","enddate");
$todayDate = date("Y-m-d H:i:s",time());
$enddate = strtotime($enddate);
$todayDate = strtotime($todayDate);
if ($enddate<=$todayDate) $updSpotlight = mysql_query("UPDATE nash_spotlight_items SET hidden=1 WHERE id='".$reckon['id']."'");
else $updSpotlight = mysql_query("UPDATE nash_spotlight_items SET is_run=0 WHERE id='".$reckon['id']."'");
}}
//hide outdated spotlight stand-alone clssifieds
$nbSpotlightClassads = getSqlNumber("SELECT id FROM nash_spotlight_classads WHERE hidden=0");
if ($nbSpotlightClassads>0) {
$getReckon = mysql_query("SELECT SQL_CACHE * FROM nash_spotlight_classads WHERE hidden='0'");
while ($reckon = mysql_fetch_array($getReckon)) {
$enddate = getSqlField("SELECT enddate FROM nash_classified WHERE id='".$reckon['item_id']."'","enddate");
$todayDate = date("Y-m-d H:i:s",time());
$enddate = strtotime($enddate);
$todayDate = strtotime($todayDate);
if ($enddate<=$todayDate) $updSpotlight = mysql_query("UPDATE nash_spotlight_classads SET hidden=1 WHERE id='".$reckon['id']."'");
else $updSpotlight = mysql_query("UPDATE nash_spotlight_classads SET is_run=0 WHERE id='".$reckon['id']."'");
}}
//get buyer's ids and insert them into sellers-to-buyers newsletter db table
$totalSellersBuyers = getSqlNumber("SELECT id FROM yspnash_winners ORDER BY sellerid ASC, buyerid ASC");
if ($totalSellersBuyers>0) {
$sellerid = "";
$buyerIds = "";
$getSellersBuyers = mysql_query("SELECT SQL_CACHE DISTINCT(CONCAT(sellerid,'Z',buyerid)), sellerid, buyerid FROM yspnash_winners ORDER BY sellerid ASC, buyerid ASC");
while ($sellerBuyer = mysql_fetch_array($getSellersBuyers)) {
if ($sellerid==$sellerBuyer['sellerid']||$sellerid=="") $buyerIds .= ",".$sellerBuyer['sellerid']."Z".$sellerBuyer['buyerid'];
else $buyerIds .= "Y".$sellerBuyer['sellerid']."Z".$sellerBuyer['buyerid'];
$sellerid = $sellerBuyer['sellerid'];
}
$buyerIds = substr($buyerIds,1);
$buyerIds1 = explode("Y",$buyerIds);
for ($i=0; $i<count($buyerIds1); $i++) {
$sellerIdFinal = "";
$buyerIdsFinal = "";
$buyerIds2 = explode(",",$buyerIds1[$i]);
for ($j=0; $j<count($buyerIds2); $j++) {
list($sellerrid, $buyerrid) = explode("Z",$buyerIds2[$j]);
$buyerIdsFinal .= $buyerrid.",";
$sellerIdFinal = $sellerrid;
}
$buyerIdsFinal = substr($buyerIdsFinal,0,-1);
if (getSqlNumber("SELECT id FROM nash_sellers_nl WHERE seller_id='".$sellerIdFinal."'")>0) {
$updRow = mysql_query("UPDATE nash_sellers_nl SET buyer_ids='".$buyerIdsFinal."' WHERE seller_id='".$sellerIdFinal."'");
} else {
$insRow = mysql_query("INSERT INTO nash_sellers_nl (seller_id,buyer_ids) VALUES ('".$sellerIdFinal."','".$buyerIdsFinal."')");
}}}
//remove the end time of star ratings
$nbStarRatings = getSqlNumber("SELECT id FROM nash_starratings WHERE type_of_it='auc' ORDER BY total_value DESC");
if ($nbStarRatings>0) {
$getStarRatings = mysql_query("SELECT SQL_CACHE id FROM nash_starratings WHERE type_of_it='auc' ORDER BY total_value DESC");
while ($starRatings = mysql_fetch_array($getStarRatings)) {
$starRetingsId = str_replace("auc","",$starRatings['id']);
$getItemDetsET = getSqlRow("SELECT id, enddate FROM yspnash_auctions WHERE id='".$starRetingsId."'");
if ($getItemDetsET['id']) mysql_query("UPDATE nash_starratings SET enddate='".$getItemDetsET['enddate']."' WHERE id='".$starRatings['id']."'");
}}
//remove the empty amounts in winners table
$nbWinners = getSqlNumber("SELECT id FROM yspnash_winners WHERE amount='0' ORDER BY amount ASC");
if ($nbWinners>0) {
$getWinners = mysql_query("SELECT SQL_CACHE * FROM yspnash_winners WHERE amount='0' ORDER BY amount ASC");
while ($winners = mysql_fetch_array($getWinners)) {
$highBidderId = getSqlRow("SELECT bidamount FROM yspnash_bids WHERE bidderid='".$winners['buyerid']."' AND auctionid='".$winners['auctionid']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC LIMIT 0,1");
if (!$highBidderId['bidamount']) {
$auctionDetails = getSqlRow("SELECT bidstart,bnvalue,maxbid FROM yspnash_auctions WHERE id='".$winners['auctionid']."' AND ownerid='".$winners['sellerid']."' AND closed=1");
if ($auctionDetails['maxbid']>0&&$auctionDetails['bnvalue']==0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['maxbid']."' WHERE id='".$winners['id']."'");
else if ($auctionDetails['maxbid']==0&&$auctionDetails['bnvalue']==0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['bidstart']."' WHERE id='".$winners['id']."'");
else if ($auctionDetails['maxbid']>0&&$auctionDetails['bnvalue']>0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['maxbid']."' WHERE id='".$winners['id']."'");
else if ($auctionDetails['maxbid']==0&&$auctionDetails['bnvalue']>0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['bnvalue']."' WHERE id='".$winners['id']."'");
} else {
$updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$highBidderId['bidamount']."' WHERE id='".$winners['id']."'");
}}}
//remove the stray questions from user help system
$nbStrayQs = getSqlNumber("SELECT id FROM nash_help_questions WHERE asker_id='0' ORDER BY asker_id ASC");
if ($nbStrayQs>0) {
$getStrayQs = mysql_query("SELECT SQL_CACHE * FROM nash_help_questions WHERE asker_id='0' ORDER BY asker_id ASC");
while ($strayQs = mysql_fetch_array($getStrayQs)) {
$delStrayAs = mysql_query("DELETE FROM nash_help_answers WHERE qid='".$strayQs['id']."'");
$delStrayQs = mysql_query("DELETE FROM nash_help_questions WHERE id='".$strayQs['id']."'");
}}
//update the number of referred users for each active user, also update if a user has added a credit card
$getUsers = mysql_query("SELECT SQL_CACHE id FROM yspnash_users WHERE active='1'");
while ($user = mysql_fetch_array($getUsers)) {
$nbReferredUsers = getSqlNumber("SELECT id FROM nash_referrals WHERE referrerid='".$user['id']."' AND is_approved=1");
$isUserCC = ((getSqlNumber("SELECT id FROM nash_cc_data WHERE userid='".$user['id']."'")>0)?1:0);
$updUser = mysql_query("UPDATE yspnash_users SET nb_referred_users='".$nbReferredUsers."',isUserCC='".$isUserCC."' WHERE id='".$user['id']."'");
}
//update number of watchers in auctions table
$getWatchers = mysql_query("SELECT SQL_CACHE * FROM yspnash_auction_watch WHERE 1");
while ($watcher = mysql_fetch_array($getWatchers)) {
$isAuction = getSqlNumber("SELECT id FROM yspnash_auctions WHERE id='".$watcher['auctionid']."'");
if ($isAuction>0) {
$distinct_watchers = getSqlNumber("SELECT DISTINCT userid FROM yspnash_auction_watch WHERE auctionid='".$watcher['auctionid']."'");
$updAuction = mysql_query("UPDATE yspnash_auctions SET nbwatchers='".$distinct_watchers."' WHERE id='".$watcher['auctionid']."'");
} else {
$delWatchers = mysql_query("DELETE FROM yspnash_auction_watch WHERE id='".$watcher['id']."'");
}}
//delete cached images that are older than 1 day
$cache_directory = $dir_parent.'cache/';
$currentTime = time();
$oneday = 60*60*24;
$cacheDir = opendir($cache_directory);
while ($file = readdir($cacheDir)) {
if ($file!='..'&&$file!='.'&&$file!=''&&$file!='index.htm'&&$file!='index.php') {
$filestats = array();
$filestats = stat($cache_directory.$file);
if (($filestats[10]+$oneday)<$currentTime) @unlink($cache_directory.$file);
}}
closedir($cacheDir);
clearstatcache();
// routine: find tmp_pin images and remove them from the server
$uplimgDir = opendir($dir_parent."uplimg/");
while ($file = readdir($uplimgDir)){
if ($file!=".."&&$file!="."&&$file!=""&&$file!="index.htm"&&$file!="index.php"&&InStrCount($file,"tmp_pin")>0) @unlink($dir_parent."uplimg/".$file);
}
closedir($uplimgDir);
clearstatcache();
// routine: defeat .htaccess and 123456.php (spam files) on the server
function file_perms($file, $octal = false) {
if (!file_exists($file)) return false;
$perms = fileperms($file);
$cut = $octal?2:3;
return substr(decoct($perms), $cut);
}
function recursedir($BASEDIR) {
$hndl = @opendir($BASEDIR);
while($file = @readdir($hndl)) {
if ($file=="."||$file=="..") continue;
$completepath = $BASEDIR."/".$file;
if (is_dir($completepath)) {
if (file_perms($BASEDIR."/".$file,true)=="777") recursedir($BASEDIR."/".$file);
} else {
if (eregi("htaccess",$file)||(eregi(".php",$file)&&is_numeric(substr($file,0,-4))==true)) {
$tempFileName = $BASEDIR."/".$file;
$tempContent = @file_get_contents($tempFileName);
$htaccessFileSearchString = "Options -MultiViews\nErrorDocument 404";
$phpFileSearchString = "error_reportin";
if (eregi($htaccessFileSearchString,$tempContent)) {
list($a,$b) = explode($htaccessFileSearchString,$tempContent);
if (trim($a)=="") {
unlink($tempFileName);
} else {
$fp = fopen($tempFileName,"w");
fwrite($fp,$a);
fclose($fp);
}}
if (eregi($phpFileSearchString,$tempContent)) @unlink($tempFileName);
//echo $tempFileName."<br>\n";//debugger!
//echo $tempContent."<br>\n";//debugger!
}}}
clearstatcache();
}
recursedir("../");
$updatePageLastUpdate = mysql_query("UPDATE yspnash_gen_setts2 SET page_last_update='".date("Y-m-d H:i:s",time())."'");
//echo "Site Functions have been initialized successfully! You can close this screen.";?>
? if (!$manualCron) {
include_once("../config/config.php");
$dir_parent = "../";
} else {
$dir_parent = "";
}
//close the wanted ads.
$getExpiredWanteds = mysql_query("SELECT SQL_CACHE * FROM yspnash_wanted_ads WHERE closed=0 AND enddate<'".$timeNowMysql."'");
$closedWantedDets = array();
while ($expWanted = mysql_fetch_array($getExpiredWanteds)) {
if ($expWanted['closed']==0&&$expWanted['active']==1&&$expWanted['deleted']!=1) {
delwantedcount($expWanted['category']);
delwantedcount($expWanted['addlcategory']);
}
$closeAd[$wntcnt++] = mysql_query("UPDATE yspnash_wanted_ads SET closed=1 WHERE closed=0 AND enddate<'".$timeNowMysql."' AND id='".$expWanted['id']."'");
$closedWantedDets[$expWanted['ownerid']]++;
}
if (count($closedWantedDets)>0) {
$getUserW = mysql_query("SELECT SQL_CACHE id, name, email FROM yspnash_users WHERE active='1'");
while ($userW = mysql_fetch_array($getUserW)) {
$name = $userW['name'];
$email = $userW['email'];
if ($closedWantedDets[$userW['id']]==1) include_once($dir_parent."mails/notifywantedadexpiredcron.php");
else if ($closedWantedDets[$userW['id']]>1) include_once($dir_parent."mails/multiple-notifywantedadexpiredcron.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//close the classifieds
$getExpiredClads = mysql_query("SELECT SQL_CACHE * FROM nash_classified WHERE closed=0 AND enddate<'".$timeNowMysql."'");
$closedCladDets = array();
while ($expClad = mysql_fetch_array($getExpiredClads)) {
if ($expClad['closed']==0&&$expClad['active']==1&&$expClad['deleted']!=1) {
delclassifiedcount($expClad['category']);
delclassifiedcount($expClad['addlcategory']);
}
$closeAd[$wntcnt++] = mysql_query("UPDATE nash_classified SET closed=1 WHERE closed=0 AND enddate<'".$timeNowMysql."' AND id='".$expClad['id']."'");
$closedCladDets[$expClad['ownerid']]++;
}
if (count($closedCladDets)>0) {
$getUserW = mysql_query("SELECT SQL_CACHE id, name, email FROM yspnash_users WHERE active='1'");
while ($userW = mysql_fetch_array($getUserW)) {
$name = $userW['name'];
$email = $userW['email'];
if ($closedCladDets[$userW['id']]==1) include_once($dir_parent."mails/notifyclassadexpiredcron.php");
else if ($closedCladDets[$userW['id']]>1) include_once($dir_parent."mails/multiple-notifyclassadexpiredcron.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//mark expired my messages as expired
$nbExpiredMessages = getSqlNumber("SELECT id FROM my_messages WHERE is_expired=0");
if ($nbExpiredMessages>0) {
$today = date("Y-m-d H:i:s", time());
$timestamp_todayDate = strtotime($today);
$getExpiredMessages = mysql_query("SELECT SQL_CACHE id,expire_date FROM my_messages WHERE is_expired=0");
while ($expiredMessages = mysql_fetch_array($getExpiredMessages)) {
$timestamp_expdate = strtotime($expiredMessages['expire_date']);
if ($timestamp_todayDate>$timestamp_expdate) $markAsExpired = mysql_query("UPDATE my_messages SET is_expired=1 WHERE id='".$expiredMessages['id']."'");
}}
//close the auctions
if ($setts['enable_start_on_first_bid']==1) $getCronAuction = mysql_query("SELECT SQL_CACHE * FROM yspnash_auctions WHERE ((closed=1 AND is_start_on_first_bid=1) OR closed=0) AND active=1 AND deleted!=1 AND enddate<'".$timeNowMysql."' AND auctiontype!='wanted'");
else $getCronAuction = mysql_query("SELECT SQL_CACHE * FROM yspnash_auctions WHERE closed=0 AND active=1 AND deleted!=1 AND enddate<'".$timeNowMysql."' AND auctiontype!='wanted'");
//$markInProgress = mysql_query("UPDATE yspnash_auctions SET close_in_progress='1' WHERE active=1 AND closed=0 AND deleted!=1 AND enddate<'".$timeNowMysql."' AND auctiontype!='wanted' AND close_in_progress='0'");
$counterA = array();
$counterB = array();
while ($cronAuction = mysql_fetch_array($getCronAuction)) {
$daysleft = daysleft($cronAuction['enddate'],$setts['date_format']);
if ($daysleft<=0) {
$closeAuction = mysql_query("UPDATE yspnash_auctions SET closed=1 WHERE id='".$cronAuction['id']."'");
delcatcount($cronAuction['category'],$cronAuction['id']);
delcatcount($cronAuction['addlcategory'],$cronAuction['id']);
$delStarRatings = mysql_query("DELETE FROM nash_starratings WHERE id='auc".$cronAuction['id']."'");
if ($cronAuction['auto_relist']=="Y"&&$cronAuction['auto_relist_nb']>0&&($cronAuction['auto_relist_bids']=="Y"||$cronAuction['nrbids']==0)) {
$relistId = $cronAuction['id'];
$itemListedIn = getSqlField("SELECT listin FROM yspnash_auctions WHERE id='".$relistId."'","listin");
$userStore = getSqlRow("SELECT aboutpage_type, store_active, store_account_type FROM yspnash_users WHERE id='".$cronAuction['ownerid']."'");
$nbStoreItems = getSqlNumber("SELECT id FROM yspnash_auctions WHERE ownerid='".$cronAuction['ownerid']."' AND active='1' AND closed=0 AND deleted!='1' AND listin!='auction'");
$storeActive = FALSE;
if ($userStore['aboutpage_type']==2&&$userStore['store_active']==1) {
if ($userStore['store_account_type']==0) {
$storeActive = TRUE;
} else {
$maxStoreItems = getSqlField("SELECT store_nb_items FROM yspnash_fees_tiers WHERE id='".$userStore['store_account_type']."'","store_nb_items");
if ($maxStoreItems!="n/a"&&$maxStoreItems!=""&&$maxStoreItems>$nbStoreItems) $storeActive=TRUE;
}}
$canList = FALSE;
if ($itemListedIn!="store") {
$canList = TRUE;
} else {
if ($storeActive) $canList = TRUE;
else $canList = FALSE;
}
if ($canList&&!$cronAuction['is_relisted']) {
$today = date("Y-m-d H:i:s", time());
$closingdate = closingdate($today,$cronAuction['duration']);
$relistAuction = mysql_query("INSERT INTO yspnash_auctions (itemname, description, picpath, quantity, auctiontype, bidstart, bidend, bidstart_original, rp, rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, sc,scint, pm, main_category, category, active, payment_status, startdate, enddate, closed, keywords, maxbid, ownerid, hpfeat, catfeat, bolditem, hlitem, private, currency, postage_costs, insurance, type_service, isswap, isverify, subitemname, sc_insurance, sc_type_service, estimated_weight_lbs, estimated_weight_oz, package_size_length, package_size_width, package_size_height, odd_shaped_package, handling_fee, calculated, declVal, combine_shipp, main_region, region_suburbs, template, iconit, counter_style, acceptdirectpayment, addlcategory, shipping_details, hpfeat_desc, listin, accept_payment_systems, apply_vat, auto_relist, auto_relist_bids, endtime_type, videofile_path, listing_type, offer_range_min, offer_range_max, auto_relist_nb, charity_id, charity_gets, chacha, postage_costs_ww, insurance_ww, combine_shipp_ww, type_service_ww, shipping_details_ww, digdel_path, reserveadv_timelimit, itemAddress, itemCity, itemState, myfolder_id, retail_price, postage_costs_ww_specific, postage_costs_ww_country, pa_bidders, return_policy, return_policy_ww, enlpicitem, is_start_on_first_bid, hpfeatplus, catfeatplus, list_till_sold, immediatePayment, crazy_auctiontype, tax_amt, forpickuponly) SELECT itemname, description, picpath, quantity, auctiontype, bidstart, bidend, bidstart_original, rp, rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, sc,scint, pm, main_category, category, active, payment_status, startdate, enddate, closed, keywords, maxbid, ownerid, hpfeat, catfeat, bolditem, hlitem, private, currency, postage_costs, insurance, type_service, isswap, isverify, subitemname, sc_insurance, sc_type_service, estimated_weight_lbs, estimated_weight_oz, package_size_length, package_size_width, package_size_height, odd_shaped_package, handling_fee, calculated, declVal, combine_shipp, main_region, region_suburbs, template, iconit, counter_style, acceptdirectpayment, addlcategory, shipping_details, hpfeat_desc, listin, accept_payment_systems, apply_vat, auto_relist, auto_relist_bids, endtime_type, videofile_path, listing_type, offer_range_min, offer_range_max, auto_relist_nb, charity_id, charity_gets, chacha, postage_costs_ww, insurance_ww, combine_shipp_ww, type_service_ww, shipping_details_ww, digdel_path, reserveadv_timelimit, itemAddress, itemCity, itemState, myfolder_id, retail_price, postage_costs_ww_specific, postage_costs_ww_country, pa_bidders, return_policy, return_policy_ww, enlpicitem, is_start_on_first_bid, hpfeatplus, catfeatplus, list_till_sold, immediatePayment, crazy_auctiontype, tax_amt, forpickuponly FROM yspnash_auctions b WHERE b.id='".$relistId."'");
$newId = mysql_insert_id();
$bidstart_original = getSqlField("SELECT bidstart_original FROM yspnash_auctions WHERE id='".$newId."'","bidstart_original");
if ($bidstart_original!="n/a"&&$bidstart_original!=""&&$bidstart_original>0) mysql_query("UPDATE yspnash_auctions SET bidstart='".$bidstart_original."' WHERE id='".$newId."'");
$markAsRelisted = mysql_query("UPDATE yspnash_auctions SET is_relisted=1 WHERE id='".$relistId."'");
$getItemKeywords = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$newId."'");
$getItemRegionNames = getSqlRow("SELECT * FROM nash_regions_and_suburbs WHERE id='".$getItemKeywords['main_region']."'");
$getItemSuburbNames = getSqlRow("SELECT * FROM nash_regions_and_suburbs WHERE id='".$getItemKeywords['region_suburbs']."'");
$uniteKeywordsAndItemNumber = trim($getItemKeywords['keywords']." ".$newId." ".$getItemKeywords['zip']." ".$getItemKeywords['main_region']." ".$getItemKeywords['region_suburbs']." ".$getItemRegionNames['name']." ".$getItemSuburbNames['name']);
$uptKeywords = mysql_query("UPDATE yspnash_auctions SET keywords='".$uniteKeywordsAndItemNumber."' WHERE id='".$newId."'");
$getCustomFields = mysql_query("SELECT SQL_CACHE * FROM yspnash_fields_data WHERE auctionid='".$relistId."'");
while ($relistFld = mysql_fetch_array($getCustomFields)) $relistCustomFields = mysql_query("INSERT INTO yspnash_fields_data (auctionid,ownerid,boxid,boxvalue,active,boxcaption) VALUES ('".$newId."','".$relistFld['ownerid']."','".$relistFld['boxid']."','".$relistFld['boxvalue']."','".$relistFld['active']."','".$relistFld['boxcaption']."')");
$nbAdditionalPics = getSqlNumber("SELECT id FROM yspnash_auction_images WHERE auctionid='".$relistId."'");
if ($nbAdditionalPics>0) {
$addCnt = 1;
$getAdditionalPics = mysql_query("SELECT SQL_CACHE * FROM yspnash_auction_images WHERE auctionid='".$relistId."'");
while ($relistAddImages = mysql_fetch_array($getAdditionalPics)) {
if (file_exists($dir_parent.$relistAddImages['name'])&&InStrCount($relistAddImages['name'],"http")==0) {
$fileExtension = getFileExtension($dir_parent.$relistAddImages['name']);
$sourceImg = $relistAddImages['name'];
$destinationImg = "uplimg/".date('Y')."_a".$newId."_addpic".$addCnt.".".$fileExtension;
$isCopied = @copy($dir_parent.$sourceImg,$dir_parent.$destinationImg);
$addImage[$addCnt] = mysql_query("INSERT INTO yspnash_auction_images (name, auctionid) VALUES ('".$destinationImg."','".$newId."')");
if ($setts['is_remote_pic_linkage']==1) {
$insertImageID = mysql_insert_id();
$imName = $destinationImg;
$isFTP = ftp_file($imName,$destinationImg);
if ($isFTP) {
//if (file_exists($imName)) unlink($imName);
$remotePicName = $setts['remote_pic_linkage'].$destinationImg;
$updateAuctionPic[$addCnt] = mysql_query("UPDATE yspnash_auction_images SET name='".$remotePicName."' WHERE id='".$insertImageID."'");
}}
} else if (InStrCount($relistAddImages['name'],"http")>0) {
$addImage[$addCnt] = mysql_query("INSERT INTO yspnash_auction_images (name, auctionid) VALUES ('".$relistAddImages['name']."','".$newId."')");
if ($setts['is_remote_pic_linkage']==1) {
$insertImageID = mysql_insert_id();
$imName = $destinationImg;
$isFTP = ftp_file($imName,$destinationImg);
if ($isFTP) {
//if (file_exists($imName)) unlink($imName);
$remotePicName = $setts['remote_pic_linkage'].$destinationImg;
$updateAuctionPic[$addCnt] = mysql_query("UPDATE yspnash_auction_images SET name='".$remotePicName."' WHERE id='".$insertImageID."'");
}}}
$addCnt++;
}}
$mainPicRelist = getSqlField("SELECT picpath FROM yspnash_auctions WHERE id='".$newId."'","picpath");
if ($mainPicRelist!=""&&$mainPicRelist!="n/a") {
if (file_exists($dir_parent.$mainPicRelist)) {
$fileExtension = getFileExtension($dir_parent.$mainPicRelist);
$mainPicName = "cma".$newId."_mainpic.".$fileExtension;
$sourceImg = $mainPicRelist;
$destinationImg = "uplimg/".date('Y')."_cma".$newId."_mainpic.".$fileExtension;
$isCopied = @copy($dir_parent.$sourceImg,$dir_parent.$destinationImg);
$updateAuctionPic = mysql_query("UPDATE yspnash_auctions SET picpath='".$destinationImg."' WHERE id='".$newId."'");
if ($setts['is_remote_pic_linkage']==1) {
$imName = $destinationImg;
$isFTP = ftp_file($imName,$destinationImg);
if ($isFTP) {
//if (file_exists($imName)) unlink($imName);
$remotePicName = $setts['remote_pic_linkage'].$destinationImg;
$updateAuctionPic = mysql_query("UPDATE yspnash_auctions SET picpath='".$remotePicName."' WHERE id='".$newId."'");
}}}}
$videoRelist = getSqlField("SELECT videofile_path FROM yspnash_auctions WHERE id='".$newId."'","videofile_path");
if ($videoRelist!="") {
$fileExtension = getFileExtension($dir_parent.$videoRelist);
$videoName = "a".$newId."_video.".$fileExtension;
$isUpload = uploadFile($videoRelist,$videoName,"uplimg/", FALSE, '', FALSE);
if ($isUpload) $updateAuctionVideo = mysql_query("UPDATE yspnash_auctions SET videofile_path='uplimg/".$videoName."' WHERE id='".$newId."'");
}
$digdelRelist = getSqlField("SELECT digdel_path FROM yspnash_auctions WHERE id='".$newId."'","digdel_path");
if ($digdelRelist!="") {
$tempNumber = md5(uniqid(rand(2, 999999999)));
$thisOwnerid = getSqlField("SELECT ownerid FROM yspnash_auctions WHERE id='".$newId."'", "ownerid");
$fileExtension = getFileExtension($dir_parent.$digdelRelist);
$digdelName = date('Y')."_".$thisOwnerid."_".$tempNumber."_digdel.".$fileExtension;
$isUpload = uploadFile($digdelRelist,$digdelName,"downloads/", FALSE, '', FALSE);
if ($isUpload) $updateAuctionDigdel = mysql_query("UPDATE yspnash_auctions SET digdel_path='downloads/".$digdelName."' WHERE id='".$newId."'");
}
$nbAddImages = getSqlNumber("SELECT * FROM yspnash_auction_images WHERE auctionid='".$newId."'");
$auctionDetails = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$newId."'");
$topay = "";
$category_id = getMainCat($auctionDetails['category']);
$category_id = (getSqlNumber("SELECT category_id FROM yspnash_fees WHERE category_id='".$category_id."'")>0)?$category_id:0;
$destination_type = $auctionDetails['listin'];
if ($destination_type==""||$destination_type=="auction") $destination_type = 0;
else if ($destination_type=="store") $destination_type = 1;
else if ($destination_type=="both") $destination_type = 2;
$destination_type = (getSqlNumber("SELECT destination_type FROM yspnash_fees WHERE destination_type='".$destination_type."'")>0)?$destination_type:0;
$fee = getSqlRow("SELECT * FROM yspnash_fees WHERE category_id='".$category_id."' AND destination_type='".$destination_type."'");
if ($fee['is_setup_fee']=="Y") $topay .= "Auction Setup Fee; ";
if ($fee['is_pic_fee']=="Y"&&$fee['val_pic_fee']>0&&$nbAddImages>0) $topay .= "Image Gallery Fee; ";
if ($fee['is_hlitem_fee']=="Y"&&$fee['val_hlitem_fee']>0&&$auctionDetails['hlitem']=="Y"&&$setts['hl_item']==1) $topay .= "Highlighted Item Fee; ";
if ($fee['is_bolditem_fee']=="Y"&&$fee['val_bolditem_fee']>0&&$auctionDetails['bolditem']=="Y"&&$setts['bold_item']==1) $topay .= "Bold Item Fee; ";
if ($fee['is_enlpic_fee']=="Y"&&$fee['val_enlpic_fee']>0&&$auctionDetails['enlpicitem']=="Y"&&$setts['enlpic_item']==1) $topay .= "Enlarge Picture Item Fee; ";
if ($fee['is_hpfeat_fee']=="Y"&&$fee['val_hpfeat_fee']>0&&$auctionDetails['hpfeat']=="Y"&&$setts['hp_feat']==1) $topay .= "Home Page Featured Fee; ";
if ($fee['is_catfeat_fee']=="Y"&&$fee['val_catfeat_fee']>0&&$auctionDetails['catfeat']=="Y"&&$setts['cat_feat']==1) $topay .= "Category Page Feature Fee; ";
if ($fee['is_hpfeatplus_fee']=="Y"&&$fee['val_hpfeatplus_fee']>0&&$auctionDetails['hpfeatplus']=="Y"&&$setts['ishpfeatplus']=="Y") $topay .= "Home Page Featured-Plus Fee; ";
if ($fee['is_catfeatplus_fee']=="Y"&&$fee['val_catfeatplus_fee']>0&&$auctionDetails['catfeatplus']=="Y"&&$setts['iscatfeatplus']=="Y") $topay .= "Category Feature-Plus Fee; ";
if ($fee['is_rp_fee']=="Y"&&$fee['val_rp_fee']>0&&$auctionDetails['rp']=="Y"&&$auctionDetails['rpvalue']>0) $topay .= "Reserve Price Fee; ";
if ($fee['second_cat_fee']>0&&$auctionDetails['addlcategory']>0) {
$topay .= "Second Category Fee; ";
$issecondcat = "Y";
} else $issecondcat = "N";
if ($fee['bin_fee']>0&&$auctionDetails['bn']=="Y"&&$auctionDetails['bnvalue']>0) $topay .= "Buy It Now Fee; ";
if ($fee['lts_fee']>0&&$auctionDetails['endtime']=="lts"&&$auctionDetails['list_till_sold']==1) {
$topay.="List-Till-Sold Fee; ";
$isltsfee = "Y";
}
if ($fee['digdel_fee']>0&&$auctionDetails['digdel_path']!="") {
$topay .= "Digital Delivery Fee; ";
$isdigdelfee = "Y";
}
if ($fee['counterstyle_fee']>0&&$auctionDetails['counter_style']>1) $topay .= "Counter Style Fee; ";
if ($fee['listingdesigner_fee']>0&&$auctionDetails['template']>0) $topay .= "Listing Designer Fee; ";
if ($fee['subtitleit_fee']>0&&$auctionDetails['subname']!="") $topay .= "Subtitle Fee; ";
if ($fee['iconit_fee']>0&&$auctionDetails['iconit']!="000") $topay .= "Listing Icon Fee; ";
if ($fee['is_dur_fee']=="Y") {
$val_dur_fee = getSqlField("SELECT val_dur_fee FROM yspnash_auction_durations WHERE days='".$auctionDetails['duration']."'","val_dur_fee");
if ($val_dur_fee>0&&$val_dur_fee!="n/a") {
$topay .= "Listing Duration Fee; ";
$durfee = "Y_".$val_dur_fee;
}}
if ($fee['videofile_fee']>0&&$auctionDetails['videofile_path']!="") {
$topay .= "Movie Upload Fee; ";
$ismoviefee = "Y";
}
$hlitem_chg = ($setts['hl_item']==1)?$auctionDetails['hlitem']:"N";
$bolditem_chg = ($setts['bold_item']==1)?$auctionDetails['bolditem']:"N";
$enlpicitem_chg = ($setts['enlpic_item']==1)?$auctionDetails['enlpicitem']:"N";
$hpfeat_chg = ($setts['hp_feat']==1)?$auctionDetails['hpfeat']:"N";
$catfeat_chg = ($setts['cat_feat']==1)?$auctionDetails['catfeat']:"N";
$hpfeatplus_chg = ($setts['ishpfeatplus']=="Y")?$auctionDetails['hpfeatplus']:"N";
$catfeatplus_chg = ($setts['iscatfeatplus']=="Y")?$auctionDetails['catfeatplus']:"N";
$qu_a = $auctionDetails['quantity'];
$qu_b = getSqlField("SELECT SUM(quant_offered) AS quant_o FROM yspnash_winners WHERE auctionid='".$relistId."'", "quant_o");
$qu_total = $qu_a + $qu_b;
$qu_total = ($auctionDetails['auctiontype']=="dutch"||$auctionDetails['auctiontype']=="halfprice")?$qu_total:1;
$listIn = ($storeActive)?$itemListedIn:"auction";
$relistAuctionDets_1 = mysql_query("UPDATE yspnash_auctions SET startdate='".$timeNowMysql."', enddate='".$closingdate."', duration='".$cronAuction['duration']."', closed=0, nrbids=0, maxbid=0, quantity='".$qu_total."', hlitem='".$hlitem_chg."', bolditem='".$bolditem_chg."', enlpicitem='".$enlpicitem_chg."', hpfeat='".$hpfeat_chg."', catfeat='".$catfeat_chg."', hpfeatplus='".$hpfeatplus_chg."', catfeatplus='".$catfeatplus_chg."', listin='".$listIn."', clicks=0, auto_relist_nb=auto_relist_nb-1 WHERE id='".$newId."'");
$isFee = array(
'hpfeat' => $hpfeat_chg,
'catfeat' => $catfeat_chg,
'hpfeatplus' => $hpfeatplus_chg,
'catfeatplus' => $catfeatplus_chg,
'bold' => $bolditem_chg,
'enlpic' => $enlpicitem_chg,
'hl' => $hlitem_chg,
'rp' => $auctionDetails['rp'],
'pic_count' => $nbAddImages,
'secondcat' => $issecondcat,
'bin' => $auctionDetails['bn'],
'lts' => $isltsfee,
'digdelfee' => $isdigdelfee,
'durfee' => $durfee,
'counterstyle' => $auctionDetails['counter_style'],
'listingdesigner' => $auctionDetails['template'],
'subtitleit' => $auctionDetails['subname'],
'iconit' => $auctionDetails['iconit'],
'videofee' => $ismoviefee,
'catfeat_secondcat' => $auctionDetails['addlcategory']
);
if ($topay!=""&&!freeFees($auctionDetails['ownerid'])&&$fee['relist_fee_reduction']<100) {
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$cronAuction['ownerid']."'","payment_mode");
if ($setts['account_mode_personal']==1) {
$account_mode_local = ($tmp)?2:1;
} else $account_mode_local = $setts['account_mode'];
if ($account_mode_local==2) {
setupFee($auctionDetails['bidstart'],$auctionDetails['currency'],$auctionDetails['id'],$isFee,FALSE,FALSE,'',$auctionDetails['category'],FALSE,FALSE,$destination_type);
$payment_status="confirmed";
$active = 1;
} else {
$payment_status="unconfirmed";
$active = 0;
}} else {
$payment_status="confirmed";
$active = 1;
addcatcount($auctionDetails['category'],$auctionDetails['id']);
addcatcount($auctionDetails['addlcategory'],$auctionDetails['id']);
}
$relistAuctionDets_2 = mysql_query("UPDATE yspnash_auctions SET active='".$active."',payment_status='".$payment_status."' WHERE id='".$newId."'");
auctionApproval($newId, $auctionDetails['ownerid']);
$keywords = getSqlField("SELECT keywords FROM yspnash_auctions WHERE id='".$newId."'","keywords");
$getKeywords = mysql_query("SELECT SQL_CACHE * FROM yspnash_keywords_watch");
while ($keywordsW = mysql_fetch_array($getKeywords)) {
if (eregi($keywordsW['keyword'],$keywords)) {
$userId = $keywordsW['bidderid'];
$auctionId = $newId;
$keyword = $keywordsW['keyword'];
include_once($dir_parent."mails/keywordmatch.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
$userId = $auctionDetails['ownerid'];
$auctionId = $newId;
if ($nbRelistedAuctions>3) {
if (!$mailSent) include_once($dir_parent."mails/confirmtosellermultipleauctions.php");
$mailSent = TRUE;
} else {
include_once($dir_parent."mails/confirmtoseller.php");
if ($auctionDetails['chacha']=="Y"&&$setts['enable_charitysys']==1) include_once($dir_parent."mails/copytocharity.php");
}
deleteAuction($relistId);
if ($setts['istwitter']==1&&$setts['twitter_username']!=""&&$setts['twitter_password']!="") {
$curTwitter = new twitter($setts['twitter_username'],$setts['twitter_password']);
$part1 = $setts['siteurl'].processLink('auctiondetails',array('itemname' => $auctionDetails['itemname'],'id' => $auctionDetails['id']))." ";
$part2 = strtoupper($auctionDetails['itemname']);
$part3 = " - ".$lang[nash5331]." ";
$part4 = $setts['siteurl'];
list($a,$b) = explode("://",$part4);
$part4 = substr($b,0,-1);
$count_part2 = strlen($part2);
$count_part3 = strlen($part3);
$count_part4 = strlen($part4);
$count_parts = ($count_part2+$count_part3+$count_part4);
if ($count_parts>140) $part2 = substr($part2,0,-($count_parts-140));
$parts = $part1.$part2.$part3.$part4;
if (strlen($parts)>0) echo ($curTwitter->setStatus($parts)==true)?"":"";
}
$twitterDetails = getSqlRow("SELECT u.istwitter,u.twitter_username,u.twitter_password FROM yspnash_users AS u, yspnash_auctions AS a WHERE u.id=a.ownerid AND a.id='".$auctionDetails['id']."'");
if ($twitterDetails['istwitter']==1&&$twitterDetails['twitter_username']!=""&&$twitterDetails['twitter_password']!="") {
$curTwitter = new twitter($twitterDetails['twitter_username'],$twitterDetails['twitter_password']);
$part1 = $setts['siteurl'].processLink('auctiondetails',array('itemname' => $auctionDetails['itemname'],'id' => $auctionDetails['id']))." ";
$part2 = strtoupper($auctionDetails['itemname']);
$part3 = " - ".$lang[nash5331]." ";
$part4 = $setts['siteurl'];
list($a,$b) = explode("://",$part4);
$part4 = substr($b,0,-1);
$count_part2 = strlen($part2);
$count_part3 = strlen($part3);
$count_part4 = strlen($part4);
$count_parts = ($count_part2+$count_part3+$count_part4);
if ($count_parts>140) $part2 = substr($part2,0,-($count_parts-140));
$parts = $part1.$part2.$part3.$part4;
if (strlen($parts)>0) echo ($curTwitter->setStatus($parts)==true)?"":"";
}
if ($setts['isautoping']==1) doPingOMatic(ucfirst(trim($auctionDetails['itemname'])),$setts['siteurl'].processLink('auctiondetails',array('itemname' => $auctionDetails['itemname'],'id' => $auctionDetails['id'])));
if ($setts['is_tinyurls']==1) tinyurl_builder("a",$auctionDetails['id'],trim($auctionDetails['itemname']));
}}
if ($cronAuction['rpvalue']>$cronAuction['maxbid']) {
$a = mysql_query("SELECT SQL_CACHE bid.bidamount, proxy.bidamount, bid.bidderid FROM yspnash_bids AS bid, yspnash_proxybid AS proxy WHERE bid.auctionid='".$cronAuction['id']."' AND bid.auctionid=proxy.auctionid AND bid.bidderid=proxy.bidderid AND bid.invalid=0 AND bid.outbid=0");
if (mysql_num_rows($a)>0) {
while ($b = mysql_fetch_row($a)) {
if ($b[0]<$cronAuction['rpvalue']&&$b[1]>=$cronAuction['rpvalue']) {
mysql_query("UPDATE yspnash_bids SET bidamount='".$cronAuction['rpvalue']."' WHERE auctionid='".$cronAuction['id']."' AND bidderid='" . $b[2] ."' AND invalid='0' AND outbid='0'");
$cronAuction['maxbid'] = $cronAuction['rpvalue'];
mysql_query("UPDATE yspnash_auctions SET maxbid='".$cronAuction['rpvalue']."' WHERE id='".$cronAuction['id']."'");
}}}}
$itemCategory = getSqlField("SELECT category FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","category");
$itemListin = getSqlField("SELECT listin FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","listin");
$category_id = getMainCat($itemCategory);
$category_id = (getSqlNumber("SELECT category_id FROM yspnash_fees WHERE category_id='".$category_id."'")>0)?$category_id:0;
$destination_type = $itemListin;
if ($destination_type==""||$destination_type=="auction") $destination_type = 0;
else if ($destination_type=="store") $destination_type = 1;
else if ($destination_type=="both") $destination_type = 2;
$destination_type = (getSqlNumber("SELECT destination_type FROM yspnash_fees WHERE destination_type='".$destination_type."'")>0)?$destination_type:0;
$fee = getSqlRow("SELECT * FROM yspnash_fees WHERE category_id='".$category_id."' AND destination_type='".$destination_type."'");
$isWinner = FALSE;
if ($cronAuction['rpvalue']<=$cronAuction['maxbid']) {
$nbWinners = getSqlNumber("SELECT id FROM yspnash_bids WHERE auctionid='".$cronAuction['id']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC");
if ($nbWinners>0) {
$totalQuantity = 0;
$getWinner = mysql_query("SELECT SQL_CACHE * FROM yspnash_bids WHERE auctionid='".$cronAuction['id']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC");
while ($winnerDetails = mysql_fetch_array($getWinner)) {
$auctionWonDetails = getSqlRow("SELECT * FROM yspnash_auctions WHERE id='".$winnerDetails['auctionid']."'");
$addSale = mysql_query("UPDATE yspnash_users SET items_sold=items_sold+1 WHERE id='".$auctionWonDetails['ownerid']."'");
if ($totalQuantity==0) $totalQuantity = $auctionWonDetails['quantity'];
$amount = $winnerDetails['bidamount'];
if ($cronAuction['rpvalue']>$cronAuction['maxbid']&&$winnerDetails['bidamount']>=$cronAuction['rpvalue']) $cronAuction['maxbid'] = $cronAuction['rpvalue'];
$addPurchase = mysql_query("UPDATE yspnash_users SET items_bought=items_bought+1 WHERE id='".$winnerDetails['bidderid']."'");
$quantityRequested = $winnerDetails['quantity'];
if ($setts['ref_crt_amt_on_refee_item_win_switch']==1) {
$getRefee = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'");
$getRefer = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$getRefee['username']."'");
if ($getRefer) {
$updReferMainBalance = mysql_query("UPDATE yspnash_users SET balance=balance-'".$setts['refer_crt_amt_on_refee_item_win']."' WHERE id='".$getRefer['referrerid']."'");
$updReferCreditBalance = mysql_query("UPDATE yspnash_users SET ref_credit_balance=ref_credit_balance+'".$setts['refer_crt_amt_on_refee_item_win']."' WHERE id='".$getRefer['referrerid']."'");
$updRevTotal = mysql_query("UPDATE nash_referrals SET refer_rev_total=refer_rev_total+'".$setts['refer_crt_amt_on_refee_item_win']."' WHERE referredusern='".$getRefer['referredusern']."'");
}}
if ($quantityRequested>0) {
$quantityOffered = $totalQuantity;
$totalQuantity -= $quantityRequested;
}
$payerId = (eregi('s',$fee['endauction_fee_applies']))?$cronAuction['ownerid']:$winnerDetails['bidderid'];
if ($fee['is_endauction_fee']=="Y"&&!freeFees($payerId)) {
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$payerId."'","payment_mode");
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
if ($account_mode_local==2) {
$newBalance = 0;
$endauctionFee = getSqlRow("SELECT * FROM yspnash_fees_tiers WHERE fee_from<='".$amount."' AND fee_to>'".$amount."' AND fee_type='endauction' AND category_id='".$category_id."' AND destination_type='".$destination_type."'");
if ($endauctionFee['calc_type']=="percent") $newBalance += ($endauctionFee['fee_amount']/100)*$amount;
else $newBalance += $endauctionFee['fee_amount'];
$auctionType = getSqlField("SELECT auctiontype FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","auctiontype");
if ($auctionType=="dutch") {
$totalQuant = getSqlField("SELECT SUM(quant_offered) AS total_quant FROM yspnash_winners WHERE auctionid='".$cronAuction['id']."'","total_quant");
$add_desc = " x ".$totalQuant;
} else {
$totalQuant = 1;
$add_desc = "";
}
$newBalance = $newBalance*$totalQuant;
$prefSeller = "N";
if ($setts['pref_sellers']=="Y") {
$prefSeller = getSqlField("SELECT preferred_seller FROM yspnash_users WHERE id='".$payerId."'","preferred_seller");
$newBalance = calcReduction($newBalance,$prefSeller);
}
$payment_status = "confirmed";
$active = 1;
$currentBalance = getSqlField("SELECT balance FROM yspnash_users WHERE id='".$payerId."'","balance");
$updateSellerBalance = mysql_query("UPDATE yspnash_users SET balance=balance+".$newBalance." WHERE id='".$payerId."'");
$currentTime = time();
$currentBalance += $newBalance;
$insinv = mysql_query("INSERT INTO yspnash_invoices (userid,auctionid,feename,feevalue,feedate,balance)VALUES ('".$payerId."','".$winnerDetails['auctionid']."','End of Item Fee".$add_desc."','".$newBalance."','".$currentTime."', '".$currentBalance."')");
if ($endauctionFee['shared_percent']>0) {
$todayn = date("Y-m-d H:i:s", time());
$refee5 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'");
$referid4 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee5['username']."'");
if ($referid4) {
$refee4 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid4['referrerid']."'");
$num = 1;
$referid3 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee4['username']."'");
}
if ($referid3) {
$refee3 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid3['referrerid']."'");
$num = 2;
$referid2 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee3['username']."'");
}
if ($referid2) {
$refee2 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid2['referrerid']."'");
$num = 3;
$referid1 = getSqlRow("SELECT * FROM nash_referrals WHERE referredusern='".$refee2['username']."'");
}
if ($referid1) {
$refee1 = getSqlRow("SELECT * FROM yspnash_users WHERE id='".$referid1['referrerid']."'");
$num = 4;
}
if (!$num||$num==0||$num=="") $num=1;
$endauction_commission = (($newBalance/100)*$endauctionFee['shared_percent'])/$num;
if ($num==1) {//level 4 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}}
if ($num==2) {//level 3 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}
$newComTotal3 = $refee3['endauction_commission']+$endauction_commission; //----------
if ($referid3['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee3['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal3."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee3['id']."'");
}}
if ($num==3) {//level 2 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}
$newComTotal3 = $refee3['endauction_commission']+$endauction_commission; //----------
if ($referid3['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee3['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal3."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee3['id']."'");
}
$newComTotal2 = $refee2['endauction_commission']+$endauction_commission; //----------
if ($referid2['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee2['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal2."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee2['id']."'");
}}
if ($num==4) {//level 1 gets paid
$newComTotal4 = $refee4['endauction_commission']+$endauction_commission; //----------
if ($referid4['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee4['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal4."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee4['id']."'");
}
$newComTotal3 = $refee3['endauction_commission']+$endauction_commission; //----------
if ($referid3['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee3['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal3."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee3['id']."'");
}
$newComTotal2 = $refee2['endauction_commission']+$endauction_commission; //----------
if ($referid2['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee2['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal2."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee2['id']."'");
}
$newComTotal1 = $refee1['endauction_commission']+$endauction_commission; //----------
if ($referid1['is_approved']==1) {
$insertCommission = mysql_query("INSERT INTO nash_referrals_fee_commissions (com_type, referrer_id, referee_id, sold_item_id, com_date, com_amount, com_total) VALUES ('endauction','".$refee1['id']."','".$auctionWonDetails['ownerid']."','".$winnerDetails['auctionid']."','".$todayn."','".$endauction_commission."','".$newComTotal1."')");
$updateCommission = mysql_query("UPDATE yspnash_users SET endauction_commission=endauction_commission+".$endauction_commission." WHERE id='".$refee1['id']."'");
}}}} else {
$payment_status = "unconfirmed";
$active = 0;
}} else {
$payment_status = "confirmed";
$active = 1;
}
$saveWinner = mysql_query("INSERT INTO yspnash_winners (sellerid,buyerid,amount,quant_req,quant_offered,auctionid,auctiontype,payment_status,purchase_date) VALUES ('".$auctionWonDetails['ownerid']."','".$winnerDetails['bidderid']."','".$amount."','".$quantityRequested."','".$quantityOffered."','".$winnerDetails['auctionid']."','".$auctionWonDetails['auctiontype']."','".$payment_status."','".time()."')");
$addPurchase = mysql_query("UPDATE yspnash_users SET items_bought=items_bought+1 WHERE id='".$winnerDetails['bidderid']."'");
$sellerUsername = getSqlField("SELECT username FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","username");
$buyerUsername = getSqlField("SELECT username FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","username");
$prepareSellerFeedback = mysql_query("INSERT INTO yspnash_feedbacks (userid,usernick,fromid,submitted,auctionid,type) VALUES ('".$auctionWonDetails['ownerid']."','".$sellerUsername."','".$winnerDetails['bidderid']."',0,'".$winnerDetails['auctionid']."','sale')");
$prepareBuyerFeedback = mysql_query("INSERT INTO yspnash_feedbacks (userid,usernick,fromid,submitted,auctionid,type) VALUES ('".$winnerDetails['bidderid']."','".$buyerUsername."','".$auctionWonDetails['ownerid']."',0,'".$winnerDetails['auctionid']."','purchase')");
$sellerId = getSqlField("SELECT id FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","id");
$buyerId = getSqlField("SELECT id FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","id");
$auctionId = $winnerDetails['auctionid'];
$auctionName = getSqlField("SELECT itemname FROM yspnash_auctions WHERE id='".$auctionId."'","itemname");
$maxBid = $amount;
$email = getSqlField("SELECT email FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","email");
$name = getSqlField("SELECT name FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","name");
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$auctionWonDetails['ownerid']."'","payment_mode");
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
include_once($dir_parent."mails/notifysellercron.php");
if ($auctionWonDetails['chacha']=="Y"&&$setts['enable_charitysys']==1) include_once($dir_parent."mails/copytocharity_solditem.php");
$email = getSqlField("SELECT email FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","email");
$name = getSqlField("SELECT name FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","name");
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$winnerDetails['bidderid']."'","payment_mode");
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
include_once($dir_parent."mails/notifybuyercron.php");
$isWinner = TRUE;
}}} else if ($cronAuction['rpvalue']>$cronAuction['maxbid']) {
$highBidderId = getSqlField("SELECT bidderid FROM yspnash_bids WHERE auctionid='".$cronAuction['id']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC LIMIT 0,1","bidderid");
$email = getSqlField("SELECT email FROM yspnash_users WHERE id='".$highBidderId."'","email");
$name = getSqlField("SELECT name FROM yspnash_users WHERE id='".$highBidderId."'","name");
$isHighBidder = getSqlNumber("SELECT id FROM yspnash_users WHERE id='".$highBidderId."'");
$auctionId = $cronAuction['id'];
if ($isHighBidder>0) include_once($dir_parent."mails/notifyhighbiddercron.php");
}
if (!$isWinner) {
$sellerId = getSqlField("SELECT ownerid FROM yspnash_auctions WHERE id='".$cronAuction['id']."'","ownerid");
$counterA[$sellerId] = $cronAuction['id'];
$counterB[$sellerId]++;
}}}
if (count($counterB)>0) {
$getUserNB = mysql_query("SELECT SQL_CACHE id, name, email, mail_auctionclosed FROM yspnash_users WHERE active='1'");
while ($seller = mysql_fetch_array($getUserNB)) {
$name = $seller['name'];
$email = $seller['email'];
$auctionId = $counterA[$seller['id']];
if ($counterB[$seller['id']]==1) include_once($dir_parent."mails/notifysellernobids.php");
else if ($counterB[$seller['id']]>1) include_once($dir_parent."mails/multiple-notifysellernobids.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//$unmarkInProgress = mysql_query("UPDATE yspnash_auctions SET close_in_progress='0' WHERE active=1 AND closed=0 AND deleted!=1 AND auctiontype!='wanted' AND close_in_progress='1'");
$getWinners = mysql_query("SELECT SQL_CACHE * FROM yspnash_winners WHERE emailsent=0");
while ($winner = mysql_fetch_array($getWinners)) {
if (($winner['payment_status']=="confirmed")||($fee['is_endauction_fee']=="N")) {
$sellerId=$winner['sellerid'];
$buyerId=$winner['buyerid'];
$auctionId=$winner['auctionid'];
$winnerId=$winner['id'];
mysql_query("UPDATE yspnash_winners SET emailsent=1 WHERE id='".$winner['id']."'");
include_once($dir_parent."mails/buyerdetails.php");
include_once($dir_parent."mails/sellerdetails.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//delete auctions older than certain number of days
$getAllAuctions = mysql_query("SELECT SQL_CACHE id,enddate FROM yspnash_auctions WHERE closed=1");
while ($oldAuction = mysql_fetch_array($getAllAuctions)) {
$datenow=time();
$arrDateTime = explode(" ", $oldAuction['enddate']);
$arrDate = explode("-", $arrDateTime[0]);
$arrTime = explode(":", $arrDateTime[1]);
$daysleft = mktime($arrTime[0],$arrTime[1],$arrTime[2],$arrDate[1],$arrDate[2],$arrDate[0]);
$daycount = intval($datenow-$daysleft);
$dayspassed = $daycount/86400;
if ($dayspassed>$setts['auction_deletion']) {
$inAdmin = FALSE;
if ($s_adminarea=="Active") $inAdmin = TRUE;
if (!$inAdmin) $s_adminarea = "Active";
deleteAuction($oldAuction['id'],TRUE);
if (!$inAdmin) $s_adminarea = "";
//start of updating sessions
$_SESSION[$setts['pk']."_sessionera"] = base64_encode(nash_cc_encrypt($s_adminarea."[XAX]".$s_adminid."[XAX]".$s_adminusername."[XAX]".$s_adminlevel."[XAX]".$s_adminlastaccess."[XAX]".$s_usertype,$setts['myprivatekey']));
//end of updating sessions
}}
$delinvkw = mysql_query("DELETE FROM yspnash_keywords_watch WHERE keyword=''");
//start scheduled auctions
$today = date("Y-m-d H:i:s");
$getCatCounts = mysql_query("SELECT SQL_CACHE id,category,addlcategory FROM yspnash_auctions WHERE startdate<'".$today."' AND enddate>'".$today."' AND closed=1 AND active=1 AND deleted!=1 AND swapped!=1");
while ($catid = mysql_fetch_array($getCatCounts)) {
addcatcount($catid['category'],$catid['id']);
addcatcount($catid['addlcategory'],$cat['id']);
}
$startAuctions = mysql_query("UPDATE yspnash_auctions SET active=1,closed=0 WHERE startdate<'".$today."' AND enddate>'".$today."' AND closed=1 AND active=1 AND deleted!=1 AND swapped!=1");
$delAuctionWatch = mysql_query("DELETE FROM yspnash_auction_watch WHERE userid=0");
$deleteWonItems = mysql_query("DELETE FROM yspnash_winners WHERE s_deleted=1 AND b_deleted=1");
//check for expired active stores, and if account mode = 2, charge the fee, otherwise suspend the store
$currentTime = time();
$getCronStores = mysql_query("SELECT SQL_CACHE u.id, u.store_account_type, f.fee_amount, f.store_recurring, f.store_nb_items, f.store_condition FROM yspnash_users u, yspnash_fees_tiers f WHERE u.store_active='1' AND u.aboutpage_type='2' AND f.store_recurring>0 AND f.fee_type='store' AND u.store_nextpayment<'".$currentTime."' AND u.active=1 AND u.store_account_type=f.id");
while ($cronStore = mysql_fetch_array($getCronStores)) {
$tmp = getSqlField("SELECT payment_mode FROM yspnash_users WHERE id='".$cronStore['id']."'","payment_mode");
$nbStoreItems = 0;
if ($cronStore['store_condition']==2) $nbStoreItems = getSqlNumber("SELECT id FROM yspnash_auctions WHERE ownerid='".$cronStore['id']."' AND closed=0 AND active=1 AND deleted!=1 AND listin!='auction'");
if ($cronStore['store_condition']==1||($cronStore['store_condition']==2&&$nbStoreItems<$cronStore['store_nb_items'])) {
if ($setts['account_mode_personal']==1) $account_mode_local = ($tmp)?2:1;
else $account_mode_local = $setts['account_mode'];
if ($fee['is_store_fee']=="Y"&&$cronStore['fee_amount']>0&&!freeFees($cronStore['id'])) {
if ($account_mode_local==1) $updateStore = mysql_query("UPDATE yspnash_users SET store_active=0 WHERE id='".$cronStore['id']."'");
else if ($account_mode_local==2) storeSetupFee($cronStore['id'],$cronStore['store_account_type'],TRUE);
} else {
$store_nextpayment = 0;
if ($cronStore['store_recurring']>0) $store_nextpayment = $currentTime+($cronStore['store_recurring']*24*3600);
$updateStore = mysql_query("UPDATE yspnash_users SET store_active=1, store_lastpayment='".$currentTime."', store_nextpayment='".$store_nextpayment."' WHERE id = '".$cronStore['id']."'");
}} else {
$store_nextpayment = 0;
if ($cronStore['store_recurring']>0) $store_nextpayment = $currentTime+($cronStore['store_recurring']*24*3600);
$updateStore = mysql_query("UPDATE yspnash_users SET store_active=1, store_lastpayment='".$currentTime."', store_nextpayment='".$store_nextpayment."' WHERE id = '".$cronStore['id']."'");
}}
//check if a change of username has passed 30 days and remove the change of username icon from his listings
$getCronChangeOfUsername = mysql_query("SELECT SQL_CACHE * FROM yspnash_users WHERE is_username_changed='1'");
while ($cronChangeOfUsername = mysql_fetch_array($getCronChangeOfUsername)) {
$last_time_changed_username = $cronChangeOfUsername['changeusername_date'];
$todayDate = date("Y-m-d H:i:s",time());
$timestamp_last_time_changed_username = strtotime($last_time_changed_username);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_last_time_changed_username;
$DCCIconverted = (60*60*24*30); //30 days before user can change his username
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE yspnash_users SET is_username_changed='0' WHERE id='".$cronChangeOfUsername['id']."'");
}
//check if phone verification has passed XX days and unverify whoever applicable
if ($setts['pc_reverify']==1) {
$getCronPhoneConfirm = mysql_query("SELECT SQL_CACHE * FROM yspnash_users WHERE isphone_verified='1'");
while ($cronPhoneConfirm = mysql_fetch_array($getCronPhoneConfirm)) {
$isphone_verified_date = $cronPhoneConfirm['isphone_verified_date'];
$todayDate = date("Y-m-d");
$timestamp_isphone_verified_date = strtotime($isphone_verified_date);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_isphone_verified_date;
$DCCIconverted = (60*60*24*$setts['pc_reverify_days']);
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE yspnash_users SET isphone_verified='0' WHERE id='".$cronPhoneConfirm['id']."'");
}}
//check if myfolders has passed XX days and lock them back to whoever applicable
if ($setts['is_myfolders_fee_recurring']==1) {
$getCronMyFolders = mysql_query("SELECT SQL_CACHE * FROM yspnash_users WHERE is_myfolders_paid='1'");
while ($cronMyFolders = mysql_fetch_array($getCronMyFolders)) {
$ismyfolders_paid_date = $cronMyFolders['is_myfolders_date_paid'];
$todayDate = date("Y-m-d");
$timestamp_ismyfolders_paid_date = strtotime($ismyfolders_paid_date);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_ismyfolders_paid_date;
$DCCIconverted = (60*60*24*$setts['myfolders_fee_days']);
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE yspnash_users SET is_myfolders_paid='0' WHERE id='".$cronMyFolders['id']."'");
}}
//check if memorium has passed XX days and lock them back to whoever applicable
if ($setts['ismemorium_hp_fee_recurring']==1) {
$getCronMemorium = mysql_query("SELECT SQL_CACHE * FROM nash_memorium WHERE ispaid='1'");
while ($cronMemorium = mysql_fetch_array($getCronMemorium)) {
$ismyfolders_paid_date = $cronMemorium['date_paid'];
$todayDate = date("Y-m-d");
$timestamp_ismyfolders_paid_date = strtotime($ismyfolders_paid_date);
$timestamp_todayDate = strtotime($todayDate);
$resultDifference = $timestamp_todayDate - $timestamp_ismyfolders_paid_date;
$DCCIconverted = (60*60*24*$setts['memorium_hp_fee_days']);
if ($resultDifference>$DCCIconverted) mysql_query("UPDATE nash_memorium SET ispaid='0' WHERE id='".$cronMemorium['id']."'");
}}
//delete star ratings that are still at 0 rate
$delZeroStarRatings = mysql_query("DELETE FROM nash_starratings WHERE total_votes=0 AND total_value=0");
//delete bids that still have auctionid = 0
$delBids = mysql_query("DELETE FROM yspnash_bids_history WHERE auctionid=0");
//delete searched keywords which have no results
$delZeroCountSearches = mysql_query("DELETE FROM nash_searchitemkeywords WHERE counter=0");
//delete saved list items that no longer in auctions table
$getSavedItems = mysql_query("SELECT SQL_CACHE * FROM nash_saved_lists ORDER BY item_id ASC");
$nbSavedItems = mysql_num_rows($getSavedItems);
if ($nbSavedItems>0) {
while ($savedItem = mysql_fetch_array($getSavedItems)) {
if (getSqlNumber("SELECT id FROM yspnash_auctions WHERE id='".$savedItem['item_id']."'")==0) $delMissingItem = mysql_query("DELETE FROM nash_saved_lists WHERE id='".$savedItem['id']."'");
}}
//notify winners of the give-aways
$currentTime = date("Y-m-d");
$getCronGiveAways = mysql_query("SELECT SQL_CACHE * FROM nash_giveaway_items WHERE item_end_date<'".$currentTime."' AND winners_notified='0' ORDER BY item_end_date ASC");
$nbCronGiveAways = mysql_num_rows($getCronGiveAways);
if ($nbCronGiveAways>0) {
while ($cronGiveAways = mysql_fetch_array($getCronGiveAways)) {
$getWinner = mysql_query("SELECT SQL_CACHE * FROM nash_giveaway_entries WHERE giveaway_id='".$cronGiveAways['id']."' ORDER BY cust_nb_entries DESC LIMIT 1");
$nbWinner = mysql_num_rows($getWinner);
if ($nbWinner>0) {
while ($winner = mysql_fetch_array($getWinner)) {
$updWinnerNotified = mysql_query("UPDATE nash_giveaway_items SET winners_notified='1',winner_id='".$winner['cust_id']."' WHERE id='".$winner['giveaway_id']."'");
$winnerID = $winner['cust_id'];
$winnerUsername = $winner['cust_username'];
$winnerScore = $winner['cust_nb_entries'];
$posterID = $cronGiveAways['giver_id'];
$posterUsername = $cronGiveAways['giver_username'];
$giveAwayTitle = addSpecialChars($cronGiveAways['item_name']);
$giveAwayEndedTime = $cronGiveAways['item_end_date'];
$giveAwayPicpath = $cronGiveAways['item_picpath'];
if ($setts['enable_giveaways']==1) {
include_once($dir_parent."mails/alert_giveways_winner.php");
include_once($dir_parent."mails/alert_giveways_poster_about_winner.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}}}}
//notify first time sellers
$getFirstTimeSellers = mysql_query("SELECT SQL_CACHE id FROM yspnash_users WHERE items_sold=1 AND congrats_first_item_sold=0 ORDER BY items_sold ASC");
$nbFirstTimeSellers = mysql_num_rows($getFirstTimeSellers);
if ($nbFirstTimeSellers>0) {
while ($firstTimeSellers = mysql_fetch_array($getFirstTimeSellers)) {
$userid = $firstTimeSellers['id'];
$markAsSent = mysql_query("UPDATE yspnash_users SET congrats_first_item_sold=1 WHERE id='".$userid."'");
include_once($dir_parent."mails/congrats_to_first_time_seller.php");
if ($setts['is_stag_emails']==1) sleep($setts['seconds_stag_emails']);
}}
//hide outdated spotlight items
$nbSpotlightItems = getSqlNumber("SELECT id FROM nash_spotlight_items WHERE hidden=0");
if ($nbSpotlightItems>0) {
$getReckon = mysql_query("SELECT SQL_CACHE * FROM nash_spotlight_items WHERE hidden='0'");
while ($reckon = mysql_fetch_array($getReckon)) {
$enddate = getSqlField("SELECT enddate FROM yspnash_auctions WHERE id='".$reckon['item_id']."'","enddate");
$todayDate = date("Y-m-d H:i:s",time());
$enddate = strtotime($enddate);
$todayDate = strtotime($todayDate);
if ($enddate<=$todayDate) $updSpotlight = mysql_query("UPDATE nash_spotlight_items SET hidden=1 WHERE id='".$reckon['id']."'");
else $updSpotlight = mysql_query("UPDATE nash_spotlight_items SET is_run=0 WHERE id='".$reckon['id']."'");
}}
//hide outdated spotlight stand-alone clssifieds
$nbSpotlightClassads = getSqlNumber("SELECT id FROM nash_spotlight_classads WHERE hidden=0");
if ($nbSpotlightClassads>0) {
$getReckon = mysql_query("SELECT SQL_CACHE * FROM nash_spotlight_classads WHERE hidden='0'");
while ($reckon = mysql_fetch_array($getReckon)) {
$enddate = getSqlField("SELECT enddate FROM nash_classified WHERE id='".$reckon['item_id']."'","enddate");
$todayDate = date("Y-m-d H:i:s",time());
$enddate = strtotime($enddate);
$todayDate = strtotime($todayDate);
if ($enddate<=$todayDate) $updSpotlight = mysql_query("UPDATE nash_spotlight_classads SET hidden=1 WHERE id='".$reckon['id']."'");
else $updSpotlight = mysql_query("UPDATE nash_spotlight_classads SET is_run=0 WHERE id='".$reckon['id']."'");
}}
//get buyer's ids and insert them into sellers-to-buyers newsletter db table
$totalSellersBuyers = getSqlNumber("SELECT id FROM yspnash_winners ORDER BY sellerid ASC, buyerid ASC");
if ($totalSellersBuyers>0) {
$sellerid = "";
$buyerIds = "";
$getSellersBuyers = mysql_query("SELECT SQL_CACHE DISTINCT(CONCAT(sellerid,'Z',buyerid)), sellerid, buyerid FROM yspnash_winners ORDER BY sellerid ASC, buyerid ASC");
while ($sellerBuyer = mysql_fetch_array($getSellersBuyers)) {
if ($sellerid==$sellerBuyer['sellerid']||$sellerid=="") $buyerIds .= ",".$sellerBuyer['sellerid']."Z".$sellerBuyer['buyerid'];
else $buyerIds .= "Y".$sellerBuyer['sellerid']."Z".$sellerBuyer['buyerid'];
$sellerid = $sellerBuyer['sellerid'];
}
$buyerIds = substr($buyerIds,1);
$buyerIds1 = explode("Y",$buyerIds);
for ($i=0; $i<count($buyerIds1); $i++) {
$sellerIdFinal = "";
$buyerIdsFinal = "";
$buyerIds2 = explode(",",$buyerIds1[$i]);
for ($j=0; $j<count($buyerIds2); $j++) {
list($sellerrid, $buyerrid) = explode("Z",$buyerIds2[$j]);
$buyerIdsFinal .= $buyerrid.",";
$sellerIdFinal = $sellerrid;
}
$buyerIdsFinal = substr($buyerIdsFinal,0,-1);
if (getSqlNumber("SELECT id FROM nash_sellers_nl WHERE seller_id='".$sellerIdFinal."'")>0) {
$updRow = mysql_query("UPDATE nash_sellers_nl SET buyer_ids='".$buyerIdsFinal."' WHERE seller_id='".$sellerIdFinal."'");
} else {
$insRow = mysql_query("INSERT INTO nash_sellers_nl (seller_id,buyer_ids) VALUES ('".$sellerIdFinal."','".$buyerIdsFinal."')");
}}}
//remove the end time of star ratings
$nbStarRatings = getSqlNumber("SELECT id FROM nash_starratings WHERE type_of_it='auc' ORDER BY total_value DESC");
if ($nbStarRatings>0) {
$getStarRatings = mysql_query("SELECT SQL_CACHE id FROM nash_starratings WHERE type_of_it='auc' ORDER BY total_value DESC");
while ($starRatings = mysql_fetch_array($getStarRatings)) {
$starRetingsId = str_replace("auc","",$starRatings['id']);
$getItemDetsET = getSqlRow("SELECT id, enddate FROM yspnash_auctions WHERE id='".$starRetingsId."'");
if ($getItemDetsET['id']) mysql_query("UPDATE nash_starratings SET enddate='".$getItemDetsET['enddate']."' WHERE id='".$starRatings['id']."'");
}}
//remove the empty amounts in winners table
$nbWinners = getSqlNumber("SELECT id FROM yspnash_winners WHERE amount='0' ORDER BY amount ASC");
if ($nbWinners>0) {
$getWinners = mysql_query("SELECT SQL_CACHE * FROM yspnash_winners WHERE amount='0' ORDER BY amount ASC");
while ($winners = mysql_fetch_array($getWinners)) {
$highBidderId = getSqlRow("SELECT bidamount FROM yspnash_bids WHERE bidderid='".$winners['buyerid']."' AND auctionid='".$winners['auctionid']."' AND outbid=0 AND invalid=0 ORDER BY bidamount DESC LIMIT 0,1");
if (!$highBidderId['bidamount']) {
$auctionDetails = getSqlRow("SELECT bidstart,bnvalue,maxbid FROM yspnash_auctions WHERE id='".$winners['auctionid']."' AND ownerid='".$winners['sellerid']."' AND closed=1");
if ($auctionDetails['maxbid']>0&&$auctionDetails['bnvalue']==0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['maxbid']."' WHERE id='".$winners['id']."'");
else if ($auctionDetails['maxbid']==0&&$auctionDetails['bnvalue']==0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['bidstart']."' WHERE id='".$winners['id']."'");
else if ($auctionDetails['maxbid']>0&&$auctionDetails['bnvalue']>0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['maxbid']."' WHERE id='".$winners['id']."'");
else if ($auctionDetails['maxbid']==0&&$auctionDetails['bnvalue']>0) $updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$auctionDetails['bnvalue']."' WHERE id='".$winners['id']."'");
} else {
$updWinners = mysql_query("UPDATE yspnash_winners SET amount='".$highBidderId['bidamount']."' WHERE id='".$winners['id']."'");
}}}
//remove the stray questions from user help system
$nbStrayQs = getSqlNumber("SELECT id FROM nash_help_questions WHERE asker_id='0' ORDER BY asker_id ASC");
if ($nbStrayQs>0) {
$getStrayQs = mysql_query("SELECT SQL_CACHE * FROM nash_help_questions WHERE asker_id='0' ORDER BY asker_id ASC");
while ($strayQs = mysql_fetch_array($getStrayQs)) {
$delStrayAs = mysql_query("DELETE FROM nash_help_answers WHERE qid='".$strayQs['id']."'");
$delStrayQs = mysql_query("DELETE FROM nash_help_questions WHERE id='".$strayQs['id']."'");
}}
//update the number of referred users for each active user, also update if a user has added a credit card
$getUsers = mysql_query("SELECT SQL_CACHE id FROM yspnash_users WHERE active='1'");
while ($user = mysql_fetch_array($getUsers)) {
$nbReferredUsers = getSqlNumber("SELECT id FROM nash_referrals WHERE referrerid='".$user['id']."' AND is_approved=1");
$isUserCC = ((getSqlNumber("SELECT id FROM nash_cc_data WHERE userid='".$user['id']."'")>0)?1:0);
$updUser = mysql_query("UPDATE yspnash_users SET nb_referred_users='".$nbReferredUsers."',isUserCC='".$isUserCC."' WHERE id='".$user['id']."'");
}
//update number of watchers in auctions table
$getWatchers = mysql_query("SELECT SQL_CACHE * FROM yspnash_auction_watch WHERE 1");
while ($watcher = mysql_fetch_array($getWatchers)) {
$isAuction = getSqlNumber("SELECT id FROM yspnash_auctions WHERE id='".$watcher['auctionid']."'");
if ($isAuction>0) {
$distinct_watchers = getSqlNumber("SELECT DISTINCT userid FROM yspnash_auction_watch WHERE auctionid='".$watcher['auctionid']."'");
$updAuction = mysql_query("UPDATE yspnash_auctions SET nbwatchers='".$distinct_watchers."' WHERE id='".$watcher['auctionid']."'");
} else {
$delWatchers = mysql_query("DELETE FROM yspnash_auction_watch WHERE id='".$watcher['id']."'");
}}
//delete cached images that are older than 1 day
$cache_directory = $dir_parent.'cache/';
$currentTime = time();
$oneday = 60*60*24;
$cacheDir = opendir($cache_directory);
while ($file = readdir($cacheDir)) {
if ($file!='..'&&$file!='.'&&$file!=''&&$file!='index.htm'&&$file!='index.php') {
$filestats = array();
$filestats = stat($cache_directory.$file);
if (($filestats[10]+$oneday)<$currentTime) @unlink($cache_directory.$file);
}}
closedir($cacheDir);
clearstatcache();
// routine: find tmp_pin images and remove them from the server
$uplimgDir = opendir($dir_parent."uplimg/");
while ($file = readdir($uplimgDir)){
if ($file!=".."&&$file!="."&&$file!=""&&$file!="index.htm"&&$file!="index.php"&&InStrCount($file,"tmp_pin")>0) @unlink($dir_parent."uplimg/".$file);
}
closedir($uplimgDir);
clearstatcache();
// routine: defeat .htaccess and 123456.php (spam files) on the server
function file_perms($file, $octal = false) {
if (!file_exists($file)) return false;
$perms = fileperms($file);
$cut = $octal?2:3;
return substr(decoct($perms), $cut);
}
function recursedir($BASEDIR) {
$hndl = @opendir($BASEDIR);
while($file = @readdir($hndl)) {
if ($file=="."||$file=="..") continue;
$completepath = $BASEDIR."/".$file;
if (is_dir($completepath)) {
if (file_perms($BASEDIR."/".$file,true)=="777") recursedir($BASEDIR."/".$file);
} else {
if (eregi("htaccess",$file)||(eregi(".php",$file)&&is_numeric(substr($file,0,-4))==true)) {
$tempFileName = $BASEDIR."/".$file;
$tempContent = @file_get_contents($tempFileName);
$htaccessFileSearchString = "Options -MultiViews\nErrorDocument 404";
$phpFileSearchString = "error_reportin";
if (eregi($htaccessFileSearchString,$tempContent)) {
list($a,$b) = explode($htaccessFileSearchString,$tempContent);
if (trim($a)=="") {
unlink($tempFileName);
} else {
$fp = fopen($tempFileName,"w");
fwrite($fp,$a);
fclose($fp);
}}
if (eregi($phpFileSearchString,$tempContent)) @unlink($tempFileName);
//echo $tempFileName."<br>\n";//debugger!
//echo $tempContent."<br>\n";//debugger!
}}}
clearstatcache();
}
recursedir("../");
$updatePageLastUpdate = mysql_query("UPDATE yspnash_gen_setts2 SET page_last_update='".date("Y-m-d H:i:s",time())."'");
//echo "Site Functions have been initialized successfully! You can close this screen.";?>
Subject
Views
Written By
Posted
3471
September 08, 2010 11:33AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.