Jump to content

Recommended Posts

Hi,

 

I am designing my site using the smarty template system and need to display my results in a horizontal way instaed of them just going down the page.

 

Here is my code so far:

 

PHP side:

<?php
$result = mysql_query("SELECT * FROM uploads WHERE owner = '".$_SESSION['username']."' AND album_id = '".$_GET['galleryID']."'");
while($row = @mysql_fetch_array($result))
$results[] = $row;
$smarty->assign("results",$results);
?>

 

Template side:

<table class="gallery" align="center" border="0">
  <tbody align="center">
    <tr align="center">
{foreach from=$results item="row"}
      <td align="center"><div id="img_{$row.id}" class="image" style="text-align: center; margin: 0 auto;">
          <div class="image"> <a href="#"><img src="{$site_url}/images/{$row.file_name}" border="0" alt="" id="{$row.id}" style="max-width: 250px;"></a> </div>
          <div style="clear: both; text-align: left"></div>
          <span class="pseudolink" onClick="delImage({$row.id})">delete</span> / <span class="pseudolink" id="clk_{$row.id}" onClick="toggleStg(event, {$row.id})">move</span>
          <div id="stg_{$row.id}" class="settings" style="display: none; text-align: left"> <nobr><b>Move to album:</b></nobr><br>
              <span class="pseudolink" onClick="xajax_moveImage({$row.id}, {$row.id})">{$gi.title}</span><br />
          </div>
        </div>
	</td>
      {/foreach} 
  </tr>
  </tbody>
</table>

 

Any help would be great!

Link to comment
https://forums.phpfreaks.com/topic/121028-bit-of-smarty-help-needed/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.