Bojan86 Posted August 9, 2009 Share Posted August 9, 2009 I'm going crazy over this bulls*it! :facewall: Now, tutorials.php doesn't works... It shows some of data, but not all of it (category, views, content...) Please, help me! Here's code! <?php //Getting the file db.php which includes our database settings. define( 'DB_PATH' , "./" ); require DB_PATH."db.php"; //Setting up a variable to request the category which is in the URL $request_cat = isset($_REQUEST['category']) ? $_REQUEST['category'] : ''; //Displaying an actual tutorial if (isset($_GET['id'])) { // Updating the views, and grabbing a tutorial based on what id it has. $update = mysql_query("UPDATE $mysql_table SET views = views + 1 WHERE id='{$_GET['id']}'"); $result = mysql_query("SELECT * FROM $mysql_table WHERE id='{$_GET['id']}'"); while($row = mysql_fetch_array($result)){ // Template for the tutorial echo " <table width='400' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='400'> <table width='400' border='0' cellspacing='0' cellpadding='0'> <tr> <td><table width='400' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='275'><div align='left'><strong> <a href='tutorials.php?category=".$row['category']."&id=".$row['id']." '>".$row['title']."</a> </strong></div></td> <td width='125'><div align='right'> [ Views: ".$row['views']." ]</div></td> </tr> </table></td> </tr> <tr> <td><div align='left'>Description: ".$row['description']."</div></td> </tr> <tr> <td><div align='left'>".$row['content']."</div></td> </tr> <tr> <td><div align='left'> <table width='400' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='150'><div align='left'>Added: ".$row['date']."</div> </td> <td><div align='right'>Author: <a href='mailto:".$row['email']."' >".$row['author']."</a> </div></td> </tr> </table> </div></td> </tr> <tr> <td><div align='left'>Category: <a href='tutorials.php?category=".$row['category']." >".$row['category']."</a> </div></td> </tr> </table></td> </tr> </table> "; // End of template of tutorial } // End of grabbing data exit(); // Stopping anything below from interfearing with this sectiom } // End of Displaying an actual tutorial //Displaying tutorials in a cateogry. if (isset($_GET['category']) && $_GET['category'] == $request_cat) { //Grabbing information from the database. $result = mysql_query("SELECT * from $mysql_table where category = '{$_GET['category']}' ORDER BY ID DESC"); while($row = mysql_fetch_array($result)) { //Template for the tutorials in a category. echo " <table width='400' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='100' align='center' valign='middle'><div align='center'> <a href='tutorials.php?category=".$row['category']."&id=".$row['id']."'> <img src='".$row['avatar']."' alt='".$row['title']."' title='".$row['title']."' width='90' height='60' border='0'></a> </div></td> <td width='300'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td> <div align='center'><strong>".$row['title']."</strong></div></td> </tr> <tr> <td> <div align='left'>Description: ".$row['description']."</div></td> </tr> <tr> <td> <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td><div align='left'>Added: ".$row['date']."</div></td> <td><div align='left'>Category: <a href='tutorials.php?category=".$row['category']." >".$row['category']."</a></div></td> </tr> </table></td> </tr> <tr> <td><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='175'><div align='left'>Author: <a href='mailto:".$row['email']."'>".$row['author']."</a></div></td> <td width='100'><div align='left'>Views: ".$row['views']."</div></td> </tr> </table></td> </tr> </table></td> </tr> </table><br> "; // End of Template for the tutorials in a category. } // End of grabbing information from database. } // End of Displaying tutorials in a cateogry. // Main Tutorial page. This is where all your categories will be listed. if (!isset($_GET['category'])) { //This makes a list of all the cateogries that are in the database! No need to make the links yourself! $result = mysql_query("SELECT DISTINCT category from $mysql_table "); while($row = mysql_fetch_array($result)) { // Showing all the categories echo " <a href='tutorials.php?category=".$row['category']."' >".$row['category']."</a><br> "; // End of showing all the categories } // End of grabbing unique categories in database }// End of main tutorial page ?> Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/ Share on other sites More sharing options...
wildteen88 Posted August 9, 2009 Share Posted August 9, 2009 Screenshot of your problem? This sounds like a HTML issue. Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894134 Share on other sites More sharing options...
Bojan86 Posted August 9, 2009 Author Share Posted August 9, 2009 In the attachment... [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894137 Share on other sites More sharing options...
wildteen88 Posted August 9, 2009 Share Posted August 9, 2009 Whats wrong? it showing one tutorial named hurf. Whats it supposed to do? EDIT: To view the tutorial you need to click the image place holder to the left. Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894153 Share on other sites More sharing options...
Bojan86 Posted August 9, 2009 Author Share Posted August 9, 2009 It should show all... Category, views, content, name of tutorial and so on... Everything but ID... Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894170 Share on other sites More sharing options...
wildteen88 Posted August 9, 2009 Share Posted August 9, 2009 tutorial.php has errors. Change lines 61 - 62 to <a href='tutorials.php?category=".$row['category']."'>".$row['category']."</a> </div></td> Change 105 - 106 to <a href='tutorials.php?category=".$row['category']."'>".$row['category']."</a></div></td> Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894173 Share on other sites More sharing options...
Bojan86 Posted August 9, 2009 Author Share Posted August 9, 2009 I'm sorry if I bored you with this s*it... Believe me, I would be more than happy if I don't have to do this... Anyway, now it shows category, I will delete views from code and mysql, so it won't be a problem anymore, but it still doesn't show content, and it's most important... So please, help me... I'm so close to shift+del everything... Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894276 Share on other sites More sharing options...
wildteen88 Posted August 9, 2009 Share Posted August 9, 2009 Click the white box on the left hand side where the avatar is supposed to be. it'll then show you your tutorial. Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894278 Share on other sites More sharing options...
Bojan86 Posted August 9, 2009 Author Share Posted August 9, 2009 You're kidding me? That's all?! Um, thanks... But, can I (or U, it's better to be U) change that avatar into link that says somethin like "view tutorial here"? I don't like avatars very much... Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894279 Share on other sites More sharing options...
wildteen88 Posted August 9, 2009 Share Posted August 9, 2009 Have a go yourself. In tutorial.php all you need to do is remove the <img> tag from the html, replace this with the text you want to see instead. I'll give you a clue its on line 86 - 87 Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894283 Share on other sites More sharing options...
Bojan86 Posted August 9, 2009 Author Share Posted August 9, 2009 Ooooo, some detective job... OK, I'll look into it. Quote Link to comment https://forums.phpfreaks.com/topic/169468-problem-with-cms-again/#findComment-894287 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.