Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

HELP - Displaying photo description for each Image in Galler

Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial)
View previous topic :: View next topic  
Author Message
Smarty n00b

Joined: 24 Dec 2011
Posts: 1

PostPosted: Sat Dec 24, 2011 6:19 pm    Post subject: HELP - Displaying photo description for each Image in Galler Reply with quote

Would appreciate if someone can help me out. I have three fields in a database tab - PhotoName, Location & Description.
Gallery Images are loaded category wise on selection via Galleria jquery plugin.

Need to display photo description for each individual image.


Code below:

<link rel="stylesheet" href="" type="text/css">
<script src=""></script>

<!-- load Galleria -->
<script src="/js/galleria-1.2.4.min.js"></script>


/* Demo styles */
.content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:958px;margin:20px auto; margin-left: -19px;}
p{margin:0 0 20px}
a {color:#22BCB9;text-decoration:none;}

/* This rule is read by Galleria to define the gallery height: */

<div class="wrapper">
<div id="container">
<div id="content">

<h2 style="margin-bottom: 5px; margin-top: -10px;">Gallery</h2>
{if $countTop gt 0} {$top.site_text} {/if}
{if $countCategoryData gt 0}
<!-- Showing the Images Now -->
{if $countCategoryImageData gt 0 }
{assign var=sn value =1}
<div class="content">
<div id="galleria">

{foreach item=categoryImage from=$categoryImageData}
<a href="{$smarty.const.SITE_URL}files/category/{$categoryImage.file_name}">
<img title=""

<br />

<!-- Showing the Categories -->

{assign var=snCategory value =1}
<table class="cat" align="left" width="60%">

{foreach item=categoryRow from=$allCategoryData}
{if $snCategory is div by 2}
<td><a href="Category.php?category_id={$categoryRow.category_id}">{$categoryRow.category_name}</a></td></tr><tr>
<td><a href="Category.php?category_id={$categoryRow.category_id}">{$categoryRow.category_name}</a></td>
{assign var=snCategory value =$snCategory+1}
<!-- Showing the Categories -->

<p>No Images in Database</p>
{if $countMiddle gt 0} {$middle.site_text} {/if}
{if $countBottom gt 0} {$bottom.site_text} {/if} </div>
<!-- Side Bar -->
<!-- Side Bar -->
<br class="clear" />
// Load the classic theme

// Initialize Galleria



PHP Code

File-id@ index.php
contains the index or main page


$admin=false;//only true when inside the admin folder
include('setting.php'); //include the basic setttings
$error=""; //it is the error variable

$category_id = (isset($_GET['category_id'])) ? secure::getFilterInputBeforeInsertIntoDatabase($_GET['category_id'], true) : "";


#Fetch category Info
$objCategory=new category($db);
$objCategory->category_id = $category_id;
} //if(!empty($category_id))

$categoryData = $categoryData->fields;

#Fetch Category Images
$objCategoryImage=new categoryImage($db);
$objCategoryImage->category_id = $categoryData['category_id'];
$categoryImageData =array();

#fetch AlL category
$objCategory=new category($db);

#fetch random text For Page

}catch(Exception $e){
$error =$e->getMessage();

$content =""; //variable which will use to hold the data displayed in content
$content =$smarty->fetch('category.tpl'); //fetch the content template
$smarty->assign("content", $content); //assign content variable in smarty
$smarty->assign("error", $error);

#Display Main Form
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial) All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP