Simpleviewer module

capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Fri, 2007-11-16 15:18
alecmyers wrote:
Minor edit to previous files...

Change DownloadMax.inc at line 134 from:

if ( $maxImageHeight ) {

to:

elseif ( $maxImageHeight ) {

To avoid some unnecessary looking-for-sizes-that-don't-exist.

I thought that at first, but what if you have maxImageHeight set, but not maxImageWidth? You'd still want to do the check. If maxImageWidth is there and it's width bound, it would have already returned in the loop above, so you'd never get to the maxImageHeight check.

But that did make me think about this line:

$widthbound = ( $potentialImages[0]->height * $maxImageWidth < $potentialImages[0]->width * $maxImageHeight ) ? 1 : 0;

If maxImageWidth is not set, maxImageWidth would be 0, so the left side of the comparison would be 0, resulting in widthbound being true, when we really want it to be false. And vice versa, if maxImageHeight is not set, maxImageHeight would be 0, so the right side would be 0, resulting in widthbound being false, when it really should be true.

How about a test to see if both maxes are set? If so, use the existing logic, if not, widthbound = true if maxImageWidth exists, and vice versa.

if ($maxImageWidth && $maxImageHeight) {
	$widthbound = ( $potentialImages[0]->height * $maxImageWidth < $potentialImages[0]->width * $maxImageHeight ) ? 1 : 0;
}
else {
	$widthbound = $maxImageWidth ? 1 : 0;
}

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2007-11-16 15:42

I think we're posting across each other..!

Quote:
If maxImageWidth is there and it's width bound, it would have already returned in the loop above, so you'd never get to the maxImageHeight check.

If maxImageWidth is there and it's widthbound you might still get to the maxImageHeight check if *none* of the images are wide enough. (Granted that none of them are probably tall enough either, in that case, but why bother looking? Just head straight to return the largest image and be done.

I've added a test for the non-existence of $maxImageHeight into the definition of $widthbound - you're correct that it's needed. Since $widthbound is only used once, on line 127, where it's already combined with a test for $imageWidthMax != 0, I didn't think it worth doing that test again. It could be refactored to make it clearer, I suppose.

That's the problem with using a value of zero as a shorthand for (effectively) +infinity.

Incidentally, setting a value of zero for maxImageWidth or maxImageheight stops simpleviewer displaying any image at all; you have to have a zero-length entry or no entry at all to test this out.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Fri, 2007-11-16 15:52
alecmyers wrote:
If maxImageWidth is there and it's widthbound you might still get to the maxImageHeight check if *none* of the images are wide enough. (Granted that none of them are probably tall enough either, in that case, but why bother looking? Just head straight to return the largest image and be done.

Right. They wouldn't be tall enough because it's width constrained.

alecmyers wrote:
Since $widthbound is only used once, on line 127, where it's already combined with a test for $imageWidthMax != 0, I didn't think it worth doing that test again.

Ah, of course.

I look forward to 0.2.5

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2007-11-18 15:11

This rolls in the previous changes ...

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2007-11-20 00:53

Firstly nice work alecmyers,

Capt Kirk and myself have been testing out this module by linking the output of the Album Tree to Simple Viewer.. I got to say the app has some potential but also it has some concerns. To me the largest concern is the way it loads photos which is a mixture of ALL the thumbnails and ALL the resized or fullsize images for the album. Thus any album with more than 50 photos, this would effectively translate to a huge page size and would have some serious performance issues. We cannot see how we can hack the viewer to prevent this to say for example, only load the the relevant resized/fullsize images for the photos being displayed in the current thumbnail grid.

I would also like to have

A) The ability to make the background transparent like lightbox so we can overlay the simpleviewer on top of a wordpress page
B) Specifying the loading order, so the thumbnails for the current grid are loaded first, followed by the resized or fullsize images, followed by the remaining thumbnails for the remaining album..

We are hoping to find a way around this limitation..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2007-11-20 10:17
ozgreg wrote:
Firstly nice work alecmyers,

Thanks!

ozgreg wrote:
Capt Kirk and myself have been testing out this module by linking the output of the Album Tree to Simple Viewer.. I got to say the app has some potential

