Jump to content

Bit of smarty help needed


steviez

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.