|
|
include 'r34.php';
@mysql_select_db($bd_name, $link);
$count = mysql_query("SELECT COUNT(*) from $tb_news WHERE `id_firm`!='1'");
while($rw=mysql_fetch_array($count))
{
$n=$rw['COUNT(*)'];
}
if (empty($lim)) { $lim=1; }
if($lim==1) { $h=0; }
else {
$lim--;
$h=$lim*5;
$lim++;
}
$res=mysql_query("SELECT $tb_news.*, $tb_firms.name_in FROM $tb_news, $tb_firms WHERE `id_news`!='1' and $tb_news.id_firm=$tb_firms.id_firm ORDER BY `id_news` DESC limit $h,10");
while($row=mysql_fetch_array($res))
{
$id_news=$row['id_news'];
$name_in=$row['name_in'];
$id_firm=$row['id_firm'];
$title=$row['title'];
$text=$row['text'];
$update=$row['data_in'];
$data=date("d.m.Y", $update);
$preview = substr("$text", 0, 500);
@print "
$data   $title |
$preview |
$name_in
|
"; }
@print "";
$st=$n/10;
if((gettype($st))==double) { $st++; settype ($st, 'integer' ); }
else { settype ($st, 'integer' ); }
$mir=$st;
print "<< ";
$back=$lim-5;
for($back;$back<=$lim;$back++) { if(($lim != $back)&&($back>0)) { print " $back "; } }
print "$lim";
$ahead=$lim+5;
$lim++;
for($lim;$lim<=$ahead;$lim++) { if(($lim<=$st)&&($mir != $h)) { print " $lim "; } }
print " >> ";
?> |
|
$word="новости"; include 'right.txt'; ?> |