:blush:

ozgreg wrote:
but also it has some concerns. To me the largest concern is the way it loads photos which is a mixture of ALL the thumbnails and ALL the resized or fullsize images for the album.

That is in fact a limitation of Simpleviewer, not of this module. (And the reason why I implemented the maxItems parameter which when used limits Simpleviewer to downloading and displaying only the first n items in the album.)

ozgreg wrote:
Thus any album with more than 50 photos, this would effectively translate to a huge page size and would have some serious performance issues.

Indeed it may do, depending on the viewer's pc and memory. This is acknowledged explicitly by the author of Simpleviewer who states that it's not intended and should not be used for viewing more than 50 images. See FAQ number 8 at this page: http://www.airtightinteractive.com/simpleviewer/faq.html

Quote:
We cannot see how we can hack the viewer to prevent this to say for example, only load the the relevant resized/fullsize images for the photos being displayed in the current thumbnail grid.

You can't with the free version, but there is an option already in the code: preLoadimges (for access to which you must pay $45 to Airtight Interactive) to go part of the way towards that. Set this option to false, recompile Simpleviewer in Adobe Flash (you can download a 30 day trial from Adobe) and this will cause Simpleviewer to load only the currently-displayed image along with all the thumbnails. That parameter is not something that can be set in the XML data without modifying the Simpleviewer code (although that's exactly what I've done on my installation) so simpleviewersource alone is unable to help.

ozgreg wrote:
I would also like to have

A) The ability to make the background transparent like lightbox so we can overlay the simpleviewer on top of a wordpress page

If I understand what you're asking, this page may be helpful:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14201&sliceId=1
In order to implement that you will need access to the Simpleviewer source code which is available from Airtight Interactive for $45.

ozgreg wrote:
B) Specifying the loading order, so the thumbnails for the current grid are loaded first, followed by the resized or fullsize images, followed by the remaining thumbnails for the remaining album..

For loading thumbnails first: as mentioned, there's the preLoadimages parameter that you can set and recompile in Simpleviewer. Or for more control you can buy ($45, yada yada yada) and hack the code about to do things in any order you like, and to do exactly what you describe would be quite straightforward I think. (In fact the Simpleviewer code is pretty smart to load the first image as soon as possible in my view as it keeps the viewer waiting for the least amount of time, but your application may benefit from a different treatment.)

ozgreg wrote:
We are hoping to find a way around this limitation..

In general you're describing the ways Simpleviewer works as limitations which suggests that you're not using it in the way it was intended - as a lightweight (it's less than 20k of code as a flash program) viewer for up to 50 small-ish images. simpleviewersource is supposed to be an interface to *that* use, rather than as a replacement for any part of Gallery which is more capable of displaying large and large numbers of images.

However, you can write a "new" flash viewer, based on Simpleviewer, if you buy the source code from Airtight Interactive (did I say, $45?) and simpleviewersource assists you to pass your own private settings to your modified version by including the facility for custom parameters (oddly enough, because this is exactly the path I've chosen to work around some of the issues you've described!)

You may also like to have a look at the Simpleviewer support forum which can be found here:
http://www.airtightinteractive.com/forum/
It's quite likely that some of these issues are discussed there. Please also bear in mind that I only wrote the interface for the (pre-existing) Simpleviewer to be able draw images from Gallery. Brickbats for design choices in Simpleviewer itself need to be directed towards its author, not towards me.

Best of luck!

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2007-11-20 10:39
alecmyers wrote:
However, you can write a "new" flash viewer, based on Simpleviewer, if you buy the source code from Airtight Interactive (did I say, $45?) and simpleviewersource assists you to pass your own private settings to your modified version by including the facility for custom parameters (oddly enough, because this is exactly the path I've chosen to work around some of the issues you've described!)

You may also like to have a look at the Simpleviewer support forum which can be found here:
http://www.airtightinteractive.com/forum/
It's quite likely that some of these issues are discussed there. Please also bear in mind that I only wrote the interface for the (pre-existing) Simpleviewer to be able draw images from Gallery. Brickbats for design choices in Simpleviewer itself need to be directed towards its author, not towards me.

Alecmyers,

For the record, was not directing any brick bats at you, I never referred to your source, it was the quickviewer script and how it would it work in a real life Gallery2 which is something I feel I have some understanding of ;)

