1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

List images below each other

Discussion in 'PHP' started by login, Mar 6, 2008.

  1. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #21
    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>&nbsp; </p></td>
    </tr>
    
    
    </table>
    
    Code (markup):
    to


    
    </td></tr>
    </table>
    
    <?php
    }
    ?>
    </p>
    <p>&nbsp; </p></td>
    </tr>
    
    
    </table>
    
    Code (markup):
     
    shallowink, Mar 6, 2008 IP
  2. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #22
    Hm, its the same mess :D

    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.
     
    login, Mar 6, 2008 IP
  3. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #23
    I'll post back when I get it squared away.
     
    shallowink, Mar 6, 2008 IP
  4. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #24
    Ok, if you're still around try this one and see if it clears it up a bit.
     
    shallowink, Mar 6, 2008 IP
  5. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #25
    Hi I am back. Sorry, it is still the same. Its late where I am, have to sleep now, thanks.
     
    login, Mar 6, 2008 IP
  6. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #26
    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>&nbsp; </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.
     
    shallowink, Mar 7, 2008 IP
  7. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #27
    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&oslash;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>&nbsp; </p> </table></td>
    </tr>

    </table>
     
    login, Mar 7, 2008 IP
  8. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #28
    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.
     
    shallowink, Mar 7, 2008 IP
  9. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #29
    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>
     
    login, Mar 7, 2008 IP
  10. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #30
    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 ;)
     
    shallowink, Mar 7, 2008 IP
  11. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #31
    :D:D:D 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.
     
    login, Mar 7, 2008 IP