Gallery Markup Plugin: Clicking on Image opens New Window

Creating and modifying plugins.
Post Reply
giantboog
Posts: 3
Joined: Sun Jan 14, 2007 9:01 am

Gallery Markup Plugin: Clicking on Image opens New Window

Post by giantboog »

First I would like to thank everyone that has worked on s9y and their related plugins as I enjoy this blogging system very much.

Synopsis:
When I click on an image embedded in one of my posts or entries with the Markup: Gallery Image Plugin that link takes me directly to my Gallery2 gallery in the same browser window. This takes me outside of my blog.

Request:
I would like to change the behavior of the Event plugin Markup: Gallery.
When I click on an image that is embedded in one of my posts or entries with the Markup: Gallery Image Plugin I would like a new browser window to open up with the Gallery2. (like the html command <a href="http:\\link" _TARGET=blank> This will open in a new browser window</a>)

OR

When I click on an image that is embedded in one of my posts or entries with the Markup: Gallery Image Plugin I would like Gallery2 to open embedded into s9y to that picture or album. This would seem to possibly be a combination of the two event plugins Markup: Gallery Image and Gallery2 Embed.

Example below:
Below is the link from Markup: Gallery Image
http://www.shoremenu.com/gallery/main.php?g2_itemId=509

Below is a link to the same picture using Gallery2 Embed
http://www.shoremenu.com/index.php?/gal ... itemId=509

I would like to be able to embed pictures with Markup: Gallery Image and also get the benefit of when clicking on them they take me to the embedded Gallery2.


Currently I have Event Plugins:
Markup: Gallery Image version: 1.10 and working

Gallery2 Embed (gallery2) version: 0.3 and working

my blog: http://www.shoremenu.com/


Thank you to scottwalsh for Markup: Gallery Image
Thank you to Aaron Axelsen for Gallery2 Embed
Thank you for reading my request :D
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Gallery Markup Plugin: Clicking on Image opens New Windo

Post by garvinhicking »

Hi!

Thanks for taking the time to explain what you need here. :-)

I HOPE I have a solution for you. Please try to open the file serendipity_event_galleryimage.php.

Inside the file you should see two occurences of "/main.php":

Code: Select all

$image_link = $gallery_base.'/main.php?g2_view=core.ShowItem&g2_itemId='.$album_id;

...

$image_link = $gallery_base.'/main.php?g2_view=core.ShowItem&g2_itemId='.$fullsize_id;
Could you try to modify those to:

Code: Select all

$image_link = $serendipity['serendipityHTTPPath'] . 'index.php?/gallery2.html&g2_view=core.ShowItem&g2_itemId='.$album_id;

...

$image_link = $serendipity['serendipityHTTPPath'] . 'index.php?/gallery2.html&g2_view=core.ShowItem&g2_itemId='.$fullsize_id;
If that works out for you, I could patch a special configuration option into the plugin.

HTH
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
giantboog
Posts: 3
Joined: Sun Jan 14, 2007 9:01 am

Hi

Post by giantboog »

Thanks for such a prompt suggestion.

I made the changes that you suggested to

serendipity_event_galleryimage.php

which I found in the following directory

/www/shoremenu/plugins/serendipity_event_galleryimage

at lines 552 and 571

After saving the changes and uploading the file back to the directory where I initially found it I tested it.

When clicking on any image the link will take me to an album view still outside of the s9y blog. (e.g. not embedded in my blog)

This is the format of the link after making the above changes.

http://www.shoremenu.com/gallery/main.p ... itemId=508

This is the format of the link before making any changes when clicking on a link.

http://www.shoremenu.com/gallery/main.p ... itemId=508

Neither of these match the previous examples below:
Below is the link from Markup: Gallery Image
http://www.shoremenu.com/gallery/main.php?g2_itemId=509

Below is a link to the same picture using Gallery2 Embed
http://www.shoremenu.com/index.php?/gal ... itemId=509

The item numbers are different 508 and 509.

Let me fiddle around with it a little more and investigate the differences.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Hi

Post by garvinhicking »

Hi!

I'm sorry, you'll need to create a new entry after you've applied the patch. This patch cannot change entries that are already saved in your s9y database, because the links exist in the database and are not re-generated by the plugin!

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply