<?php // Dane z SQL'a do tablicy $count = 0; { $array_smiles[$count]['smile'] = $record_smiles['smile']; $array_smiles[$count]['file'] = $record_smiles['file']; $count++; } { $int_poile = $_GET['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'"; { $record['text_short'] = str_replace($array_smiles[$i]['smile'], '<img src="images/smiles/icon_' . $array_smiles[$i]['file'] . '.gif" />', $record['text_short']); } { $image = '<img src="images/avatars/' . $record['image'] . '">'; } else { $image = ''; } $link_short = $record['link']; { $link_short .= '...'; } { $link = '<br /><br /><b>Link:</b> <a href="' . $record['link'] . '" target="_blank">' . $link_short . '</a>'; } else { $link = ''; } //wyswietlam tutaj nick itp itd } } echo' <table class="news_short" cellpadding="0" cellspacing="0" width="300"> <form action="index.php" method="get"> <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 { } $_GET['x'] = 0; for($j = 0; $j<$newsy; $j+=$int_poile) { if ($j != 0) { } if($j == $_GET['od']) { } else { } $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 { } ?> i chodzi o to ze gdy wybiore zeby sortowal pojedynczo tzn zeby na kazdej stronie
byl jeden news to podzieli dobrze ale gdy przejde na kolejna stronke to on zapomina o tym ze ma dzielic pojedynczo i d
zieli ze jest ich po 5! 5 to jest domyslne jak to poprawic?
---dodane---
I mam problem taki, że gdy wybiorę sortowanie po 1 newsie na stronie to gdy przejde np do 3 znow wyswietla mi po 5( bo tak jest ustawione domyslnie) jak mam zrobic zeby pamietal mi ze ma sortowac po 1 newsie albo gdyby tych newsow bylo 50 zeby to dzialalo przy sortowaniu po 10 na stronie(bo mam opcje ze sortuje 1 5 10 i 25)mam nadzieje ze teraz jest wszystko wporzadku i moj temat nie zostanie zablokowany