Slideshow/Cooliris on keyword albums?
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
I'm using the Carbon theme, not a theme with a built-in slideshow. Is there anyway to make a slideshow work with keyword albums? I would ideally want CoolIris to work as well. |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
No one has any suggestions? Is this just not possible? It seems like it should be, I have the flashyourweb mini slideshow showing keyword albums. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
You could try my picLensRss.php or mediaBlock. -s |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Place this code directly above the </head> tag in your theme's theme.tpl {php} if(isset($_REQUEST['g2_keyword'])){ $this->assign('keyword',$_REQUEST['g2_keyword']); }else{ $this->assign('keyword',''); } {/php} {if $theme.pageType == 'album' && $keyword} <link rel="alternate" type="application/rss+xml" title="PicLens RSS" href="/gallery2/picLensRss.php?mode=dynamic&g2_view=keyalbum.KeywordAlbum&g2_keyword={$keyword}" id="picLensGallery"/> {/if} clear your gallery's template cache and let me know how it works -s |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
This didn't work, but I had remove the previous edits to theme.tpl and album.tpl, was I supposed to leave those in? |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
That should be the only edit you need, see it worked for me. http://www.flashyourweb.com/media/index.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=batman I don't have many items tagged with keywords. -s |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
Not sure what I'm doing wrong... These are the two steps I performed: Am I missing something? I was able to get your mini slideshow working so I'm not totally new to this... Edit: I'm using the URL rewrite module and it appears that you aren't. Does this make a difference? The URL to my keyword albums appears as mysite\gallery2\key\keyword, whereas yours appears as yoursite/media/index.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=batman |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Well, even though your REQUEST variables look different, they should still be available. -s |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
Unfortunately I can't give you a URL as my Gallery is hosted only internally, and I can't put it online. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I have another idea, give me a sec to figure it out. -s |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Ok, took a sec to work this out(plus dinner) {assign var="separator" value=''} {assign var="itemString" value=''} {foreach from=$theme.children item=child} {if $itemString != ''} {assign var="separator" value=|} {/if} {assign var="itemString" value=$itemString$separator`$child.id`} {/foreach} {if $theme.pageType == 'album' && $itemString} <link rel="alternate" type="application/rss+xml" title="PicLens RSS" href="/gallery2/picLensRss.php?mode=simple&g2_itemIds={$itemString}" id="picLensGallery"/> {/if}
You'll have to add some lines to picLensRss.php case 'simple': $itemIds = explode('|', GalleryUtilities::getRequestVariables('itemIds')); list ($ret, $items) = GalleryCoreApi::loadEntitiesById( $itemIds, 'GalleryItem' ); if ($ret) { print "Error loading childItems:" . $ret->getAsHtml(); } foreach($items as $item){ if(!$item->canContainChildren){ $xml .= getDisplay($item); } } break; just below case 'search': $xml .= getSearchItems($g2_itemId, $mime); break;
This will add all items sans albums to the feed(even unsupported items) that appear on the page only. -s |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
Where does the new theme.tpl code go? Am I supposed to leave in your previous code as well? Sorry for the trouble, you've been extremely helpful so far. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Place this code directly above the </head> tag in your /gallery2/themes/carbon/templates/local/theme.tpl {if $theme.pageType == 'album'} {g->theme include="keywordRss.tpl"} {/if} rename the attached keyword.tpl.txt to keyword.tpl and upload to /gallery2/themes/carbon/templates/local/keyword.tpl clear your gallery's template cache. should work for tag albums & search albums too. -s FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2 |
|
mikeage
![]()
Joined: 2005-01-23
Posts: 138 |
![]() |
does the picLensRss.php file support the standard dynamic albums (updates, random, popular) and/or tag albums? |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
It works the same as my mediaRss.php. -s |
|
mikeage
![]()
Joined: 2005-01-23
Posts: 138 |
![]() |
Ah; never mind; I missed the part of your last post where you wrote "should work for tag albums & search albums too." |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I just updated my picLens download with the above required code to make use of the keywordRss.tpl -s |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
Great! The update to piclensrss.php got this working for me. Thanks for all your help! The only thing missing is making this work for multi-page albums, but in the meantime I'll just increase the amount of results per page. Thanks again! |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Quote:
Great! The update to piclensrss.php got this working for me Fantastic! I had given up ;) It should work for multipage keyword albums, and could easily be updated for tag albums, but the search will remain on a perpage basis, as I know nearly nothing about gallery's search functions. -s |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
I was testing it out and it didn't seem to work for multipage keyowrd albums. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Well, I did not have enough keyword items to test multipage, so I added the tagName variable and it does work for multipage (at least with rewrite off) So here's the updated code for keywordRss.tpl: {php} if(isset($_REQUEST['g2_keyword'])){ $this->assign('keyword',$_REQUEST['g2_keyword']); }else{ $this->assign('keyword',''); } if(isset($_REQUEST['g2_tagName'])){ $this->assign('tagName',$_REQUEST['g2_tagName']); }else{ $this->assign('tagName',''); } {/php} {if $keyword} <link rel="alternate" type="application/rss+xml" title="PicLens RSS" href="/gallery2/picLensRss.php?mode=dynamic&g2_view=keyalbum.KeywordAlbum&g2_keyword={$keyword}" id="picLensGallery"/> {elseif $tagName} <link rel="alternate" type="application/rss+xml" title="PicLens RSS" href="/gallery2/picLensRss.php?mode=dynamic&g2_view=tags.VirtualAlbum&g2_tagName={$tagName}" id="picLensGallery"/> {else} {assign var="separator" value=''} {assign var="itemString" value=''} {foreach from=$theme.children item=child} {if $itemString != ''} {assign var="separator" value=|} {/if} {assign var="itemString" value=$itemString$separator`$child.id`} {/foreach} {if $itemString} <link rel="alternate" type="application/rss+xml" title="PicLens RSS" href="/gallery2/picLensRss.php?mode=simple&g2_itemIds={$itemString}" id="picLensGallery"/> {/if} {/if} I'd be interested to know if rewrite changes the $_REQUEST variables. -s |
|
wreckanize
Joined: 2007-10-30
Posts: 24 |
![]() |
This does seem to be related to the rewrite module. I tested it out using the default URL for keyword albums and every image from a 5 page keyword album showed up in cooliris. |
|
mikeage
![]()
Joined: 2005-01-23
Posts: 138 |
![]() |
I'm trying to use picLensRss 2.0.9 to display dynamic albums, and I'm having a problem. The albums from g2_view=dynamicalbum.* all work fine, but tag albums all give me the same error in my logs: 2008/11/19 06:12:37 [error] 23695#0: *122534 FastCGI sent in stderr: "PHP Fatal error: Class 'TagsHelper' not found in /path/to/gallery/picLensRss.php on line 56 PHP Stack trace: PHP 1. {main}() /path/to/gallery/picLensRss.php:0 PHP 2. xml() /path/to/gallery/picLensRss.php:830 PHP 3. getTagChildIds() /path/to/gallery/picLensRss.php:796" while reading upstream, client: X.X.X.X, server: mikeage.net, request: "GET /content/gallery/picLensRss.php?mode=dynamic&g2_view=tags.VirtualAlbum&g2_tagName=Whatever HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mikeage.net" If it matters, I have a multi-site installation (both embedUri and g2Uri point to the specific G2 that I'm trying, not my code base. Tag albums do work in general. I haven't yet touched my templates; I'm entering this path manually. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Quote:
PHP Fatal error: Class 'TagsHelper' not found what version of the tags module are you using? -s FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2 |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
this is the only version I know of 1.3.6 -s |
|
mikeage
![]()
Joined: 2005-01-23
Posts: 138 |
![]() |
That's the version I have (slightly customized, but just to support AND/OR tag albums) |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Try adding the following line to picLensRss.php line 54: GalleryCoreApi::requireOnce('modules/tags/classes/TagsHelper.class');
-s |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
New code update utilizes gallery's own slideshow module without need for my script(picLensRss.php): {if $theme.pageType == 'album' && $theme.item.entityType == 'GalleryDynamicAlbum'} {assign var="separator" value=''} {assign var="itemString" value=''} {foreach from=$theme.children item=child} {if $itemString != ''} {assign var="separator" value=|} {/if} {assign var="itemString" value=$itemString$separator`$child.id`} {/foreach} {if $itemString} <link rel="alternate" type="application/rss+xml" title="Photo RSS" href="{g->url arg1="view=slideshow.SlideshowMediaRss" arg2="itemList=`$itemString`"}"/> {/if} {/if}
Works for all dynamic albums including keyword and tag albums -s |
|
mikeage
![]()
Joined: 2005-01-23
Posts: 138 |
![]() |
nice; works great! |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
The above code will only work with the current page. Personally I only show 24 items in my dynamic albums, 3 columns x 8 rows all on one page. To load all items from a keyword or tag album, basically we'd have to re-query for the results: {php} if(isset($_REQUEST['g2_keyword'])){ $this->assign('keyword',$_REQUEST['g2_keyword']); }else{ $this->assign('keyword',''); } if(isset($_REQUEST['g2_tagName'])){ $this->assign('tagName',$_REQUEST['g2_tagName']); }else{ $this->assign('tagName',''); } {/php} {if $keyword} <link rel="alternate" type="application/rss+xml" title="PicLens RSS" href="/gallery2/picLensRss.php?mode=dynamic&g2_view=keyalbum.KeywordAlbum&g2_keyword={$keyword}" id="picLensGallery"/> {elseif $tagName} <link rel="alternate" type="application/rss+xml" title="PicLens RSS" href="/gallery2/picLensRss.php?mode=dynamic&g2_view=tags.VirtualAlbum&g2_tagName={$tagName}" id="picLensGallery"/> {/if} but this requires my picLensRss.php. -s |
|
joelrnorton
Joined: 2008-06-02
Posts: 5 |
![]() |
Suprsidr, Does the code to retrieve all items in the keyword/tag album fully replace the code you originally posted which only retrieves the items on the current page? If so, am I correct in assuming that this code basically replaces the other in the theme.tpl file, just above the </head> tag? Thanks! |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
Wayne, If you have a spare moment, wonder if you could look at this. As I mentioned in a different thread, I'm using the mini slideshow to replace the lytebox/cooliris slideshow in G2.3. I have it mostly working great. I created a module which adds this block(link...) to the sidebar, formatting, etc. removed for readability here, but the editor is nixing the code indentation ********* <div> The above calls my external slideshow page, passing the itemId & title as parameters in the url: ************* <?php $title = $_GET['title'];{* only used for page title at this stage...*} <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("http://www.wildsuburbia.com/b2e/gallery2/minislideshow.swf", "objectId", "800", "700", "9.0.115.0", "ffffff"); {* The following is my crude way of shoehorning the itemID into the flashvars stream...I tried a thousand variations, this works...*} var $s1 = "xmlUrl="; var $s2 = "http://www.wildsuburbia.com/b2e/gallery2/mediaRss.php?g2_itemId=<?php echo $item_id; ?>%26recursive=true"; var $s3 = "&useFull=true&showDropShadow=true&delay=4&transInType=Fade&transOutType=Fade"; so.addParam("flashVars", $s1+$s2+$s3); // ]]> <div id="flashcontent> blah, blah, blah, *************************** Ok, I know there are more scientific ways to do this I couldn't tell whether the code further up the thread & particularly one-page limitation applies to the lytebox/cooliris only, or also mediaRss & the mini? I couldn't find a similar discussion/snippets for mediaRss/mini slideshow, so I'm posting this, hoping there is a way around the one page limit, particularly for search results... If I don't get any better suggestions, I'm getting ready to try and parse the page url, but my gut tells me that's like swatting flies with a backhoe... Thanks again, really appreciate the help. ____ |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Well, you didn't really need to create a module. I just updated the minislideshow with my current mediaRss.php to include a new mode. I created an extra template and included it in my theme.tpl {g->theme include="alternateRss.tpl"} alternateRss.tpl: {if $theme.pageType == 'album' && $theme.item.entityType == 'GalleryDynamicAlbum'} {assign var="separator" value=''} {assign var="itemString" value=''} {foreach from=$theme.allChildIds item=id} {if $itemString != ''} {assign var="separator" value=|} {/if} {assign var="itemString" value=$itemString$separator`$id`} {/foreach} {if $itemString} <div> <a href="http://www.wildsuburbia.com/slideshows/ss.php?g2_itemIds={$itemString}&title={$item_title}" title="View Album as Slideshow"> View Album as Slideshow </a> </div> {/if} {/if} Does this help? I do something similar in the sidebar on mysite http://www.flashyourweb.com/media/index.php?g2_view=dynamicalbum.PopularAlbum&g2_albumId=32 minislideshow.tpl: {if $theme.pageType == 'album' && $theme.item.entityType == 'GalleryDynamicAlbum'} {assign var="separator" value=''} {assign var="itemString" value=''} {foreach from=$theme.children item=child} {if $itemString != ''} {assign var="separator" value=|} {/if} {assign var="itemString" value=$itemString$separator`$child.id`} {/foreach} {/if} {if $theme.pageType == 'album'} <div id="gsSidebar" class="gcBorder1"> <div id="sidebarMini"> Generated By <a href="http://www.flashyourweb.com/staticpages/index.php?page=embed-o-rator" target="_blank">The Acme MiniSlideShow EMBED-O-RATOR</a> </div> <script type="text/javascript" src="{g->url href='modules/flashvideo/lib/swfobject.js'}"> </script> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("{g->url href='minislideshow.swf'}", "minislideshow", "180", "180", "9.0.115.0", "ffffff"); {if !empty($theme.rssIds)} so.addParam("flashVars", "xmlUrl={g->url href='mediaRss.php'}?mode=simple%26g2_itemIds={$theme.rssIds}&showDropShadow=true&shuffle=true"); {elseif $itemString} so.addParam("flashVars", "xmlUrl={g->url href='mediaRss.php'}?mode=simple%26g2_itemIds={$itemString}&showDropShadow=true&shuffle=true"); {else} so.addParam("flashVars", "xmlUrl={g->url href='mediaRss.php'}?mode=dynamic%26g2_view=dynamicalbum.RandomAlbum%26g2_albumId={$theme.item.id}&showDropShadow=true"); {/if} so.addParam("wmode", "transparent"); so.addParam("allowFullscreen", "true"); so.addParam("allowScriptAccess", "always"); so.write("sidebarMini"); // ]]> </script> </div> {/if} I have more if you need it. -s FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2 |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
Outstanding. Thanks a lot. I had started playing around w/ some of the Smarty string functions & was able to get what I needed from a tagalbum uri, and pass it as a parameter in a test case. But that's as far as I got so far. I'll start playing w/ this new stuff straightaway. Question: How will the most recent mini slideshow/mediaRss handle g2 search results? Didn't see any references in the above code. I don't think that's technically a dynamic album, is it? The url that the search generates for the results is pretty scary, if I can't get the mini to digest that, I'll probably have to hack the Lytebox ss back in just for the search results, since it seems to handle that well... |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Never been much for gallery's limited search functionality, always used tag or keyword searches. So, I don't have any experience with search albums. Bu they should also return $theme.allChildIds -s |
|
davidarnoult
Joined: 2008-03-18
Posts: 39 |
![]() |
Hi Suprsidr, Can you tell me how you create your multiple tag search, it is really cool! Thanks |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I'll package it up later when I get home, I had to adjust the query as well as the templates. -s |
|
davidarnoult
Joined: 2008-03-18
Posts: 39 |
![]() |
Thanks David |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
I agree that the gallery search needs a huge update. How much would it take to provide an option for 'AND' type boolean searches in that slick tag setup you have?! The ability to, for example, return all of the red luxury cars would hugely extend it's utility. Folks have been clamoring for years for a boolean search in gallery , some of the hacks are almost there, but still buggy & inconsistent... ___ |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Ok, I put up what I have. I'll look into adding booleanesque functionality when I have time. -s |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
Hi Wayne, I've been experimenting w/ the new mediaRss, and the mode=simple is doing the famous "loading 1/0" dance for me. Other modes seem OK. Go to this test page w/ hardcoded xmlUrl & look at the sourcecode, the swfobject stuff is near the bottom of the page: http://www.wildsuburbia.com/slideshows/url.php This page works fine if I plug in an itemID or mode=dynamic xmlUrl. I had the same issue as others w/ MediaRss.php, where I needed to whack the language code from ~line800 from the MediaRss as per your advice, even in prior version. Any idea what's happening here? I looked at the so values in firebug & they seem to look good. RE: Tag & Keyword albums, if mode=dynamic works, is there an advantage to using the mode=simple instead? My hope was finding some way to get g2 search results into the mini, since the search results page doesn't seem to dump childId's that I can see, but I could be looking in the wrong place. This is what the url looks like: Thanks, _____ |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
it should be http://www.wildsuburbia.com/b2e/gallery2/mediaRss.php?mode=simple%26g2_itemIds=170|183|253|361|158|256|363|258|260|166 |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
Thanks. I shouldn't have missed that. I'm building the xmlUrl in another file & passing it as a parameter in the href that calls the slideshow page. The %26 is being I appreciate the sharp eyes. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I use a couple of functions that may help: function getRelevantKeys() { $relevantKeys = array ('mode', 'g2_view', 'g2_itemId', 'limit', 'g2_keyword', 'g2_tagName', 'mime', 'recursive', 'limit', 'g2_maxImageHeight', 'g2_maxImageWidth', 'useThumb', 'useMicro', 'showTitle', 'noLink', 'noShadow', 'shuffle', 'column', 'rss', 'pagenate', 'ajaxLink', 'showSummary', 'showOwner', 'showDate', 'showViews', 'showRating', 'fullInfo'); $keys = array (); foreach ($_REQUEST as $key=>$value) { if (in_array($key, $relevantKeys)) { $keys[$key] = $value; } } return $keys; } function rebuildCurrentUrl() { $keys = getRelevantKeys(); $pageUrl = 'http'; $pageUrl .= '://'; $pageUrl .= $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; if (count($keys) > 0) { $pageUrl .= '?'; foreach ($keys as $key=>$value) { $pageUrl .= $key.'='.$value.'&'; } } return rtrim($pageUrl, '&'); }
-s |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
Wayne, The one thing I wonder about before I get too much further, is there any practical limit to the mumber of items that can be passed as a Thanks, ____ |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I never load more then say 40 items or so in a slideshow and absolutely no more then 100. -s |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
OK, hypothetically, if for whatever reason ( web-connected Digital Picture Frames or bigscreen HD TV's comes to mind...) someone wanted to |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I don't believe there is any limit to post variables http://www.w3schools.com/php/php_post.asp -s |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
Did you ever get a chance to look into the boolean functions? suprsidr wrote:
Ok, I put up what I have. I'll look into adding booleanesque functionality when I have time. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
No, sorry been very busy. -s |
|
ForestCat
Joined: 2007-04-27
Posts: 29 |
![]() |
I understand. I had high hopes, since that functionality is something a lot of people have been begging for in Gallery for a long time, and it's what's needed, IMO to bring Gallery2 up to par with some of the other script & web based packages. I have reservations about Gallery3, I've now got a lot of my time invested in Gallery2, and it seems they've changed _everything_, including the theme interface. What I've read leads me to believe that G3 will be much less customizable/configurable, which was what led me to G2 in the first place. Hope I'm wrong. The lack |
|