Location: PHPKode > projects > infoboard > infoboard/index.php
<?
session_start(); 
include("./data/connect.php");
include("./data/_uconfig.php");
$iscon["boardsetting"] = $iscon["boardinfo"];
$iscon["langsetting"] = $iscon["getlang"];
include("./_class/lang.php");
include("./_class/lang_".$iscon["getlang"].".php");
include("./_class/_func.php");
include("./_class/class.global.php");
include("./_class/class.topic.php");
include("./_class/class.infoboard.php");
include("./_class/setting.php");
include("./_class/form.user.php");
include("./_class/formbanner.php");
include("./_class/formicon.php");

$infoboard = new showboard();
$isform = new infoboard();
$infoboard->getglobal();
$infoboard->checksess();
$infoboard->isconnect();

if($iscon["admin"]) $iscon["boardinfo"] = 0;


$gid=$infoboard->gid;
if(!$gid){
	 $gid = $infoboard->checkidgroup();
	 if(!$gid){
		 echo "Empty Group!";
		 exit();
	 }
}else{
	 $infoboard->checkgroupname($gid);
}

$iscon["gname"] = "";
if($infoboard->gname) $iscon["gname"] = $infoboard->gname;


if($infoboard->action == "topic"){
	 if($msg = $infoboard->checkpost($gid, $infoboard->gread)){
		  refback($msg);
	 }
}

