⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 日程 BosDates v4.5 Copyright ?2004-2005 BosDev
💻 PHP
📖 第 1 页 / 共 5 页
字号:
		$categoryOptional2 = toEdit($categoryOptional2);		$categoryOptional3 = toEdit($categoryOptional3);		$categoryOptional4 = toEdit($categoryOptional4);		$categoryOptional5 = toEdit($categoryOptional5);		$adTypeArray = explode(",",$categoryAdTypes);		$adPriceArray = explode(",",$categoryAdPrices);		$result = query("SELECT type_id,type_title FROM {$class_prefix}ad_types ORDER BY type_id",$class_link);		while(list($typeID,$typeTitle) = mysql_fetch_row($result)) {			$typeTitle = stripslashes($typeTitle);			$isUsed = "";			$price = "";			if(in_array($typeID,$adTypeArray)) {				$pos = array_search($typeID,$adTypeArray);				$isUsed = "checked";				$price = $adPriceArray[$pos];				}			$adTypes .=<<<ENDTYPES			<tr>			 <td align="center"><input type="checkbox" name="adType{$typeID}" value="$typeID" $isUsed></td>			 <td>$typeTitle</td>			 <td align="center"><input type="text" name="adPrice{$typeID}" value="$price" style="width:50px;"></td>			</tr>ENDTYPES;			}		if($categoryImg != "") {			$img=<<<ENDIMG			<img src="{$insUrl}images/categories/$categoryImg"><br>			<input type="checkbox" name="deleteImage" value="1"> {$Languages['admin']['cateditdelimg']}<br>ENDIMG;			}		$topBanners = "<option value=\"\">{$Languages['admin']['cateditbannernone']}</option>";		$bottomBanners = "<option value=\"\">{$Languages['admin']['cateditbannernone']}</option>";		$result = query("SELECT banner_id,banner_name FROM {$class_prefix}banners ORDER BY banner_name",$class_link);		while(list($bannerID,$bannerName) = mysql_fetch_row($result)) {			$bannerName = stripslashes($bannerName);			if($bannerTop == "$bannerID") { $topBanners .= "<option value=\"$bannerID\" selected>$bannerName</option>"; }				else { $topBanners .= "<option value=\"$bannerID\">$bannerName</option>"; }			if($bannerBottom == "$bannerID") { $bottomBanners .= "<option value=\"$bannerID\" selected>$bannerName</option>"; }				else { $bottomBanners .= "<option value=\"$bannerID\">$bannerName</option>"; }			}		if($bannerTop == "rand") { $topBanners .= "<option value=\"rand\" selected>{$Languages['admin']['cateditbannerrandom']}</option>"; }			else { $topBanners .= "<option value=\"rand\">{$Languages['admin']['cateditbannerrandom']}</option>"; }		if($bannerBottom == "rand") { $bottomBanners .= "<option value=\"rand\" selected>{$Languages['admin']['cateditbannerrandom']}</option>"; }			else { $bottomBanners .= "<option value=\"rand\">{$Languages['admin']['cateditbannerrandom']}</option>"; }		$displayData =<<<ENDDATA		<div id="generalBox">		<table width="100%" border="0" cellspacing="1" cellpadding="3">		 <tr>		  <td class="headtd">{$Languages['admin']['menucategories']}</td>		 </tr>		 <tr>		  <td>		   <table width="100%" border="0" cellspacing="1" cellpadding="3">		   <form method="post" action="index.php" enctype="multipart/form-data" onReset="javascript:history.go(-1);">		   <input type="hidden" name="action" value="categoriesEditProcess">		   <input type="hidden" name="category" value="$category">		    <tr>		     <td class="headtd">{$Languages['admin']['catedithead']}</td>		    </tr>		    <tr>		     <td>		      <b>{$Languages['admin']['catedittitle']}:</b><br>		      <input type="text" name="newTitle" value="$categoryTitle" style="width:400px;"><br>		      <b>{$Languages['admin']['cateditdesc']}:</b><br>		      <textarea name="newDescription" style="width:400px; height:50px;">$categoryDesc</textarea><br>		      <br>		      <b>{$Languages['admin']['cateditopt']}:</b><br>		      <table width="400" border="0" cellspacing="1" cellpadding="3"> 		       <tr> 		        <td class="alttd" width="10" align="center">#</td> 		        <td class="alttd" width="65" align="center">{$Languages['admin']['cateditopttitle']}</td> 		        <td class="alttd" width="325">{$Languages['admin']['cateditoptdesc']}</td> 		       </tr> 		       <tr> 		        <td>1</td> 		        <td><input type="text" name="newCategoryOptional1" value="$categoryOptional1" style="width:65px;"></td> 		        <td><input type="text" name="newCategoryOptional1Def" value="$categoryOptional1Def" style="width:300px;"></td> 		       </tr> 		       <tr> 		        <td>2</td> 		        <td><input type="text" name="newCategoryOptional2" value="$categoryOptional2" style="width:65px;"></td> 		        <td><input type="text" name="newCategoryOptional2Def" value="$categoryOptional2Def" style="width:300px;"></td> 		       </tr> 		       <tr> 		        <td>3</td> 		        <td><input type="text" name="newCategoryOptional3" value="$categoryOptional3" style="width:65px;"></td> 		        <td><input type="text" name="newCategoryOptional3Def" value="$categoryOptional3Def" style="width:300px;"></td> 		       </tr> 		       <tr> 		        <td>4</td> 		        <td><input type="text" name="newCategoryOptional4" value="$categoryOptional4" style="width:65px;"></td> 		        <td><input type="text" name="newCategoryOptional4Def" value="$categoryOptional4Def" style="width:300px;"></td> 		       </tr> 		       <tr> 		        <td>5</td> 		        <td><input type="text" name="newCategoryOptional5" value="$categoryOptional5" style="width:65px;"></td> 		        <td><input type="text" name="newCategoryOptional5Def" value="$categoryOptional5Def" style="width:300px;"></td> 		       </tr> 		      </table>		      <br>		      <b>{$Languages['admin']['catedittype']}:</b><br>		      <table width="400" border="0" cellspacing="1" cellpadding="3"> 		       <tr> 		        <td class="alttd" width="50" align="center">{$Languages['admin']['cateditadallow']}</td>		        <td class="alttd" width="300">{$Languages['admin']['cateditadtitle']}</td>		        <td class="alttd" width="50" align="center">{$Languages['admin']['cateditadprice']}</td>		       </tr>		       $adTypes		       </table>		       <br>		      <b>{$Languages['admin']['cateditimg']}:</b><br>		      $img		      {$Languages['admin']['cateditimgrep']}: <input type="file" name="newImage"><br>		      <br>		      <table width="400" border="0" cellspacing="1" cellpadding="3"> 		       <tr> 		        <td class="alttd"><b>{$Languages['admin']['cateditbanners']}</b></td>		       </tr> 		       <tr> 		        <td>{$Languages['admin']['cateditbannertop']}: <select name="newBannerTop">$topBanners</select></td>		       </tr> 		       <tr> 		        <td>{$Languages['admin']['cateditbannerbottom']}: <select name="newBannerBottom">$bottomBanners</select></td>		       </tr>		       </table>		       <br>		      <input type="reset" value="{$Languages['admin']['cancel']}"><input type="submit" value="{$Languages['admin']['process']}">		     </td> 		    </tr>		   </form>		   </table>		  </td>		 </tr>		</table>		</div>ENDDATA;		break;	case "categoriesEditProcess":		if($userData['admin'] != 2) { header("Location: index.php?action=logout"); die(); }		$category = protect($category);		$newTitle = protect($newTitle);		$newDescription = protect($newDescription);		$newCategoryOptional1 = protect($newCategoryOptional1);		$newCategoryOptional2 = protect($newCategoryOptional2);		$newCategoryOptional3 = protect($newCategoryOptional3);		$newCategoryOptional4 = protect($newCategoryOptional4);		$newCategoryOptional5 = protect($newCategoryOptional5);		$newCategoryOptional1Def = protect($newCategoryOptional1Def);		$newCategoryOptional2Def = protect($newCategoryOptional2Def);		$newCategoryOptional3Def = protect($newCategoryOptional3Def);		$newCategoryOptional4Def = protect($newCategoryOptional4Def);		$newCategoryOptional5Def = protect($newCategoryOptional5Def);		$newBannerTop = protect($newBannerTop);		$newBannerBottom = protect($newBannerBottom);		$adTypes = "";		$adPrices = "";		while(list($key,$val) = each($_POST)) {			if(substr($key,0,6) == "adType") {				${"adPrice".$val} = formatPrice(${"adPrice".$val},0);				$adTypes .= "$val,";				$adPrices .= ${"adPrice".$val}.",";				}			}		//Update the category		$result = query("UPDATE {$class_prefix}categories SET category_title='$newTitle',category_desc='$newDescription',category_ad_types='$adTypes',category_ad_prices='$adPrices',category_optional_1='$newCategoryOptional1',category_optional_1_def='$newCategoryOptional1Def',category_optional_2='$newCategoryOptional2',category_optional_2_def='$newCategoryOptional2Def',category_optional_3='$newCategoryOptional3',category_optional_3_def='$newCategoryOptional3Def',category_optional_4='$newCategoryOptional4',category_optional_4_def='$newCategoryOptional4Def',category_optional_5='$newCategoryOptional5',category_optional_5_def='$newCategoryOptional5Def',banner_top='$newBannerTop',banner_bottom='$newBannerBottom' WHERE category_id=$category",$class_link);		//Get parent for return, and image for check		$result = query("SELECT category_parent,category_img FROM {$class_prefix}categories WHERE category_id=$category",$class_link);		list($parent,$currentImg) = mysql_fetch_row($result);		//If deleting the image or replacing it, get rid of old one		if($deleteImage == "1" || is_uploaded_file($_FILES['newImage']['tmp_name'])) {			@unlink("{$insPath}images/categories/$currentImg");			$result = query("UPDATE {$class_prefix}categories SET category_img='' WHERE category_id=$category",$class_link);			}		//Process new image		if(is_uploaded_file($_FILES['newImage']['tmp_name'])) {			$fileName = processImage($_FILES['newImage'],1);			if($fileName != "") { $result = query("UPDATE {$class_prefix}categories SET category_img='$fileName' WHERE category_id=$category",$class_link); }			}		$displayData =<<<ENDDATA		<div id="generalBox">		<table width="100%" border="0" cellspacing="1" cellpadding="3">		 <tr>		  <td class="headtd">{$Languages['admin']['menucategories']}</td>		 </tr>		 <tr>		  <td>		   {$Languages['admin']['cateditconf']}		  </td>		 </tr>		</table>		</div>		<META HTTP-EQUIV="refresh" CONTENT=2;URL="index.php?action=categories&parent=$parent">ENDDATA;		break;	case "categoriesDelete":		if($userData['admin'] != 2) { header("Location: index.php?action=logout"); die(); }		$category = protect($category);		$result = query("SELECT category_title,category_subs,category_listings FROM {$class_prefix}categories WHERE category_id=$category",$class_link);		list($catTitle,$catSubs,$catListings) = mysql_fetch_row($result);		$msg = sprintf($Languages['admin']['catdelmsg'],$catTitle,$catSubs,$catListings);		$displayData =<<<ENDDATA		<div id="generalBox">		<table width="100%" border="0" cellspacing="1" cellpadding="3">		<form method="post" action="index.php" onReset="javascript:history.go(-1);">		<input type="hidden" name="action" value="categoriesDeleteProcess">		<input type="hidden" name="category" value="$category">		 <tr>		  <td class="headtd">{$Languages['admin']['menucategories']}</td>		 </tr>		 <tr>		  <td>		   <table width="100%" border="0" cellspacing="1" cellpadding="3">		    <tr>		     <td class="headtd">{$Languages['admin']['catdelhead']}</td>		    </tr>		    <tr>		     <td>		      $msg<br>		      <input type="reset" value="{$Languages['admin']['cancel']}"><input type="submit" value="{$Languages['admin']['process']}">		     </td>		    </tr>		   </form>		   </table>		  </td>		 </tr>		</table>		</div>ENDDATA;		break;	case "categoriesDeleteProcess":		if($userData['admin'] != 2) { header("Location: index.php?action=logout"); die(); }		$category = protect($category);		$result = query("SELECT category_parent FROM {$class_prefix}categories WHERE category_id=$category",$class_link);		list($parent) = mysql_fetch_row($result);		//Prune the structure back		pruneTree($category);		//Recount cats/subs		updateCounts();		$displayData =<<<ENDDATA		<div id="generalBox">		<table width="100%" border="0" cellspacing="1" cellpadding="3">		 <tr>		  <td class="headtd">{$Languages['admin']['menucategories']}</td>		 </tr>		 <tr>		  <td>		   <table width="100%" border="0" cellspacing="1" cellpadding="3">		    <tr>		     <td class="headtd">{$Languages['admin']['catdelhead']}</td>		    </tr>		    <tr>		     <td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -