URL-encoding the & can't "break your gallery2 installation" because it's not *in* gallery that you url-encode it. You need to use "%26" in the javascript in your webpage, not the bare & character. If you link directly to the URL in your browser to test it you need to un-encode it and use the & char again; I've tested the corrected version of your link and the module's working correctly: http://galerie.cvjm-nuernberg.de/main.php?g2_view=simpleviewersource.XMLOut&g2_itemId=119
If you correct the syntax in your HTML/javascript and url-encode (as instructed) then it will work.
Error (ERROR_BAD_PARAMETER) : simpleviewersource.XMLOut&g2_itemId=119 can't be parsed
* in modules/core/classes/GalleryView.class at line 149 (GalleryCoreApi::error)
* in main.php at line 325 (GalleryView::loadView)
* in main.php at line 104
* in main.php at line 88
* in main.php at line 3
I don't understand why you'd rather install a php hack (that only works for one album) instead of putting a crossdomain.xml policy file in the right place. But hey, whatever works for you.
To be frank, I'm not really sure this is a real problem. Couldn't it just be the line spacing of the text in simpleviewer? Nobody is adding extra line breaks anywhere.
Have a look in your database with phpMyAdmin and see what the description field actually contains. There's a lot of (potential) different formats, with different line endings like <br> and "\n\r" and stuff.
If you can figure out that it is in fact an extra line then you could reformat the string inbetween the two lines of XMLOut.inc that you modified; php's got lots of string formatting functions that might help.
Play around with the php string formatting commands then; alternatively you could purchase the simpleviewer source, and see what the line spacing for that field is.
so now i am having trouble figuring out why the title & description are not showing up on the slideshow page.
i think its this piece from album.tpl. should that be showing up?
Have we suddenly switched to looking at source code outside the simpleviewersource module? I don't think simpleviewersource includes a file called album.tpl.
If so, you've stepped outside the bounds of my expertise, at least for a thread with this title.
that is true, admin.tpl is outside of the simpleviewer module, its part of the matrix template. But for some reason, when going to the simpleviewer slideshow, that part of the template is no longer rendered. Is the simpleviewer module disabling it?
It's not so much disabling it as not having anything to do with it whatsoever. The "slideshow" is just basically a blank page with the simpleviewer embedded in the middle. The HTML for that is in Slideshow.tpl.
I just tried out this module and I think it's quite nice, although it does not really work "out of the box" (version 0.2.6 when I tried).
I have done a few changes to the files so that it works for me. There are some bug fixes, some customization. I thought I would contribute back the patch file so that it might be useful for someone
Note that I also had to define all the simpleviewer parameters with values for my root album (could not leave them "unset") otherwise it does not work; probably some warning issued by the XMLOUT script...
It would be nice if the "Open in new window" link from simpleviewer's right-click menu could send the user to the gallery page, not the image directly. I am not sure if it is possible though...
Mostly "undefined index" and warnings like these... In several places actually.
Also, I had to define values for all parameters in the top album, otherwise it just does not work.
Sorry I did not keep the exact messages, but the following parts of my patch were fixes for me (in addition to defining values for all parameters).
Also, I had to define values for all parameters in the top album, otherwise it just does not work.
That's not my experience though. It's necessary to define a small subset of the parameters in the root album.
I'm not accepting the change of link from "slideshow" to "slideshow SV", or the replacement of the title with the item summary (in the Simpleviewer caption) but these are really matters of taste. Thanks for all the others. It's a long time since I wrote that code!
The latest revision is now 1726, which all being well will be available in the repository in about 6 hours' time.
Ok, I updated and there are still some issues (I did not report them previous time, sorry):
Notice: Undefined variable: fnvParams in /home2/apache2/www/photos/modules/simpleviewersource/XMLOut.inc on line 96
Notice: Undefined index: maxImageWidth in /home2/apache2/www/photos/modules/simpleviewersource/XMLOut.inc on line 97
Looks like just changing "fnvParams" to "fnParams" fixed the issue for me...
Help!??!!
Showing my newbe status here... installed and am running SimpleViewer just fine (have external pages calling pics from G2 & internally in G2), but have decide to disable SimpleViewer from within Gallery 2 and just use the standard "photo" page. I have deleted the directory called "xml_slideshow" in lib/directory, but SimpleViewer still shows when going to a picture's photo page? Any help is much appreciated...
Nope... uninstalled, deleted, reinstalled, activated... only affects my external viewer pages. Can't remember how I set it up , but, any ideas what I may have done??? I am using Extreme theme and don't see anything in photo.tpl.......................
Just figured it out... Extreme theme's photo page has very similar look to Simpleviewer
My dumbness. It's great to see it in the repository.
I installed this years ago and it was working great. I just re-installed it due to hardware upgrade and I had a tough time getting it to work. The problem? I used my old Simpleviewer v1.8. This version does not work. There may be a workaround but I didn't bother. Simpleviewer v1.9 works straight out of the box.
Posts: 3369
URL-encoding the & can't "break your gallery2 installation" because it's not *in* gallery that you url-encode it. You need to use "%26" in the javascript in your webpage, not the bare & character. If you link directly to the URL in your browser to test it you need to un-encode it and use the & char again; I've tested the corrected version of your link and the module's working correctly:
http://galerie.cvjm-nuernberg.de/main.php?g2_view=simpleviewersource.XMLOut&g2_itemId=119
If you correct the syntax in your HTML/javascript and url-encode (as instructed) then it will work.
Posts: 11
Thanks for your reply.
I tried it again with
But I still get the error "Gallery not found".
I am not completely mistaken, then the the url-encoded version of the url should work exactly the same way as the not encoded. But with http://galerie.cvjm-nuernberg.de/main.php?g2_view=simpleviewersource.XMLOut%26g2_itemId=119 I get an error message of my gallery2:
Ciao!
Stefan
Posts: 3369
Not true; your supposition fails by demonstration. But I think that's irrelevant, actually.
Send me the url (by pm if you prefer) of the simpleviewer page which is giving the error.
Posts: 11
Thanks again.
My testsite is here: http://www.kunstrasenfestival.de/imagetest.html
Ciao!
Stefan
Posts: 3369
Looks like you're falling foul of Adobe's cross domain xml security policy: the simpleviewer code is being loaded from one domain and the xml source is in another. See this post and the ones following for appropriate advice:
http://gallery.menalto.com/node/85127#comment-298860
Actually ignore that link, just go here:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213
Posts: 11
Thank you very much! It works now - with a little php skript:
Ciao!
Stefan
Posts: 3369
I don't understand why you'd rather install a php hack (that only works for one album) instead of putting a crossdomain.xml policy file in the right place. But hey, whatever works for you.
Posts: 11
Because I didn't read it to the end...
It works with crossdomain.xml, too.
Ciao!
Stefan
Posts: 21
Is it possible to show the item description from gallery2 as the caption like on the simpleviewer low res demo?
http://www.airtightinteractive.com/simpleviewer/examples/lores/
Posts: 3369
Instead of the item filename?
try changing from line 128 of XMLOut.inc from
$myFilename = $myItem->getTitle(); echo ("<image><filename>$myItemId</filename><caption>$myFilename</caption></image>\n");to
$myDescription = $myItem->getDescription(); echo ("<image><filename>$myItemId</filename><caption>$myDescription</caption></image>\n");Posts: 21
perfect! well...almost perfect...
it makes the line breaks into 2 line breaks...do you know a simple way to make that display correctly?
btw....im super impressed with how quick and accurate you are! TY!
Posts: 3369
Post an example please.
Posts: 21
so from the description field, i have:
line 1
line 2
but it renders in the slide show with an extra line break:
line 1
line 2
Posts: 3369
I mean, post a screen shot.
To be frank, I'm not really sure this is a real problem. Couldn't it just be the line spacing of the text in simpleviewer? Nobody is adding extra line breaks anywhere.
Posts: 21
in XMLOut.inc:
$myDescription = $myItem->getDescription();
echo ("<image><filename>$myItemId</filename><caption>$myDescription</caption></image>\n");
edit photo page:

