Relative urls in GalleryEmbed

IanLewis

Joined: 2007-04-28
Posts: 3
Posted: Thu, 2008-08-21 02:20

Hi, I'm doing development on a plugin for b2evolution that integrates gallery2. The plugin currently supports adding gallery2 images to posts and single sign on via a separate embedded gallery2 page. This page is currently not shown within a b2evolution page but in a separate page which embeds gallery2 in b2evolution without displaying it in a b2evolution page.

For obvious reasons this isn't ideal and I am currently developing a way to include gallery2 in b2evolution much the same way as the Wordpress plugin does. However, when I give GalleryEmbed::init() an embeduri that is the same as the current url is changing the url to a relative url. This would work normally but b2evolution includes an html <base> tag which changes the relative base url.

Giving something like http://mysite.com/gallery2-page as an embed url to GalleryEmbed::init() generates <a href="gallery2-page?g2_itemid=2..."> kinds of links. If there is a <base> tag included in the document head which has a different url than the current url (something like http://mysite.com/skins/skinname/gallery-page), this doesn't work and clicking on any of the images shown yields 404 errors. Adjusting the url manually to http://mysite.com/gallery2-page?g2_itemid=2... produces the expected results and the page for the photo is displayed.

Changing the url to something other than the current url causes GalleryEmbed to generate absolute urls.

Is there a way to work around this? Maybe a way to fool GalleryEmbed into producing absolute link urls?

Ian