RSGallery2 Support Forums
Welcome, Guest. Please login or register.

Login with username, password and session length
  Home    Forum    Help    Search    Login    Register  
*
News : November 21, 2008, 08:09:25 am
+  RSGallery2 Support Forums
|-+  RSgallery2 support forums
| |-+  Display and Templates (Moderators: Jonah, Tomislav Ribicic, Daniel Tulp, Ronald Smit)
| | |-+  replace display page with lightbox - semantic
Advanced search
  « previous next »
Pages 1
Author
Topic: replace display page with lightbox - semantic  (Read 874 times)
« on: October 17, 2008, 02:50:01 am »
Kevin James Smith Offline
Newbie
*
Posts: 3

View Profile Email

Hi,

I am trying to change the thumbs_float.php file so that when a user clicks on a thumb, it opens a lightbox with the the larger image instead of going to the display page. I have managed to get the lightbox to pop open with an image, but due to the fact that the code uses "original" to state which image it should load, it loads the last image in the gallery, regardless of what thumb you click on. I have also managed to get it to display "x of x pictures" so i only need to figure this bit out and its done. The code I am using is as follows:

The line of code in question:

Code:
<a rel="lightbox[gallery]" href="<?php echo waterMarker::showMarkedImage$item->name'original' ); ?> ">

[Edit] The original code for this line was this:

Code:
<a href="<?php echo JRoute::_"index.php?option=com_rsgallery2&page=inline&id=".$item->id."&Itemid=$Itemid" ); ?>">


The full thumbs_float.php file in its current state:

Code:
<?php defined('_JEXEC') or die('Restricted access'); ?>



<?php

$floatDirection 
$rsgConfig->get'display_thumbs_floatDirection' );

global 
$Itemid;

?>




<ul id="rsg2-thumbsList">

<?php 

foreach( $this->gallery->currentItems() as $item ):

if( $item->type != 'image' )

continue;  // we only handle images



$thumb $item->thumb(); ?>




<li <?php echo "style='float: $floatDirection'"?> >

<a rel="lightbox[gallery]" href="<?php echo waterMarker::showMarkedImage$item->name'original' ); ?> ">

<!--<div class="img-shadow">-->

<img alt="<?php echo htmlspecialchars(stripslashes($item->descr), ENT_QUOTES); ?>" src="<?php echo $thumb->url(); ?>" />

<!--</div>-->

<span class="rsg2-clr"></span>

<?php if($rsgConfig->get("display_thumbs_showImgName")): ?>

<br /><span class='rsg2_thumb_name'><?php echo htmlspecialchars(stripslashes($item->title), ENT_QUOTES); ?></span>

<?php endif; ?>

</a>

<?php if( $this->allowEdit ): ?>

<div id="rsg2-adminButtons">

<a href="<?php echo JRoute::_("index.php?option=com_rsgallery2&page=edit_image&id=".$item->id); ?>"><img src="<?php echo JURI::base(); ?>/administrator/images/edit_f2.png" alt="" height="15" /></a>

<a href="#" onClick="if(window.confirm('<?php echo _RSGALLERY_DELIMAGE_TEXT;?>')) location='<?php echo JRoute::_("index.php?option=com_rsgallery2&page=delete_image&id=".$item->id); ?>'"><img src="<?php echo JURI::base(); ?>/administrator/images/delete_f2.png" alt=""  height="15" /></a>

</div>

<?php endif; ?>

</li>

<?php endforeach; ?>

</ul>

<div class='rsg2-clr'>&nbsp;</div>


thanks for any help in advance!
« Last Edit: October 17, 2008, 02:52:23 am by Kevin James Smith » Logged
 
Reply #1
« on: October 17, 2008, 10:13:55 am »
Kevin James Smith Offline
Newbie
*
Posts: 3

View Profile Email

For anyone else trying to achieve the same thing I have figured it out, using a bit of code from elsewhere in the forum and changing it slightly.

Open thumbs_float.php from the components/com_rsgallery2/templates/semantic/html folder.

Then replace:

Code:
<a href="<?php echo JRoute::_"index.php?option=com_rsgallery2&page=inline&id=".$item->id."&Itemid=$Itemid" ); ?>">

With:

Code:
<a href="<?php echo imgUtils::getImgOriginal$item->name ); ?>" rel="lightbox[gallery]" title="<?php echo $item->title;?>">

Make sure you are using the semantic template, and that you have the float option selected in configuration(not tables).

This will also display the lightbox as a gallery with the next and previous buttons.
« Last Edit: October 17, 2008, 10:24:19 am by Kevin James Smith » Logged
 
Print  Pages 1
« previous next »
Jump to: