Размер файла: 3.06Kb
<?php
#[-------------------------------------------]
#[=] [=]
#[=] Wap - Голосования [=]
#[=] [=]
#[=] Версия - 2.0 [=]
#[=] Автор - chezz [=]
#[=] Мыло - [email protected] [=]
#[=] ICQ - 29-48-48 [=]
#[=] [=]
#[-------------------------------------------]
define('VOTES','1');
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);
require_once ("config.php"); /////Подключаем настройки
require_once ("connect.php"); /////Подключаемся к БД
require_once ("func.php"); /////Подключаем функции
require_once ("lang.ini.php");/////Подключаем lang-файл
if (isset($_GET['p']))
{
$p=filtr($_GET['p']);
if(isset($_GET['z'])) $z=filtr($_GET['z']);
else $z="";
} else {
$z=""; }
@mysql_query("OPTIMIZE TABLE ".$prefix."votes");
@mysql_query("OPTIMIZE TABLE ".$prefix."count");
$r3=@mysql_query("SELECT * FROM ".$prefix."votes");
if(mysql_num_rows($r3)=="1") {
$row = mysql_fetch_array($r3);
$id = $row['id'];
header("Location: show.php?id=$id&$m");
}
if ($z==false OR $z==1) { $start=0; $page="first"; }
else
{
$pg=mysql_num_rows($r3)/$na_stranice;
if ($p="next") $start=$z*$na_stranice-$na_stranice;
else $start=$z*$na_stranice+$na_stranice;
$pg=ceil($pg);
$minpage=1;
$maxpage=$pg;
}
if (!isset($page))
{
if ($z == $maxpage) $page="last";
else $page="some";
}
$thispage=$z;
$r=@mysql_query("SELECT * FROM ".$prefix."votes ORDER BY `id` DESC LIMIT $start, $na_stranice");
$r2=@mysql_query("SELECT countall FROM ".$prefix."count ORDER BY `id` DESC LIMIT $start, $na_stranice");
body_begin();
echo "<p><b>$lang[votes]:</b></p>";
for($i = 0;$i < mysql_num_rows($r);$i++)
{
if(!isset($num))
{
if(isset($p))
{
$num=$start+1;
}
else $num=1;
}
else $num++;
$row = mysql_fetch_array($r);
$row2 = mysql_fetch_array($r2);
$id = $row['id'];
$count = $row2['countall'];
if(!$count) $count="0";
$name = $row['name'];
echo $num.') <a href="show.php?id='.$id.'&'.$m.'">'.$name."</a> [".$count."]<br/>\n";
}
if (mysql_num_rows($r3)>$na_stranice)
{
if ($page=="first")
{
$z=2;
echo "<a href=\"index.php?p=next&z=$z&$m\">$lang[next]</a>";
}
elseif ($page=="last")
{
$z=$thispage-1;
echo "<a href=\"index.php?p=prev&z=$z&$m\">$lang[prev]</a>";
}
else
{
$z=$thispage-1;
echo "<a href=\"index.php?p=prev&z=$z&$m\">$lang[prev]</a>";
$z=$thispage+1;
echo "<a href=\"index.php?p=next&z=$z&$m\">$lang[next]</a>";
}
}
echo "<br/><br/><a href=\"http://$main_link\">$lang[main_name]</a>\n\r";
xmllink();//Ссылка на xhtml или на wml
echo "$copy";
body_end();
mysql_close($connect);
?>