📄 account.php
字号:
if(($newOptions & 64) != 0) { $adFee = sprintf("%01.2f",$adFee + $SystemOptions['fee_color']); } //Check images if($adImage1 != "") { $adFee = sprintf("%01.2f",$adFee + $SystemOptions['fee_images']); } if($adImage2 != "") { $adFee = sprintf("%01.2f",$adFee + $SystemOptions['fee_images']); } if($adImage3 != "") { $adFee = sprintf("%01.2f",$adFee + $SystemOptions['fee_images']); } if($adImage4 != "") { $adFee = sprintf("%01.2f",$adFee + $SystemOptions['fee_images']); } if($adImage5 != "") { $adFee = sprintf("%01.2f",$adFee + $SystemOptions['fee_images']); } //Check coupon if(isset($couponCode) && trim($couponCode) != "") { $couponCode = protect($couponCode); $result = query("SELECT coupon_percent,coupon_amount,coupon_expires,coupon_restrict FROM {$class_prefix}coupons WHERE coupon_code='$couponCode'",$class_link); list($couponPercent,$couponAmount,$couponExpires,$couponRestrict) = mysql_fetch_row($result); //Is coupon valid? $pass = 1; if($couponExpires != "0000-00-00" && time() > strtotime($couponExpires)) { $pass = 0; $couponMsg = "{$Languages['account']['addcouponexpired']}<br><br>"; } //Let's see if it's restricted. if($couponRestrict == 1) { $result = query("SELECT COUNT(coupon_code) FROM {$class_prefix}coupons_lock WHERE user_id=$userID AND coupon_code='$couponCode' GROUP BY coupon_code",$class_link); list($chkUse) = mysql_fetch_row($result); if($chkUse != 0) { $pass = 0; $couponMsg = "{$Languages['account']['addcouponused']}<br><br>"; } else { //They are ok to use it, now lock it $result = query("INSERT INTO {$class_prefix}coupons_lock VALUES('$couponCode',$userID)",$class_link); } } if($pass == 1) { //We can use this coupon, let's adjust the price if($couponPercent != 0) { //Percentage off if($couponPercent < 100) { $couponPercent = "0.$couponPercent"; } else { $couponPercent = 1; } $adFee = sprintf("%01.2f",$adFee - ($adFee * $couponPercent)); } else { //Amount off $adFee = sprintf("%01.2f",$adFee - $couponAmount); } if($adFee < 0) { $adFee = "0.00"; } //Update the uses for the coupon $result = query("UPDATE {$class_prefix}coupons SET coupon_uses=coupon_uses+1 WHERE coupon_code='$couponCode'",$class_link); } } //Update the ad with it's fee $result = query("UPDATE {$class_prefix}ads SET ad_fee='$adFee' WHERE ad_id=$adID",$class_link); //If ad is free, update status if($adFee == "0.00" && $SystemOptions['auto_approve'] == 1) { $result = query("UPDATE {$class_prefix}ads SET ad_status=1 WHERE ad_id=$adID",$class_link); updateCounts(); updateRSS(); alertAdmin("posted",$adID); $msg = "{$Languages['account']['addcompleteposted']}<br><br>"; } if($adFee == "0.00" && $SystemOptions['auto_approve'] == 0) { alertAdmin("pendingApproval",$adID); $msg = "{$Languages['account']['addcompletepending']}<br><br>"; } //Display our page if($adFee == "0.00") { //No fees pending $displayData =<<<ENDDATA <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td> $msg </td> </tr> </table>ENDDATA; } else { //User does owe fees, ask if they wish to post another ad, or checkout. $adArray = array(); $result = query("SELECT ad_id,ad_fee FROM {$class_prefix}ads WHERE ad_status=9 AND ad_user_id=$userID",$class_link); while(list($pendingAdID,$pendingFee) = mysql_fetch_row($result)) { array_push($adArray,intval($pendingAdID)); $pendingFees += $pendingFee; } $passArray = rawurlencode(serialize($adArray)); $form = paymentForm($passArray,$pendingFees); $adFee = formatPrice($adFee); $pendingFees = formatPrice($pendingFees); $paymentMsg = sprintf($Languages['account']['addcompleteprepayment'],$adFee,$pendingFees); $displayData =<<<ENDDATA <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td> $msg $couponMsg $paymentMsg<br> $form </td> </tr> </table>ENDDATA; alertAdmin("toBePaid",$adID); } break; default: //Check to see if they are agreeing to the rules if(isset($accept)) { if($accept == "true") { $result = query("UPDATE bosdevUUS SET bc2='1' WHERE id=$userID",$uus_link); $userInfo['rules'] = "1"; } } //Check to see if this user has agreed to the rules if($userInfo['rules'] != "1" && file_exists("{$insPath}rules.txt") ) { //Get rules $fp = @fopen("{$insPath}rules.txt","r"); while (!feof ($fp)) { $rules .= @fgets($fp, 4096); } @fclose($fp); //Display form $displayData =<<<ENDDATA <table width="100%" border="0" cellspacing="1" cellpadding="3"> <form method="post" action="account.php" onReset="javascript:window.location='{$insUrl}';"> <input type="hidden" name="action" value="add"> <input type="hidden" name="accept" value="true"> <tr> <td> {$Languages['account']['addrules']}<br> <br> <textarea name="rules" style="width:100%; height:500px;" readonly>$rules</textarea><br> <br> <input type="reset" value="{$Languages['account']['addrulesno']}"> <input type="submit" value="{$Languages['account']['addrulesyes']}"> </td> </tr> </form> </table>ENDDATA; } else { //Choose category if(!isset($catParent) || $catParent == "") { $catParent = 0; } $catParent = protect($catParent); if($catParent != 0) { $check_cat = $catParent; while($check_cat != 0) { $result = query("SELECT category_parent,category_title FROM {$class_prefix}categories WHERE category_id=$check_cat",$class_link); list($checkParent,$catTitle) = mysql_fetch_row($result); $cat_title = stripslashes($cat_title); $catTree = " » <a href=\"{$insUrl}account.php?action=add&catParent=$check_cat\">$catTitle</a> $catTree"; $check_cat = $checkParent; } $catTree = "<a href=\"{$insUrl}account.php?action=add\">{$Languages['account']['addtop']}</a> $catTree<br><br>"; } $result = query("SELECT category_id,category_title,category_ad_types,category_subs FROM {$class_prefix}categories WHERE category_parent=$catParent ORDER BY category_title",$class_link); while(list($catID,$catTitle,$catTypes,$catSubs) = mysql_fetch_row($result)) { $catTitle = stripslashes($catTitle); if($catTypes != 0) { $addLink = " <a href=\"account.php?action=add&step=1&adCategory=$catID\">[{$Languages['account']['addplace']}]</a>"; } else { $addLink = ""; } if($catSubs != 0) { $catList .= "<li><a href=\"account.php?action=add&catParent=$catID\">$catTitle</a>» $addLink<br>"; } else { $catList .= "<li>$catTitle $addLink<br>"; } } $displayData =<<<ENDDATA <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td align="left"> {$Languages['account']['addchoosecat']}<br> <br> $catTree $catList<br> </td> </tr> </table>ENDDATA; break; } } break; case "adRenew": $adID = protect($adID); $result = query("SELECT ad_title,ad_type,ad_category,ad_options FROM {$class_prefix}ads WHERE ad_id=$adID",$class_link); list($adTitle,$adType,$adCategory,$adOptions) = mysql_fetch_row($result); $adTitle = stripslashes($adTitle); //Get pricing data $result = query("SELECT category_ad_types,category_ad_prices FROM {$class_prefix}categories WHERE category_id=$adCategory",$class_link); list($catTypes,$catPrices) = mysql_fetch_row($result); $catPriceArray = explode(",",$catPrices); $catTypesArray = explode(",",$catTypes); $count = 0; while(list(,$val) = each($catTypesArray)) { if($val == $adType) { $catPrice = $catPriceArray[$count]; } $count++; } for($i=1;$i<=4;$i++) { if($SystemOptions['time_'.$i] != "2147483647") { $timeParts = explode("|",$SystemOptions['time_'.$i.'_multiplier']); if($timeParts[0] == "1") { $price = formatPrice($catPrice * $timeParts[1]); } else { $price = formatPrice($catPrice + $timeParts[1]); } if($SystemOptions['time_'.$i] != "0") { $timeOptions .= "<option value=\"$i\">{$SystemOptions['time_'.$i]} {$Languages['account']['adddays']} $price</option>"; } else { $timeOptions .= "<option value=\"$i\">{$Languages['account']['addunldays']} $price</option>"; } } } $msg1 = sprintf($Languages['account']['renewintro1'],$adTitle); $displayTitle = $Languages['account']['renewhead']; $displayData =<<<ENDDATA <table width="100%" border="0" cellspacing="1" cellpadding="3"> <form method="post" action="account.php" onReset="javascript:history.go(-1);"> <input type="hidden" name="action" value="adRenewProcess"> <input type="hidden" name="adID" value="$adID"> <input type="hidden" name="adCategory" value="$adCategory"> <tr> <td> $msg1<br> <br> {$Languages['account']['renewintro2']}<br> <br> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td colspan="2" class="alttd"><b>{$Languages['account']['addnumdays']}:</b></td> </tr> <tr> <td> {$Languages['account']['addnumdaysintro']}<br> <select name="newTime">$timeOptions</select> </td> </tr> </table>ENDDATA; //Check to see if options are allowed if($SystemOptions['allow_featured'] == 1) { if($SystemOptions['fee_featured'] != "0.00") { $msg = sprintf($Languages['account']['addadditionalfee'],formatPrice($SystemOptions['fee_featured'])); $featured = "{$Languages['account']['adsscreendispfea']}: <select name=\"newFeatured\"><option value=\"1\">{$Languages['account']['yes']}</option><option value=\"0\" selected>{$Languages['account']['no']}</option></select> Additional $msg<br>"; } else { $featured = "{$Languages['account']['adsscreendispfea']}: <select name=\"newFeatured\"><option value=\"1\">{$Languages['account']['yes']}</option><option value=\"0\" selected>{$Languages['account']['no']}</option></select><br>"; } $showOptions = "true"; } if($SystemOptions['allow_bold'] == 1) { if($SystemOptions['fee_bold'] != "0.00") { $msg = sprintf($Languages['account']['addadditionalfee'],formatPrice($SystemOptions['fee_bold'])); $bold = "{$Languages['account']['adsscreendispbold']}: <select name=\"newBold\"><option value=\"2\">{$Languages['account']['yes']}</option><option value=\"0\" selected>{$Languages['account']['no']}</option></select> Additional $msg<br>"; } else { $bold = "{$Languages['account']['adsscreendispbold']}: <select name=\"newBold\"><option value=\"2\">{$Languages['account']['yes']}</option><option value=\"0\" selected>{$Languages['account']['no']}</option></select><br>"; } $showOptions = "true"; } if($SystemOptions['allow_italic'] == 1) { if($SystemOptions['fee_italic'] != "0.00") { $msg = sprintf($Languages['account']['addadditionalfee'],formatPrice($SystemOptions['fee_italic'])); $italic = "{$Languages['account']['adsscreendispitalic']}: <select name=\"newItalic\"><option value=\"4\">{$Languages['account']['yes']}</option><option value=\"0\" selected>{$Languages['account']['no']}</option></select> Additional $msg<br>"; } else { $italic = "{$Languages['account']['adsscreendispitalic']}: <select name=\"newItalic\"><option value=\"4\">{$Languages['account']['yes']}</option><option value=\"0\" selected>{$Languages['account']['no']}</option></select><br>"; } $showOptions = "true"; } if($SystemOptions['allow_color'] == 1) { $back = 1; for($i=8;$i<=64;$i=$i*2) { $optionColors .= "<option value=\"$i\" class=\"background_{$back}\">{$Languages['account']['color']} $back</option>"; $back++; } if($SystemOptions['fee_color'] != "0.00") { $msg = sprintf($Languages['account']['addadditionalfee'],formatPrice($SystemOptions['fee_color'])); $colors = "{$Languages['account']['adsscreendispbg']}: <div id=\"listings\"><select name=\"newColor\"><option value=\"\"></option>$optionColors></select></div> Additional $msg<br>"; } else { $colors = "{$Languages['account']['adsscreendispbg']}: <div id=\"listings\"><select name=\"newColor\"><option value=\"\"></option>$optionColors</select></div><br>"; } $showOptions = "true"; } if($showOptions == "true") { $displayData .=<<<ENDDATA <br> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td colspan="2" class="alttd"><b>{$Languages['account']['adsscreendispopt']}:</b></td> </tr> <tr> <td> $featured $bold $italic $colors </td> </tr> </table>ENDDATA; } //Check to see if we have any coupons $today = date("Y-m-d"); $result = query("SELECT COUNT(coupon_id) FROM {$class_prefix}coupons WHERE coupon_expires > '$today' OR coupon_expires = '0000-00-00'",$class_link); list($coupons) = mysql_fetch_row($result); if($coupons != 0) { $displayData .=<<<ENDDATA <br> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td colspan="2" class="alttd"><b>{$Languages['account']['addcoupon']}:</b></td> </tr> <tr> <td> {$Languages['account']['addcouponintro']}<br> <input type="text" name="couponCode"> </td> </tr> </table>ENDDATA; } $displayData .=<<<ENDDATA </td> </tr> <tr> <td align="center"><input type="submit" value="{$Languages['account']['process']}"></td> </tr> </form> </table>ENDDATA; break; case "adRenewProcess": $adID = protect($adID); $adCategory = protect($adCategory); $newFeatu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -