if(isset($_GET['p'])){
include "pages.php";
die();
}
$baseURL = '/books.library/';
$sub_domains = array( 'med','law','lit','sci','edu','sha','eco','civ','pha','den','agr','art','eng','arc','it','ol','pol','res','tra','media');
$host = explode(".",$_SERVER['HTTP_HOST']);
if( ($host[2] && in_array($host[0],$sub_domains) ) || isset($host[3])){
$urlto = "https://www.jamaa.net".$_SERVER['REQUEST_URI'];
Header("Location: $urlto");
die();
}
include "../common.php";
include FUNCS."post.funcs.php";
//$db->close();
//@mysql_connect($books[server],$books['user'],$books[pass]);
//mysql_select_db($books[database]);
$banned_cats = array(228,38,39,40,41,85,193,216,217,218,219,220,221);
/*
if($_GET[a123]==321){
$query = $db->query("select id from books where id<'117202' and waiting=1");//144258
while($down = $db->fetch($query)){
print $down['id'].',';
}
}else*/if($_GET['i'] && $_SESSION['B'.$_GET['i']]==-1){
$_GET['i'] = preg_replace('/[^0-9]/', '', $_GET['i']);
$query = $db->query("select * from books where id='".$_GET['i']."' and waiting>=0 limit 1");// and waiting=0
if($db->num($query)>0){
$down = $db->fetch($query);
$db->query("update `books` set `counter`=`counter`+1 where `id`='".$_GET['i']."' LIMIT 1");
// AUTO SHOW NEW HIDDEN BOOKS
$db->query("update books set waiting=0 where waiting=1 AND timestamp=1555500000 order by rand() LIMIT 1");
//if(strpos($down['book_url'],"mohamedrabeea.net")) $down['book_url'] = $down['direct_url'];
if(!preg_match('/http/i',$down['book_url']) && file_exists("../lib/".$down['book_url'])){
$down['book_url'] = str_replace("books/","",$down['book_url']);
//$down['book_url'] = urlencode($down['book_url']);
//$down['book_url'] = "/lib/books/" . $down['book_url'];
$typ = explode('.',$down['book_url']);
$ext = '.'.$typ[(count($typ)-1)];
$db->close();
//header("charset=windows-1256");
$uri = explode('/',$settings['uri']);
$count = count($uri)-2;
for( $i=0; $i<=$count; $i++ ){ $site_folder .= '/'.$uri[$i]; }
$filename = $_SERVER['DOCUMENT_ROOT'] . $site_folder ."/../lib/books/" . urldecode($down['book_url']);
header("Cache-Control: public");
header("Content-Description: File Transfer");
//header('Content-disposition: attachment; filename='.basename($filename));
header('Content-disposition: attachment; filename = '.iconv("windows-1256","utf-8",trim($down['title']).$ext) );
//header("Content-Type: application/zip");
header("Content-Type: ".filetype($filename));
header("Content-Transfer-Encoding: binary");
header('Content-Length: '. filesize($filename));
readfile($filename);
die();
}elseif(!preg_match('/http/i', $down['book_url'])){
$_SESSION['B'.$_GET['i']] = 0;
Header("Location: ".$second_href."lib/".$down['book_url']);
exit;
}else{
function update_url($url){
if( strpos( $url, '%' ) == false && preg_match('/archive.org/i', $url ) ){
$url = iconv("windows-1256","utf-8",$url);
$urls = explode('/',$url);
$new_url = '';
$i = 0;
foreach($urls as $val){
$i++;
if($i==count($urls)){
//$new_url .= strtolower(str_replace("+","%20",urlencode($val)));
$modified = preg_replace_callback('/%[0-9A-F]{2}/', function(array $matches)
{
return strtolower($matches[0]);
},
$val);
$new_url .= str_replace("+","%20",urlencode($modified));
}else $new_url .= $val.'/';
}
return $new_url;
}elseif( strpos( $url, 'univ-tebessa.dz/fichiers/Theses_dissertations/docs/ThesesMas/Letterslangues' ) ){
$url = str_ireplace(array('2017DID0','2017SL0','2017DCC0','Analysedudiscourse','2017AD0','2017LC0'),array('2017DID','2017SL','2017DCC','Analysedudiscours','2017AD','2017LC'),$url);
return iconv("windows-1256","utf-8",$url);
}else{
return iconv("windows-1256","utf-8",$url);
}
}
$_SESSION['B'.$_GET['i']] = 0;
header("Location: ".update_url($down['book_url']));
exit;
}
}
}elseif($_GET['i']){
$_GET['i'] = preg_replace('/[^0-9]/', '', $_GET['i']);
$query = $db->query("select * from books where id='".$_GET['i']."' limit 1");// and waiting=0
if($db->num($query)>0){
$down = $db->fetch($query);
$down['title'] = preg_match('/pdf/i', $down['title']) ? $down['title'] : $down['title'].'.pdf';
$book_title = $down['title'];
$page_title = "����� ���� ".$book_title;
$page_desc = $down['book_size'] ? "��� �����: ".$down['book_size'] : "��� �����: KB";
$_SESSION['B'.$_GET['i']]=1;
}else{
header("HTTP/1.0 404 Not Found");
$page_title = "404 Not Found!";
//echo "Sorry.. Book not found, it may be removed for copyright contents.";
//die();
}
}elseif($_GET['id']){
$_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']);
$query = $db->query("select * from books where id='".$_GET['id']."' and waiting>=0 limit 1");// and waiting=0
if($db->num($query)>0){
$down = $db->fetch($query);
$down['title'] = preg_match('/pdf/i', $down['title']) ? $down['title'] : $down['title'].'.pdf';
$book_title = $down['title'];
$page_title = "����� ���� ".$book_title." ���� �����";
$page_desc = $down['book_size'] ? "��� �����: ".$down['book_size'] : "��� �����: KB";
}else{
header("HTTP/1.0 404 Not Found");
$page_title = "404 Not Found!";
//echo "Sorry.. Book not found, it may be removed for copyright contents.";
//die();
}
}elseif($_GET['search']){
$page_title = ($_GET['ref']=='author' ? "����� ���� ��� " : "").$_GET['search']." ���� �����";
}elseif($_GET['cat']){
$_GET['cat'] = preg_replace('/[^0-9]/', '', $_GET['cat']);
$query = $db->query("select * from books_type where id='".$_GET['cat']."' limit 1");
if($db->num($query)>0){
$downcat = $db->fetch($query);
$page_title = $downcat['title']." ����� ������";
}
}elseif($do=="up"){
$file_size = $_FILES['book']['size'];
$file_name = $_FILES['book']['name'];
$file = $_FILES['book'];
$userid = $userid>0 ? $userid : 0;
$gmt = time();
if($file_name){
$types = array("zip", "rar", "pps", "ppt", "pptx", "pdf", "psd", "doc", "docx", "txt", "mp3");
$type = explode("." ,$file_name);
$ext = $type[(count($type)-1)];
if(!in_array(strtolower($ext), $types)){
$inside_tbl .= "����� $file_name - ��� ����� �����...";
}elseif($file_size>110000000){
$inside_tbl .= "����� $file_name - ���� ���� ����...";
}else{
$type[0] = str_replace(" ","_",$type[0]);
//$type[0] = str_replace("-","_",$type[0]);
$file_name = $type[0].".".$ext;
while(file_exists("../lib/books/$file_name")){
$type[0] = $type[0]."_";
$file_name = $type[0].".".$ext;
}
//if($userid)
// $db->query("update `users` set `counter`=`counter`+1 where `userid`='".$userid."' LIMIT 1");
//copy($_FILES['book']['name'],"../lib/books/$file_name");
move_uploaded_file($_FILES['book']['tmp_name'], "../lib/books/$file_name");
if(file_exists("../lib/books/$file_name")){
$book_url = "books/$file_name";
if(!$id){
$db->query("insert into books (waiting) VALUES ('1')");//or die(mysql_error());
$id = $db->inserted();
$a_dd = "timestamp = '$gmt' ,";
}
$db->query("UPDATE books SET
`title` = '$title' ,
`text` = '$text' ,
`author` = '$author' ,
`book_url` = '$book_url' ,
`book_type` = '$book_type' ,
`user` = '$yourname' ,
`userid` = '$userid' ,
".$a_dd."
`waiting` = '1'
WHERE `id` = '$id' LIMIT 1")
and ($inside_tbl .= "�� ����� ������ $title ��� ������� �����... ����� ��� ���� ������� ������");
//or die(mysql_error());
}// END FILE EXISTS
else
{
$inside_tbl .= "����� $file_name �� ��� ���� �� ��� ��� ����� ����� �����... ���� �������� ������";
}
}// END IF GOOD FILE
}// END IF $FILE
elseif(preg_match('/http|ftp/i', $book_url))
{
if(preg_match('/pdf|doc|rar|zip|xls/i',$book_url) ){
if(!$id){
$db->query("insert into books (waiting) VALUES ('1')");
//or die(mysql_error());
$id = $db->inserted();
$a_dd = "timestamp = '$gmt' ,";
}
$db->query("UPDATE books SET
`title` = '$title' ,
`text` = '$text' ,
`author` = '$author' ,
`book_url` = '$book_url' ,
`book_type` = '$book_type' ,
`user` = '$user' ,
`userid` = '$userid' ,
".$a_dd."
`waiting` = '1'
WHERE `id` = '$id' LIMIT 1")
and ($inside_tbl .= "�� ����� ������ $title ��� ������� �����... ����� ��� ���� ������� ������");//or die(mysql_error());
}
else
{
$inside_tbl .= '����� ������ ���� ������ ��� ����....';
}
}
else
{
$inside_tbl .= '�� ��� ����� �� ���� �� ���� ���� �� ������ �������....';
}
$upload_message = $inside_tbl;
$inside_tbl = '';
}else{
$page_title = '����� ����� ����� ���� �����������';
}
$page_title = str_replace(array('���� �����','���� �����','���� ����'),array('�����','�����','����'),$page_title);
?>
����� ����� ����� ���� �����������
if($page_title == "404 Not Found!"){
if($_GET['i'] || $_GET['id'])
$query = $db->query("select * from books where id='".($_GET['i']?$_GET['i']:$_GET['id'])."' limit 1");// and waiting=1
if($db->num($query)>0){
$down404 = $db->fetch($query);
$book_title404 = preg_match('/pdf/i', $down404['title']) ? $down404['title'] : $down404['title'].'.pdf';
}
print '
404 Not Found!
'.$book_title404.'
Sorry.. Book not found, it may be removed for copyright contents.
����� ������ ��� �����.. ������� ������� ���� ����� �� ����� ��� ������
';
}elseif(!$_GET['search'] && !$_GET['id'] && !$_GET['i'] && !$_GET['cat'] && !$_GET['page']){ ?>
������� �����
������� ����� �������� ��� �������
if(!file_exists('books_cats.txt') && filemtime('books_cats.txt')<(time()+(3600*48)) ){
$book_cats = array();
$book_icon = array();
$types_query = $db->query("select * from books_type where sub_id = 0");
$types_sub_query = $db->query("select * from books_type where sub_id>0 ORDER BY sub_id ASC");
if($db->num($types_query)>0 && $db->num($types_sub_query)>0){
while($result = $db->fetch($types_query)){
$book_cats[$result['id']] = $result['title'];
$book_icon[$result['id']] = $result['text'];
}
$cat_id=0;
while($sub_result = $db->fetch($types_sub_query)){
if($sub_result['sub_id'] != $cat_id){
if($cat_id!=0){
$inside_tbl .= '
';
}
$cat_id = $sub_result['sub_id'];
$inside_tbl .= '
'.$book_cats[$cat_id].'
';
}
$count = $db->query("select count(*) from books where book_type='".$sub_result['id']."'");
$inside_tbl .= ''.$sub_result['title'].' ('.$db->result($count,0,0).') ';
//if($i==2 || $i==5 || $i==8 || $i==11 || $i==14 || $i==17 || $i==20 || $i==23 || $i==26 || $i==29 || $i==32) $inside_tbl .= '
';
}
$inside_tbl .= '
';
}else{
$inside_tbl .= '�� ���� �� ������ ... ';
}
$file_target = @fopen('books_cats.txt', "w");
@fwrite ($file_target, $inside_tbl);
@fclose ($file_target);
}else{
$inside_tbl .= file_get_contents('books_cats.txt');
}
print $inside_tbl;
?>
}elseif($_GET['id']){
$query = $db->query("select * from books where id='".$_GET['id']."' limit 1");// and waiting=0
$result = $db->fetch($query);
if($db->num($query)>0){
$type = $db->query("select title,sub_id from books_type where id='".$result['book_type']."'");
$res = $db->fetch($type);
$top = $db->query("select title, text from books_type where id='".$res['sub_id']."'");
$top_res = $db->fetch($top);
$db->query("UPDATE books set `sended`=`sended`+1 WHERE id='".$_GET['id']."' limit 1 ");
//if($db->num($query)>0){
$result['author'] = $result['author'] ? ' ������: '.$result['author'].' ' : '' ;
$the_book = ''.(stripslashes($result['title'])).' ';
if(file_exists('/lib/'.$result['book_url']) || !preg_match('/http/i',$result['book_url'])){
$typ = explode('.',$result['book_url']);
$ext = $typ[(count($typ)-1)];
if(file_exists('/lib/'.$result['book_url'])) $fite_dets = '��� �����: '.number_format((filesize("/lib/".$result['book_url'])/1024),0).' KB ';
}elseif(preg_match('/http/i',$result['book_url'])){
$typ = explode('.',$result['book_url']);
$ext = $typ[(count($typ)-1)];
$types = array("zip", "rar", "pps", "ppt", "pptx", "pdf", "psd", "doc", "docx", "txt", "mp3");
if(!in_array(strtolower($ext), $types)){
$ext = '';
}
if($result['book_size']) $fite_dets = '��� �����: '.$result['book_size'].' ';
}
if(!$ext){
$typ = explode('.',$result['title']);
$ext = $typ[(count($typ)-1)];
if(strlen($ext)>4) $ext = 'nan';
}
$fite_dets .= $ext != 'nan' ? '��� �����: '.$ext.' ' : '';
$result['user'] = $result['userid']>0 ? H_user($result['userid'],$result['user']) : $result['user'];
$images = explode("\n",$result['images']);
if( strlen($images[0])>10 /*&& ( file_exists(trim($images[0])) || ereg('http',$images[0]) )*/ ){
$image_ready = true;
$book_image = strpos($images[0],'://') !==false ? trim($images[0]) : $second_href.trim($images[0]);
if(preg_match('/.gif/i',$images[0])) $giffer = 'data-gifffer="'.$book_image.'" data-gifffer-alt="'.$result['title'].'"';
}else
$book_image = $baseURL.'assets/icons/ext/'.strtolower($ext).'.png';
?>
������ ����
�������: ->
���� ������:
������: 23-05-2025
��� ���� �������:
���� �������:
��� ���� ����� ���� ����� ������:
$book1 = $db->query("select * from books where `id`<".$_GET['id']." order by id desc limit 1");// and waiting=0
$book2= $db->query("select * from books where `id`>".$_GET['id']." order by id asc limit 1");// and waiting=0
$book1 = $db->fetch($book1);
$book2 = $db->fetch($book2);
print '
';
?>
/*if(ereg('archive.org/download',$result['book_url']) && ereg('.pdf',$result['book_url']) && !$image_ready) $script = '
$(".loading").click(function() {
//$(".loading").html("ÝÖáÇð ÇäÊÙÑ .. íÊã ÇáÇä ÇáÊÍÏíË");
//$(".img-fluid").title("íÊã ÇáÇä ÇáÊÍÏíË");
$.ajax({
type: "POST",
url: "ajax.php",
data: { id: "'.base64_encode($result['book_url'].')('.$result['id']).'" },
success: function(data) {
//$(".loading").html("");
if(data != "Error"){
$(".img-fluid").attr("src", data);
$(".img-fluid").addClass("shadow");
}
}
});
return false;
});
$(".loading").click();
';
//&& strlen($result['direct_url'])<10
else*/if( (preg_match('/archive.org/i',$result['book_url']) || preg_match('/mobt3ath.com/i',$result['book_url']) || preg_match('/nyu.edu/i',$result['book_url']) || preg_match('/univ-tebessa.dz/i',$result['book_url']) || preg_match('/mohamedrabeea.net/i',$result['book_url']) || (preg_match('/hindawi.org/i',$result['book_url']) && strlen($down['direct_url'])<10 ) ) ) $script = '
$(".img-fluid").click(function() {
$.ajax({
type: "POST",
url: "ajax2.php",
data: { id: "'.base64_encode($result['book_url'].')('.$result['id']).'" },
success: function(data) {
//var ss = data.split("|");
if(data != "Error") $(".size").html("ÍÌã ÇáãáÝ: " + data + " ");
}
});
return false;
});
$(".img-fluid").click();
';
else
$script = '
$(".loading").click(function() {
$.ajax({
type: "POST",
url: "ajax3.php",
data: { id: "1" },
success: function(data) {
//var ss = data.split("|");
//if(data != "Error") $(".size").html("��� �����: " + data + " ");
}
});
return false;
});
$(".loading").click();
';
}else{ ?>
���� ������� ������ ��� ������.. ���� ��� ������ �� ��� ���� ������ ������
}
}elseif($_GET['i']){
if($down){
/*
$query = $db->query("select * from books where id='".$_GET['i']."' and waiting=0 limit 1");
if($db->num($query)>0){
$down = $db->fetch($query);
$db->query("update `books` set `counter`=`counter`+1 where `id`='".$_GET['i']."' LIMIT 1");
if(file_exists("../lib/".$down['book_url'])){
$down['book_url'] = str_replace("books/","",$down['book_url']);
//$down['book_url'] = urlencode($down['book_url']);
//$down['book_url'] = "/lib/books/" . $down['book_url'];
$typ = explode('.',$down['book_url']);
$ext = '.'.$typ[(count($typ)-1)];
$db->close();
$uri = explode('/',$settings['uri']);
$count = count($uri)-2;
for( $i=0; $i<=$count; $i++ ){ $site_folder .= '/'.$uri[$i]; }
$filename = $_SERVER['DOCUMENT_ROOT'] . $site_folder ."/lib/books/" . urldecode($down['book_url']);
header("Cache-Control: public");
header("Content-Description: File Transfer");
//header('Content-disposition: attachment; filename='.basename($filename));
header('Content-disposition: attachment; filename = '.urldecode($down['book_url']));
//header("Content-Type: application/zip");
header("Content-Type: ".filetype($filename));
header("Content-Transfer-Encoding: binary");
header('Content-Length: '. filesize($filename));
readfile($filename);
die();
}else*/
if(!preg_match('/http/i', $down['book_url'])){
$down['book_url'] = str_replace("books/","",$down['book_url']);
$down['book_url'] = urlencode($down['book_url']);
$down['book_url'] = $second_href."/lib/books/".$down['book_url'];
$typ = explode('.',$down['book_url']);
$ext = '.'.$typ[(count($typ)-1)];
}else{
$marks_file_target = ' target="_blank"';
}
//$down['book_url'] = str_replace('http://search.4shared.com/network/search.jsp?searchmode=2&searchName=','https://www.4shared.com/web/q/#category=5&query=',$down['book_url']);
$marks_file_name = str_ireplace(array('.pdf','.rar','.zip','.doc','.docx','.ppt'),'',$down['title']);
$marks_file_url = $down['book_url'];
$book_type = $down['book_type'];
if(strlen($ext)<4) $ext='.pdf';
$images = explode("\n",$down['images']);
if(strlen(trim($images[0]))>10){
$book_image = strpos($images[0],'://') !==false ? trim($images[0]) : $second_href.trim($images[0]);
}else
$book_image = $baseURL.'assets/images/eqra.jpg';
$result['book_url'] = urldecode($down['book_url']);
if( (preg_match('/archive.org/i',$result['book_url']) || preg_match('/mobt3ath.com/i',$result['book_url']) || preg_match('/nyu.edu/i',$result['book_url']) || preg_match('/univ-tebessa.dz/i',$result['book_url']) || preg_match('/mohamedrabeea.net/i',$result['book_url']) || preg_match('/hindawi.org/i',$result['book_url']) ) && strlen($down['direct_url'])<10 ) $script = '
$(".img-fluid").click(function() {
$.ajax({
type: "POST",
url: "ajax2.php",
data: { id: "'.base64_encode($result['book_url'].')('.$down['id']).'" },
success: function(data) {
//var ss = data.split("|");
if(data != "Error"){
$(".size").html("File Size: " + data);
$(".size").attr("class","btn btn-success");
}
}
});
return false;
});
$(".img-fluid").click();
';
else
$script = '
$(".img-fluid").click(function() {
$.ajax({
type: "POST",
url: "ajax3.php",
data: { id: "1" },
success: function(data) {
//var ss = data.split("|");
//if(data != "Error") $(".size").html("��� �����: " + data + " ");
}
});
return false;
});
$(".img-fluid").click();
';
}else{
$marks_file_name = "404 Not found.!";
$marks_file_url = "";
}
?>
Download File
You have requested: https://www.jamaa.net/books.library/
//if(in_array($down['book_type'],$banned_cats)){
print '
';
/*}else{
print '
';
}*/
?>
} ?>
query("select * from books where id=0");
$sub_title = '��� ������ ';
$section = 'main';
}elseif($_GET['search']==='Copy Rights'){
$copyrights = file_get_contents("copyrights.txt");
$copyrights_lines = explode("\n",$copyrights);
$page = $_GET['page'] ? $_GET['page'] : 0 ;
$search = trim($copyrights_lines[$page]);
$search_word = explode(" ",$search);
$search_Q = '';
foreach($search_word as $word){
if(strlen(trim($word))>2) $search_Q .= '%'.trim(str_ireplace('�','',$word));
if(strlen($search_Q)>10) break;
}
$search_Q = str_replace(array('%��','%��','%���','%���'),'%',$search_Q);
//AND `id`>'117000'
$books = $db->query("select books.id, books.title, books.author, books.counter, books.text, books.images, books.book_url from books where (`title` LIKE '$search_Q%' ) ORDER BY books.id desc");//waiting=0 AND
//$pages = count($copyrights_lines);
$sub_title = $search . ' --- '.$search_Q.' --- ������ ';
$section = 'main';
}elseif($_GET['search']){
$search = urldecode($_GET['search']);
$search_word = explode(" ",str_ireplace(array(',','.','-','_','`','\'','"','�',':','�','�','?','�','�',';','"',')','(',']','[','}','{','>','<','.pdf','pdf','doc','�'),' ',$search));
$search_Q = '';
foreach($search_word as $word){
if(strlen(trim($word))>2) $search_Q .= '%'.trim($word);
if(strlen($search_Q)>15) break;
}
$search_Q = str_replace(array('%��','%��','%���','%���'),'%',$search_Q);
//$search_Q = str_replace(' ','%',$search);
$books = $db->query("select books.id, books.title, books.author, books.counter, books.text, books.images, books.book_url, (SELECT text FROM books_type WHERE id=(SELECT sub_id FROM books_type WHERE id=books.book_type)) as icon from books where (`title` like '%$search_Q%' OR `author` like '%$search_Q%' OR `user` like '%$search_Q%') ORDER BY rand() LIMIT 200");// waiting=0 AND
// OR `text` like '%$search_Q%' OR `book_url` like '%$search_Q%'
$sub_title = $_GET['ref']== 'author' ? '��� ���� ��� '.$search : '����� ����� �� '.$search;
$section = 'main';
}elseif($_GET['i']){
$searhs = explode(' ',str_replace(array(',','.','-','_','`','\'','"','�',':','�','�','?','�','�',';','"',')','(',']','[','}','{','>','<',' ��',' ��',' ���',' ���'),' ',$down['title']));
//$searh = $searhs[0].'%'.$searhs[2];
//$searh2 = $searhs[count($searhs)-2];
$rand = array(rand(0,count($searhs)),rand(0,count($searhs)),rand(0,count($searhs)));
$ie = $ii = 0;
foreach($searhs as $val){
if(strlen($val)>3 && in_array($ie,$rand) && $ii<3){
$ss .= '%'.$val;
$ii++;
}
$ie++;
}
if($down){
//, (SELECT text FROM books_type WHERE id=(SELECT sub_id FROM books_type WHERE id=books.book_type)) as icon
$books = $db->query("select books.id, books.title, books.author, books.counter, books.text, books.images, books.book_url from books where books.id!='".$_GET['i']."' AND books.book_type='".$down['book_type']."' AND (books.title LIKE '$ss%' OR books.text LIKE '$ss%') order by rand() limit 12");// AND books.waiting=0
}else{
$books = $db->query("select * from books where id<0");
}
$sub_title = '����� ���� ������';
$section = 'latest';
}elseif($_GET['id']){
$books = $db->query("select books.id, books.title, books.author, books.counter, books.text, books.images, books.book_url, (SELECT text FROM books_type WHERE id=(SELECT sub_id FROM books_type WHERE id=books.book_type)) as icon from books where books.book_type=".$result['book_type']." order by rand() limit 12");// books.waiting=0 AND
$sub_title = '������ �� �����';
$section = 'latest';
}elseif($_GET['cat']){
$cat_title = $db->query("SELECT books_ty.id,books_ty.title,books_ty.sub_id, (SELECT title FROM books_type WHERE id=books_ty.sub_id) as top_title FROM books_type books_ty WHERE books_ty.id='".$_GET['cat']."' LIMIT 1");
$cat_res = $db->fetch($cat_title);
$page = $_GET['page'] ? $_GET['page'] : 1;
$page_limit = 21*($page-1);
$books_count = $db->count("books","waiting=0 AND book_type=".$cat_res['id']."");
$pages = floor((($books_count-1)/21)+1);
$books = $db->query("select books.id, books.title, books.author, books.counter, books.text, books.images, books.book_url, (SELECT text FROM books_type WHERE id='".$cat_res['sub_id']."') as icon from books where books.book_type='".$cat_res['id']."' ORDER BY id DESC LIMIT $page_limit,21");//books.waiting=0 AND
$sub_title = $cat_res['top_title'] .' � '. $cat_res['title'];
$section = 'main';
}else{
$page = $_GET['page'] ? $_GET['page'] : 1;
$page_limit = 21*($page-1);
//$rand = 0;//rand(0,200);
//$page_limit = 15*($rand);
$books_count = $db->count("books","waiting=0");
$pages = floor((($books_count-1)/21)+1);
$books = $db->query("select books.id, books.title, books.author, books.counter, books.text, books.images, books.book_url, (SELECT text FROM books_type WHERE id=(SELECT sub_id FROM books_type WHERE id=books.book_type)) as icon from books order by books.timestamp desc limit $page_limit,21");// where waiting=0
$sub_title = '���� ����� ���� �� �������';
$section = 'latest';
}
print '
'.$sub_title.'
';
if($_GET['search']/*!=='CopyRights'*/ || $_GET['id'] || $_GET['i']){
print '
';
}else{
print '
';
}
$ii = 0;
while($result = $db->fetch($books)){
//if(eregi('http',$result['book_url'])) $tar_get = " target='_blank'"; else $tar_get="";
$result['author'] = $result['author'] ? ' ���:
'.$result['author'].' ' : '' ;
if($_GET['search']=='CopyRights'){
print '
';
}elseif($_GET['search'] || $_GET['id'] || $_GET['i']){
if($ii>0 && $ii<6) print '
';
elseif($ii==6) print '
';
}else{
if($ii>0 && $ii<6) print '
';
elseif($ii==6) print '
';
}
$typ = explode('.',$result['book_url']);
$ext = $typ[(count($typ)-1)];
if(strlen($ext)>4){
$typ = explode('.',$result['title']);
$ext = $typ[(count($typ)-1)];
if(strlen($ext)>4) $ext = 'pdf';
}
$result['images'] = strpos($result['images'],'://') !==false ? $result['images'] : ($result['images'] ? $second_href.$result['images'] : $baseURL.'assets/icons/ext/'.$ext.'.png');
if($_GET['search']==='CopyRights'){
print '
('.$result['counter'].')
'.$result['author'].''.($result['text']).'
'.$result[tags].' '.$result[dets].'
remove
show
';
}elseif($ii<6)
print '
('.$result['counter'].')
'.$result['author'].''.substr($result['text'],0,80).'
';
//
/*elseif($ii<12)
print '
('.$result['counter'].')
'.$result['author'].'
';*/
else
print '
('.$result['counter'].')
'.$result['author'].''.substr($result['text'],0,80).'
';
//
/*print '
('.$result['counter'].')
'.$result['author'].'
';*/
$ii++;
}
print '';
?>
if($pages>1){ ?>
} ?>
���� ����� ����� ��������:
����� �� ����� ������� �������
����� ����� ����� ���� ����������� ��������� ��� ������ ���� Shabab SY �������� ��� �����...
/**/?>