I wish it was as easy as spending $45, if you look at the terms of conditions on the Pro we are pretty much limited in what we can do to fix the simpleviewer which is a pain as I get the feeling with a few tweaks it could be made into a really good module that would compliment a great number of embedded applications..

As I said, the comments where directed at the product not your scripts..

Ozgreg

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2007-11-20 10:56

Hi Ozgreg,

Don't worry, no offence taken ... the simpleviewersource script was written to suit my own real-life commercial needs to be able to display part of some of my own Gallery albums in a new and manageable way to my customers - other people's uses for it will vary widely and some people will find it unsuitable, no doubt.

My understanding of the simpleviewer-pro licence is that you can do most reasonable things with it except redistribute the original or modified source code. I believe you can modify it to suit your own needs and have the new compiled version on your website for people to download and view in their browser like all flash executables, which would cover most people's intended use. Specifically, there's nothing more restrictive about the "pro" licence compared to the one that accompanies the free version - so if the free version can be used then so could a version modified to suit your requirements.

And if you have comments and questions about the Simpleviewer Flash application (rather than the simpleviewersource module for Gallery) they're probably more rewardingly discussed on the Airtight Interactive forum where people who genuinely can help (like the module's author) are to be found.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2007-11-20 11:02

Yeah it is the redistribute which is the exact thing we want to do as a simple viewer would really suit a lot of Wordpress users who just want something very simple and we can and already have tied your script to the Gallery2 Album Tree making it all just a matter of clicking on the tree to see the simpleviewer output which would have been pretty cool..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2007-11-20 11:12

I'd suggest a conversation with Felix at Airtight Interactive then. I'm still not entirely clear what constitutes redistribution, since clearly one is permitted to 'redistribute' it from one's website to the viewer. And one is even encouraged to do so, with the free version, which has the download link.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2007-11-20 12:09

You guys are describing all the same issues I was dealing with last year at this time with my slideshow.
Wish I had the feedback you're getting Alec ;)

I wrote a preloader that loads only the large image while simultainiously(sp?)creating a thumb. This way we utilize your browser's cache.
Flash transparent backgrounds - The upcoming update to flashplayer will allow fullscreen and wmode transparent. Currently you cannot use both allowFullscreen and any wmode at the same time.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2007-11-20 12:20
suprsidr wrote:
I wrote a preloader that loads only the large image while simultainiously(sp?)creating a thumb. This way we utilize your browser's cache.

The first version of simpleviewersource just provided the main image as the thumbnail, and then the browser's cache took the hit for the second (main) download - but that doesn't work so well if you're Capt_Kirk, with umpteen bazillion gigabyte main images to download (hey cool, this browser's spell-check has both umpteen and bazillion in it! :-) )

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2007-11-20 12:46
alecmyers wrote:
suprsidr wrote:
I wrote a preloader that loads only the large image while simultainiously(sp?)creating a thumb. This way we utilize your browser's cache.

The first version of simpleviewersource just provided the main image as the thumbnail, and then the browser's cache took the hit for the second (main) download - but that doesn't work so well if you're Capt_Kirk, with umpteen bazillion gigabyte main images to download (hey cool, this browser's spell-check has both umpteen and bazillion in it! :-) )

Yeah we like to be pretty demanding don't we :) Page Sizes are pretty important, Wordpress users like things simple and quick, something that your script will do now.. :)

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2007-11-20 12:49
suprsidr wrote:
You guys are describing all the same issues I was dealing with last year at this time with my slideshow.
Wish I had the feedback you're getting Alec ;)

I wrote a preloader that loads only the large image while simultainiously(sp?)creating a thumb. This way we utilize your browser's cache.
Flash transparent backgrounds - The upcoming update to flashplayer will allow fullscreen and wmode transparent. Currently you cannot use both allowFullscreen and any wmode at the same time.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

