Location: PHPKode > projects > infoboard > infoboard/_class/setting.php
<?
	 function formsetting($idadmin){
		   global $iscon;
		   global $infoboard;
		   if(!$iscon["idadmin"]) return $infoboard->formadmin();
		   $print="";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div id=\"tabgroup\"><strong>".$iscon["lang"][92]."</strong></div>\n";
		   $print.= "<br class=\"clear-all\" />\n";

		   $print.= "<form name=\"setting\" action=\"./_req/savesetting.php\" method=\"post\">";
		   $print.= "<div id=\"col_l\">\n";

		   $print.= "<div class=\"textform\">".$iscon["lang"][16]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"website\" size=\"30\" value=\"".$iscon["website"]."\" class=\"input\" /></label>\n";
		   $print.= "<div class=\"textform\">".$iscon["lang"][70]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"title\" size=\"30\" value=\"".$iscon["title"]."\" class=\"input\" /></label>\n";
		   $print.= "<div class=\"textform\">&nbsp;</div>\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["boardsetting"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= $iscon["lang"][28]." <input name=\"boardinfo\" type=\"radio\" value=\"0\" ".$checked." /> ".$iscon["lang"][44]." / ".$iscon["lang"][45]." \n";

		   if($iscon["boardsetting"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"boardinfo\" type=\"radio\" value=\"1\" ".$checked." />".$iscon["lang"][71]." \n";
		   $print.= "</div>\n";

		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div class=\"textform\">".$iscon["lang"][73]."</div>\n";
		   $print.= "<label><textarea name=\"keywords\" cols=\"40\" rows=\"4\" class=\"input\">".$iscon["keywords"]."</textarea></label>\n";
		   $print.= "</div>\n";
		   $print.= "<div id=\"col_r\">\n";
		   $print.= "<div class=\"textform\">".$iscon["lang"][69]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"fullpath\" size=\"30\" value=\"".$iscon["fullpath"]."\" class=\"input\" /></label>\n";
		   $print.= "<div class=\"textform\">".$iscon["lang"][12]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"mailmaster\" size=\"30\" value=\"".$iscon["mailmaster"]."\" class=\"input\" /></label>\n";
		   $print.= "<div class=\"textform\">".$iscon["lang"][72]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"copyright\" size=\"30\" value=\"".$iscon["copyright"]."\" class=\"input\" /></label>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div class=\"textform\">".$iscon["lang"][74]."</div>\n";
		   $print.= "<label><textarea name=\"description\" cols=\"40\" rows=\"4\" class=\"input\">".$iscon["description"]."</textarea></label>\n";
		   $print.= "</div>\n";
		   $print.= "<div style=\"clear: both;\">&nbsp;</div>\n";

		   $fileext = $iscon["fileext"];
               $ext="";
			   for($i=0; $i<count($fileext); $i++){
				    if($i == count($fileext)-1){
						 $ext.= trim($fileext[$i]);
					}else{
						 $ext.= trim($fileext[$i]).",";
					}
			   }

		   $print.= "<div class=\"textform\">".$iscon["lang"][27]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"fileext\" size=\"70\" value=\"".$ext."\" class=\"input\" /></label>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $word = $iscon["badword"];
               $badword="";
			   for($i=0; $i<count($word); $i++){
				    if($i == count($word)-1){
						 $badword.= trim($word[$i]);
					}else{
						 $badword.= trim($word[$i]).",";
					}
			   }

		   $print.= "<div class=\"textform\">".$iscon["lang"][75]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"badword\" size=\"70\" value=\"".$badword."\" class=\"input\" /></label>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   
		   $keepregister = $iscon["keepregister"];
               $keepreq="";
			   for($i=0; $i<count($keepregister); $i++){
				    if($i == count($keepregister)-1){
						 $keepreq.= trim($keepregister[$i]);
					}else{
						 $keepreq.= trim($keepregister[$i]).",";
					}
			   }

		   $print.= "<div class=\"textform\">".$iscon["lang"][76]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"keepregister\" size=\"70\" value=\"".$keepreq."\" class=\"input\" /></label>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div class=\"textform\">".$iscon["lang"][37]."</div>\n";
		   $print.= "<label><input type=\"text\" name=\"maxsize\" size=\"15\" value=\"".$iscon["maxsize"]."\" class=\"input\" /> ( <strong>".$infoboard->img2bytes($iscon["maxsize"])."</strong>)</label>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div class=\"textform\">\n";
		   $print.= " ".$iscon["lang"][77]." <input type=\"text\" name=\"showtopic\" size=\"3\" value=\"".$iscon["showtopic"]."\" class=\"input\" /> ".$iscon["lang"][78]." \n";
		   $print.= "&nbsp; &nbsp; ".$iscon["lang"][79]." <select name=\"target\" class=\"input\">\n";
		   if($iscon["target"] == "_blank") $selected=" selected=\"selected\" "; else $selected=""; 
		   $print.= "<option value=\"_blank\" ".$selected.">_blank</option>\n";
		   if($iscon["target"] == "_self") $selected=" selected=\"selected\" "; else $selected=""; 
		   $print.= "<option value=\"_self\" ".$selected.">_self</option>\n";
		   $print.= "</select>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "Right Topic <input type=\"text\" name=\"righttopic\" size=\"3\" value=\"".$iscon["righttopic"]."\" class=\"input\" /> item \n";
		   $print.= "&nbsp; &nbsp; Right Word <input type=\"text\" name=\"numright\" size=\"3\" value=\"".$iscon["numright"]."\" class=\"input\" /> character \n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= $iscon["lang"][82]." <input type=\"text\" name=\"showreply\" size=\"3\" value=\"".$iscon["showreply"]."\" class=\"input\" />\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "</div>\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["imgnew"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= $iscon["lang"][147]." <input name=\"imgnew\" type=\"radio\" value=\"0\" ".$checked." /> OFF \n";

		   if($iscon["imgnew"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"imgnew\" type=\"radio\" value=\"1\" ".$checked." /> ON \n";
		   $print.= "</div>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div class=\"textform\">\n";
		   $print.= $iscon["lang"][83]."  <input type=\"text\" name=\"imghot\" size=\"3\" value=\"".$iscon["imghot"]."\" class=\"input\" />\n";
		   $print.= "&nbsp; &nbsp; ".$iscon["lang"][84]." <input type=\"text\" name=\"imgcool\" size=\"3\" value=\"".$iscon["imgcool"]."\" class=\"input\" />\n";
		   $print.= "</div>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["showfont"] > 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= $iscon["lang"][90]." <input name=\"showfont\" type=\"checkbox\" value=\"1\" ".$checked."/> Font ";
		   if($iscon["showInsertImage"] > 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"showInsertImage\" type=\"checkbox\" value=\"1\"".$checked." /> Image \n";

		   if($iscon["showtable"] > 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"showtable\" type=\"checkbox\" value=\"1\" ".$checked."/> Table \n";

		   if($iscon["showcode"] > 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"showcode\" type=\"checkbox\" value=\"1\"".$checked." /> Code \n";
		   $print.= "</div>\n";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["urlmod"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "Mod Rewrite <input name=\"urlmod\" type=\"radio\" value=\"0\" ".$checked." onclick=\"showmod(0);\"  /> OFF \n";
		   if($iscon["urlmod"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"urlmod\" type=\"radio\" value=\"1\" ".$checked." onclick=\"showmod(1);\" /> ON \n";

		   $print.= "&nbsp; &nbsp; Separate <select name=\"separate\" class=\"input\">\n";
		   if($iscon["_s"] == ".") $selected=" selected=\"selected\" "; else $selected=""; 
		   $print.= "<option value=\".\" ".$selected.">.</option>\n";
		   
		   if($iscon["_s"] == "/") $selected=" selected=\"selected\" "; else $selected=""; 
		   $print.= "<option value=\"/\" ".$selected.">/</option>\n";
		   $print.= "</select>\n";
		   if(isset($iscon["friendly"])) $getfriendly = $iscon["friendly"]; else $getfriendly=false;

		   if(!$getfriendly) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "&nbsp; &nbsp; Friendly URL <input name=\"friendly\" type=\"radio\" value=\"false\" ".$checked." /> OFF \n";

		   if($getfriendly) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"friendly\" type=\"radio\" value=\"true\" ".$checked." /> ON \n";
		   $print.= "</div>\n";
		   $print.= "<div id=\"showmod\" ";
		   if($iscon["urlmod"] == 0) $print.= "style=\"display:none\"";
		   $print.= ">\n";
		   $print.= "<label><textarea name=\"htcode\" cols=\"90\" rows=\"13\" class=\"input\" style=\"font-size:10px;\" >";
		   $print.= "Options +FollowSymLinks -Indexes\n";
		   $print.= "RewriteEngine on\n";
		   $print.= "RewriteBase ".$iscon["base_url"]."\n";
		   $print.= "RewriteRule ^infoboard/([^/]*).([0-9]+).html$ ./?infoboard=$1.$2 [L]\n";
		   $print.= "RewriteRule ^infoboard/([^/]*).([0-9]+).([^/]*).html$ ./?infoboard=$1.$2.$3 [L]\n";
		   $print.= "RewriteRule ^infoboard/([^/]*).([0-9]+).([0-9]+).([0-9]+).html$ ./?infoboard=$1.$2.$3.$4 [L]\n";
		   $print.= "RewriteRule ^infoboard/([^/?]*)/([^/]*)$ ./?infoboard=$1/$2 [L]\n";
		   $print.= "RewriteRule ^infoboard/([^/?]*)/([^/]*)/([^/]*)$ ./?infoboard=$1/$2/$3 [L]\n";
		   $print.= "RewriteRule ^infoboard/([^/?]*)/([0-9]+)/([0-9]+)/([0-9]+)$ ./?infoboard=$1/$2/$3/$4 [L]\n";
		   $print.= "RewriteRule ^infoboard/([^/?]*)/([0-9]+)/([0-9]+)/([0-9]+)/([^/]*)$ ./?infoboard=$1/$2/$3/$4/$5 [L]\n";
		   $print.= "RewriteRule ^^infoboard/(.*)$ ./?infoboard=$1 [L]\n";
		   $print.= "AddDefaultCharset UTF-8\n";
		   $print.= "DirectoryIndex index.php index.html default.htm default.php index.php3\n";
		   $print.= "</textarea></label>\n";
		   $print.= "</div>\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["showlevel"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= $iscon["lang"][85]." <input name=\"showlevel\" type=\"radio\" value=\"0\" ".$checked." /> OFF \n";
		   if($iscon["showlevel"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"showlevel\" type=\"radio\" value=\"1\" ".$checked." /> ON \n";
		   $print.= "</div>\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["lockuser"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= $iscon["lang"][86]." <input name=\"lockuser\" type=\"radio\" value=\"0\" ".$checked." /> OFF \n";

		   if($iscon["lockuser"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"lockuser\" type=\"radio\" value=\"1\" ".$checked." /> ON \n";
		   $print.= "</div>\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["stamppic"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= $iscon["lang"][87]." <input name=\"stamppic\" type=\"radio\" value=\"0\" ".$checked." /> OFF \n";
		   if($iscon["stamppic"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"stamppic\" type=\"radio\" value=\"1\" ".$checked." /> ON \n";
		   $print.= " &nbsp; &nbsp;  ".$iscon["lang"][89]." <input type=\"text\" name=\"textstamp\" size=\"15\" value=\"".$iscon["textstamp"]."\" class=\"input\" />\n";
		   $print.= "</div>\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["showip"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= $iscon["lang"][88]." <input name=\"showip\" type=\"radio\" value=\"0\" ".$checked." /> OFF \n";
		   if($iscon["showip"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"showip\" type=\"radio\" value=\"1\" ".$checked." /> ON \n";
		   $print.= "</div>\n";
		   $print.= "<div class=\"textform\">\n";
		   if($iscon["useronline"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "User Online <input name=\"useronline\" type=\"radio\" value=\"0\" ".$checked." /> OFF \n";

		   if($iscon["useronline"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"useronline\" type=\"radio\" value=\"1\" ".$checked." /> ON \n";
		   $print.= "</div>\n";

		   $print.= "<div class=\"textform\">\n";
		   if($iscon["showlang"] == 0) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "Show Language <input name=\"showlang\" type=\"radio\" value=\"0\" ".$checked." /> OFF \n";

		   if($iscon["showlang"] == 1) $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"showlang\" type=\"radio\" value=\"1\" ".$checked." /> ON \n";
		   $print.= "</div>\n";

		   $print.= "<div class=\"textform\">\n";
		   if($iscon["langsetting"] == "th") $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "Language <input name=\"getlang\" type=\"radio\" value=\"th\" ".$checked." /> THAI \n";

		   if($iscon["langsetting"] == "en") $checked=" checked=\"checked\" "; else $checked=""; 
		   $print.= "<input name=\"getlang\" type=\"radio\" value=\"en\" ".$checked." /> ENG \n";
		   $print.= "</div>\n";
		  $print.= "<div style=\"clear: both;\">&nbsp;</div>\n"; 
		   $print.= "<div id=\"col_l\">\n";
		   $print.= "</div>\n";
		   $print.= "<div id=\"col_r\">\n";
		   $print.= "</div>\n";
		   $print.= "<div style=\"clear: both;\">&nbsp;</div>\n";
		   if(!$idadmin) $disabled = " disabled=\"disabled\" "; else $disabled="";

		   $print.= "<p><input type=\"submit\" name=\"submit\" value=\"Submit\" ".$disabled." /> \n";
		   $print.= "<input type=\"button\" value=\"Cancel\" onclick=\"javascript:history.back();\" /></p>\n";
		   $print.= "</form>";
		   $print.= "<br class=\"clear-all\" />\n";
		   $print.= "<br class=\"clear-all\" />\n";

		   return $print;
     }
?>  
Return current item: infoboard