query('SELECT * FROM texts WHERE pid='.$id.' ORDER BY position'); $i=1; while($db->next_record()){ $t[$i]=$db->record['title']; $c[$i]=$db->record['body']; $i++; } $tpl->load("articles_index"); $tpl->load_dynamic("articles_index", "articles"); $tpl->load_dynamic("articles_index", "articles"); $tpl->load_dynamic("articles_index", "more"); $link = "articles"; $q=" type='visible' "; $db->query("SELECT id,title,body,anons,date,url FROM articles WHERE ".$q." ORDER BY date DESC LIMIT 3"); while($db->next_record()) { $id = $db->record['id']; $img = $more = ""; $body = trim($db->record['body']); if((trim($body) != "") && (trim(strip_tags($body)) != " ")) $more = $tpl->parse_dynamic("more", array("link"=>"/".$link."/".$db->record['url'].".html")); $img=$dir['photos'].'/articles/'.$db->record['id'].'.jpg'; if (file_exists($dir['main'].$img)) { $size=getimagesize($dir['main'].$img); $hh="height:".$size[1]."px;"; if (($size[0]>100)and($size[1]>$size[0])) {$hh1="height=\"100\"";$hh="height:100px;";} elseif(($size[0]>100)and($size[0]>$size[1])) {$hh1="width=\"100\"";$hh="height:".($size[1]*100/$size[0])."px;";} $img=""; }else{ $img=''; $hh=''; } $anons=$db->record['anons']; $anons=strip_tags($anons); if (strlen($anons)>200) { $anons=substr($anons,0,197).'...'; } $date=$months[date("n", $db->record['date'])]; $date=date("d", $db->record['date'])." ".$date." ".date("Y", $db->record['date']); $articles .= $tpl->parse_dynamic("articles", array("date"=>$date, "title"=>$db->record['title'], "anons"=>$anons, "more"=>$more, "img"=>$img, 'hh'=>$hh)); } $db1 = new DbLib; $db1->cfg($db_host, $db_user, $db_pass, $db_name); $db->query('SELECT * FROM products WHERE cat_id=1 AND visible=\'y\' ORDER BY position,name'); $works=''; while($db->next_record()){ $db1->query('SELECT * FROM photos WHERE cat_id='.$db->record['id'].' order by name limit 1'); $db1->next_record(); $works.='
  • '; } // while ?> Создание сайтов Запорожье, изготовление сайтов Запорожье, разработка сайтов Запорожье - Sukro



    Статьи