I'm sending the correct path info via the embed::init(), infact i have changed the URI's to many settings and get similar results.
the random image that appears is a valid "thumbnail" image, the link to see the full image is incorrect.
I thought it may be the way i defined the URI's but the embeded gallery works correctly.
example of a correct image but non-correct link:
<a href="index.php?g2_itemId=24&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT" >
<img src="http://www.mydomain.com/modules/images/engine/main.php?g2_view=core.DownloadItem&g2_itemId=25&g2_serialNumber=2&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT" width="150" height="113" class="giThumbnail" alt="Slide04.JPG" longdesc=""/>
</a>
Should be:
<a href="http://www.mydomain.com/modules/images/index.php?g2_itemId=24&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT" >
<img src="http://www.mydomain.com/modules/images/engine/main.php?g2_view=core.DownloadItem&g2_itemId=25&g2_serialNumber=2&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT" width="150" height="113" class="giThumbnail" alt="Slide04.JPG" longdesc=""/>
</a>
OR:
<a href="/modules/images/index.php?g2_itemId=24&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT" >
<img src="http://www.mydomain.com/modules/images/engine/main.php?g2_view=core.DownloadItem&g2_itemId=25&g2_serialNumber=2&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT" width="150" height="113" class="giThumbnail" alt="Slide04.JPG" longdesc=""/>
</a>
Posts: 32509
are you sure you're using the GalleryEmbed params that we expect in G2.1?
other than that, you've discovered another bug. i filed it for you:
https://sourceforge.net/tracker/index.php?func=detail&aid=1442057&group_id=7130&atid=107130
Posts: 18
I dont think there is a session problem per se, I think there is a link problem. Or a falt in the way embedURI and g2Uri are used/modified.
Logged in as a user results in...
Scheme 1. sending to GalleryEmbed::init(array(...))
embed URI (embedUri) /server/path/html/modules/images/index.php
base URI (g2Uri) /server/path/html/modules/images/engine/
GalleryEmbed::getImageBlock(...) result html:
(no image appears!!)
<div class="one-image"><a href="index.php?g2_itemId=42&g2_GALLERYSID=059bb436435d3afd9194791203701125"> <img src="engine/main.php?g2_view=core.DownloadItem&g2_itemId=43&g2_serialNumber=2&g2_GALLERYSID=059bb436435d3afd9194791203701125" width="150" height="113" class="giThumbnail" alt="Slide10.JPG" longdesc=""/> </a></div>
the src link is incorrect should at least be /modules/images/engine/main.php...
the href is incorrect it should be /modules/images/index.php...
Scheme 2. sending to GalleryEmbed::init(array(...))
Trying a different URI scheme:
embed URI (embedUri) http://www.website.net/modules/images/index.php
base URI (g2Uri) http://www.website.net/modules/images/engine/
GalleryEmbed::getImageBlock(...) result html:
(no image appears!!)
<div class="one-image"><a href="index.php?g2_itemId=139&g2_GALLERYSID=52f0da46852044f3bf77e2734a2a3aeb" >
<img src="engine/main.php?g2_view=core.DownloadItem&g2_itemId=140&g2_serialNumber=3&g2_GALLERYSID=52f0da46852044f3bf77e2734a2a3aeb" width="150" height="112" class="giThumbnail" alt="halloween800x600.jpg" longdesc=""/></a></div>
the src link is incorrect should at least be /modules/images/engine/main.php...
the href is incorrect it should be /modules/images/index.php...
Scheme 3. sending to GalleryEmbed::init(array(...))
Trying a different URI scheme (known to be incorrect):
embed URI (embedUri) modules/images/index.php
base URI (g2Uri) http://www.website.net/modules/images/engine/
GalleryEmbed::getImageBlock(...) result html:
(random Image Appears, Yea...)
<div class="one-image"><a href="index.php?g2_itemId=24&g2_GALLERYSID=6dcb87efd5ed5c6ad1d08714c7bf7f0d" >
<img src="http://www.website.net/modules/images/engine/main.php?g2_view=core.DownloadItem&g2_itemId=25&g2_serialNumber=2&g2_GALLERYSID=6dcb87efd5ed5c6ad1d08714c7bf7f0d" width="150" height="113" class="giThumbnail" alt="Slide04.JPG" longdesc=""/></a></div>
but...
the href is still incorrect it should be something like http://www.website.net/modules/images/index.php...
Posts: 18
From the doc - Scheme 2. should work right?
Posts: 32509
is there still a document that has "/appdir/gallery2" and not "/appdir/gallery2/" in it? (notice the traling slash)
Posts: 18
yes line 44 of Embedding that came with the 2.1 RC1 download forgot the trailing slash. I'm using the trailing slash in my Scheme 2 and the results are not what I expect.
Posts: 18
ok, more looking into the issue on my part. I notice that with xoops the "home" page and some modules cause the link to be incorrect. Is smarty sending the link information? I would like to know how the urls for the random image are being sent to see if I can fix it on my end.
Posts: 32509
there's no EMBEDDING document in the current nightly snapshot. if you find such typos in codex.gallery2.org, don't hesitate to correct them yourself or report.
thanks.
i guess you get the wrong embedUri from xoops, right?
that's why i wouldn't acquire it dynamically on each request, but store the known good values for embedUri and g2Uri on setup.
also, short urls (rewrite module) is a very complicated topic, so you might want to try adding rewrite support later when everything else works.
Posts: 18
There is something going on here that I"m not understanding.
I have hard coded the information (http://www.site.com/modules/images/index.php and http://www.site.com/modules/images/engine/)
I do not use rewrite. I get the same results.
on the http://www.site.com page i DO NOT see the random images but I do see their titles.
on the http://www.site.com/user.php (incorrect login redirect) i DO see the random images and correct links.
on some modules I DO NOT see random images but their titles, other modules I see everything correctly.
I'm thinking there is a smarty or some other issue here. (this did not happen with gallery2 v2.0.2 embedded)
How did :getImageBlock(...) change from v2.0.2 to v2.1? How is it determined how urlgenerator's $protocol, $host, $path and $file(may be null)
are truncated and passed on to and thru the templates.
Maybe this is a better question: How could you scrub, clip, truncate, erase the $protocol, $host, and part of the $path?
when it "works" i get:
<a href="/modules/images/index.php?g2_itemId...
<img src="/modules/images/engine/main.php?g2_view=core.DownloadItem...
when is does not "work" i get:
<a href="index.php?g2_itemId...
<img src="engine/main.php?g2_view=core.DownloadItem...
Posts: 18
I have a fix:
forceFullUrl= true
Everything (dynamic acquisition of embeduri and g2uri included) works as expected. Something is not working 100% correctly with the relative linking method.
Posts: 32509
where is fullUrl=true required?
we already have it everywhere in the imageblock module. if you have problems, then you have changed / old templates (modules/imageblock/templates/ ...)
Posts: 18
Update: Still have a similar issue with v2.1.2. The imageblock template has:
forceFullUrl=$ImageBlockData.forceFullUrl
And I cannot see where to set the $ImageBlockData.forceFullUrl (assuming it is a variable)
I created a local template and changed every instance of the above code to:
forceFullUrl=1
And the embeded blocks work as expected.
Where is $ImageBlockData info set?
Posts: 8339
I just ran into this same problem with the latest nightly (2.3)
I changed line 199 imageBlockHelper.class
$ImageBlockData['forceFullUrl'] = 0;
to
$ImageBlockData['forceFullUrl'] = 1;
Why would that be hardcoded?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2