Ive read and re read the article a few times.. all the time I try to put it to use with my current news displayer I get parse errors out the butt or It dont work properly...
Ive been trying for bout 3-5 days now and I still cannot figure it out...
Im trying to get it to display 3 entrys per page, but always show the previous / next buttons, just make the previous one not clickable on the first page, and the next button not clickable on the last...
Here is my code (I removed all the stuff that made it break since I had no idea what I was doing anyway.. but this works fine just no 1 2 3 buttons)
function displayNews () {
global $TheHardyZcom;
$user_status = $this->user_info($TheHardyZcom,title);
mysql_connect($this->server, $this->db_user, $this->db_pass);
mysql_select_db($this->database);
$query = mysql_query("SELECT * FROM news ORDER BY time DESC LIMIT 0,3");
$result = mysql_num_rows($query);
mysql_close();
if ($result < 1) {
echo "No new news";
}
else {
while ($row = mysql_fetch_array($query)) {
$id = $row["id"];
$time = $row["time"];
$n_date = date("F jS", $time);
$n_year = date("Y", $time);
$n_time = date("g:ia", $time);
$time = "$n_date<b class='color'>,</b> $n_year <b class='color'>@</b> $n_time";
$user = $row["user"];
$subject = $row["subject"];
$data = $row["data"];
$editer = $row["edited"];
echo "<b class='color'>$subject</b> <b class='color'>(</b>$time<b class='color'>)</b> - <a href='profile.php?user=$user'>$user</a>";
if ($user_status == "Admin") {
?>
- <a href="news.php?edit=<? echo "$id" ?>&subject=<? echo "$subject" ?>&news=<? echo "$data" ?>">edit</a> - <a href="news.php?del=<? echo "$id" ?>">delete</a>
<?
}
?>
<table width="95%" border="0" cellpadding="0" cellspacing="0" class="noborder" align="center">
<tr>
<td>
<? echo "$data" ?><br>
</td>
</tr>
</table>
<?
if ($editer) {
echo "<i>edited by:</i> <a href='profile.php?user=$editer'>$editer</a><br>";
}
echo "<br>";
}
}
}
Anyone who could help me Id appreciate it alot.. thanks 😐