//Расчёт количества страниц
$x=0;
if (isset($_GET[x]))
{
$x=$_GET[x];
$x=$x-1;
}
$yz=$x*10;
//Страница
function strani($x, $query, $num)
{
$koliko=mysql_num_rows($query);
$strani=round($koliko/$num+0.5);
$y=$x+2;
$w=$x;
$x=$x+1;
echo "<br><br>Страницы: ";
if($strani=='1')
{
echo "<a href='?x=1'>1</a>";
}
elseif ($strani=='2')
{
echo "<a href='?x=1'>1</a> ";
echo "<a href='?x=2'>2</a>";
}
elseif ($strani=='3')
{
echo "<a href='?x=1'>1</a> ";
echo "<a href='?x=2'>2</a> ";
echo "<a href='?x=3'>3</a>";
}
elseif($y>=$strani)
{
$y=$strani;
$w=$strani-2;
$x=$strani-1;
echo "
<a href='?x=1'>1</a> ...
<a href='?x=$w'>$w</a>
<a href='?x=$x'>$x</a>
<a href='?x=$y'>$y</a>";
}
elseif ($w<=1)
{
echo "<a href='?x=1'>1</a>
<a href='?x=2'>2</a>
<a href='?x=3'>3</a> ...
<a href='?x=$strani'>$strani</a>";
}
else
{
echo "<a href='?x=1'>1</a> ...
<a href='?x=$w'>$w</a>
<a href='?x=$x'>$x</a>
<a href='?x=$y'>$y</a> ...
<a href='?x=$strani'>$strani</a>";
}
}
function categorystrani($x, $query, $num, $cat)
{
$koliko=mysql_num_rows($query);
$strani=round($koliko/$num+0.5);
$y=$x+2;
$w=$x;
$x=$x+1;
echo "<br><br>Страницы: ";
if($strani=='1')
{
echo "<a href='?site=category&cat=$cat&x=1'>1</a>";
}
elseif ($strani=='2')
{
echo "<a href='?site=category&cat=$cat&x=1'>1</a> ";
echo "<a href='?site=category&cat=$cat&x=2'>2</a>";
}
elseif ($strani=='3')
{
echo "<a href='?site=category&cat=$cat&x=1'>1</a> ";
echo "<a href='?site=category&cat=$cat&x=2'>2</a> ";
echo "<a href='?site=category&cat=$cat&x=3'>3</a>";
}
elseif($y>=$strani)
{
$y=$strani;
$w=$strani-2;
$x=$strani-1;
echo "
<a href='?site=category&cat=$cat&x=1'>1</a> ...
<a href='?site=category&cat=$cat&x=$w'>$w</a>
<a href='?site=category&cat=$cat&x=$x'>$x</a>
<a href='?site=category&cat=$cat&x=$y'>$y</a>";
}
elseif ($w<=1)
{
echo "<a href='?site=category&cat=$cat&x=1'>1</a>
<a href='?site=category&cat=$cat&x=2'>2</a>
<a href='?site=category&cat=$cat&x=3'>3</a> ...
<a href='?site=category&cat=$cat&x=$strani'>$strani</a>";
}
else
{
echo "<a href='?site=category&cat=$cat&x=1'>1</a> ...
<a href='?site=category&cat=$cat&x=$w'>$w</a>
<a href='?site=category&cat=$cat&x=$x'>$x</a>
<a href='?site=category&cat=$cat&x=$y'>$y</a> ...
<a href='?site=category&cat=$cat&x=$strani'>$strani</a>";
}
}
//Страница
function stranikomentarjev($x, $query, $num, $id)
{
$koliko=mysql_num_rows($query);
$strani=round($koliko/$num+0.5);
$site=$_GET[site];
$y=$x+2;
$w=$x;
$x=$x+1;
echo "<br><br>Страницы: ";
if($strani=='1')
{
echo "<a href='?site=news&id=$id&x=1'>1</a>";
}
elseif ($strani=='2')
{
echo "<a href='?site=news&id=$id&x=1'>1</a> ";
echo "<a href='?site=news&id=$id&x=2'>2</a>";
}
elseif ($strani=='3')
{
echo "<a href='?site=news&id=$id&x=1'>1</a> ";
echo "<a href='?site=news&id=$id&x=2'>2</a> ";
echo "<a href='?site=news&id=$id&x=3'>3</a>";
}
elseif($y>=$strani)
{
$y=$strani;
$w=$strani-2;
$x=$strani-1;
echo "
<a href='?site=news&id=$id&x=1'>1</a> ...
<a href='?site=news&id=$id&x=$w'>$w</a>
<a href='?site=news&id=$id&x=$x'>$x</a>
<a href='?site=news&id=$id&x=$y'>$y</a>";
}
elseif ($w<=1)
{
echo "<a href='?site=news&id=$id&x=1'>1</a>
<a href='?site=news&id=$id&x=2'>2</a>
<a href='?site=news&id=$id&x=3'>3</a> ...
<a href='?site=news&id=$id&x=$strani'>$strani</a>";
}
else
{
echo "<a href='?site=news&id=$id&x=1'>1</a> ...
<a href='?site=news&id=$id&x=$w'>$w</a>
<a href='?site=news&id=$id&x=$x'>$x</a>
<a href='?site=news&id=$id&x=$y'>$y</a> ...
<a href='?site=news&id=$id&x=$strani'>$strani</a>";
}
}
ребят подскажите плиз как сделать отдельный дизайн кнопки с номером страници на которой находишься!