.lical_h2 /* заголовок темы */ { color:#00769F; font-family:Arial; font-size: 15px; letter-spacing: 1px; /* интервал между символами */ padding: 0px; /* поля вокруг текста */ margin-top: 0px; font-weight: bold; text-align: center; text-transform: uppercase; /* все буквы заглавные*/ } @media (min-width: 480px) and (max-width: 1000px) /* для PC */ { .lical_h2 {font-size: 1.4vw;} } @media screen and (max-width: 480px) /* для мобилы */ { .lical_h2 {font-size: 4vw; } } "; //////////////////////////////////////////////////////////////////// if(isset($_GET['id'])) $id=$_GET['id']; else $id=0; if(isset($_GET['start'])) $start=$_GET['start']; else $start=0; //exit("! "); $keywords=$description=$title=$h1="Архив новостей Крыма"; include_once($_SERVER['DOCUMENT_ROOT']."/sys/db.php"); $db_main = new db_work; $db_main->connect(); //////////////////////////// $chapter_id=$id; include_once($_SERVER['DOCUMENT_ROOT']."/news/nav_block.php"); ///////////////////////////////////////// // хлебные крошки $spaceX="5px"; $parent_path=""; $parent_path.="Архив новостей Крыма"; if($id) { $parent_path.="".$chapter_selected." "; $TFS = "Новости по теме: ".$chapter_selected; } else { $parent_path.="Все новости "; $TFS = "Новости: Главная."; } ///////////////////////////////////////////// //////////////////////////////////////////////// $txtCount=0; $list=""; $cur_count=0; $list=""; /* $list.=""; */ ////////////////////////////////////// $sql_str="1"; if($chapter_id) $sql_str="theme_id = ".$id.""; ///// страницы $result=$db_main->execute("select count(1) AS count FROM news WHERE ".$sql_str.""); if($row = mysqli_fetch_assoc($result)) { $txtCount =$row['count']; // exit("! $txtCount"); $isFirst=1; if(isset($start)) { $isFirst=0; $page_txt=$start/$nMessPerPage; //$start=0; } else// чтобы отматывалось в конец: { $page_txt= $txtCount/$nMessPerPage; $start=(int)($page_txt*$nMessPerPage); //exit("$page_txt*$nMessPerPage"); } $page_begin=0; $x = 0; //exit("$start"); if(isset($page_txt)) { $page_begin= ((integer)$page_txt); $x = $page_begin*$nMessPerPage; if($x>$txtCount) { $x=$txtCount; $page_begin= ((integer)($x/$nMessPerPage)); } } $endX=$nMessPerPage; if($isFirst)//чтобы последняя страница была вся заполнены для начала { //if($txtCount>=$nMessPerPage) { $x=$txtCount-$nMessPerPage; if($txtCount<$nMessPerPage) $x=0; $endX=$nMessPerPage; } } //exit("! $txtCount | $x | $endX"); if($x + $endX > $txtCount) $endX= $txtCount-$x; $countP = (int)($txtCount/$nMessPerPage); if( ($txtCount%$nMessPerPage) ) $countP++; //exit("! $countP || $txtCount | $x | $endX"); /////////////// цыфры страниц: $nContinue=0; $pages_str="
Страницы: "; if($countP>1) for($i=0; $i<$countP ; $i++) { if( ($i>$show_numbs_limit && $i<($countP-$show_numbs_limit)) && !($i>($page_begin-$show_numbs_limit) && $i<($page_begin+$show_numbs_limit)) ) { if($nContinue==0) $pages_str.="..."; $nContinue=1; continue; } $nContinue=0; if($page_begin == $i) { $pages_str.=" ".($i+1)." "; } else { $pages_str.=" ".($i+1).""; } }//for( $pages_str.="
"; } ////////////////////////////// $result=$db_main->execute("SELECT id,name,time,big_text,theme_id FROM news WHERE ".$sql_str." order by time desc LIMIT $x, $endX"); $nthem=0; while($row = mysqli_fetch_assoc($result)) { $date=date("d.m.Y",$row['time'])."".date("H:i",$row['time']); $name=$name0=$row['name']; //if(strlen($name)>60) // $name=substr($name,0,60)."..."; $theme_id=$row['theme_id']; $result2=$db_main->execute("SELECT * FROM l_news_theme WHERE id=".$theme_id." "); if($row2 = mysqli_fetch_assoc($result2)) { $theme=ucfirst($row2['name']); $list.="
".$theme."
"; } //$name2=str_replace(" "," ",$name);//чтобы переносилось весь $name $list.="
Дата и время   Новость
".$date." ".$name."
"; // вариант для мобил $list.=""; $text=strip_tags(str_replace("\\","",$row['big_text'])); $len=strlen($text); if($len>($limit)) { $text=$text0=substr($text,0,($limit)); //exit("!! $text"); $text=substr($text0,0,strrpos($text0," ")); if(!empty($text)) $text.="..."; } $list.="
".$text."

подробнее

"; $nthem++; } /////////////////////////////////////////////// /* function get_count($id) { global $cur_count,$db_main; $result=$db_main->execute("SELECT id FROM forum WHERE parent_id=".$id.""); while($row = mysqli_fetch_assoc($result)) { $cur_count++; get_count($row['id']); } } */ include_once($_SERVER["DOCUMENT_ROOT"]."/sys/main_functions.php"); include_once($_SERVER["DOCUMENT_ROOT"]."/sys/header.php"); echo $local_css; ///////////////////////////////// ?> "; echo $block_nav_str; echo "
"; echo ""; echo "

".$chapter_selected."

"; echo "
"; if($txtCount>$nMessPerPage) echo $pages_str; echo "
"; //////////////////////////////////////////////////////// echo "
"; echo $list; echo " "; echo "
"; if($txtCount>$nMessPerPage) echo $pages_str; //echo "
"; echo "



"; echo " "; // выбор мобилы или PC ?> goto_art(); "; $db_main->close(); ?>