Статьи "; $info_descr = file_get_contents("articles/cat.inf"); $a_info = preg_split('/\n|\r\n?/', $info_descr); foreach($a_info as $one_info) { $name_descr = explode("|", $one_info); show_cat_sql($name_descr[0],$name_descr[1]); } require 'inc/tail_page.htm'; require 'inc/tail.htm'; } else { //article if(urlencode($article) == 'kak_vybrat_programmu_1s_pravilnyy_vybor_sistemy_%E2%80%93_zalog_uspeshnoy_avtomatizatsii') { header("HTTP/1.1 301 Moved Permanently"); header('Location: http://stimul.kiev.ua/articles.htm?a=kak_vybrat_programmu_1s_pravilnyy_vybor_sistemy_-_zalog_uspeshnoy_avtomatizatsii'); die(); } $fname="articles/".$article.".htm"; if(!file_exists($fname)) { error404('articles.htm/a',$article); }; $sql = "SELECT `articles`.`id`, `articles`.`article_id` \n" . ", `articles`.`name` as article_name \n" . ", `articles`.`descr` as description \n" . ", `articles`.`keywords` as keywords \n" . ", `articles`.`footer` as footer \n" . ", `articles`.`hdr_descr` as description_hdr \n" . ", `articles`.`hdr_title` as title_hdr \n" . ", UNIX_TIMESTAMP(`articles`.`pub_date`) as pub_date \n" . ", CONCAT_WS(' / ',`p4`.`name`,`p3`.`name`,`p2`.`name`,`p1`.`name`) as paragraph \n" . ", `images`.`image` as image \n" . "FROM `articles` \n" . "LEFT JOIN `images` ON `images`.`article_id` = `articles`.`id` \n" . "INNER JOIN `folders` ON `folders`.`id` = `articles`.`folder` \n" . "LEFT JOIN `paragraphs` AS `p1` ON `articles`.`paragraph` = `p1`.`id` \n" . "LEFT JOIN `paragraphs` AS `p2` ON `p1`.`parentid` = `p2`.`id` \n" . "LEFT JOIN `paragraphs` AS `p3` ON `p2`.`parentid` = `p3`.`id` \n" . "LEFT JOIN `paragraphs` AS `p4` ON `p3`.`parentid` = `p4`.`id` \n" . "WHERE (`articles`.`article_id` = '". mysql_real_escape_string($article) ."') \n" . " AND(`folders`.`name` = 'articles')"; $result = mysql_query($sql) or die("Invalid query: " .$sql.': '. mysql_error()); $xart_info = array(); while ($row = mysql_fetch_assoc($result)) { $xart_info[$row["article_id"]] = $row; } mysql_free_result($result); $xart_info_keys = array_keys($xart_info); for($i=0;$imktime()) { if($debug!=1) { error404('articles.htm/a/date',$article); } }; $art_paragraph = $b_info["paragraph"]; $subparagraph2 = $art_paragraph; $subparagraph2_url = "tags.php?t=".urlencode($art_paragraph); $extra_head = ' '; if($img_file!='') { $extra_head = $extra_head.' '; } $extra_html = ' itemscope="" itemtype="http://schema.org/Article"'; } require 'inc/head.htm'; require 'inc/menu.htm'; require 'inc/head_page.htm'; echo "

$article_name

\"$article_name\" "; readfile($fname); $filename = "_cache/".$article."_footer.dat"; if(file_exists($filename)) $ftime = filemtime($filename); else { $ftime = FALSE; if($debug!=1) { $pingURL = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; rpc_ping($pingURL); } } if($ftime + (14*24*3600) < mktime()) { $ftime = FALSE; } if($ftime == FALSE) { $before_output = ob_get_clean(); ob_start(); //make all... $bans = bans_by_tags($tags); if(sizeof($bans)>0) { $str_text = "

"; foreach ($bans as $one_ban) { $str_text = $str_text . "" . $one_ban[0] . "
"; } $str_text = $str_text . "

"; echo $str_text; } if(sizeof($tags)>0) { $tags_sql = ""; foreach ($tags as $one_tag) { $tags_sql = $tags_sql . ",'" . mysql_real_escape_string($one_tag) . "'"; } $tags_sql = substr($tags_sql, 1); $tag_array = &build_tag_array_sql("articles"," and (`tags`.`keyword` in (".$tags_sql."))",0); foreach ($tags as $one_tag) { $sort_idx1_arr[] = $tag_array[lcase($one_tag)]; } array_multisort($sort_idx1_arr, SORT_ASC, $tags); $max_tag_array = max($sort_idx1_arr); $str_text = "

Другие материалы по теме:
"; foreach ($tags as $one_tag) { $cnt = $tag_array[lcase($one_tag)]; if($cnt>1) { if ($cnt <= 0.025*$max_tag_array) { $font_size = 1; } elseif ($cnt <= 0.05*$max_tag_array) { $font_size = 2; } elseif ($cnt <= 0.1*$max_tag_array) { $font_size = 2; } elseif ($cnt <= 0.2*$max_tag_array) { $font_size = 3; } elseif ($cnt <= 0.4*$max_tag_array) { $font_size = 4; } elseif ($cnt <= 0.8*$max_tag_array) { $font_size = 5; } else { $font_size = 6; } $str_text = $str_text . "" . $one_tag . ", "; } } $str_text = substr($str_text,0,-2); $str_text = $str_text . "

 

"; $str_text = $str_text . "

Статьи из раздела: " . $art_paragraph . "

"; $my_name = $article; $a_by_first_tag = intersect_by_tags_sql($tags, $my_name, "articles", 5); if(sizeof($a_by_first_tag)>0) { echo $str_text . "

 

Другие статьи по теме:

"; show_articles_by_array_sql($a_by_first_tag,0,0); } echo "
"; } //end make all $my_output = ob_get_clean(); if($debug!=1) { file_put_contents($filename, $my_output); } ob_start(); echo $before_output; echo $my_output; } else { readfile($filename); } require 'inc/tail_page.htm'; require 'inc/tail.htm'; } ?>