Sorry you did not get the feedback S :( Part of the benefit of bring the Embedded G2 applications back to this forum is access to ideas like what we are seeing and helping others like us who have added Content to G2..

BTW your slideshow is not working :(

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2007-11-23 13:00

Here's a version of simplesourceviewer adapted for the XML slideshow from www.flashnifties.com.

It's got a load of extra parameters, since there's more to set for the Flashnifties viewer. In a fit of originality I've called this module "flashniftiessource".

I thought long and hard (ok, well, hard, at any rate) about whether to combine them into one module, and decided not to, because:

  • Although the structure is the same, the parameters are entirely different, and the XML output structure is entirely different. The extra logic to run one set of rules or the other outweighs the savings.
  • You'd need different albumEdit tabs because of the length of the parameters pages
  • There are hundreds of other flash Viewers (Flashnifites has another two or three, Airitight Interactive has another two, and that's without even looking) and they all use different XML syntaxes. So if you want to use simpleviewersource on something else you'd need to modify it anyway. That gets harder the more "all encompassing" it tries to be. Better to have a lightweight module that's easy to hack about to individual requirements.
  • Few people are going to want to run more than one kind of flash viewer on their site, so no point burdening them with the code for all the others. If people do want more than one, they can run multiple modules

As before, please test it out, let me know if/what I've missed.

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Fri, 2007-11-23 19:54

Might want to add that for the FlashNifties version you need to add the line

so.addVariable("file", "http://www.mysite.com/main.php?g2_view=flashniftiessource.XMLOut%26g2_itemId=xxxxx");

w the new URL into your html file after the "var so = new SWFObject..." line

thanks again!

--
Chris
http://ChristianJamesPhoto.com

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Fri, 2007-11-23 19:58

I was wondering why you have to enable each album to be used in the SimpleViewer / FlashNifties plugins?
Is this a security concern for the album to enable it, or just a matter of how the code was written for Gallery?

--
Chris
http://ChristianJamesPhoto.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2007-11-24 12:04
ckawalek wrote:
I was wondering why you have to enable each album to be used in the SimpleViewer / FlashNifties plugins?

You don't - you can leave it enabled (as it's set up by the configuration) in the root album, and all child albums will be enabled. If you turn it off in the root album you can enable the plugin anywhere lower down in the album tree that you like, the value set cascades down until set differently lower down the hierarchy.

So you have flexibility to enable all albums, all albums except the ones you specify, or disable all albums and enable only the ones you specify. It's up to you.

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Sat, 2007-11-24 23:33

Ahh, that makes sense now

alecmyers wrote:
ckawalek wrote:
I was wondering why you have to enable each album to be used in the SimpleViewer / FlashNifties plugins?

You don't - you can leave it enabled (as it's set up by the configuration) in the root album, and all child albums will be enabled. If you turn it off in the root album you can enable the plugin anywhere lower down in the album tree that you like, the value set cascades down until set differently lower down the hierarchy.

So you have flexibility to enable all albums, all albums except the ones you specify, or disable all albums and enable only the ones you specify. It's up to you.

--
Chris
http://ChristianJamesPhoto.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2007-11-26 11:34

Found a new bug: DownloadMax.inc doesn't check that the derivative cache is up to date, so resizes are not created where they don't exist. That means that unless someone has already viewed a resize of a particular image, that resize will not be considered for use.

Fix: replace the code section around line 103 as follows:

	// If the user can see resized versions consider those too
	$ret = GalleryCoreApi::assertHasItemPermission($masterId,'core.viewResizes');
	if (!$ret) {
	    list ($ret, $resizes) = GalleryCoreApi::fetchResizesByItemIds(array($masterId));
	    if ($ret) {
		return array($ret,null);
	    }
	   
	    foreach ($resizes[$masterId] as $resize) {
		list ($ret, $uptodateResize) = GalleryCoreApi::rebuildDerivativeCacheIfNotCurrent($resize->getId());
	 	if ($ret) {
		    return $ret;
	    	}
		$potentialImages[] = $uptodateResize;
 	    }
	}
 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2007-11-28 22:17

New version of Flashniftiessource herewith. This one adds a menu item "Slideshow" in any album with photos (subject to the offerSlideshow configuration parameter set on), and has a template that includes the XML slideshow in its HTML.

You'll need to create a new folder /lib/xml_slideshow and in it put the swfobject.js and the slideshow.swf files.

The modules/flashniftiessource/templates/Slideshow.tpl template will need some work to get it to fit in to your own website design, of course.

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Wed, 2007-12-12 20:45
alecmyers wrote:
You'll need to create a new folder /lib/xml_slideshow and in it put the swfobject.js and the slideshow.swf files.

I'm guessing you meant to say upload flashdetect.js and not swfobject.js?

thanks!
--
Chris
http://ChristianJamesPhoto.com

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Wed, 2007-12-12 20:54

Looks great!
Only problem I found was w using the parameter "auto" for the width and height. The slideshow box doesn't show up in Internet Explorer and it shows up much smaller than it should in Firefox (maybe 200x200px when it should be 400x600px)

--
Chris
http://ChristianJamesPhoto.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2007-12-12 22:02
Quote:
I'm guessing you meant to say upload flashdetect.js and not swfobject.js?

The name changed - see http://blog.deconcept.com/2006/04/21/flashobject-to-become-swfobject/ for details. The latest version is called swfobject.js - I can't remember which ships with the slide-show viewer, but if it's an old one then it's probably worth upgrading from the author's site at http://blog.deconcept.com/swfobject/

Quote:
Looks great!
Only problem I found was w using the parameter "auto" for the width and height. The slideshow box doesn't show up in Internet Explorer and it shows up much smaller than it should in Firefox (maybe 200x200px when it should be 400x600px)

(Don's Tommy Cooper style Fez)

-Patient: "Doctor, Doctor, it hurts when I go like *that*, and like *that*, and like *that*! What should I do?"

-Doctor: "Don't go like *that*!"

Um, seriously though, is that a problem with the viewer, or with the parameters being passed to it?

[EDIT -]

Sorry, at first I was confusing flashdetect.js with flashobject.js, which came with SimpleViewer. But looking at the source of flashdetect.js (that comes with the FlashNifties player) it's actually swfobject.js under another (third) name. How confusing.

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Wed, 2007-12-12 22:09

You still reference "flashdetect.js" in the
modules/flashniftiessource/templates/Slideshow.tpl
which should then be changed to the new swfobject.js

and yeah the flashnifties slideshow program ships w the older version, flashdetect.js and not swfobject.js

I was just letting you know that you can't use "auto" as a parameter w the menu item "Slideshow" or it won't work right, just something of note that was making mine not work when I first installed it, not really a problem in the end though.

One little probelm, the slideshow also doesn't load if you have an ' in the title of the album, e.g. Ben's Photos

--
Chris
http://ChristianJamesPhoto.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2007-12-12 22:23

I'm still using the flashdetect.js file as distributed too - so yes, I should at least be consistent. Probably better to stick to the distribution version.

Thanks for the heads up about the ' - I caught it for the image titles(line 121 of XMLOut.inc) but it needs checking for the album title too. I guess it should be escaped to what, &#39 or something? If you fancy checking that would be kind. I was just lazy previously as you'll see.

I'll check out the auto thing too. I'm dying of man-flu at the moment, so that'll be when/if I get better.

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Wed, 2007-12-12 23:32

It works fine w either version of flashdetect.js - I personally switched all the files over to the new version, swfobject.js

For image titles when you have an apostrophe it displays a quotation mark instead of just a single apostrophe
Yeah &#39 is right for an apostrophe

the auto thing is because in Slideshow.tpl you now have "{$width}", "{$height}",

<script type="text/javascript">
	var so = new SWFObject("/lib/xml_slideshow/slideshow.swf", "gallery", "{$width}", "{$height}", "6", "#000000");
	so.addVariable("file", "{$XMLurl}");
	so.write("flashcontent");
</script>

if you set the width and height to a number it works again - but I'm not sure if that will mess w how you wrote the plugin? It seems to work either way, as long as you set a number somewhere.

If you want the slideshows to loop or to use the randomize parameter also open the XMLOut.inc

and change the 5th last line from:
echo ('<slideshow>');
to
echo ('</slideshow>');

Seriously though, no rush on any of this, it's really just nitpicking that if I don't post now when I'm testing it I'll forget to later. The plugin really works fantastically well and I loved being able to disable both the old slideshow and fullscreen slideshow plugins today!!!

get well soon!

--
Chris
http://ChristianJamesPhoto.com

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Thu, 2007-12-13 00:04

Did I mention how nice it is if you add music too :-)

example w music from the event:
http://christianjamesphoto.com/main.php?g2_view=flashniftiessource.Slideshow&g2_itemId=28838

it's just so easy now
--
Chris
http://ChristianJamesPhoto.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2007-12-13 23:45

While I am a huge anti-fan of website that force music on you, I must admit, in your case it really works.

I've fixed the </slideshow> bug (thanks, sorry, shouldn't have made you tell me twice ;-) ) and also properly html-entitied the captions/titles etc.

