Просмотр файла bestwap_news/index.php

Размер файла: 1.7Kb
<?
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>';
print '<head><title>BestWap.wml.su</title><LINK HREF="http://wclick.net.ru/style1.css" REL="stylesheet" TYPE="text/css"></head><body>';
print '<link rel="icon" href="http://bestwap.wml.su/favicon.png"type="image/x-icon"/>';
print '<p align="left">';
include "cfg.php";
if (!@$s) $s=0;
$q=mysql_query("select count(id) from `news` where 1;");
$r=mysql_fetch_array($q);
$count=$r['count(id)'];
if ($s*$lim+$lim>$count) $limit=$count-$s*$lim; else $limit=$lim;
//print $s*$lim;
print $lang['show'].($s*$lim+1).'-'.($s*$lim+$limit).'<br/>'."\n";
print '<p align="left" style="background-color:#666666">';
$q=mysql_query("select * from `news` where 1 order by id desc limit ".($s*$lim).", $limit");
while($data = @mysql_fetch_array($q)){
	$date = (int)(date('d',$data['date'])).' '.$lang[date('m',$data['date'])];
	print '<b><u>'.$date.'</u></b><br/>'.$data['text'].'<br/>'."\n";
	$r1=mysql_fetch_array(mysql_query("select count(*) from `news_com` where nid='".$data['id']."';"));
	print '<a href="opinion.php?id='.$data['id'].'">'.$lang['opinion'].'</a> ['.$r1['count(*)'].']<br/><br/>'."\n";
}
$razd='';
if ($s!=0) { print '<a href="index.php?s='.($s-1).'">'.$lang['back'].'</a>'."\n"; $razd=' | ';};
if (($s==0)&&($count>$lim*$s+1)) print '<a href="index.php?s=1">'.$lang['archive'].'</a>'."\n"; else
if ($count>$s*$lim+$lim) print $razd.'<a href="index.php?s='.($s+1).'">'.$lang['next'].'</a>'."\n";
print '<p align="left">';
print '<br/>---<br/>'."\n";
print '<a href="http://bestwap.wml.su">bestwap.wml.su</a><br/>'."\n";
print '</p></body></html>';
?>