Told ya to make a backup lol. I did that in a hurry. ok change this last part: echo "</td></tr>"; echo "</table>"; <?php } ?> </p> <p> </p></td> </tr> </table> Code (markup): to </td></tr> </table> <?php } ?> </p> <p> </p></td> </tr> </table> Code (markup):
Hm, its the same mess Hey, I dont blame you if you give up. You have helped me a lot already. I have to go now and will not be back in 2-3 hours.
Ok I gave it another shot. I think this section is what needs to be changed. Of course you went back to the one that works so I aint sure. But this is the last section. </td></tr> <?php } ?> </p> <p> </p> </table></td> </tr> </table> Code (markup): All we have to do is get that /table tag into the correct spot and it should work.
Maybe i missed out on something, but that would make the whole thing look like this: www.helter.no <table width="100%" border="0"> <tr> <td width="50%"><p><strong>De nyeste heltene </strong><br /> <br /> Her er de siste som er lagt inn: <br /> <br /> </p> </td> <td width="50%"><p><strong>Mest besøkte helter </strong></p> <p>Tips venner og bekjente om din helt. Jo flere besøkende noen fÃ¥r, jo høyere opp pÃ¥ lista kommer de.</p> </td> </tr> <tr> <td valign="top" width="50%" style="padding-left:4px" class="text"> <?php ///Newest recipes $res_new = mysql_query("select * from ".TABLE_PREFIX."recipes where published = '1' order by id desc limit 0,5"); while($row_new = mysql_fetch_array($res_new)) { if ( $row_new['picture'] != '' && file_exists("admin/uploads/".$row_new["picture"])) { ///Make thumbnail if ( makethumb($row_new["picture"], "admin/uploads", "90" , "S_", "admin/uploads")) { $pathtopicnew = $NewThumbFileName; } else { $pathtopicnew = "admin/uploads/".$row_new["picture"]; } } else { // set inn url til default bildet ditt her $pathtopicnew = 'images/ikkebilde.gif'; } $uri = urlencode( str_replace( array(' ', '_'), array('_', '~'), $row_new['name'])); echo "<table>"; printf('<tr><td><a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a></td><td> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a></td></tr>', $row_new['id'], $uri, $pathtopicnew, $row_new['name']); echo "</table>"; ?> <!-- <?php echo $row_new["views"];?> visninger gjennomsnittelig karakter: <?php echo $row_new["mark"];?> <strong><?php echo $row_new["description"];?></strong> --> <?php } ?> </td> <td valign="top" width="50%" style="padding-left:4px" class="text"> <p> <?php ///Most viewed recipes $res_view = mysql_query("select * from ".TABLE_PREFIX."recipes where published = '1' order by views desc limit 0,5"); while($row_view = mysql_fetch_array($res_view)) { if ( $row_view['picture'] != '' && file_exists("admin/uploads/".$row_view["picture"])) { ///Make thumbnail if ( makethumb($row_view["picture"], "admin/uploads", "90" , "S_", "admin/uploads")) { $pathtopicnew = $NewThumbFileName; } else { $pathtopicnew = "admin/uploads/".$row_view["picture"]; } } else { // set inn url til default bildet ditt her $pathtopicnew = 'images/ikkebilde.gif'; } $uri = urlencode( str_replace( array(' ', '_'), array('_', '~'), $row_view['name'])); echo "<table>"; printf('<tr><td><a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a></td><td> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a></td></tr>', $row_view['id'], $uri, $pathtopicnew, $row_view['name']); echo "</table>"; ?> Sett <?php echo $row_view["views"];?> ganger<br /> <!-- gjennomsnittelig karakter: <?php echo $row_view["mark"];?> <strong><?php echo $row_view["description"];?></strong> --> </td></tr> <?php } ?> </p> <p> </p> </table></td> </tr> </table>
That was changed earlier I thought let me check. But the /table and the /td /tr should have been placed below the loop. Well the /td /tr can be in the loop, but the /table has to be out of it. echo "<table>"; printf('<tr><td><a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a></td><td> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a>', $row_view['id'], $uri, $pathtopicnew, $row_view['name']); ?> And that top echo "<table>"; was moved up as well. So that's probably what the issue is. Too many copies of the file.
Thats right, too many copies. Look now, it works Thanks again for your help, very nice of you to take care of a php novice like me. echo "<table>"; printf('<tr><td><a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a></td><td> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a>', $row_view['id'], $uri, $pathtopicnew, $row_view['name']); ?> <span class="text"> Sett <?php echo $row_view["views"];?> ganger </span> <!-- gjennomsnittelig karakter: <?php echo $row_view["mark"];?> <strong><?php echo $row_view["description"];?></strong> --> </td></tr> <?php } ?> </table></td> </tr> </table>
Nice, it only took us 24 hours. So when you get ready to transfer that site over to DIVs and pure CSS, don't call me
I will never attempt to do that. If you had seen some of the other code you would get a heart attack. I have another problem on the site also, but people with good php experience gave up on it so I will leave it alone. Or I could pay you $20 to fix that other problem.