Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


problem with showing topics!

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
deleted user 111213
Grandmaster Cheater
Reputation: 0

Joined: 09 Nov 2007
Posts: 714

PostPosted: Sat Dec 06, 2008 4:10 am    Post subject: problem with showing topics! Reply with quote

Code:
<?php

include "(../global.php)";

function isInteger($input){
  return preg_match('@^[-]?[0-9]+$@',$input) === 1;
}

function ShowTopics($forumid){
   $sql =  "SELECT * FROM `forum_topics` WHERE `cid`=$forumid";
   $res = mysql_query($sql) or die(mysql_error());
   if(mysql_num_rows($res) == 0){
      echo "There are no topics in this forum, <a href=\"../forum-index.php?act=create&id=" . $forumid . "\">click here</a> to create a topic!\n";
   } else {
echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n";
echo "<tr align=\"center\"><td>Title</td><td>User</td><td><Date</td><td>Replies</td></tr>\n";
      while($row2 = mysql_fetch_assoc($res)){
     #$sql3 = "SELECT count(*) AS num_replies FROM forum_replies WHERE tid='".$row2['id']."'";
#$res3 = mysql_query($sql3) or die(mysql_error());
$row3 = mysql_fetch_assoc($res3);
     echo "<tr><td><a href=\"./forum-index.php?act=topid&id="$row2['id']."\">".s($row2['title'])."</a></td><td>".uid($row2['uid'])."</td><td>".$row2['date']."</td><td>".$row3['num_replies']."</td></tr>\n";
      }
echo "</table>\n";
   }
}


$id = $_GET['id'];

if(isInteger($id)){
   $sql1 = "SELECT * FROM `forum_sub_cats` WHERE `id`=$id";
   $res1 = mysql_query($sql1) or die(mysql_error());

   if(mysql_num_rows($res1) == 0){
      echo "The forum sub category you supplied does not exist!\n";
   } else {
      $row = mysql_fetch_assoc($res1);
      if($row['admin'] > 0){
         if($admin_user_level > 0){
            ShowTopics($row['id']);
         } else {
            echo "You must be an admin to view this forum!\n";
         }
      } else {
         ShowTopics($row['id']);
      }
   }
}
?>


doesn't show anything. i have fixed like the problem where it says that they don't exist when they do, but now i have a problem when the topics i made don't show up.
Back to top
View user's profile Send private message
~NJ
Grandmaster Cheater Supreme
Ban
Reputation: 0

Joined: 09 Mar 2007
Posts: 1417
Location: sitting outside of the forum

PostPosted: Sat Dec 06, 2008 7:47 am    Post subject: Reply with quote

Not again dude. Seriously, you need to LEARN PHP and MySQL before you come here. This is a place for specific issues and problems not a place to get other programmers and developers to just do stuff for you.
_________________
I failed to properly read http://forum.cheatengine.org/viewtopic.php?t=247716 last time I updated my trainer
Back to top
View user's profile Send private message MSN Messenger
deleted user 111213
Grandmaster Cheater
Reputation: 0

Joined: 09 Nov 2007
Posts: 714

PostPosted: Sat Dec 06, 2008 8:17 am    Post subject: Reply with quote

i already requested lock like hours ago cause i figured it out like straight away, but it don't matter now, cause i nearly finished except one small error.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites