Yeesh, time to post up the code then and find out the problem as I can't seem to figure it out.
Here is the php file:
<?php
include('includes/DB.php')
?>
<html>
<head>
<title>Unleashed - Guild of World of Warcraft</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
<div id="nav">
<ul>
<li> <a href="/">Home</a></li>
<li> <a href="http://www.guildland.com">Forum</a></li>
<li> <a href="/rules.php">Rules</a></li>
</ul>
<ul>
<li> <a href="http://www.guildland.com/usercp">Account</a></li>
<li> <a href="/gallery/">Gallery</a></li>
<li> <a href="/links.php">Links</a></li>
</ul>
</div>
</div>
<div id="content1">
<div id="text1">
<div class="heading">News Archive</div>
<br />
<p>
<?php
//Get the numeration of the page
$num = $_GET['page'];
//if the numeration is empty
if(empty($num)){
//the numeration is 1
$num = 1;
};
//Sets the limit of results to display in each page, change if you want.
$limit = 16;
/*
The query will start selecting the numeration, for example 2, less 1, that would be 1
* the limits of results to show per page, 2 in this case so it would be 1*2 = 2, it will
start from 2 ;) if the limit would be 5 and the numeration would be 3 if would be (3-1)*5 = 10
*/
$start = ($num-1)*$limit;
//rounds the result
$start = round($start,0);
/*
This query will select the contrene FROM the start and with a limit of 2, in this case,
because the variable $limit is 2
You can add a WHERE something= '$something' for example, or delete the ORDER by `id`, or change it,
etc
*/
$sql = "SELECT * FROM news ORDER BY date DESC LIMIT $start, $limit";
//now it makes the query and names it as result2
$result2 = mysql_query($sql);
/*
While will repeat this query and mysql_fect_array allow me array the content
*/
while ($r = mysql_query($result2)){
echo "$r[title]<br>";
};
//Get the total number of results
$totalpages = mysql_result(mysql_query("SELECT Count(*) from `news`"),0);
/*
Total resutls/ the limit, in this example is 2, so if there are 10 total result and the limit is 2
there will be 5 pages.
*/
$totalpages = $totalpages / $limit;
$totalpages = ceil($totalpages);
//The variable c is 0
$c = 0;
//while c is < than the total pages
while($c<$totalpages){
//sets the variable $page as 0 + 1 = 1
$page = $c + 1;
//Gets the number of the page and if its the same that the page
if($_GET['num']==$page){
//its only echoes the page, not the url to this page
echo "[$page] ";
}else{
//it echoes the url to the page
echo "<a href=\"?page=$page\">[$page]</a> ";
}
$c = $c+1;
}
// We want three columns:
$display_columns = 2;
// We do the query, and find out how many items we'll need to list.
$result = mysql_query($sql);
$count = mysql_num_rows($result);
// We have enough to figure out how many empty spaces there'll be left at
// the bottom of the table.
$padding = ($display_columns-1)-(($count-1)%$display_columns);
// We also know enough to know how many rows there'll be, but I for one
// don't really care about that right now.
$num = 0;
echo '<table width="100%" border=0 cellpadding=1 cellspacing=1><tr>';
while($news = mysql_fetch_assoc($result)) {
echo '<td width="50%">';
echo "<div style=\"font-size: 12px;\" align=\"left\"><a href=\"archive.php?view=news&id=$news[id]\" target=\"_self\">$news[title]</a>";
echo '<div style="font-size: 12px;" align="left">';
echo $news['date'];
echo '</div></td>';
if(++$num % $display_columns == 0)
echo '</tr><tr>';
}
echo '</tr>';
// That's all the items done; now we just need to pad the table out and
// wrap up. We don't need to pad at all if $padding is zero.
if($padding!=0)
{ for($i=0;$i<$padding;$i++)
echo '<td></td>';
echo '</tr>';
}
echo '</table>';
?>
</p>
</div>
</div>
<div id="footer">
<a href="/news/">News</a> |
<a href="http://www.guildland.com">Forum</a> |
<a href="/rules.php">Rules</a> |
<a href="http://www.guildland.com/usercp">Account</a> |
<a href="/gallery/">Gallery</a> |
<a href="/links.php">Links</a>
<p><a href="http://www.freewebsitetemplates.com">Legal Documents</a> |
<a href="http://www.freewebsitetemplates.com">Game Policies</a> <br />
© 2006 <a href="http://www.worldofwarcraft.com">World of Warcraft</a>. All rights reserved.</p>
</div>
</div>
</body>
</html>
Here is the CSS file:
body {
background: #000000;
color: #534834;
font-family: tahoma, arial;
font-size: 11px;
line-height: 15px;
margin: 0;
padding: 0;
text-align: center;
}
* html body {
line-height: 13px;
}
a:link {
color: #B00000;
font-weight: bold;
text-decoration: none;
}
a:visited {
color: #B00000;
font-weight: bold;
text-decoration: none;
}
a:hover, a:active {
color: #000000;
font-weight: bold;
text-decoration: underline;
}
#footer a:link {
color: #F1D6AC;
font-weight: bold;
text-decoration: none;
}
#footer a:visited {
color: #F1D6AC;
font-weight: bold;
text-decoration: none;
}
#footer a:hover, #footer a:active {
color: #FFFFFF;
font-weight: bold;
text-decoration: underline;
}
#nav a:link {
color: #F1D6AC;
font-weight: bold;
text-decoration: none;
}
#nav a:visited {
color: #F1D6AC;
font-weight: bold;
text-decoration: none;
}
#nav a:hover, #nav a:active {
color: #FFFFFF;
font-weight: bold;
text-decoration: underline;
}
#right a:link {
color: #73613B;
font-weight: bold;
text-decoration: underline;
}
#right a:visited {
color: #73613B;
font-weight: bold;
text-decoration: underline;
}
#right a:hover, #right a:active {
color: #000000;
font-weight: bold;
text-decoration: none;
}
/* ------------------------------------------------------------------ DIV ID's ------- */
#container {
margin: 0 auto;
margin-top: 20px;
text-align: left;
width: 900px;
}
#content1 {
background: url(images/undead-bg2.gif) no-repeat 2px;
clear: both;
display: block;
height: 450px;
padding-left: 130px;
padding-top: 38px;
width: 770px;
}
#footer {
background: url(images/footer-bg.jpg) no-repeat;
clear: both;
color: #F1D6AC;
display: block;
height: 99px;
padding-top: 20px;
text-align: center;
width: 900px;
}
#header {
background: url(images/header-bg2.jpg) no-repeat;
display: block;
height: 197px;
width: 900px;
}
#left {
background: url(images/btm-left-bg.gif) no-repeat;
display: block;
float: left;
height: 494px;
width: 558px;
}
#pagebottom {
clear: both;
width: 900px;
}
#nav {
padding-left: 175px;
padding-top: 68px;
}
#nav ul {
float: left;
list-style: none;
margin: 0;
margin-right: 70px;
padding: 0;
}
* html #nav ul {
margin-right: 40px;
}
#nav li {
float: left;
list-style: none;
margin: 0;
margin-right: 30px;
padding: 0;
}
#right {
background: url(images/btm-right-bg.gif) no-repeat;
display: block;
float: left;
height: 464px;
padding-left: 25px;
padding-top: 30px;
width: 314px;
}
#text1 {
width: 600px;
}
#text2 {
margin-left: 110px;
margin-top: 28px;
width: 410px;
}
#text3 {
font-family: tahoma, arial;
font-size: 4px;
}
#quicklinks {
background: url(images/quicklinks-bg.gif) no-repeat;
display: block;
height: 165px;
margin-bottom: 10px;
padding-top: 5px;
width: 210px;
}
#quicklinks ul {
list-style: none;
margin: 0;
margin-left: 40px;
padding: 0;
}
* html #quicklinks ul {
margin-top: 22px;
}
#quicklinks li {
list-style: none;
margin: 0;
margin-top: 15px;
padding: 0;
}
* html #quicklinks li {
margin-top: 16px;
}
/* ------------------------------------------------------------------ CLASSE'S ------- */
.flt-lft {
float: left;
margin-right: 10px;
}
.flt-rgt {
float: right;
}
.heading {
color: #413727;
font-family: arial;
font-size: 14px;
font-weight: bold;
margin-bottom: -10px;
}
* html .heading {
margin-bottom: -16px;
}
.heading2 {
color: #413727;
font-family: arial;
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
}
.small {
font-size: 10px;
}
So anyone that can give me info leading to the fix please do.
THanks Kudose for checking on that.