I've also added a url-rewrite section so you can get to the slideshow with http://examplesite.whatsit/show/1234 etc. However ... having this kind of url throws off the relative url to the javascript files like swfobject.js etc - I can't work out the correct way in a template file to reference the url for the /lib directory (I want to reference the gallery base directory url) - I'm sure there's a canonical correct way to do it and I can't work it out. Can anyone help?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2007-12-14 17:34

OK, try these files in the relevant places, see if the url_rewrite works for you and the escaped image titles etc.

Regarding the use of "auto" sizes - what would be an appropriate size to put in the html page for the size of the viewer, if the image size is set to auto?

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Fri, 2007-12-14 21:04

Tried and tested the new files out and everything is working just great now.

For the size of the viewer - I wouldn't go anything smaller than 600x600.

--
Chris
http://ChristianJamesPhoto.com

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Fri, 2007-12-14 21:40

Any chance of the slideshow ever working w keyword or dynamic albums? Or is that just a whole new can of worms that I shouldn't have asked about?

--
Chris
http://ChristianJamesPhoto.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2007-12-14 22:59
Quote:
Any chance of the slideshow ever working w keyword or dynamic albums? Or is that just a whole new can of worms that I shouldn't have asked about?

Um, I don't know really... I've never used either of those features ... how do you imagine that would work from the user's point of view? Do they appear just as a regular album? I'd have to install them and see how they work. How does one add menu items to those kinds of albums?

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Sat, 2007-12-15 01:39

