i need to list images below each other here: www.helter.no Here is the code, what do I have to change? Thanks, green rep to good answers <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'])); printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a>', $row_new['id'], $uri, $pathtopicnew, $row_new['name']); ?> <!-- <?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'])); printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <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']); ?> Sett <?php echo $row_view["views"];?> ganger<br /> <!-- gjennomsnittelig karakter: <?php echo $row_view["mark"];?> <strong><?php echo $row_view["description"];?></strong> --> <?php } ?> </p> <p> </p></td> </tr> </table>
<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'])); printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a>', $row_new['id'], $uri, $pathtopicnew, $row_new['name']); ?> <!-- <?php echo $row_new["views"];?> visninger gjennomsnittelig karakter: <?php echo $row_new["mark"];?> <strong><?php echo $row_new["description"];?></strong> --><br /><br /><br /> <?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'])); printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <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']); ?> Sett <?php echo $row_view["views"];?> ganger<br /> <!-- gjennomsnittelig karakter: <?php echo $row_view["mark"];?> <strong><?php echo $row_view["description"];?></strong> --><br /><br /> <?php } ?> </p> <p> </p></td> </tr> </table> PHP: Maybe that will work? I ran through it quick but it may work.
Can try removing that align='left' part. If that doesn't work could use CSS to do it. But is it the images with text in the center column?
Cant see any align='left' in the code above. Its the images below the text "De nyeste heltene" and "Mest besøkte helter "
printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <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']); Its in the one above it too. Ah ok, the ones that could be put into a table? heh, cause making that work without tables is often worse codewise than using tables. I can show you how to do it but it will get ugly.
actually try this first: printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" style="display:block"/> </a> <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']); Just copy,paste it over the first one. Test it.
Well I was hoping for a quick solution lol. printf('<div class="imgbox"><a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a></div>', $row_new['id'], $uri, $pathtopicnew, $row_new['name']); Then we have to go your stylesheet and add .imgbox Can you add that and post it so I can test the CSS locally?
Thanks Added: <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'])); printf('<div class="imgbox"><a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a></div>', $row_new['id'], $uri, $pathtopicnew, $row_new['name']); ?> <!-- <?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'])); printf('<div class="imgbox"><a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a> <a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a></div>', $row_new['id'], $uri, $pathtopicnew, $row_new['name']); ?> Sett <?php echo $row_view["views"];?> ganger<br /> <!-- gjennomsnittelig karakter: <?php echo $row_view["mark"];?> <strong><?php echo $row_view["description"];?></strong> --> <?php } ?> </p> <p> </p></td> </tr> </table>
ok man I screwed with this for about 15 minutes and CSS just isn't working so here's a table solution: 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>"; That should fix the first one.
Hey, now were talking look at helter.no now. Just need to get the text beside the pics now instead of below
You mean on the second column? um where's that text coming from? Ok, I see what's going on now. Have to put the end tags for /td /tr lower and the table start end tags outside of the loop.
Second column yes. Sett <?php echo $row_view["views"];?> ganger<br /> shallowink, what can I do to repay you for this good help?
Ok, I would backup the current file before trying this : <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"); echo "<table>"; 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'])); 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_new['id'], $uri, $pathtopicnew, $row_new['name']); ?> <!-- <?php echo $row_new["views"];?> visninger gjennomsnittelig karakter: <?php echo $row_new["mark"];?> <strong><?php echo $row_new["description"];?></strong> --> echo "</td></tr>"; <?php } ?> </table> </td> <td valign="top" width="50%" style="padding-left:4px" class="text"> <p> <?php ///Most viewed recipes echo "<table>"; $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'])); 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_new['id'], $uri, $pathtopicnew, $row_new['name']); ?> Sett <?php echo $row_view["views"];?> ganger<br /> <!-- gjennomsnittelig karakter: <?php echo $row_view["mark"];?> <strong><?php echo $row_view["description"];?></strong> --> echo "</td></tr>"; echo "</table>"; <?php } ?> </p> <p> </p></td> </tr> </table>