kDOT
29-11-2009, 11:25 AM
I try to go on my forum i get this on Forum.php
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 5
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 5
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 6
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 27
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 27
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 28
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 52
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 52
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 53
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 74
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 74
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 76
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 100
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 100
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 102
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 118
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 118
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 120
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 137
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 137
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 138
Warning: include(includes/smile.php) [function.include]: failed to open stream: No such file or directory in /home/kylesmit/public_html/index.php/forum.php on line 7
Warning: include(includes/smile.php) [function.include]: failed to open stream: No such file or directory in /home/kylesmit/public_html/index.php/forum.php on line 7
Warning: include() [function.include]: Failed opening 'includes/smile.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kylesmit/public_html/index.php/forum.php on line 7
ForumTopics:RepliesTopicstarterLast replyNew topic
Then i go onto functions cos thats what it says its not working in;
<?php
session_start();
echo "<link REL=stylesheet TYPE=text/css HREF=http://www.mafia-assassins.net/main.css>";
$query=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1");
$info = mysql_fetch_object($query);
$date = gmdate('Y-m-d h:i:s');
function logincheck(){
if (empty($_SESSION['real_name'])){
echo "
<SCRIPT LANGUAGE='JavaScript'>
window.location='index.php';
</script>
";
exit();
}}
///FINSH UPDATING ONLINE
$select = mysql_query("SELECT * FROM travel WHERE username='$username'");
$num = mysql_num_rows($select);
if ($num ==1){
$sql2="SELECT * from travel WHERE username='$username'";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['timeleft'];
$destination= $rows2['destination'];
}
$last = $time - time();
if ($last <=0){
mysql_query("INSERT INTO `logs` ( `id` , `who` , `action` , `date` ) VALUES ('', '$username', 'Traveled to $destination!', '$date')");
mysql_query("UPDATE users SET country='$destination' WHERE username='$username'");
mysql_query("DELETE FROM travel WHERE username='$username'");
}}
$select = mysql_query("SELECT * FROM BFtimes WHERE username='$username'");
$num = mysql_num_rows($select);
if ($num ==1){
$sql2="SELECT * from BFtimes WHERE username='$username'";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['time'];
}
$last = $time - time();
if ($last <=0){
mysql_query("DELETE FROM BFtimes WHERE username='$username'");
}}
$sql2="SELECT * from BF";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['timeleft'];
$owner= $rows2['owner'];
$id= $rows2['id'];
$timeleft = $time - time() ;
$timeadd = time() + 3600 ;
if ($timeleft <0){
mysql_query("UPDATE BF SET `bullets`=`bullets`+'150', timeleft='$timeadd' WHERE status='Producing' AND id='$id' AND bullets='0'");
if(mysql_affected_rows() >= "1"){
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$owner' LIMIT 1"));
mysql_query("UPDATE crews SET `bullets`=`bullets`+'250' WHERE name='$fetch->crew' LIMIT 1");
}
mysql_query("UPDATE BF SET timeleft='$timeadd' WHERE id='$id'");
}}
$sql2="SELECT * from users WHERE username='$username'";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['trainwait'];
$name= $rows2['username'];
$timeleft = $time - time() ;
if ($timeleft <0){
mysql_query("UPDATE users SET trainwait='0' WHERE username='$name'");
}}
$sql2="SELECT * from jail ORDER by id ASC LIMIT 10";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['timeleft'];
$name= $rows2['username'];
$timeleft = $time - time() ;
if ($timeleft <0 || $name ==""){
mysql_query("DELETE FROM jail WHERE username='$name'");
}}
$sql="SELECT * FROM users WHERE username='$username' LIMIT 1";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
$date = gmdate('Y-m-d h:i:s');
if (($rows['rank'] == "Minor") && ($rows['rankpoints'] >= "400")){ $newrank="Wasteman"; $done="1"; }
elseif (($rows['rank']== "Wasteman") && ($rows['rankpoints'] >= "1230")){ $newrank="Thug"; $done="1"; }
elseif (($rows['rank']== "Thug") && ($rows['rankpoints'] >= "2000")){ $newrank="Badman"; $done="1"; }
elseif (($rows['rank']== "Badman") && ($rows['rankpoints'] >= "4320")){ $newrank="Respectable Badman"; $done="1"; }
elseif (($rows['rank']== "Respectable Badman") && ($rows['rankpoints'] >= "8600")){ $newrank="Assassin"; $done="1"; }
elseif (($rows['rank']== "Assassin") && ($rows['rankpoints'] >= "15506")){ $newrank="Respectable Assassin"; $done="1"; }
elseif (($rows['rank']== "Respectable Assassin") && ($rows['rankpoints'] >= "22361")){ $newrank="Boss"; $done="1"; }
elseif (($rows['rank']== "Boss") && ($rows['rankpoints'] >= "36000")){ $newrank="Respectable Boss"; $done="1"; }
elseif (($rows['rank']== "Respectable Boss") && ($rows['rankpoints'] >= "65333")){ $newrank="Godfather"; $done="1"; }
elseif (($rows['rank']== "Godfather") && ($rows['rankpoints'] >= "83216")){ $newrank="Legendary Godfather"; $done="1"; }
elseif (($rows['rank']== "Legendary Godfather") && ($rows['rankpoints'] >= "99633")){ $newrank="Don"; $done="1"; }
elseif (($rows['rank']== "Don") && ($rows['rankpoints'] >= "120000")){ $newrank="Respectable Don"; $done="1"; }
elseif (($rows['rank']== "Respectable Don") && ($rows['rankpoints'] >= "163000")){ $newrank="Global Threat"; $done="1"; }
elseif (($rows['rank']== "Global Threat") && ($rows['rankpoints'] >= "230000")){ $newrank="Infamous Mafioso"; $done="1"; }
else{ $done =="0"; }
if ($done == "1"){
mysql_query("UPDATE users SET rank='$newrank', mail='1', bullets=bullets+'2500' WHERE username='$username'");
mysql_query("INSERT INTO `messages` ( `id` , `t` , `f` , `message` , `date` , `r` , `saved` )
VALUES (
'', '$username', '$username', 'You have been promoted to $newrank congratulations, You received 2,500 bullets!', '$date', '0', '0')");
mysql_query("INSERT INTO `logs` ( `id` , `who` , `action` , `date` ) VALUES ('', '$username', 'Ranked up to <b>$newrank</b>!', '$date')");
}
///////HOUSTON WE HAVE JAIL CHECK!
?>
Then when i go onto forum in cpanel view heres the codes;
<?
session_start();
include "includes/functions.php";
logincheck();
$username=$_SESSION['username'];
include "includes/db_connect.php";
include"includes/smile.php";
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
$userlevel=$fetch->userlevel;
$forum_look=$_GET['forum_look'];
$forum_count = 15;
function index_navigation($index, $count, $num) {
$forum = $_GET['forum'];
if ($index != 0) {
print "<a href=\"forum.php?forum=".$forum."&forum_look=" . ($index - $count) . "\"><<<Last</a> ";
}
if ($num == $count) {
print "<a href=\"forum.php?forum=".$forum."&forum_look=" . ($index + $count) . "\">Next>>></a>";
}
}
if (! isset($forum_look) ) {
$forum_look = 0;
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="includes/in.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width=551 border=1 align="center" cellpadding=2 cellspacing=0 class=thinline rules=none>
<tr>
<td colspan=4 class=header><div align="center">Forum</div></td>
</tr>
<tr>
<td bgcolor=black height=1 colspan=4></td>
</tr>
<tr bgcolor=white>
<td align=center width=41% class=tip>Topics:</td>
<td align=center width=21% class=tip>Replies</td>
<td align=center width=18% class=tip>Topicstarter</td>
<td align=center width=20% class=tip>Last reply</td>
</tr>
<tr>
<td bgcolor=black height=2 colspan=4></td>
</tr>
<? $query=mysql_query("SELECT * FROM `topics` WHERE `forum`='$forum' ORDER BY `lastreply` DESC LIMIT $forum_look, $forum_count");
while($select=mysql_fetch_object($query)){
$num=mysql_num_rows($query);
$total=mysql_num_rows(mysql_query("SELECT * FROM replys WHERE idto='$select->id'"));
$last=mysql_fetch_object(mysql_query("SELECT * FROM replys WHERE idto='$select->id' ORDER by id DESC LIMIT 1"));
if ($select->sticky == "1"){
$typo = "<img src=images/forum/sticky.gif border=0>";
}else{
$typo = "<img src=images/forum/normal.gif border=0>";
}
?>
<tr>
<td height="41"><a href="forum_view.php?viewtopic=<?php echo "$select->id"; ?>&forum=<?php echo "$forum"; ?>"><?php echo "$typo"; ?>
<?php echo "$select->title"; ?></a></td>
<td align=center><?php echo "$total"; ?></td>
<td align=center><a href="profile.php?viewuser=<?php echo "$select->username"; ?>"><?php echo "$select->username"; ?></a></td>
<td align=center><a href="profile.php?viewuser=<?php echo "$select->username"; ?>"><?php echo "$last->username"; ?></a></td>
</tr> <? } ?>
<tr>
<td bgcolor=black height=2 colspan=4></td>
</tr>
<tr bgcolor=white>
<td align=right colspan=4 ><a href='topic.php?viewtopic=<?php echo "$viewtopic"; ?>&forum=<?php echo"$forum"; ?>'><font color="#000000">New
topic</font></a></td>
</tr>
</table>
<div align="center"><br>
<br>
<?php
index_navigation($forum_look, $forum_count, $num);
?>
</div>
</body>
</html>
Anyone help me out here, on how to get it working?
regards,
Kyle
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 5
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 5
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 6
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 27
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 27
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 28
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 52
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 52
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 53
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 74
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 74
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 76
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 100
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 100
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 102
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 118
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 118
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 120
Warning: mysql_query() [function.mysql-query]: Access denied for user 'kylesmit'@'chopin.x10hosting.com' (using password: NO) in /home/kylesmit/public_html/index.php/includes/functions.php on line 137
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kylesmit/public_html/index.php/includes/functions.php on line 137
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kylesmit/public_html/index.php/includes/functions.php on line 138
Warning: include(includes/smile.php) [function.include]: failed to open stream: No such file or directory in /home/kylesmit/public_html/index.php/forum.php on line 7
Warning: include(includes/smile.php) [function.include]: failed to open stream: No such file or directory in /home/kylesmit/public_html/index.php/forum.php on line 7
Warning: include() [function.include]: Failed opening 'includes/smile.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kylesmit/public_html/index.php/forum.php on line 7
ForumTopics:RepliesTopicstarterLast replyNew topic
Then i go onto functions cos thats what it says its not working in;
<?php
session_start();
echo "<link REL=stylesheet TYPE=text/css HREF=http://www.mafia-assassins.net/main.css>";
$query=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1");
$info = mysql_fetch_object($query);
$date = gmdate('Y-m-d h:i:s');
function logincheck(){
if (empty($_SESSION['real_name'])){
echo "
<SCRIPT LANGUAGE='JavaScript'>
window.location='index.php';
</script>
";
exit();
}}
///FINSH UPDATING ONLINE
$select = mysql_query("SELECT * FROM travel WHERE username='$username'");
$num = mysql_num_rows($select);
if ($num ==1){
$sql2="SELECT * from travel WHERE username='$username'";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['timeleft'];
$destination= $rows2['destination'];
}
$last = $time - time();
if ($last <=0){
mysql_query("INSERT INTO `logs` ( `id` , `who` , `action` , `date` ) VALUES ('', '$username', 'Traveled to $destination!', '$date')");
mysql_query("UPDATE users SET country='$destination' WHERE username='$username'");
mysql_query("DELETE FROM travel WHERE username='$username'");
}}
$select = mysql_query("SELECT * FROM BFtimes WHERE username='$username'");
$num = mysql_num_rows($select);
if ($num ==1){
$sql2="SELECT * from BFtimes WHERE username='$username'";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['time'];
}
$last = $time - time();
if ($last <=0){
mysql_query("DELETE FROM BFtimes WHERE username='$username'");
}}
$sql2="SELECT * from BF";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['timeleft'];
$owner= $rows2['owner'];
$id= $rows2['id'];
$timeleft = $time - time() ;
$timeadd = time() + 3600 ;
if ($timeleft <0){
mysql_query("UPDATE BF SET `bullets`=`bullets`+'150', timeleft='$timeadd' WHERE status='Producing' AND id='$id' AND bullets='0'");
if(mysql_affected_rows() >= "1"){
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$owner' LIMIT 1"));
mysql_query("UPDATE crews SET `bullets`=`bullets`+'250' WHERE name='$fetch->crew' LIMIT 1");
}
mysql_query("UPDATE BF SET timeleft='$timeadd' WHERE id='$id'");
}}
$sql2="SELECT * from users WHERE username='$username'";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['trainwait'];
$name= $rows2['username'];
$timeleft = $time - time() ;
if ($timeleft <0){
mysql_query("UPDATE users SET trainwait='0' WHERE username='$name'");
}}
$sql2="SELECT * from jail ORDER by id ASC LIMIT 10";
$result2=mysql_query($sql2);
while($rows2=mysql_fetch_array($result2)){ // Start looping table row
$time= $rows2['timeleft'];
$name= $rows2['username'];
$timeleft = $time - time() ;
if ($timeleft <0 || $name ==""){
mysql_query("DELETE FROM jail WHERE username='$name'");
}}
$sql="SELECT * FROM users WHERE username='$username' LIMIT 1";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
$date = gmdate('Y-m-d h:i:s');
if (($rows['rank'] == "Minor") && ($rows['rankpoints'] >= "400")){ $newrank="Wasteman"; $done="1"; }
elseif (($rows['rank']== "Wasteman") && ($rows['rankpoints'] >= "1230")){ $newrank="Thug"; $done="1"; }
elseif (($rows['rank']== "Thug") && ($rows['rankpoints'] >= "2000")){ $newrank="Badman"; $done="1"; }
elseif (($rows['rank']== "Badman") && ($rows['rankpoints'] >= "4320")){ $newrank="Respectable Badman"; $done="1"; }
elseif (($rows['rank']== "Respectable Badman") && ($rows['rankpoints'] >= "8600")){ $newrank="Assassin"; $done="1"; }
elseif (($rows['rank']== "Assassin") && ($rows['rankpoints'] >= "15506")){ $newrank="Respectable Assassin"; $done="1"; }
elseif (($rows['rank']== "Respectable Assassin") && ($rows['rankpoints'] >= "22361")){ $newrank="Boss"; $done="1"; }
elseif (($rows['rank']== "Boss") && ($rows['rankpoints'] >= "36000")){ $newrank="Respectable Boss"; $done="1"; }
elseif (($rows['rank']== "Respectable Boss") && ($rows['rankpoints'] >= "65333")){ $newrank="Godfather"; $done="1"; }
elseif (($rows['rank']== "Godfather") && ($rows['rankpoints'] >= "83216")){ $newrank="Legendary Godfather"; $done="1"; }
elseif (($rows['rank']== "Legendary Godfather") && ($rows['rankpoints'] >= "99633")){ $newrank="Don"; $done="1"; }
elseif (($rows['rank']== "Don") && ($rows['rankpoints'] >= "120000")){ $newrank="Respectable Don"; $done="1"; }
elseif (($rows['rank']== "Respectable Don") && ($rows['rankpoints'] >= "163000")){ $newrank="Global Threat"; $done="1"; }
elseif (($rows['rank']== "Global Threat") && ($rows['rankpoints'] >= "230000")){ $newrank="Infamous Mafioso"; $done="1"; }
else{ $done =="0"; }
if ($done == "1"){
mysql_query("UPDATE users SET rank='$newrank', mail='1', bullets=bullets+'2500' WHERE username='$username'");
mysql_query("INSERT INTO `messages` ( `id` , `t` , `f` , `message` , `date` , `r` , `saved` )
VALUES (
'', '$username', '$username', 'You have been promoted to $newrank congratulations, You received 2,500 bullets!', '$date', '0', '0')");
mysql_query("INSERT INTO `logs` ( `id` , `who` , `action` , `date` ) VALUES ('', '$username', 'Ranked up to <b>$newrank</b>!', '$date')");
}
///////HOUSTON WE HAVE JAIL CHECK!
?>
Then when i go onto forum in cpanel view heres the codes;
<?
session_start();
include "includes/functions.php";
logincheck();
$username=$_SESSION['username'];
include "includes/db_connect.php";
include"includes/smile.php";
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
$userlevel=$fetch->userlevel;
$forum_look=$_GET['forum_look'];
$forum_count = 15;
function index_navigation($index, $count, $num) {
$forum = $_GET['forum'];
if ($index != 0) {
print "<a href=\"forum.php?forum=".$forum."&forum_look=" . ($index - $count) . "\"><<<Last</a> ";
}
if ($num == $count) {
print "<a href=\"forum.php?forum=".$forum."&forum_look=" . ($index + $count) . "\">Next>>></a>";
}
}
if (! isset($forum_look) ) {
$forum_look = 0;
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="includes/in.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width=551 border=1 align="center" cellpadding=2 cellspacing=0 class=thinline rules=none>
<tr>
<td colspan=4 class=header><div align="center">Forum</div></td>
</tr>
<tr>
<td bgcolor=black height=1 colspan=4></td>
</tr>
<tr bgcolor=white>
<td align=center width=41% class=tip>Topics:</td>
<td align=center width=21% class=tip>Replies</td>
<td align=center width=18% class=tip>Topicstarter</td>
<td align=center width=20% class=tip>Last reply</td>
</tr>
<tr>
<td bgcolor=black height=2 colspan=4></td>
</tr>
<? $query=mysql_query("SELECT * FROM `topics` WHERE `forum`='$forum' ORDER BY `lastreply` DESC LIMIT $forum_look, $forum_count");
while($select=mysql_fetch_object($query)){
$num=mysql_num_rows($query);
$total=mysql_num_rows(mysql_query("SELECT * FROM replys WHERE idto='$select->id'"));
$last=mysql_fetch_object(mysql_query("SELECT * FROM replys WHERE idto='$select->id' ORDER by id DESC LIMIT 1"));
if ($select->sticky == "1"){
$typo = "<img src=images/forum/sticky.gif border=0>";
}else{
$typo = "<img src=images/forum/normal.gif border=0>";
}
?>
<tr>
<td height="41"><a href="forum_view.php?viewtopic=<?php echo "$select->id"; ?>&forum=<?php echo "$forum"; ?>"><?php echo "$typo"; ?>
<?php echo "$select->title"; ?></a></td>
<td align=center><?php echo "$total"; ?></td>
<td align=center><a href="profile.php?viewuser=<?php echo "$select->username"; ?>"><?php echo "$select->username"; ?></a></td>
<td align=center><a href="profile.php?viewuser=<?php echo "$select->username"; ?>"><?php echo "$last->username"; ?></a></td>
</tr> <? } ?>
<tr>
<td bgcolor=black height=2 colspan=4></td>
</tr>
<tr bgcolor=white>
<td align=right colspan=4 ><a href='topic.php?viewtopic=<?php echo "$viewtopic"; ?>&forum=<?php echo"$forum"; ?>'><font color="#000000">New
topic</font></a></td>
</tr>
</table>
<div align="center"><br>
<br>
<?php
index_navigation($forum_look, $forum_count, $num);
?>
</div>
</body>
</html>
Anyone help me out here, on how to get it working?
regards,
Kyle