$infoboard->stringurl();
$htm=$infoboard->htm;
$pnext=$infoboard->pnext;
$iscon["base_url"]=str_replace($_SERVER["DOCUMENT_ROOT"], "", dirname($_SERVER["PHP_SELF"]))."/"; 
if($iscon["base_url"] == "//") $iscon["base_url"]="/";

       $print= "";
	   $print.= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
	   $print.= "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
	   $print.= "<head>\n";
	   $print.= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
	   $print.= "<base href=\"http://".$_SERVER["HTTP_HOST"].$iscon["base_url"]."\" />\n";

	   $print.= "<meta name=\"keywords\" content=\"".$iscon["keywords"]." ,INFOBOARD 8, infoboard\" />\n";
	   $print.= "<meta name=\"description\" content=\"".$iscon["description"]."\" />\n";
	   $print.= "<title>\n";

		  switch($infoboard->action){
		  case"topic";
				$print.= $infoboard->titlequestion($gid, $htm);
		  break;
		  case"ins";
				$print.= $infoboard->titlequestion($gid, $htm);
		  break;
		  default;
		      $print.= $iscon["title"];
		  }

	   $print.= "</title>\n";
	   $print.= "<link href=\"./_css/style.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n";
	   $print.= "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"".$iscon["title"]."\" href=\"./xml.php?gid=".$gid."\" />\n";
	   $print.= "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./_js/prototype.js\"></script>\n";
	   $print.= "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./_js/html2xhtml.js\"></script>\n";
	   $print.= "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./_js/richtext_compressed.js\"></script>\n";
	   $print.= "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./_js/infoboard_".$iscon["getlang"].".js\"></script>\n";

	   $print.= "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./_js/picker.js\"></script>\n";
	   $print.= "<script language=\"javascript\">AC_FL_RunContent = 0;</script>\n";
	   $print.= "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./_js/AC_RunActiveContent_mo.js\"></script>\n";

	   $print.= "<script language=\"JavaScript\" type=\"text/javascript\">\n";
	   $print.= "function insertimg(id) {\n";
	   $print.= "url='http://".$_SERVER["HTTP_HOST"].$iscon["base_url"]."data/icon/i';\n";
	   $print.= "frames._detail.focus();\n";
	   $print.= "frames._detail.document.execCommand('InsertImage', false, url+id+'.gif');\n";
	   $print.= "}\n";
	   $print.= "</script>\n";
	   $print.= "<link href=\"./_js/picker.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
	   $print.= "</head>\n";
	   $onload="";
	   if($infoboard->action == "addnew"){
		    if($gid) $onload=" onload=\"groupid(".$gid.");\" ";
	  }
	   $print.= "<body ".$onload.">\n";
	   $print.= "<div id=\"header\">\n";
	   $print.= "<form name=\"issearch\"  id=\"issearch\" method=\"post\" action=\"./_req/search.php\" onSubmit=\"checksearch(this)\">";
	   $print.= "<div id=\"top_search\">";
	   $print.= "<div align=\"right\">";
	   if($iscon["showlang"] > 0){
		    $print.= "<a href=\"./_req/getlang.php?lang=th\"><img src=\"./_img/th.png\" alt=\"\" border=\"0\" /></a> ";
			$print.= " <a href=\"./_req/getlang.php?lang=en\"><img src=\"./_img/en.png\" alt=\"\" border=\"0\" /></a>";
			$print.= "<br />\n";
	   }
	   $print.= "<br />\n";
	   $print.= "Search : <input name=\"q\" type=\"text\" id=\"que\" size=\"15\" class=\"input\" />";
	   $print.= "</div>\n";
	   $print.= "</div>\n";
	   $print.= "</form>";
	   if(file_exists("./data/topbanner.dat")){
		    $ext = $infoboard->isread("./data/topbanner.dat");
			$topbanner = $infoboard->showimg("./data/", "topbanner", $ext, 1, "", "", 0, 0, 1);
	   }else{
		    $topbanner = "<img src=\"./_img/topbanner.png\" border=\"0\" />\n";
	   }
	   $print.= "<div id=\"colhead\">\n";
	   $print.= "<a  title=\"".$iscon["lang"][1]."\" href=\"./\">\n";
	   $print.= $topbanner;
	   $print.= "</a>\n";
	   $print.= "</div>\n";
	   $print.= "<div id=\"colhead2\">\n";
	   $print.= $infoboard->isread("./data/tophead.txt");
	   $print.= "</div>\n";
	   $print.= "</div>\n";
	   $print.= "<div id=\"menu\">\n";
	   $print.= "<ul>\n";
	   $print.= "<li><a  title=\"".$iscon["lang"][1]."\" href=\"./\" ";
	   if(!$infoboard->action) $print.= "class=\"first\"";
	   $print.= " >".$iscon["lang"][1]."</a></li>\n";
	   
	   if(($infoboard->action == "topic") || ($infoboard->action == "group")){
		     $print.= "<li><a  title=\"".$infoboard->gname."\" href=\"".$infoboard->txtmod()."group".$iscon["_s"].$gid.$iscon["_s"]."0".$iscon["_s"]."1".$infoboard->extmod()."\n";
			 $print.= "\" class=\"first\">".$iscon["lang"][8]."  ".$infoboard->gname."</a></li>\n";
	   }
	   if(!$iscon["boardinfo"]){
		    $print.= "<li><a  title=\"".$iscon["lang"][2]."\" href=\"".$infoboard->txtmod()."addnew".$iscon["_s"].$gid.$infoboard->extmod()."\" \n";
			if($infoboard->action == "addnew") $print.= "class=\"first\"";
			$print.= " >".$iscon["lang"][2]."</a></li>\n";
	   }
	   if(!$iscon["boardinfo"]){
		    if(!$iscon["idadmin"]){
				  $print.= "<li class=\"blank\">::::::::::::</li>\n";
				  if(!$iscon["user"]){
					   for($i=1;$i<=3; $i++){
						    $cnum = $i+2;
							$print.= "<li><a  title=\"".$iscon["lang"][$cnum]."\" href=\"javascript:infoboardtopcontent(".$i.");\" id=\"topuser".$i."\">";
							$print.= $iscon["lang"][$cnum]."</a></li>\n";
					   }
				 }
			}
	   }
	   $print.= "</ul>\n";
	   $print.= "<div id=\"usercontent\">";
	   if($iscon["user"]){
		    $print.= "<a href=\"".$infoboard->txtmod()."user".$iscon["_s"].$gid.$infoboard->extmod()."\">".$iscon["lang"][15]." : ".$iscon["user"]."</a>\n";
	   }else{
		    $print.= "<a href=\"".$infoboard->txtmod()."admin".$iscon["_s"].$gid.$infoboard->extmod()."\">".$iscon["lang"][91];
			if($iscon["admin"]) $print.= " : ".$iscon["admin"];
			$print.= "</a>\n";
	   }
	   $print.= "</div>\n";
	   $print.= "</div>\n";

	   $print.= "<div id=\"wrapper\">\n";
	   $print.= "<div class=\"btm\">\n";
	   $print.= "<div id=\"page\">\n";
	   if(!$infoboard->action){
		   if($iscon["showslide"]){
			   $print.= "<iframe src=\"./_req/slideshow.php\" frameborder=\"0\" width=\"".$iscon["slide_width"]."\"  ";
			   $print.= "scrolling=\"no\" height=\"".$iscon["slide_height"]."\"  wrap=\"physical\" border=\"0\"></iframe>\n";
		   }
		   $print.= $infoboard->showcoverbanner(1);
		   $print.= "<div id=\"firstcontent\">";
	   }else{
		   $print.= "<div id=\"content\">\n";
	   }

	   $print.= "<div class=\"txtbody\">\n";
	   $iscon["qlevel"] = $infoboard->qlevel;
	   $iscon["alevel"] = $infoboard->alevel;
	   $iscon["gread"] = $infoboard->gread;
	   $iscon["checkq"] = $infoboard->checkq;
	   $iscon["checka"] = $infoboard->checka;
	   $iscon["checkpic"] = $infoboard->checkpic;
	   $iscon["uppic"] = $infoboard->uppic;
	   
	   if(!$infoboard->action){
		   $print.= tabuser(1, $gid);
	   }else{
		   $print.= $infoboard->showbanner(4, "center");
	   }
		  switch($infoboard->action){
		  case"addnew";
		  $print.= $isform->switchform("", "", "", "", 1, $pnext);
		  break;
		  case"topic";
				 $print.= $infoboard->questiondetail($gid, $htm);
				 if($infoboard->checklevel($infoboard->alevel)) $print.= $isform->switchform($infoboard->qid, "", $htm, "", 2, $pnext);
		  break;
		  case"ins";
				 $idpage = $gid.$iscon["_s"].$htm.$iscon["_s"].$pnext;
				 if($infoboard->qid > 0) $req=3; else $req=4;
				 $print.= $infoboard->insertquestion($req, $idpage, $infoboard->qid, $infoboard->aid, $pnext);
				 $print.= $isform->switchform($infoboard->qid, $infoboard->aid, $htm, $infoboard->border, $req, $pnext);
				 $print.= "</div>\n"; 
		  break;
		  case"edit";
				 $idpage = $gid.$iscon["_s"].$htm.$iscon["_s"].$pnext;
				 $print.= $isform->editquestion($idpage, $infoboard->target, $infoboard->cid, $pnext);
		  break;
		  case"report";
		  $idpage = $gid.$iscon["_s"].$htm.$iscon["_s"].$pnext;
		  $print.= $infoboard->formreport($idpage);
		  break;
		  case"user";
		  $print.= $infoboard->formprofile();
		  break;
		  case"active";
				 if($infoboard->checkactive($infoboard->isuser, $infoboard->iscode)){
					   refurl($infoboard->isuser." Active Code", "./");
				 }else{
					   refurl("Cannot Active Code", "./");
				 }
		  break;
		  case"forget";
				 if(!$infoboard->checkmailforget($infoboard->isuser, $infoboard->iscode)){
					  refurl("Cannot Forget", "./");
				 }
		  break;
		  case"egroup";
			 $print.= $infoboard->egroupform($iscon["idadmin"]);
		  break;
		  case"config";
			 $print.= formsetting($iscon["idadmin"]);
		  break;
		  case"topbanner";
			 $print.= topbanner($topbanner);
		  break;
		  case"banner";
			 $print.= formbanner();
		  break;
		  case"blockad";
			 $print.= formblockad();
		  break;
		  case"slideshow";
			 $print.= formslideshow();
		  break;
		  case"icon";
		     $iconcount=$infoboard->isread("./data/icon.dat");
			 $print.= formicon($iconcount);
		  break;
		  case"member";
			 $print.= $infoboard->listuser();
		  break;
		  case"blockuser";
			 $print.= $infoboard->listblockuser();
		  break;
		  case"admin";
			 $print.= $infoboard->listadmin();
		  break;
		  case"proof";
			 $print.= $infoboard->checkproof();
		  break;
		  case"pic";
			 $print.= $infoboard->checkpicproof();
		  break;
		  case"group";
			 $print.= $infoboard->groupid(1);
			 $print.= $infoboard->groupid(0);
		  break;
		  case"search";
		  if($infoboard->isexp[2]){
			    $dirsearch = "./data/search/";
				if(isset($iscon["friendly"])) $getfriendly = $iscon["friendly"]; else $getfriendly=false;
				$qry =$infoboard->isexp[2];
				if ($qry){
					  $dir_depth=0;
					  $cur_path = array($dirsearch);
					  $results  = array("");
					  $topic  = array("");
					  $matches=0;
					  $qry=strtolower($qry);
					  if (strcmp($qry, "")!=0) search_dir();
					  for ($a=0; $a<$matches; $a++) {
						    $idnum = eregi_replace($dirsearch,"",$results[$a]); 
							$idnum = eregi_replace(".txt","",$idnum); 
							$idnum = eregi_replace("cache","",$idnum); 
							$idnum = eregi_replace("\.",$iscon["_s"],$idnum); 
							if($getfriendly) {
								 $gettitle = $infoboard->urlfriendly($topic[$a]);
							}else{
								 $gettitle = "";
							}
							$showtopic[] = "<a href=\"".$infoboard->txtmod()."topic".$idnum.$gettitle.$infoboard->extmod()."\" class=\"htopic\">".$topic[$a]."</a><br />".$detail[$a]."<br /><hr size=\"1\" />";
					  }
					  if ($matches){
						     for ($i = 0 ; $i < $matches ; $i++) {
								 $print.= $showtopic[$i]."<br />" ; 
							}
					  }else{
						   $print.= "Your search - <u>".$infoboard->isexp[2]."</u> - did not match any documents. ";
					  }
				}
		  }
		  break;
		  default;
			 $print.= $infoboard->isread("./data/home.txt");
			 if($iscon["show_lastpost"]) $print.= $infoboard->firstupdate();
			 $print.= $infoboard->first();
		  }
	   $print.= "</div>\n";
	   $print.= "</div>\n";

