Photo Album - multiretrival problem

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Photo Album - multiretrival problem

Post by madsny »

Hi.

MAIN GOAL:
my goal is to print out all photo's in the photo album as an XMLwhere all photos should be divided into their respective categories, like:

   
   


... etc.

PAST AND TESTS:
I've prevously experimented with altering the photo album template to plot out as xml and then using an empty page template, this worked fine until i actually deleted an album entry in the backend, thing is, to use the "capture" function in smarty, i need a template like the default template for showing photos, therefore i returned back to using CGfeedMaker.

NEW IDEA: -WHERE I NEED HELP!
CGfeedMaker is great and it seems to plot out the photos perfectly, but remember i want to post all photos in their respective categories, luckely we have the option to use the album='1,2,5' function.
BUT here's the problem, when you create a new album it get's it's own uniqe ID, this is the same id you give to the command album='', the thing is, if you delete an album in the photo album admin there'll be an empty id place holder this gives sense, but since im using an foreach and counting a variable and parsing this to the command album='' i'll not only get empty albums but i won't get the right order in which i placed my albums in the admin.

so i was thinking, if there a way to retrieve an albums ID ex.
this code assigns a new variable, increases it on every iteration so we can load the next album data, this won't work if you like me have deleted a album, plus it won't show the albums in the order you placed them in the backend.
so the question is cold i somehow capture the photo album's frontpage
{cms_module module='album'}
and then ask for it's id number ??? like
$albums->"give_me_that_god_dam_id".... you get the point. ;)

Code: Select all

{assign var='albumNum' value=0}
 
    {capture assign='albumsfff'}
      {cms_module module='album'}
    {/capture}   

{foreach from=$albums item='entry'}
	<WEGOTANOTHERCATEGORY_ABUMHEREMAN>
	{assign var='albumNum' value=$albumNum+1}
	
    {capture assign='photos'}
      {cms_module module='album' albums=$albumNum}
    {/capture}   

    {foreach from=$pictures item='entry'}
    <item>
      <title>{$entry->name}</title>
      <img>{$entry->picture}</img>
    </item>
    {/foreach}
    
    </WEGOTANOTHERCATEGORY_ABUMHEREMAN>
    {/foreach}

kind regards.
M
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Photo Album - multiretrival problem

Post by madsny »

and Every TIME you write or ask a question you find the solution yourself :D
hehe sorry, i feel stupied :D

{$albums->id}
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Photo Album - multiretrival problem

Post by madsny »

Just to keep any interessted updated, i solved the problem.

Here's how you post all photo links into an xml within their respective categories (good for flash).

you'll need installed:
CGfeedMaker
photo album

CGfeedMaker template:
this is the template im using for the feedmaker.

Code: Select all

<?xml version="1.0"?>
<rss version="2.0">
  <channel>
 
{assign var='albumNum' value=-1}
  
{capture assign='albumsfff'}
	{cms_module module='album'}
{/capture}   

{foreach from=$albums item='entry'}
	<cat>
	{assign var='albumNum' value=$albumNum+1}
	
    {capture assign='photos'}
      {cms_module module='album' action='recently_updated' albums=$albums[$albumNum]->id number='15'}
    {/capture}   

    {foreach from=$pictures item='entry'}
    	<item>
	    	<title>{$entry->name}</title>
    		<img>{$entry->picture}</img>
    		<imgthumb>{$entry->thumbnail}</imgthumb>
    	</item>
    {/foreach}
    
    
    </cat>
    {/foreach}
  </channel>
</rss>

PAGE:
Then create a new page and place this link, with a ref. to your template
{CGFeedMaker action='rsslink' feed='YOUR TEMPLATE NAME'}

if you then visit this page you'll see an rss link, clicking on it and you'll get the right url to place into ex. Flash to fetch all you photos :D..

you'll properly have to tweek the code a bit here and there to meet your demands, but it workes nicely

Enjoy
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Photo Album - multiretrival problem

Post by sn3p »

[SOLVED] ? ;)
Post Reply

Return to “Modules/Add-Ons”