File size: 3.29Kb
<?php
include('nm.php');
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
if($_SESSION['admin_name']=="")
{ header("Location: $error"); exit(); }
else
{
if($admin_name!=$_SESSION['admin_name'] && $admin_password!=$_SESSION['admin_password'])
{ header("Location: $error"); exit(); }}
include('head.php');
echo"<tr>";
echo"<td class=\"row1\">";
echo"<span class=\"yellow\">";
echo"Рейтинг страниц:";
echo"</span>";
echo"</td>";
echo"</tr>";
$pnumber=$amount;
if($s == "")
$s=1; $begin=($s-1)*$pnumber;
$thm=mysql_query("select * from statstr ORDER BY countstr DESC limit $begin, $pnumber;");
$tot=mysql_query("select count(*) from statstr ;");
if($thm && $tot)
{
while($theme = mysql_fetch_array($thm))
{
echo"<tr>";
echo"<td class=\"row1\">";
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
echo"<span class=\"bool\">";
echo "".$theme['namestr']."<br>";
echo "<small>Посещений: <b>".$theme['countstr']."</b></small>";
echo"</span>";
echo"</td>";
echo"</tr>";
}
echo"<tr>";
echo"<td class=\"row1\">";
$total=mysql_fetch_array($tot);
$number = (int) ($total['count(*)']/$pnumber);
if($total['count(*)'] >= ($pnumber+1))
{
if((float) ($total['count(*)']/$pnumber)-$number !=0) $number++;
echo"<span class=\"red\">";
if($s == 1) echo"<<.Пред. |";
echo"</span>";
if($begin>0) {
echo "<a href=\"statstr.php?s=".($s-1)."&set=$set\"><<.Пред.</a>";
echo"<span class=\"red\">|</span>"; }
if($total['count(*)']>$begin+$pnumber) {
echo"<span class=\"red\">|</span>";
echo "<a href=\"statstr.php?s=".($s+1)."&set=$set\">След.>></a>"; }
echo"<span class=\"red\">";
if($number == $s) echo"| След.>>";
echo"</span>";
$all=ceil($total['count(*)'] / $pnumber); $i=1; $c=""; $tt=$s;
while($i<=$all){
if($i<=3 || $i==$tt- 1 || $i==$tt || $i==$tt+1 || $i>=$all-2)
{$ii="<a href=\"statstr.php?s=".$i."&sid=$sid\">".$i."</a>";
if($i==$tt) { if($i!=$all){ $c.= "<b>$i</b>,";}
else{$c.= "<b>$i</b>";}
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
}
else { if($i!=$all){ $c.= "$ii,";} else{$c.= "$ii";} }}
else{$c.= "."; } $i++; }
$c=preg_replace("/[,][.]+/", "...",$c);
echo"<span class=\"red\">";
echo "<br>$c";
echo"</span>";
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<td class=\"row1\">";
echo"<span class=\"red\">";
echo"<b>Всего : ".$total['count(*)']."</b><br>";
echo"</span>"; } }
echo '<a href="./">Статистика</a><br>';
echo"</td>";
echo"</tr>";
include('foot.php');
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
?>