if($infoboard->action){
	   $print.= "<div id=\"sidebar\">\n";
	   $print.= "<img src=\"./_img/v8s.png\" alt=\"\" width=\"199\" height=\"40\" />\n";
	   $print.= "<ul>\n";
	   $print.= "<li>\n";
	   if(!$iscon["idadmin"]) $print.= tabuser("", $gid);
	   $print.= "</li>\n";
	   $print.= "</ul>\n";
	   $print.= $infoboard->sideuser($gid);
	   $print.= $infoboard->sideadmin($gid);

	   $print.= "<div style=\"clear: both;\">&nbsp;</div>\n";
	   
	   if($infoboard->action){
		    $print.= $infoboard->sidegroup();
			if($infoboard->action != "group") $print.= $infoboard->sidetopic();
	  }
       $print.= $infoboard->showbanner(3, "center");
	   $print.= "</div>\n";

}

	   $print.= "<div style=\"clear: both;\">&nbsp;</div>\n";
	   $print.= "<br class=\"clear-all\">\n";
	   $print.= "<div style=\"clear: both;\">&nbsp;</div>\n";
	   $print.= "</div>\n";
	   $print.= "</div>\n";
	   $print.= "</div>\n";
	   $print.= "<div id=\"footer\">\n";
	   $print.= $infoboard->showbanner(2, "center");
	   $print.= "<div align=\"center\">\n";
	   $print.= "<a href=\"xml.php?gid=".$gid."\"><img src=\"_img/rss2_button.gif\" alt=\"FEED\" width=\"80\" height=\"15\" border=\"0\" /></a>\n";
	   $print.= " &nbsp; \n";
	   $print.= "<a href=\"http://cannot.info\"><img src=\"_img/button_cannotinfo1.png\" alt=\"CANNOT.INFO\" width=\"80\" height=\"15\" border=\"0\" /></a>\n";
	   $print.= " &nbsp; \n";
	   $print.= "<a href=\"#\"><img src=\"_img/button_css.png\" alt=\"CSS\" width=\"80\" height=\"15\" border=\"0\" /></a>\n";
	   $print.= "</div>\n";
	   $print.= "<br />\n";
	   $print.= "<p>".$iscon["copyright"]."</p>\n";
	   $print.= $infoboard->checkon("./data/on.dat");
	   $print.= "</div>\n";
	   $print.= "</body>\n";
	   $print.= "</html>\n";
	   $infoboard->isclose();
	   echo $print;

?>
Return current item: infoboard