They both look just like regular albums (check out the front page of my website, all the smaller thumbnails are links to keyword albums), just without any way to edit them directly. You can edit the general settings for the way all of the dynamic / keyword albums behave from the site admin section. From there you can add blocks and set the number of columns / rows, but nothing shows up when you add the "Item Actions" block to the albums.
That's about all the help I can be for whats happening, code wise I really don't know whats going on, but I would think it has to be creating a list somewhere of whats displayed which you could use to generate the XML from.

--
Chris
http://ChristianJamesPhoto.com

 
appelm

Joined: 2008-01-02
Posts: 20
Posted: Sat, 2008-01-05 20:54

This looks very nice but getting it to work is a bit tricky.
Are you or anyone working on a theme that uses either player with this plugin?
I'm using greypop theme (lightbox) now which is pretty good but not as customizable as I'd like.
Both simpleviewer and flashnifties seem to have a lot of settable options.

(btw, this wide thread is driving me crazy. is there way a to wordwrap that I'm missing?)

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2008-01-05 21:19
Quote:
This looks very nice but getting it to work is a bit tricky.

If you can be a bit more specific about what's tricky, maybe I can help?

I have it working with the Siriux theme quite nicely. I'm not sure what theme Chris is using though.

 
appelm

Joined: 2008-01-02
Posts: 20
Posted: Sat, 2008-01-05 21:26

ok thanks! I'm getting this error when I try to enter the link from the flashnifties tab (after replacing the %26 with &).. I haven't gotten to the point of trying to feed xml to flashnifites..

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

--------------------------------------------------------------------------------

A semi colon character was expected. Error processing resource 'http://marcappel.com:8889/gallery2/main.php?g2_view=flashni...

<image img='http://marcappel.com:8889/gallery2/main.php?g2_view=flashniftiessource.DownloadMax&g2_maxImageHeight=300&...

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2008-01-05 22:03
Quote:
ok thanks! I'm getting this error when I try to enter the link from the flashnifties tab (after replacing the %26 with &).

That's very easy to fix - just don't enter the link in your browser, it's not ever supposed to be viewed that way. (The reason is that it's not returning "proper" XML, which is why your browser is barfing. However, Flashnifties and the Simpleviewer code parse it correctly.) Alternatively, choose view page source and you'll see the correct output.

 
appelm

