Wielkie dzięki LBO!!Wszystko działa jak należy pozdro dla Ciebie!
ale mam jeszcze jeden problem! chodzi o to ze wprowadzilem taka opcje! ze wybieram sobie po ile ma wyswietlac mi newsow na stronie i gdy wyswietlam ze po 1 na stronie to pokazuje mi sie 6 stron czyli dobrze ale gdy przejde na strone inna np 3 to on wyswietla mi 5 newsow i ze sa dwie stronki do wyswietlenia!poprostu zapomina co ma robic to kod mam nadzieje ze wystarczajacy
<?php
$count = 0;
{
$array_smiles[$count]['smile'] = $record_smiles['smile'];
$array_smiles[$count]['file'] = $record_smiles['file'];
$count++;
}
if (isset($_POST['send'])) {
$int_poile = $_POST['submit_poile'];
{
$int_od = 0;
}
else
{
$int_od = $_GET['od'];
}
}
else
{
$int_poile = 5;
{
$int_od = 0;
}
else
{
$int_od = $_GET['od'];
}
}
$sql = "SELECT id, status, text_short, title, nick, image, link, date, mail FROM ne
ws_news WHERE status='1' ORDER BY date DESC";
$newsy = 0;
$limit = ' LIMIT ' . $int_od . ', ' . $int_poile;
$sql = "SELECT id, status, text_short, title, nick, image, link, date, mail FROM ne
ws_news WHERE status='1' ORDER BY date DESC $limit";
{
if ($record['status'] == 1)
{
$id_news = $record['id'];
$num_comments = 0;
$sql = "SELECT id, id_news FROM news_comments WHERE id_news='$id_news'";
for ($i = 0; $i < count($array_smiles); $i++) {
$record['text_short'] = str_replace($array_smiles[$i]['smile'], '<img src="images/smiles/icon_' . $array_smiles[$i]['file'] . '.gif" />', $record['text_short']); }
if(!empty($record['image'])) {
$image = '<img src="images/avatars/' . $record['image'] . '">';
}
else
{
$image = '';
}
$link_short = $record['link'];
{
$link_short = substr($link_short, 0
,20
); $link_short .= '...';
}
if (!empty($record['link'])) {
$link = '<br /><br /><b>Link:</b> <a href="' . $record['link'] . '" target="_blank">' . $link_short . '</a>';
}
else
{
$link = '';
}
//tu wyswietlam nick itp itd
}
}
<table class="news_short" cellpadding="0" cellspacing="0" width="300">
<form enctype="multipart/form-data" action="index.php" method="post">
<tr>
<td class="nick" width="70" align="center">Pokaż po</td>
<td class="nick" width="60" align="center"><select name="submit_poile"><option>1<option selected>5<option>10<option>25</td>
<td class="nick" width="110" align="center"> newsów na stronie</td>
<td class="nick" width="60" align="center"><input type="submit" name="send" value="Pokaż" /></td>
</tr>
</form>
</table>
<br /><br />';
$prev = $int_od - $int_poile;
if($prev >=0)
{
echo '<a href="index.php?od=' . $prev . '"><span class="arrows">« Poprzednia </span></a>';
}
else
{
echo '<span class="arrows2">« Poprzednia </span>';
}
$x = 0;
for($j = 0; $j<$newsy; $j+=$int_poile)
{
if ($j != 0)
{
echo '<span class="arrows"> | </span>'; }
if($j == $_GET['od'])
{
echo '<b>'.($x + 1).'</b>'; }
else
{
echo '<a href="index.php?od=' . $j . '">' .($x + 1). '</a>'; }
$x++;
}
$next = $int_od + $int_poile;
if($next<floor($newsy))
{
echo '<a href="index.php?od=' .$next . '"><span class="arrows"> Następna »</span></a>';
}
else
{
echo '<span class="arrows2"> Następna »</span>';
}
?>