simpleviewer:

Posts: 3369
Have a look in your database with phpMyAdmin and see what the description field actually contains. There's a lot of (potential) different formats, with different line endings like <br> and "\n\r" and stuff.
If you can figure out that it is in fact an extra line then you could reformat the string inbetween the two lines of XMLOut.inc that you modified; php's got lots of string formatting functions that might help.
Posts: 21
in the DB, i dont see any line endings....
it just shows:
Oil on Canvas
48" x 36"
Posts: 3369
Play around with the php string formatting commands then; alternatively you could purchase the simpleviewer source, and see what the line spacing for that field is.
Posts: 21
got it!
$myDescription = str_replace("\r", "", "$myDescription");
so now i am having trouble figuring out why the title & description are not showing up on the slideshow page.
i think its this piece from album.tpl. should that be showing up?
<div class="gbBlock gcBackground1"> <table style="width: 100%"> <tr> <td> {if !empty($theme.item.title)} <h2> {$theme.item.title|markup} </h2> {/if} {if !empty($theme.item.description)} <p class="giDescription"> {$theme.item.description|markup} </p> {/if} </td> <td style="width: 30%"> {g->block type="core.ItemInfo" item=$theme.item showDate=false showSize=false showOwner=$theme.params.showAlbumOwner class="giInfo"} </td> </tr> </table> </div>Posts: 3369
Have we suddenly switched to looking at source code outside the simpleviewersource module? I don't think simpleviewersource includes a file called album.tpl.
If so, you've stepped outside the bounds of my expertise, at least for a thread with this title.
Posts: 21
that is true, admin.tpl is outside of the simpleviewer module, its part of the matrix template. But for some reason, when going to the simpleviewer slideshow, that part of the template is no longer rendered. Is the simpleviewer module disabling it?
Posts: 3369
It's not so much disabling it as not having anything to do with it whatsoever. The "slideshow" is just basically a blank page with the simpleviewer embedded in the middle. The HTML for that is in Slideshow.tpl.
Posts: 12
Hi,
I just tried out this module and I think it's quite nice, although it does not really work "out of the box" (version 0.2.6 when I tried).
I have done a few changes to the files so that it works for me. There are some bug fixes, some customization. I thought I would contribute back the patch file so that it might be useful for someone
Note that I also had to define all the simpleviewer parameters with values for my root album (could not leave them "unset") otherwise it does not work; probably some warning issued by the XMLOUT script...
You can see the result there: http://cowaddict.org/voyages/simpleview/46626
It would be nice if the "Open in new window" link from simpleviewer's right-click menu could send the user to the gallery page, not the image directly. I am not sure if it is possible though...
Bests,
Posts: 3369
Hi Jigoro,
Please tell me about the problems you had with the module
Thanks
EDIT: OK, I've accepted some of your corrections - thanks for pointing them out. I'll get the repository updated asap.
Anyone using this module is recommended to update to the latest code (no version number change) and thanks to Jigoro for the fault-finding.
Posts: 12
Mostly "undefined index" and warnings like these... In several places actually.
Also, I had to define values for all parameters in the top album, otherwise it just does not work.
Sorry I did not keep the exact messages, but the following parts of my patch were fixes for me (in addition to defining values for all parameters).
Best regards,
--- simpleviewersource.ori/classes/SimpleviewerParameterMapHelper.class 2009-03-06 04:38:01.000000000 +0100
+++ simpleviewersource/classes/SimpleviewerParameterMapHelper.class 2009-03-06 03:33:46.000000000 +0100
@@ -148,7 +148,7 @@
while ($result = $searchResults->nextResult()) {
$params[]=array('id'=>$result[0],'paramValue'=>$result[1]);
}
- return array(null, $params[0]);
+ return array(null, $params ? $params[0] : null);
}
--- simpleviewersource.ori/SimpleviewerSourceItemEdit.inc 2009-03-06 04:38:01.000000000 +0100
+++ simpleviewersource/SimpleviewerSourceItemEdit.inc 2009-03-06 04:25:57.000000000 +0100
@@ -48,6 +48,8 @@
GalleryCoreApi::requireOnce('modules/simpleviewersource/classes/SimpleviewerParameterMapHelper.class');
foreach ( $params as $myTuple ) {
trim($myTuple['paramName']);
+ if (!isset($myTuple['paramValue']))
+ $myTuple['paramValue'] = "";
/* parameters must have a non-blank name */
if ( strlen($myTuple['paramName']) && strlen($myTuple['paramValue']) && !($myTuple['id']) ) {
/* create the parameter */
@@ -63,7 +65,7 @@
}
}
/* dead parameters */
- if ($myTuple['delete']) {
+ if (isset($myTuple['delete']) && $myTuple['delete']) {
$ret = SimpleviewerParameterMapHelper::deleteParam($myTuple['id']);
if ($ret) {
return array($ret, null);
@@ -116,7 +118,7 @@
if ($ret) {
return array ($ret,null);
}
- $form['custom'][]= array('id' => $aParam[id], 'paramName' => $myParamName, 'paramValue' => $aParam[paramValue]);
+ $form['custom'][]= array('id' => $aParam['id'], 'paramName' => $myParamName, 'paramValue' => $aParam['paramValue']);
}
$form['custom'][] = array('id' => "", 'paramName' => null, 'paramValue' => null);
--- simpleviewersource.ori/XMLOut.inc 2009-03-06 04:38:01.000000000 +0100
+++ simpleviewersource/XMLOut.inc 2009-03-06 04:22:43.000000000 +0100
@@ -93,8 +93,8 @@
'useAuthToken' => false,
'htmlEntities' => true));
$fnParams['imagePath']=$urlgen->generateUrl( array( 'view' => 'simpleviewersource.DownloadMax',
- 'maxImageHeight' => $svParams['maxImageHeight'],
- 'maxImageWidth' => $svParams['maxImageWidth'],
+ 'maxImageHeight' => $fnParams['maxImageHeight'],
+ 'maxImageWidth' => $fnParams['maxImageWidth'],
'itemId'=>'' ),
array( 'forceFullUrl' => true,
'forceSessionId'=>false,
Posts: 3369
Hi Jigoro,
Yes, I see the problems you refer to.
That's not my experience though. It's necessary to define a small subset of the parameters in the root album.
I'm not accepting the change of link from "slideshow" to "slideshow SV", or the replacement of the title with the item summary (in the Simpleviewer caption) but these are really matters of taste. Thanks for all the others. It's a long time since I wrote that code!
The latest revision is now 1726, which all being well will be available in the repository in about 6 hours' time.
Posts: 12
Sure, no problem, as I wrote in my first message, a part of this patch is just customization for me
I was just lazy to edit the patch, sorry for this!
Thank you for your quick response
Best regards
Posts: 3369
Could you do me a favour and check the new version when it's available?
I also rolled in a couple of changes which mean that there's no longer an HTTP redirect when downloading each image, it's served on the first request.
Posts: 12
Sure, but I won't be able to do it before Monday. I'll send a status then.
Posts: 12
Ok, I updated and there are still some issues (I did not report them previous time, sorry):
Notice: Undefined variable: fnvParams in /home2/apache2/www/photos/modules/simpleviewersource/XMLOut.inc on line 96
Notice: Undefined index: maxImageWidth in /home2/apache2/www/photos/modules/simpleviewersource/XMLOut.inc on line 97
Looks like just changing "fnvParams" to "fnParams" fixed the issue for me...
Hope this helps ^^
Posts: 3369
thanks - fixed in revision 1730.
Posts: 8
Help!??!!
Showing my newbe status here... installed and am running SimpleViewer just fine (have external pages calling pics from G2 & internally in G2), but have decide to disable SimpleViewer from within Gallery 2 and just use the standard "photo" page. I have deleted the directory called "xml_slideshow" in lib/directory, but SimpleViewer still shows when going to a picture's photo page? Any help is much appreciated...
Posts: 3369
uninstall the module from the plugins page
Posts: 8
Nope... uninstalled, deleted, reinstalled, activated... only affects my external viewer pages. Can't remember how I set it up , but, any ideas what I may have done??? I am using Extreme theme and don't see anything in photo.tpl.......................
Just figured it out... Extreme theme's photo page has very similar look to Simpleviewer
...Sorry, my dumbness
Posts: 4
How can I get the latest revision 1730? Thanks.
Posts: 3369
1730 is the one in the repository.
Posts: 4
My dumbness. It's great to see it in the repository.
I installed this years ago and it was working great. I just re-installed it due to hardware upgrade and I had a tough time getting it to work. The problem? I used my old Simpleviewer v1.8. This version does not work. There may be a workaround but I didn't bother. Simpleviewer v1.9 works straight out of the box.
Excellent work, Alec.