Joined: 2008-01-02
Posts: 20
Posted: Sat, 2008-01-05 22:30

ok.. makes sense. I was just trying that because I wasn't seeing the slideshow link so thought maybe something else was broken.

I'm slowly getting there.. I hadn't downloaded flashnifties from their website and it was only from your clue above that I need
"to create a new folder /lib/xml_slideshow and in it put the swfobject.js and the slideshow.swf files."
that I figured that out though seems pretty obvious now!

I'm a bit of an ambitious newb with this stuff. But I do have the slideshow link appearing now and it works though
requires some customization as you mention. Turns out the Siriux theme wasn't showing the slideshow link but when I switched
back to Matrix, the link was there.

Thanks a lot. Great work. How about a step-by-step guide if you have time?

 
rjacobs

Joined: 2007-02-18
Posts: 26
Posted: Tue, 2008-05-27 17:39

I was wondering about the use of dynamic albums as well (noted earlier in the thread). I'm not sure how many people use tag or keyword albums (generated with their respective plugins), but it would seem like a great way to manage the albums that are to be displayed with this simpleviewer module.

I too don't really know what's going on at the code level, however, it seems that both the tag and keyword plugins define a different g2_view, for example here is one of mine (w/o URL rewrite):

http://photolib.ryanjacobs.name/main.php?g2_view=tags.VirtualAlbum&g2_tagName=chile

Since I am under the impression that this simpleviewer module creates it's own g2_view "parameter", does this mean that adapting it to use these dynamic albums is more than just swapping saaaay "itemId" with "tagName" is some variable definition in the simpleviewer module code & XML call for simpleviewer?

Just curious as dynamic albums are hugely powerful and it would be great to see them supported with this clever tool.

Cheers!

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-05-27 18:31
Quote:
Since I am under the impression that this simpleviewer module creates it's own g2_view "parameter"

the View parameter in the url is a direction to Gallery which View to load ... each view has it's own file, in the url listed above it's the VirtualAlbum file in the tags module folder. It's not that simpleviewer creates its own g2_view parameter, more that it supplies its own view(s) which are loaded by setting the g2_View parameter in the url to direct the Gallery core to load them.

Each view is written in php to look for and use its own individual parameters after that, so there's no use supplying a tagName parameter to any of the views that make up simpleviewersource - they wouldn't have a clue what to do with it (and would ignore it.)

Simpleviewersource uses the itemId parameter as follows: firstly it checks that the item in question has children (is an album) otherwise it returns an error, then loads the list of simpleviewer parameters that are stored for that album, sends the out in the right format and follows up with the list of pictures.

If you wanted to do something similar for the tags module, it would be easier to start there and add a new view to it. Gallery as a whole handles inter-module dependencies particularly badly so there's no elegant or efficient way for the simpleviewer module to check for or access the private data maintained by the tags module.

I guess what I'm saying is that what you're suggesting would be quite difficult!

 
rjacobs

Joined: 2007-02-18
Posts: 26
Posted: Tue, 2008-05-27 19:38

Thanks for that. I think I see, and it kinda confirms the logic-based idea I had in my head (as I mentioned, the intricacies of the code are beyond me at this point). Part of me imagined that there was some kind of generic album data that Gallery would use to render an album page (fed from various modules or the core) and that structure would be used by the template across all albums (regular, virtual, etc.). Seems the simpleviewer module is interacting at a much lover level than this. Would require a total overhaul I imagine.

