<?php
if (!defined('BLOCK_FILE')) {
    Header("Location: ../index.php");
    exit;
}

$top= "4";//количество отображаемых новостей
$symbols = 50;//количство букв в заголовке новости
$symbols2 = 150;//количество букв в новости

/* Top 10 news */
global $prefix, $db, $dbi;
$result = $db->sql_query("SELECT sid, counter, title, hometext, counter FROM ".$prefix."_stories $queryalang ORDER BY counter DESC LIMIT 0,$top");
if ($db->sql_numrows($result) > 0) {
    $lugar=1;
    while(list($sid, $counter, $title, $hometext,) = $db->sql_fetchrow($result)) {
    $sid = intval($sid);
    $hometext=strip_tags(bb_decode($hometext, 'news'));
    $linktitle = cutstr($title, $symbols);
    $counter = intval($counter);
    $text = cutstr($hometext, $symbols2);
    
    
        if($counter>0) {
$content .= "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">  
<tr><td align=\"center\"></td>
<tr><td align=\"center\"><H2>$linktitle</H2></td>
</tr><tr><td align=\"center\">
<img border=\"0\" width=\"160\" height=\"120\" align=\"center\" style=\"cursor: pointer;\" OnMouseOver=\"Tip('<img src=&quot; http://www.ru/папка/$sid.jpg\ &quot; width=392 ;>')\" src=\"http://www.ru/папка/$sid.jpg\"  border=\"0\"></a>
</td></tr>  
<tr><td colspan=\"0\">&nbsp&nbsp&nbsp&nbsp&nbsp$text</td></tr><tr><td colspan=\"2\" align=\"center\">
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href=\"index.php?name=news&op=view&id=$sid\" title=\"Подробнее\">Подробнее>>></td>
</tr></table>";

    }
    }
}



?>
