runnerjp Posted May 31, 2008 Share Posted May 31, 2008 for some reason i cant seem to understand that if i have a thread and a reply my form displays like so but if i only have a thread it displays like this sorry if this is in wrong room but im thinkin its my php thats doing it... <table class='maintable'> <tr class='headline'><td width=20%>Author</td><td width=80%>Post</td></tr> <?php if ($pagenum == 1){ ?> <tr class='mainrow'><td valign='top'><?php echo $gettopic3['author'] ?> </td> <td vakign='top'>created on <?php echo $gettopic3['showtime']?><br> <hr> <p> <?php $message = $gettopic3['post']; $message=nl2br($message); ?> <? echo $message ?></p> <p><br> </p></td></tr> <?php } $getreplies="Select * from forumtutorial_posts where parentid='$id' $max"; //getting replies $getreplies2=mysql_query($getreplies) or die(mysql_error()."Could not get replies"); while($getreplies3=mysql_fetch_array($getreplies2)) { ?><tr class='mainrow'><td valign='top'><? echo $getreplies3['author']?> </td><td vakign='top'>replied at <? echo $getreplies3['showtime']?> <br> <hr> <p> <?php $message=$getreplies3['post']; $message=nl2br($message); ?> <?php echo $message?></p> <p><br> </p></td></tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/ Share on other sites More sharing options...
ILYAS415 Posted May 31, 2008 Share Posted May 31, 2008 okay having a lk... Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554197 Share on other sites More sharing options...
ILYAS415 Posted May 31, 2008 Share Posted May 31, 2008 spotted a spelling mistake on the 7th line... <td vakign='top'> supposed to be valign not vakign also im not clear wat the problem is :S Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554199 Share on other sites More sharing options...
ILYAS415 Posted May 31, 2008 Share Posted May 31, 2008 same mistake towards the end... <tr class='mainrow'><td valign='top'><? echo $getreplies3['author']?> </td><td vakign='top'>replied at <? echo $getreplies3['showtime']?> <br> you done vakign Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554202 Share on other sites More sharing options...
wildteen88 Posted May 31, 2008 Share Posted May 31, 2008 The problem is an HTML issue and not a PHP related one. Check through the HTML output for any errors. Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554203 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 sorry chnaged above images... can you soo the munu on the right changing position.... <table class='maintable'> <tr class='headline'><td width=20%>Author</td><td width=80%>Post</td></tr> <? if ($pagenum == 1){ ?> <tr class='mainrow'><td valign='top'><? echo $gettopic3['author'] ?> </td> <td valign='top'>created on <? echo $gettopic3['showtime']?><br> <hr> <p> <? $message = $gettopic3['post']; $message=nl2br($message); ?> <? echo $message ?></p> <p><br> </p></td></tr> <?php } $getreplies="Select * from forumtutorial_posts where parentid='$id' $max"; //getting replies $getreplies2=mysql_query($getreplies) or die(mysql_error()."Could not get replies"); while($getreplies3=mysql_fetch_array($getreplies2)) { ?><tr class='mainrow'><td valign='top'><? echo $getreplies3['author']?> </td><td valign='top'>replied at <? echo $getreplies3['showtime']?> <br> <hr> <p> <? $message=$getreplies3['post']; $message=nl2br($message); ?> <? echo $message?></p> <p><br> </p></td></tr> </table> thing is without php works fine with does that Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554214 Share on other sites More sharing options...
paulman888888 Posted May 31, 2008 Share Posted May 31, 2008 how many problems do you have? You ask so many questions and i think you should stop getting the Amazing people a php freaks to make your forum. There here to help not make a whole system for you Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554222 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 they tinkerings in the system... i havent asked any 1 to make me a forum at all... 4 questions i have asked of today are 1. this one... which is not building anything but solving 2. how to add my url in a php echo ... once again building nothing of my forum but giving me advice so i know how to use it 3. whats the best way to do the sliding menu.... you told me spry... and i went away looked it up and as you see from my images i have it working... so this one was for advice... 4. i had my script set up within the ajax menu but it was not working properly... they advised my so insert a hidden field as this would solve it.... once again i built it all and just needed guidence on my error... so to answer you question i have a few as im still gttin the nack of this stuff... learn as you go kinda job... so yes they are here to help in which they are doing and im very greatfull for but they have not created any part of my forum at all! Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554229 Share on other sites More sharing options...
ILYAS415 Posted May 31, 2008 Share Posted May 31, 2008 Hmm have you tried my suggestions yet Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554231 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 hey ILYAS415 i did indeed ... infect i found 2 saying vakign lol corrected them but the error still prosists maybe its because the table has no data in it due to there been no data in my db on the lower 1 my replys Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554234 Share on other sites More sharing options...
ILYAS415 Posted May 31, 2008 Share Posted May 31, 2008 in your script when your looping for ur replies you used this... <? echo $getreplies3['author']?> Quickly check to make sure that thats right in the db. I dont think that'll fix it tho. Its definately to do with the table (html and also layout). Cant find the problem tho... Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554240 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 yer they are all correct as then there are in the db they are shown... but surly it cant be a html and layout problem because when i have information for both threads and replies it does this this is the form thats goes wierd when there are no replies yet... as soon as i replie is made it goes correct Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554242 Share on other sites More sharing options...
ILYAS415 Posted May 31, 2008 Share Posted May 31, 2008 Hmm the script you provided isnt all of the script is it? Because in the script you provided theres no users online thing but in your screenshots there are. Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554244 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 this is just because its an include page thing... <? $page = $_GET['page']; if (ereg('[A-Za-z0-9]',$page) ) { if (file_exists('include/'.$page.'.php')) { include('include/'.$page.'.php'); } else { include('include/main.php'); } } else { include('include/main.php'); }?> thats deff not issue Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554245 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 ok iv done cuttin pasting ect lol an i have found the problem <?php } $getreplies="Select * from forumtutorial_posts where parentid='$id' $max"; //getting replies $getreplies2=mysql_query($getreplies) or die(mysql_error()."Could not get replies"); while($getreplies3=mysql_fetch_array($getreplies2)) { ?> this php here (i new it was php) but thing is why and what do i do Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554248 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 ok also iv just found out that if i post more then 3 posts it goes mental lol im going to post the whole script to see if my paginagtion has anything to do with it <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css"> <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/members/include/style.css"> <?php include "connect.php"; //mysql db connection here $id=$_GET['id']; $forum=$_GET['forum']; $pagenum = isset($_GET['pagenum']) ? $_GET['pagenum'] : "1"; $gettopic="SELECT * from forumtutorial_posts where postid='$id'"; $gettopic2=mysql_query($gettopic) or die("Could not get topic"); $gettopic3=mysql_fetch_array($gettopic2); ?> <A href='index.php?page=mainforums'><img src="http://www.runningprofiles.com/images/homeforum.gif" alt="home" border="0" /></a> <A href="index.php?page=forum&forum=<?php echo $forum ;?>"><img src="http://www.runningprofiles.com/images/backforum.gif" alt="forum" border="0" /></a> <A href="index.php?page=post"><img src="http://www.runningprofiles.com/images/new_post.gif" border="0" /></a> <?php if($gettopic3['forumlock'] == 0) { echo "<a href=\"index.php?page=reply&id=$id\"><img src=\"http://www.runningprofiles.com/images/post_reply.gif\" border=\"0\" /></a>"; } else { echo 'forum is locked'; } ?> <?php //Here we count the number of results //Edit $data to be your query $data = mysql_query("SELECT * from forumtutorial_posts where parentid='$id'") or die(mysql_error()); $rows = mysql_num_rows($data); //This is the number of results displayed per page $page_rows = 10; //This sets the range to display in our query $max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows; //This is your query again, the same one... the only difference is we add $max into it { ?> <?php }?> <table class='maintable'> <tr class='headline'><td width=20%>Author</td><td width=80%>Post</td></tr> <?php if ($pagenum == 1){ ?> <tr class='mainrow'><td valign='top'><?php echo $gettopic3['author'] ?> </td> <td valign='top'>created on <?php echo $gettopic3['showtime']?><br> <hr> <p> <?php $message = $gettopic3['post']; $message=nl2br($message); ?> <?php echo $message ?></p> <p><br> </p></td></tr> <?php } $getreplies="Select * from forumtutorial_posts where parentid='$id' $max"; //getting replies $getreplies2=mysql_query($getreplies) or die(mysql_error()."Could not get replies"); while($getreplies3=mysql_fetch_array($getreplies2)) { ?><tr class='mainrow'><td valign='top'><?php echo $getreplies3['author']?></td> <td valign='top'>replied at <?php echo $getreplies3['showtime']?> <br> <hr> <p> <?php $message=$getreplies3['post']; $message=nl2br($message); ?> <?php echo $message?></p> <p><br> </p></td></tr> </table> <?php echo "<br>"; } // Find out the total number of pages depending on the limit set $numofpages = $rows / $page_rows; $totalpages = ceil($numofpages); // Start links for pages $maxpage = $totalpages == 0 ? 1 : $totalpages; // add this line echo "<p align=center>Page $pagenum of $maxpage <br /> "; // change this // Sets link for previous 25 and return to page 1 if($pagenum != 1){ $pageprev = ($pagenum - 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=message&id=$id&pagenum=1\"><<</a> "; echo "<a href=\"".$_SERVER['PHP_SELF']."?page=message&id=$id&pagenum=$pageprev\">PREV </a> "; }else{ echo ""; } // Loop thru all the pages and echo out the links for($i = 1; $i <= $numofpages; $i++){ if($i == $pagenum){ echo "[".$i."] "; }else{ echo "<a href=\"".$_SERVER['PHP_SELF']."?page=message&id=$id&pagenum=$i\">$i</a> "; } } // Check for straglers after the limit blocks if(($rows % $page_rows) != 0){ if($i == $pagenum){ echo "[".$i."] "; }else{ echo "<a href=\"".$_SERVER['PHP_SELF']."?page=message&id=$id&pagenum=$i\">$i</a> "; } } // Print out the Next 25 and Goto Last page links if(($rows - ($page_rows * $pagenum)) > 0){ $pagenext = $pagenum++; echo "<a href=\"".$_SERVER['PHP_SELF']."?page=message&id=$id&pagenum=$pagenext\">NEXT </a> "; echo "<a href=\"".$_SERVER['PHP_SELF']."?page=message&id=$id&pagenum=$totalpages\">>></a> "; }else{ echo(""); } echo "</p>"; ?> e] Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554250 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 ok im gttin there lol only took 4 hours of takin apart code bit by bit so i will say its solved Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554255 Share on other sites More sharing options...
ILYAS415 Posted May 31, 2008 Share Posted May 31, 2008 good job mate howd u fix it Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554256 Share on other sites More sharing options...
runnerjp Posted May 31, 2008 Author Share Posted May 31, 2008 well basicly a } was put in the wrong place messing up the table some how lol i cant belive 1 } would cause so much Quote Link to comment https://forums.phpfreaks.com/topic/108125-solved-forum-issue-or-maybe-php-issue/#findComment-554259 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.