Thanks for the clarification. Either way, Gallery makes a nice backend for simpleviewer... just means I have to give up the tagging part for this functionality. Just gotta start looking for a way to manually duplicate pics across multiple albums (there does not appear to be a very effective way to do that yet... without re-writing all descriptions, etc... but that's another topic all-togther).

Thanks!

 
DuncanR

Joined: 2006-09-06
Posts: 29
Posted: Thu, 2008-07-17 09:42

Hello,

love the module - i've been playing around with simpleviewer and now another flash viewer called mono slideshow. I'm adapting your module to provide the xml it requires, and it seems easy enough to do. I just had a question which has more to do with the best approach to take during configuration when the module is first installed. Mono slideshow has a couple of hundred parameters, and although each of them have a default, the basic settings I want to use for each album require changes to about 50 of them.

Is setting all of these via config.inc likely to cause a problem in terms of the general smooth running of gallery? As I am currently only doing this for my website, it would make sense to have as many parameters as possible set in stone, so that setting up a new album doesn't take a massive amount of time.

Mono slideshow is a pay-for programme, but they don't provide the source (or at least I don't think so - don't really understand flash), otherwise I would change the default options within the flash code.

TL;DR: Will creating dozens of extra parameters per album bog this module/gallery/my database down? Is it even possible?

EDIT: Actually, just looked at your flashnifties source and notice that you do something very similar - but the question still stands, is there a limit to the number of these kind of parameters you can attach to an album before performance degrades?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2008-07-17 10:36
Quote:
Is setting all of these via config.inc likely to cause a problem in terms of the general smooth running of gallery? As I am currently only doing this for my website, it would make sense to have as many parameters as possible set in stone, so that setting up a new album doesn't take a massive amount of time.

Not sure I'd put them in config.inc. The approach I took in simpleviewersource was to set them at the root album level and have them picked up from there by descendent albums - then they could be overridden on a case-by-case basis. I don't think that you'd notice a performance hit on anything up to 100-500 different parameters.

If you're feeling lazy you could hard code them into the xmlout.inc I suppose.

 
moveswithwind

Joined: 2008-10-13
Posts: 3
Posted: Mon, 2008-11-24 17:59

Good work on the viewer I have installed it and it works. I would like to ask if there was a way to have a link on the top which show simple viewer for whatever album you are in ? ie simpleview or flashview

Regards Vaughan, Cape Town South Africa

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2008-11-24 18:07

If you activate the "slideshow" setting in the album settings, then you ... get a link to the slideshow. Is that what you mean?

 
brewster1134

Joined: 2009-02-11
Posts: 29
Posted: Wed, 2009-02-11 03:28

I am trying to figure out how to instead of add a link under my thumbnail that says 'Slideshow', i want to just replace the link the on the thumbnail to go to the slideshow. How would i make this change?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2009-02-11 08:31

It depends on your theme.

Look in your album.tpl, for the test for an album item - you should see something like this:

{if ($child.canContainChildren || $child.entityType == 'GalleryLinkItem')}

then after it something like this

{g->url arg1="view=core.ShowItem"  arg2="itemId=`$child.id`"}

which you should replace with

{g->url arg1="view=simpleviewersource.Slideshow" arg2="itemId=`$child.id`"}

I haven't tested it, but that's the general idea.

 
brewster1134

Joined: 2009-02-11
Posts: 29
Posted: Thu, 2009-02-12 00:44

that worked perfect! ty!

 
habakuk

Joined: 2006-03-24
Posts: 28
Posted: Thu, 2009-02-12 16:11

Hello,

i tried the plugin with this code:

Quote:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<script type="text/javascript">
var fo = new SWFObject("viewer.swf", "simpleviewer", "480", "680", "8", "#ffffff");
//Optional Configuration
fo.addVariable("xmlDataPath", "http://galerie.cvjm-nuernberg.de/main.php?g2_view=simpleviewersource.XMLOut&g2_itemId=119");
fo.addVariable("langOpenImage", "Open Image in New Window");
fo.addVariable("langAbout", "About");
fo.addVariable("preloaderColor", "0x999999");
fo.write("flashcontent");
</script>
</body>
</html>

But SimpleViewer says "Gallery not found". In the description http://codex.gallery2.org/Gallery2:Modules:simpleviewersource#Usage it says that i have to url-encode the "&", but that breaks my gallery2 installation (see http://galerie.cvjm-nuernberg.de/main.php?g2_view=simpleviewersource.XMLOut%26g2_itemId=119 ).

Do you have any tips for me?

Thanks.
Stefan