"; $table_name = "blogs"; if(isset($id)){ include("$rootpath/now/article.php"); $this_content=$output; echo standard_content($this_content); exit(); } $bodyClass = 'blogIndex'; $headerBottom = "

".unlanguage("ТЕПЕРЬ###NOW")."

".unlanguage("Актуально: новости, статьи, репетиции###Actually: news, articles, rehearsals")."
"; $dom_ready_scripts[]=" $( window ).scroll(function() { var top=$(window).scrollTop(); //dbg(top); if(top<330){ $('body').removeClass('min'); $('body.blogIndex div.header').height(420-top); } else { $('body').addClass('min'); } }) "; $search_pars[]=$TitleNotEmpty; if($user_level>=5){ $add_new=add_new('blogs', "Статью"); } else { $search_pars[]="display=1"; } if(isset($tag)){ $objects_by_tags = objects_by_tags("blogs", $tag); if($objects_by_tags){ $search_pars[] = "id in (".join($objects_by_tags, ',').")"; $paging_pars[] = "tag=$tag"; } unset($catsButtons, $closecatspars); $tags_array = tags_from_string($tag); foreach($tags_array as $c=>$v){ $tmpcats=$tags_array; unset($tmpcats[$c], $tmpcatspars, $closecatspars); if(is_array($tmpcats) and count($tmpcats)){ foreach($tmpcats as $cc=>$vc) $tmpcatspars[]="$vc"; $closecatspars[] = "tag=".join($tmpcatspars,","); } $catsButtons[] = "$v"; } if(is_array($catsButtons)){ $catsButtonsList="
Записи с ".((count($tags_array)>1)?"метками":"меткой")."    ".join($catsButtons)."
"; } } if(isset($month)){ $search_pars[] = "date_format(created, '%Y-%c') = '$month'"; $paging_pars[] = "month=$month"; } ############# $fields = array('id', 'title', 'about', 'created', 'display', 'views', 'author', 'caption'); $pars['page']=$page; $pars['order']='created desc, id desc'; $pars['items_on_page']=10; $pars['hidden_search_pars']=$search_pars; $pars['paging_pars']=$paging_pars; $pars['heads_on_page_var']='objects_on_page'; $pars['objects_type']='Objects'; $result_array=listalka($table_name, $fields, $pars); // echo "
".print_r($result_array, 1)."
"; if($debug) $this_content.="
".print_r($result_array['query'], 1)."
"; $found_items = $result_array['found_items']; $total_pages = $result_array['total_pages']; if(is_array($result_array['fields'])){ foreach($result_array['fields'] as $array){ unset($image, $thisSubsections, $itemCaption); foreach($array as $k=>$v){ $$k=unlanguage($v); } if($user_level>=5){ $edit=controls($id, $table_name, $display); } $href="$htmlrootpath/now/?id=$id"; //#disqus_thread $thumbik = thumbnail($table_name, $id, "t"); if($thumbik['exists']) { $thumb=""; $yashareImage=$thumbik['src']; } else { $thumb=$yashareImage=""; } $tags_list=object_tags_links("blogs$language", $id, "$htmlrootpath/now/", ''); $author_date = "$author, ".date_string($created); if(trim($author)=='') $author_date = date_string($created); if(trim($caption)!='') $itemCaption = "
$caption
";; $rows[]="
$title
$author_date $edit
$thumb $itemCaption
$about
$views
$tags_list
"; } } if(is_array($rows)){ $rowsList="
".join($rows, "")."
"; } if($total_pages>1){ $listalka = $result_array['listalka']; } //СВЕЖИЕ ЗАПИСИ $result=sql("select id, title from blogs where display=1 $andTitleNotEmpty order by created desc limit 10"); while(list($id, $title) = mysql_fetch_row($result)){ $title=unlanguage($title); $recentEntries[]="$title"; } if(is_array($recentEntries)){ $recentEntriesList="
".unlanguage("СВЕЖИЕ ЗАПИСИ###RECENT ENTRIES")."
".join($recentEntries, "")."

"; } // АРХИВ ЗАПИСЕЙ list($currentYear)=mysql_fetch_row(sql("select YEAR(CURDATE())")); // месяцы текущего года $result=sql("select distinct date_format(created, '%c') from blogs where YEAR(created)='$currentYear' and created<>'0000-00-00' $andTitleNotEmpty order by created desc"); while(list($m) = mysql_fetch_row($result)){ $archiveRows[]="".$month_array[$m]." $currentYear"; } //Предыдущие годы $result=sql("select distinct YEAR(created) from blogs where YEAR(created)<>'$currentYear' and created<>'0000-00-00' $andTitleNotEmpty order by created desc"); while(list($y) = mysql_fetch_row($result)){ unset($yearMonths, $yearMonthsList); // месяцы этого года $yresult=sql("select distinct date_format(created, '%c') from blogs where YEAR(created)='$y' and created<>'0000-00-00' order by created desc"); while(list($ym) = mysql_fetch_row($yresult)){ $yearMonths[]="".$month_array[$ym]." $y"; } if(is_array($yearMonths)) $yearMonthsList = "
".join($yearMonths, "")."
"; $archiveRows[]="
$y$yearMonthsList
"; } if(is_array($archiveRows)){ $archiveRowsList="
".unlanguage("АРХИВ ЗАПИСЕЙ###ARCHIVE")."
".join($archiveRows, "")."

"; } //Теги if($language==1){ $onlyNotEmpty = " and object_id in (select id from blogs where $TitleNotEmpty)"; } $result=sql("select tag_id, COUNT(*) as c from tags_lnk where object_type='blogs$language' $onlyNotEmpty group by tag_id order by c desc"); // limit 10 while(list($tag_id, $c) = mysql_fetch_row($result)){ $tag = get_title('tags', $tag_id, 'tag'); $tagHref = urlencode($tag); $tagsRows[]="$tag"; } if(is_array($tagsRows)){ $tagsRowsList="
".unlanguage("ТЕГИ###TAGS")."
".join($tagsRows, "")."
"; } $this_content.="
$yashare
$catsButtonsList
$rowsList
$recentEntriesList $archiveRowsList $tagsRowsList
$listalka $add_new
"; //$content_page_title=$page_header; echo standard_content($this_content);