Onbekend |
|
Ik heb geprobeerd het navigatiesysteem Slipie hier bij de scripts, te combineren met mijn "nieuwssysteem" .. alleen als ik de pagina open waar het opstaat krijg ik een timeout ..
<link rel="stylesheet" href="style.css" type="text/css">
<?
include "config.php";
$page = (!isset($_GET['page'])) ? 1 : $_GET['page'];
//aantal records per pagina
$max = 5;
$start = ($max * $page) - $max;
//hier je gegevens van je mysql ophalen
while($news = mysql_fetch_object(mysql_query("SELECT * FROM news ORDER BY nid LIMIT " . $start . ", " . $max . ""))) {
$message = nl2br($news->message);
$message = wordwrap($message, 81, "\n", 1);
?>
<table bgcolor="#333333" width="100%" class="textbody" align="center" vAlign="center" cellpadding="5" cellspacing="0" bordercolor="#000000" border="1">
<tr>
<td colspan="4"><?=$news->title;?></td>
</tr>
<tr height="100">
<td align="left" valign="top" width="20%"><b><?=$news->poster;?></b></td><td colspan="3" valign="top" align="left"><?=$message;?></td>
</tr>
<tr>
<td colspan="2" style="border:0px;"><?=$news->date;?> - <?=$news->time;?></td><td style="border:0px;" align="right">Comments</td>
</tr>
</table>
<br>
<?
}
//hier aan jou mysql gegevens aanpassen
$rows = mysql_result(mysql_query("SELECT COUNT(nid) FROM news ORDER BY nid"),0);
$pages = ceil($rows / $max);
if ($page > 1) {
$previous = $page - 1;
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $previous . "\"><<</a> ";
}
for ($i = 1; $i <= $pages; $i++) {
if ($page == $i) {
if ($i == $pages) {
echo "<b>" . $i . "</b> ";
} else {
echo "<b>" . $i . "</b>, ";
}
} else {
if ($i == $pages) {
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $i . "\">" . $i . "</a> ";
} else {
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $i . "\">" . $i . "</a>, ";
}
}
}
if ($page < $pages) {
$next = $page + 1;
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $next . "\">>></a>";
}
?>
<link rel="stylesheet" href="style.css" type="text/css"> <? include "config.php"; $page = (!isset($_GET['page'])) ? 1 : $_GET['page']; //aantal records per pagina $max = 5; $start = ($max * $page) - $max; //hier je gegevens van je mysql ophalen $message = nl2br($news->message); $message = wordwrap($message, 81, "\n", 1); ?> <table bgcolor="#333333" width="100%" class="textbody" align="center" vAlign="center" cellpadding="5" cellspacing="0" bordercolor="#000000" border="1"> <tr> <td colspan="4"><?=$news->title;?></td> </tr> <tr height="100"> <td align="left" valign="top" width="20%"><b><?=$news->poster;?></b></td><td colspan="3" valign="top" align="left"><?=$message;?></td> </tr> <tr> <td colspan="2" style="border:0px;"><?=$news->date;?> - <?=$news->time;?></td><td style="border:0px;" align="right">Comments</td> </tr> </table> <br> <? } //hier aan jou mysql gegevens aanpassen $pages = ceil($rows / $max); if ($page > 1) { $previous = $page - 1; echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $previous . "\"><<</a> "; } for ($i = 1; $i <= $pages; $i++) { if ($page == $i) { if ($i == $pages) { echo "<b>" . $i . "</b> "; } else { echo "<b>" . $i . "</b>, "; } } else { if ($i == $pages) { echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $i . "\">" . $i . "</a> "; } else { echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $i . "\">" . $i . "</a>, "; } } } if ($page < $pages) { $next = $page + 1; echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=" . $next . "\">>></a>"; } ?>
|