[php_everywhere]
include(“includes/inc.php”);
$navbar1 = ” “;
$navbar2 = ” “;
$navbar3 = ” “;
$tables1 = ”
“; $tables2 = “ |
“; $tables3 = “ |
“; $tables4 = “ |
“;
$action = $_GET[‘s’];
if(!isset($action)) $action = “home”;
IF ($action==”home”){
tpl_header($namesite);
$numblock = mysql_num_rows(mysql_query(“SELECT * FROM book_blocks where active=’1′ AND place !=’3′ AND lang=’$defaultlang'”));
if($numblock == 0){
if($allowtabs ==1){
echo ‘
var tabber1 = new Yetii({ id: "demo" });
‘;
}
//echo langloop();
blocks(3);
}else{
echo $tables1;
blocks(1);
echo $tables2;
if($allowtabs ==1){
echo ‘
var tabber1 = new Yetii({ id: "demo" });
‘;
}
//echo langloop();
blocks(3);
echo $tables3;
blocks(2);
echo $tables4;
}
tpl_footer();
}ELSEIF ($action==”book”){
$id = intval($_GET[“id”]);
$id = clean_value($id);
$Sql = mysql_query(“select * from book_books where id=’$id’ AND active=’1′”);
$Row = mysql_fetch_array($Sql);
if (!$Row)
{
error();
exit;
}
$sql2 = mysql_query(“update book_books set vis=vis+1 where id=’$id’ AND active=’1′”) or die (“Query failed”);
$ttitle = text_select_html_off($Row[‘name’]);
$Row[‘image’] = text_select_html_off($Row[‘image’]);
$m1 = text_select_html_off($Row[‘m1’]);
$m2 = text_select_html_off($Row[‘m2’]);
$Row[‘editor’] = text_select_html_off($Row[‘editor’]);
$Row[‘translator’] = text_select_html_off($Row[‘translator’]);
$Row[‘auditor’] = text_select_html_off($Row[‘auditor’]);
$Row[‘publisher’] = text_select_html_off($Row[‘publisher’]);
$text = stripslashes($Row[‘text’]);
$d = date(“j/n/Y”,$Row[‘date’]);
$short = nl2br($m1);
if($Row[‘image’]==””){
$igg1 = “”;
}else{
$igg1 = ”
$lang[77]
“;
}
if($Row[‘editor’]==””){
$igg2 = “”;
}else{
$igg2 = ”
$lang[78]”.$Row[‘editor’].”
“;
}
if($Row[‘translator’]==””){
$igg3 = “”;
}else{
$igg3 = ”
$lang[79]”.$Row[‘translator’].”
“;
}
if($Row[‘auditor’]==””){
$igg4 = “”;
}else{
$igg5 = ”
$lang[80]”.$Row[‘auditor’].”
“;
}
if($Row[‘publisher’]==””){
$igg5 = “”;
}else{
$igg5 = ”
$lang[81]”.$Row[‘publisher’].”
“;
}
if($Row[‘text’]==””){
$igg6 = “”;
}else{
$igg6 = ”
$lang[83]”.$text.”
“;
}
///////////**** start show attach ****///////////
$queryxs = mysql_query(“SELECT * FROM book_attachment where textid=’$id’ AND active=1 order by id desc”);
$xxs = mysql_num_rows($queryxs);
if($xxs == 0){
$ggs = $lang[109];
}else{
$ggs = ”
“;while($p = mysql_fetch_array($queryxs)){$p[‘name’] = text_select_html_off($p[‘name’]);$p[‘url’] = text_select_html_off($p[‘url’]);$file_url = explode(“/”,$p[‘url’]);
$file_name_only = $file_url[count($file_url)-1];
$pathok = “$folderbooks/$file_name_only”;if($urlfiles==1){
$rrr = $p[‘url’];
}else{if (file_exists($pathok))
{
if ($htmlorphp==”1″){
$g = “download-“.$p[‘id’].”.html”;
}else{
$g = “index.php?s=download&id=”.$p[‘id’].””;
}
$rrr = $g;
}else{
$rrr = $p[‘url’];
}$ggs .= “”;
}}$ggs .= ”
“.typefile($p[‘url’],$p[‘name’]).” | “.$p[‘name’].” |
“;
}
///////////**** start show attach ****///////////
// start cat
$Sqlx = mysql_query(“select id,name from book_catgory where id=’$Row[cat]'”);
$Rowx = mysql_fetch_array($Sqlx);
$Rowx[‘name’] = text_select_html_off($Rowx[‘name’]);
if ($htmlorphp==”1″){
$lcat = ““.$Rowx[‘name’].”“;
}else{
$lcat = ““.$Rowx[‘name’].”“;
}
// end cat
///////////**********///////////
if($Row[‘image’]==””){
$igg1x = “”;
}else{
$igg1x = ”
“;
}
if($Row[‘editor’]==””){
$igg2x = “”;
}else{
$igg2x = “$lang[78] “.$Row[‘editor’].”
“;
}
if($Row[‘translator’]==””){
$igg3x = “”;
}else{
$igg3x = “$lang[79] “.$Row[‘translator’].”
“;
}
if($Row[‘auditor’]==””){
$igg4x = “”;
}else{
$igg5x = “$lang[80] “.$Row[‘auditor’].”
“;
}
if($Row[‘publisher’]==””){
$igg5x = “”;
}else{
$igg5x = “$lang[81] “.$Row[‘publisher’].”
“;
}
if($Row[‘text’]==””){
$igg6x = “”;
}else{
$igg6x = ”
“;
}
$ggx = ”
$igg6x”;
/////////****************////////
$gg = ”
$igg1
$igg2
$igg3
$igg4
$igg5$igg6
$lang[76] | “.$Row[‘name’].” |
“.$lcat.” | |
$lang[49] | “.$d.” |
$lang[48] | “.$Row[‘vis’].” |
$lang[19] | “.$short.” |
$lang[20] | “.$Row[‘m2’].” |
$lang[110] ($xxs) : | “.$ggs.” |
*** |
“;
tpl_header($ttitle);
//echo $tables1;
//blocks(1);
//echo $tables2;
tpl_table($ttitle,$ggx);
//echo $tables3;
//blocks(2);
//echo $tables4;
tpl_footer();
}ELSEIF ($action==”category”){
$id = intval($_GET[“id”]);
$id = clean_value($id);
$Sql = mysql_query(“select * from book_catgory where id=’$id’ AND active=’1′”);
$Row = mysql_fetch_array($Sql);
if (!$Row)
{
error();
exit;
}
$Row[‘name’] = text_select_html_off($Row[‘name’]);
$m1 = text_select_html_off($Row[‘m1’]);
$m2 = text_select_html_off($Row[‘m2′]);
$consub = mysql_num_rows(mysql_query(“SELECT * FROM book_catgory where active=’1′ AND sub=’$id'”));
$conbook = mysql_num_rows(mysql_query(“SELECT * FROM book_books where active=’1’ AND cat=’$id'”));
tpl_header($Row[‘name’]);
//echo $tables1;
//blocks(1);
//echo $tables2;
if($consub > 0){
tpl_table($lang[175].$Row[‘name’],catloop($catsloop,$id));
echo ”
“;
}
if($conbook > 0){
tpl_table($Row[‘name’],booksincategory($limitbookincate,$id,$langid));
}
if($consub==0 AND $conbook==0){
tpl_table($Row[‘name’],booksincategory($limitbookincate,$id,$langid));
}
//echo $tables3;
//blocks(2);
//echo $tables4;
tpl_footer();
}ELSEIF ($action==”page”){
$id = intval($_GET[“id”]);
This blurs his odds not just to have suggested minutes with his female accomplice additionally discolor the desire to begin Learn More viagra on line a family.
$id = clean_value($id);
$Sql = mysql_query(“select * from book_pages where id=’$id’ AND active=’1′”);
$Row = mysql_fetch_array($Sql);
if (!$Row)
{
error();
exit;
}
$Row[‘name’] = text_select_html_off($Row[‘name’]);
$m1 = text_select_html_off($Row[‘m1’]);
$m2 = text_select_html_off($Row[‘m2’]);
$Row[‘text’] = stripslashes($Row[‘text’]);
$Row[‘text’] = str_replace(“{lastbook}”,books($limitbookinmenu,1,$langid),$Row[‘text’]);
$Row[‘text’] = str_replace(“{oldbook}”,books($limitbookinmenu,2,$langid),$Row[‘text’]);
$Row[‘text’] = str_replace(“{bookvisitor}”,books($limitbookinmenu,3,$langid),$Row[‘text’]);
$Row[‘text’] = str_replace(“{cat}”,categorymenu(),$Row[‘text’]);
$Row[‘text’] = str_replace(“{poll}”,pollx(),$Row[‘text’]);
$Row[‘text’] = str_replace(“{category}”,catloop($catsloop,0),$Row[‘text’]);
$d = date(“j/n/Y”,$Row[‘date’]);
$sql2 = mysql_query(“update book_pages set vis=vis+1 where id=’$id’ AND active=’1′”) or die (“Query failed”);
tpl_header($Row[‘name’]);
tpl_table($Row[‘name’],$Row[‘text’]);
tpl_footer();
}ELSEIF ($action==”poll”){
tpl_header($lang[205]);
tpl_table($lang[205],poll($idpoll));
$sqlc = mysql_query(“select * from book_poll where id != ‘$idpoll’ AND active=’1′”);
if(mysql_num_rows($sqlc) != 0){
tpl_table($lang[205],allpoll());
}
tpl_footer();
}ELSEIF ($action==”pollshow”){
$id = intval($_GET[“id”]);
$id = clean_value($id);
$sql = @mysql_query(“select * from book_poll where id=’$id’ AND active=’1′”);
$Row = @mysql_fetch_array($sql);
if (!$Row)
{
error();
exit;
}
$Row[‘name’] = text_select_html_off($Row[‘name’]);
$Row[‘a1’] = text_select_html_off($Row[‘a1’]);
$Row[‘a2’] = text_select_html_off($Row[‘a2’]);
$Row[‘a3’] = text_select_html_off($Row[‘a3’]);
tpl_header($Row[‘name’]);
tpl_table($lang[205],poll($id));
tpl_footer();
}ELSEIF ($action==”vote”){
$xxx = intval($_POST[‘xxx’]);
if($xxx==0){
$id = intval($idpoll);
}else{
$id = intval($xxx);
}
$answers = addslashes($_POST[‘answer’]);
$datex = time();
$timenow = time()+$pollbetween;
$iip = $_SERVER[‘REMOTE_ADDR’];
$sqldlelte = mysql_query(“delete from book_ips where date < ‘$datex’ AND cat=’0′”);
$sql = mysql_query(“select * from book_ips where ipx=’$iip’ AND pollid=’$id’ AND cat=’0′”);
if(mysql_num_rows($sql)==0){
$sqlx = mysql_query(“insert into book_ips SET ipx=’$iip’, date=’$timenow’,cat=’0′,pollid=’$id'”);
if ($answers == “vote1”){
$update = mysql_query(“UPDATE book_poll SET v1=v1+1 where id=’$id'”);
}elseif ($answers == “vote2”){
$update = mysql_query(“UPDATE book_poll SET v2=v2+1 where id=’$id'”);
}elseif ($answers == “vote3”){
$update = mysql_query(“UPDATE book_poll SET v3=v3+1 where id=’$id'”);
}
if ($update){
$x = $lang[202];
$x .= “”;
}else{
$x = $lang[203];
}
}else{
$x = $lang[204];
}
tpl_header($lang[201]);
tpl_table($lang[201],$x);
tpl_footer();
}ELSEIF ($action==”search”){
if ($htmlorphp==”1″){
$y = “result.html”;
}else{
$y = “index.php?s=result”;
}
$bbbb = ”
“;
tpl_header($lang[177]);
tpl_table($lang[177],$bbbb);
tpl_footer();
}ELSEIF ($action==”result”){
$text = $_POST[‘textsearch’];
$text = trim($text);
$text = mysql_real_escape_string($text);
$text = addslashes($text);
$ppp = $_POST[‘searchplace’];
$ppp = mysql_real_escape_string($ppp);
if(isset($text) and !empty($text) and strlen($text)>=$wordinsearch1 and strlen($text)<=$wordinsearch2)
{
//insert word start
$num = mysql_query(“select * from book_search where name=’$text'”);
$refnumber = mysql_num_rows($num);
if($refnumber == 0){
$sqlr = mysql_query(“insert into book_search SET name=’$text’, counter=’1′, date='”.time().”‘”);
}else{
$updater = mysql_query(“update book_search set counter=counter+1 where name=’$text'”);
}
//end insert word
$sqlxx = mysql_query(“SELECT id,name FROM `book_search` WHERE BINARY `name` LIKE ‘%$text%’ LIMIT 1”)or die(“ERROR”);
$Rowxx = mysql_fetch_array($sqlxx);
$tx = $lang[219];
$page = (int) (!isset($_GET[“page”]) ? 1 : $_GET[“page”]);
$page = ($page == 0 ? 1 : $page);
$perpage = $limitresultsearch;
$startpoint = ($page * $perpage) – $perpage;
if($ppp==”q”){
$sql = mysql_query(“SELECT id,name,active,editor FROM `book_books` WHERE BINARY `name` LIKE ‘%$text%’ AND active=1 order by id desc LIMIT $startpoint,$perpage”)or die(“ERROR”);
$num = mysql_num_rows($sql);
if($num == 0){
$msg = $lang[217];
}else{
$msg = ”
“;
$c = 1;
while ($Row = mysql_fetch_array($sql))
{
$Row[name] = str_replace(“$text”,”$text“,$Row[name]);$Row[name] = stripslashes($Row[name]);
//$Row[name] = htmlspecialchars($Row[name]);$Row[‘editor’] = text_select_html_off($Row[‘editor’]);if ($htmlorphp==”1”){
$links = “book-$Row[id].html”;
}else{
$links = “index.php?s=book&id=$Row[id]”;
}$msg .= “”;
$c++;
}$msg .= ”
# | “.$lang[218].” | “.$lang[174].” |
$c | » $Row[name] | “.$Row[‘editor’].” |
“;
}
}elseif($ppp==”a”){
$sql = mysql_query(“SELECT id,name,editor FROM `book_books` WHERE BINARY `editor` LIKE ‘%$text%’ AND active=’1′ order by id desc LIMIT $startpoint,$perpage”)or die(mysql_error());
$num = mysql_num_rows($sql);
if($num == 0){
$msg = $lang[217];
}else{
$msg = ”
“;
$c = 1;
while ($Row = mysql_fetch_array($sql))
{
$Row[‘name’] = text_select_html_off($Row[‘name’]);
$Row[‘editor’] = text_select_html_off($Row[‘editor’]);if ($htmlorphp==”1”){
$links = “book-$Row[id].html”;
}else{
$links = “index.php?s=book&id=$Row[id]”;
}$msg .= “”;
$c++;
}$msg .= ”
# | “.$lang[218].” | “.$lang[174].” |
$c | » “.$Row[‘name’].” | “.$Row[‘editor’].” |
“;
}
}elseif($ppp==”n”){
$sql = mysql_query(“SELECT id,name,active,m1,editor FROM `book_books` WHERE BINARY `m1` LIKE ‘%$text%’ AND active=1 order by id desc LIMIT $startpoint,$perpage”)or die(“ERROR”);
$num = mysql_num_rows($sql);
if($num == 0){
$msg = $lang[217];
}else{
$msg = ”
“;
$c = 1;
while ($Row = mysql_fetch_array($sql))
{
$Row[name] = str_replace(“$text”,”$text“,$Row[name]);$Row[name] = stripslashes($Row[name]);
//$Row[name] = htmlspecialchars($Row[name]);$Row[‘editor’] = text_select_html_off($Row[‘editor’]);if ($htmlorphp==”1”){
$links = “book-$Row[id].html”;
}else{
$links = “index.php?s=book&id=$Row[id]”;
}$msg .= “”;
$c++;
}$msg .= ”
# | “.$lang[218].” | “.$lang[174].” |
$c | » $Row[name] | “.$Row[‘editor’].” |
“;
}
}elseif($ppp==”t”){
$sql = mysql_query(“SELECT id,name,active,text,editor FROM `book_books` WHERE BINARY `text` LIKE ‘%$text%’ AND active=1 order by id desc LIMIT $startpoint,$perpage”)or die(“ERROR”);
$num = mysql_num_rows($sql);
if($num == 0){
$msg = $lang[217];
}else{
$msg = ”
“;
$c = 1;
while ($Row = mysql_fetch_array($sql))
{
$Row[name] = str_replace(“$text”,”$text“,$Row[name]);$Row[name] = stripslashes($Row[name]);
//$Row[name] = htmlspecialchars($Row[name]);$Row[‘editor’] = text_select_html_off($Row[‘editor’]);if ($htmlorphp==”1”){
$links = “book-$Row[id].html”;
}else{
$links = “index.php?s=book&id=$Row[id]”;
}$msg .= “”;
$c++;
}$msg .= ”
# | “.$lang[218].” | “.$lang[174].” |
* | » $Row[name] | “.$Row[‘editor’].” |
“;
}
}else{
$msg = $lang[220];
}
}else{
$tx = $lang[201];
$msg .= $lang[221];
}
tpl_header($lang[222]);
tpl_table($tx,$msg);
tpl_footer();
}ELSEIF ($action==”download”){
$id = intval($_GET[“id”]);
clean_value($id);
$Sql = mysql_query(“select * from book_attachment where id=$id AND active=1”);
$Row = @mysql_fetch_array($Sql);
if (!$Row)
{
error();
exit;
}
$fileName = text_select_html_off($Row[‘url’]);
$file_data = explode(“/”, $fileName);
$file_name_only = $file_data[count($file_data)-1];
if($urlfiles==1){
$pathok = $fileName;
}else{
$pathok = “$folderbooks/$file_name_only”;
}
$sql = mysql_query (“update book_attachment set vis=vis+1 where id=$id”) or die (“Query failed”);
if (file_exists($pathok))
{
header(‘Content-type: application/force-download’);
header(‘Content-Transfer-Encoding: Binary’);
header(‘Content-length: ‘.filesize($pathok));
header(‘Content-disposition: attachment; filename=’.$file_name_only.”);
readfile($pathok);
}else{
echo “”;
}
}ELSEIF ($action==”test”){
tpl_header(“تجارب”);
echo $tables1;
blocks(1);
echo $tables2;
tpl_table(“تجارب”,’
var tabber1 = new Yetii({ id: "demo" });
‘);
echo $tables3;
blocks(2);
echo $tables4;
tpl_footer();
}
?>