Location: PHPKode > projects > infoboard > infoboard/_class/formbanner.php
<?
	 function topbanner($img){
		   global $iscon;
		   global $infoboard;
		   if(!$iscon["idadmin"]) return $infoboard->formadmin();
		   $print="";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div id=\"tabgroup\"><strong>".$iscon["lang"][146]."</strong></div>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   if($img) $print.=$img;
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<form name=\"setting\" action=\"./_req/topbanner.php\" method=\"post\" enctype=\"multipart/form-data\">";
		   $print.= "<label>\n<input name=\"image\" type=\"file\" id=\"image\" size=\"15\" class=\"input\" /></label>\n\n";
		   $print.= "299px × 58px<br class=\"clear-all\" />\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<label><p><input type=\"submit\" name=\"submit\" value=\"Change\" /> \n";
		   $print.= "<input type=\"button\" value=\"Cancel\" onclick=\"javascript:history.back();\" /></p>\n";
		   $print.= "</label>\n";

		   $print.= "</form>";
		    $print.= "<br class=\"clear-all\" />\n";
		   return $print;
     }

	 function formbanner(){
		   global $iscon;
		   global $infoboard;
		   if(!$iscon["idadmin"]) return $infoboard->formadmin();
		   $bantarget = array("Top", "Bottom", "Right", "Inside"); 
		   $bansize = array(60, 60, 30, 60); 
		   $print="";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div id=\"tabgroup\"><strong>".$iscon["lang"][17]."</strong></div>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<form name=\"setting\" action=\"./_req/savebanner.php\" method=\"post\">";
		   for($i=0; $i<count($bantarget); $i++){
			    $input=$i+1;
				$print.= "<div class=\"textform\">(".$bantarget[$i]." code)</div>\n";
				$print.= "<label><textarea name=\"banner".$input."\" cols=\"".$bansize[$i]."\" rows=\"6\" class=\"input\">".$infoboard->isread("./data/banner".$input.".dat")."</textarea></label>\n";
				$print.= "<br class=\"clear-all\" />\n";
		   }

		   $print.= "<label><p><input type=\"submit\" name=\"submit\" value=\"Submit\" /> \n";
		   $print.= "<input type=\"button\" value=\"Cancel\" onclick=\"javascript:history.back();\" /></p>\n";
		   $print.= "</label>\n";

		   $print.= "</form>";
		    $print.= "<br class=\"clear-all\" />\n";
		   return $print;
     }

	 function formblockad(){
		   global $iscon;
		   global $infoboard;
		   if(!$iscon["idadmin"]) return $infoboard->formadmin();
		   $print="";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div id=\"tabgroup\"><strong>Block AD.</strong></div>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   if($iscon["getlang"] == "th"){
			    $print.= "* ห้ามใส่ข้อความสั้น และมีความหมายกว้างเกินไป เพราะจะทำให้กระทู้ที่ไม่ใช่โฆษณา จะถูกตรวจสอบก่อนแสดงทุกหัวข้อ\n";
				$print.= "<br class=\"clear-all\" />\n";
		   }
		   $print.= "<form name=\"setting\" action=\"./_req/blockad.php\" method=\"post\">";
		   $path="./data/ad.dat";
		   $count=0;
		   if(file_exists($path)){
				$fp = fopen ($path, "r");
				while (!feof ($fp)){
					 $data= fgets($fp);
					 if(trim($data)) $print.= "<label><p><input type=\"text\" name=\"ad[]\" size=\"10\" value=\"".trim($data)."\" class=\"input\" /></p></label>";
				}
		   }
		   for($i=1; $i<=5; $i++){
			    $print.= "<label><p><input type=\"text\" name=\"ad[]\" size=\"10\" value=\"\" class=\"input\" /></p></label>";
		   }
		   $print.= "<label><p><input type=\"submit\" name=\"submit\" value=\"Submit\" /> \n";
		   $print.= "<input type=\"button\" value=\"Cancel\" onclick=\"javascript:history.back();\" /></p>\n";
		   $print.= "</label>\n";

		   $print.= "</form>";
		    $print.= "<br class=\"clear-all\" />\n";
		   return $print;
     }


	 function formslideshow(){
		   global $iscon;
		   global $infoboard;
		   if(!$iscon["idadmin"]) return $infoboard->formadmin();
		   $print="";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div id=\"tabgroup\"><strong>Slide Show</strong></div>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<form name=\"setting\" action=\"./_req/saveslide.php\" method=\"post\" enctype=\"multipart/form-data\">";

		   $path="./data/slideshow.dat";
		   $count=0;
		   if(file_exists($path)){
				$fp = fopen ($path, "r");
				while (!feof ($fp)){
					 $data= fgets($fp);
					 $exp = explode("_|_",$data);
					 if(trim($exp[0])){
						  $count++;
						  if(file_exists("./data/slide/".trim($exp[0]).".jpg")){
							   $print.= "<img src=\"./data/slide/".trim($exp[0]).".jpg\"  width=\"100\" height=\"100\" border=\"0\" />\n";
							   $print.= "<br class=\"clear-all\" />\n";
						  }
						  $print.= "<label><input type=\"text\" name=\"title".$count."\" size=\"30\" value=\"".trim($exp[1])."\" class=\"input\" /></label>\n";
						  $print.= "<label>\n<input name=\"image".$count."\" type=\"file\" size=\"30\" class=\"input\" /></label>\n\n";
						  $print.= "<input type=\"hidden\" name=\"cid".$count."\" value=\"".trim($exp[0])."\" />\n";
						  $print.= "<br class=\"clear-all\" />\n";
					 }
				}
		   }

		   $print.= "<br class=\"clear-all\" />\n";
		   if($count < $iscon["image_slideshow"]){
			   $count=$count+1;
			   $print.= "<br class=\"clear-all\" />\n";
			   $print.= $count."NEW SLIDE\n";
			    for($i=$count; $i<=$iscon["image_slideshow"]; $i++){
					 $print.= "<label>".$i."<input type=\"text\" name=\"title".$i."\" size=\"30\" value=\"\" class=\"input\" /></label>\n";
					 $print.= "<label>\n<input name=\"image".$i."\" type=\"file\" size=\"30\" class=\"input\" /></label>\n\n";
					 $print.= "<input type=\"hidden\" name=\"cid".$i."\" value=\"\" />\n";
					 $print.= "<br class=\"clear-all\" />\n";
				}
		   }
		   $print.= "<input type=\"hidden\" name=\"total\" value=\"".$iscon["image_slideshow"]."\" />\n";
		   $print.= "<label><p><input type=\"submit\" name=\"submit\" value=\"Submit\" /> \n";
		   $print.= "<input type=\"button\" value=\"Cancel\" onclick=\"javascript:history.back();\" /></p>\n";
		   $print.= "</label>\n";

		   $print.= "</form>";
		   $print.= "<br class=\"clear-all\" />\n";
		   return $print;
     }
?>
Return current item: infoboard