Please login or register.
Login with username, password and session length
May 25, 2013, 11:49:43 AM
News: We're back! And here to stay!
collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Recent Posts

you must provide a description by kasix
[Yesterday at 11:48:59 PM]


Fatal error: by mailtobala04
[May 17, 2013, 04:36:20 PM]


Backend Items (Images) don't work by bauchinj
[May 15, 2013, 04:18:55 PM]


Permissions issue: a user can upload images in other user galleries by guidocx84
[May 11, 2013, 05:17:44 PM]


Payment after loggin by mirjam
[May 11, 2013, 03:02:56 PM]


image titles without dashes by mirjam
[May 11, 2013, 02:57:48 PM]


Batch Upload Fails by mirjam
[May 11, 2013, 02:52:08 PM]


Slow Gallery with many Photos by mirjam
[May 11, 2013, 02:49:36 PM]

Advertisement


Pages: [1]   Go Down

Author Topic: Display popups on thumbs_table.php instead on item_image.php RSGallery 2 3.x  (Read 233 times)

Offline dreetje

  • Newbie
  • *
  • Posts: 2

Hi Guys, .

Is it possible to make the popup on the thumbs_table.php page and not on the gallery page(item_image.php)? And how do i do it?
I tried to combine the itemimage and the thumbstable but that doesn't work correctly....

Can someone plz help ?

 

Offline mirjam

  • Dev Team
  • Hero Member
  • *****
  • Posts: 558

Is it possible to make the popup on the thumbs_table.php page and not on the gallery page(item_image.php)?
Yes, that is possible, with some "intelligent" cut & paste   ;)

When you go via your RSGallery2 menu item to a gallery and have the thumbs view set in the table way it is indeed the code in that thumbs_table.php that shows the thumb image(s) with a link to the individual image. This is the code:
Code: [Select]
<div class="shadow-box" >
<div class="img-shadow">
<a href="<?php echo JRoute::_"index.php?option=com_rsgallery2&page=inline&id=".$item->id ); ?>">
<img src="<?php echo $thumb->url();?>" alt="<?php echo htmlspecialchars(stripslashes($item->descr), ENT_QUOTES); ?>"/>
</a>
</div>
</div>
You can replace this by, for example
Code: [Select]
<img src="<?php echo $thumb->url();?>" alt="<?php echo htmlspecialchars(stripslashes($item->descr), ENT_QUOTES); ?>"/>
to check that with this new line you only have the image, without the CSS shadow box and without a link to another page.

You want a popup when you click this image, and ideed, the code from item_image.php is a nice example.

The modal popup behaviour is done with this code, however, $imageOrigingalURL needs to be adjusted from the name that is available in thumb_table.php, together with some other code that is used for that variable. So in the end you can comment/remove the divs for the shadow-box as shown above and put some php code for the modal popup there:
Code: [Select]
<?php
$watermark $rsgConfig->get('watermark');
$imageOriginalUrl $watermark waterMarker::showMarkedImage$item->name'original' ) : imgUtils::getImgOriginal$item->name );
JHTML::_('behavior.modal');
$jsModal '
window.addEvent("domready", function() {
SqueezeBox.initialize({});
var img = $$("img.rsg2-displayImage")[0];
img.addEvent("click", function(e)
{
new Event(e).stop();
SqueezeBox.fromElement(img,{url:"' 
$imageOriginalUrl .'", 
classWindow:"rsg2", 
classOverlay:"rsg2",
onOpen:function(img){
var p = new Element("p", {class:"rsg2-popup-title"});
$(p).appendText("'
strip_tags($item->name) . '");
$(p).inject(img);
var pSize1 = $(p).getSize().size;
p = new Element("p", {class:"rsg2-popup-description"});
$(p).appendText("'
strip_tags($item->descr) . '");
$(p).inject(img);
var pSize2 = $(p).getSize().size;
size = SqueezeBox.size;
size.y += pSize1.y + pSize2.y;
SqueezeBox.resize(size, true);
}});
});
});'
;
$doc =& JFactory::getDocument();
$doc->addScriptDeclaration($jsModal);
?>

and of course, after that you show the image with with the class (since that is described in the modal code as the img class where the popup should be used):
Code: [Select]
<img class="rsg2-displayImage" src="<?php echo $thumb->url();?>" alt="<?php echo htmlspecialchars(stripslashes($item->descr), ENT_QUOTES); ?>"/>

Note that when you upgrade RSGallery2 the template Semantice (that holds the files mentioned here) will be overwritten and you'll loose your changes. However, this post will help you set up your own template: http://www.rsgallery2.nl/display_and_templates/how_create_your_own_template_or_modify_semantic_template_16758.0.html.
Suddenly on maternity leave: our baby boy was born a few weeks early, he's doing well now.
For the next couple of weeks I won't available, for true emergences pm locutusweb please.

I hope that RSGallery2 users will help each other out in the mean time.
Pages: [1]   Go Up