PHP and MySQL help

Discussion in 'PHP' started by Fink, Jul 25, 2006.

  1. #1
    Hi

    im making a directory using PHPLD2 and want to make it so that on the front page, the 3 newest feartured link's will be shown.
    The problem is not to get the 3 newest to be shown on the front page.
    It is that i want them in a table with 3 rows. along with an image next to them.... the image is not a problem.
    How do i make it so that i get one in one row. The next in the next and so on.

    It is freaking me out...
    this is the code for the 3 to be shown on the front page in main.tpl:

    This is the code in index.php :

     
    Fink, Jul 25, 2006 IP
  2. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,
    Try this:

    {if $category.ID eq 0 and not $p and not $qu}
    <table>
    {foreach from=$feat3 item=link name=links}
    <tr>

    <td><a href="{$link.URL}">{$link.TITLE}</a>
    <td>{$link.DESCRIPTION}<br>{/foreach}{/if}</td></tr>
    {/foreach}
    </table>
    {/if}

    Personally I hate using tables. I am working on rebuilding my site's template without using tables. I messed up my site too many times trying to modify or add things to this template.
    You can add the image in the above code between the <tr> and the first <td> like this:
    <td><img src="imagepath.jpg"></td>

    Thomas
     
    coderlinks, Jul 25, 2006 IP
  3. JBauer

    JBauer Guest

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can use <span></span> just as well instead of tables. If you don't know much about css you can always just write the spacing inline.
    <span style="width:50px">{your icon}</span> <span style="width:100px">{your link code}</span> <br>
     
    JBauer, Jul 25, 2006 IP