LightBox Prev/Next image threading

RT for threading all images of the content parts of a category where the LightBox (SlimBox) is used.

FIXME better translate

If larger picture quantities are present in a specific category, it is not so simple to be handled in the backend if all pictures are positioned in one CP. Therefore, this pictures stock is distributed among several CPs. However the LightBox scrolls the pictures not automatically from one CP to the next (Prev/Next), but will stop at the beginning/end of the respective CPs.

To include all the images of the several CPs into the sliding process you can use this RT.
(Alternatively, of course, the scripts gallery or galleryX can be used. (other logic, installation more complex)).

(Also works with the extension MediaBox-Advanced).

<note> This RT will include the pictures of the CP text w/image also, if the LightBox were activated here. </note>


rt_lighbox_prev_next_all.php V1.0 17.12.09

Docu: –
Forum: –

Autor: K.Heermann (flip-flop) http://planmatrix.de
CMS Version: >= 1.3
Version: V1.0
Update 05.08.2011 KH: Bug solved “If no category is specified in the array”.

Tag: –

Filename: rt_lighbox_prev_next_all.php

Folder: template/inc_script/frontend_render/

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_render'] = 1;



Description

In the range === CUSTOM INPUT === of the RT can be indicated, for which categories this behavior is desired. For this we registered the IDs of the categories into the Array $_categories = array( );. Two characteristics: Include ot exclude this behavior.
Whether include or exclude is set up with the switch $inc_categories = true/false;.

true = include aktiv, false = exclude aktiv

Example:

  $inc_categories  = true;
  $_categories     = array(5,7,23,67);

In the categories with IDs 5,7,23,67 it is checked whether a Lightbox is active and the series of images can be combined (Prev/Next).
If $inc_categories = false; the pictures would be excluded of this operation in the categories with the ID 5,7,23,67.

<note> If the array $_categories = array( ); is empty, each category will be reviewed on the use of LightBox, regardless of the setting has been made in the $inc_categories.

</note>

Code

rt_lighbox_prev_next_all

<?php
/*********************************************************************************************
 V1.0  17.12.09 K.Heermann (flip-flop)
 "LightBox Prev/Next all": All Prev/Next from LightBox bind up
 New rel for all LB pictures is called: rel="lightbox[catid-XX]"
 Where XX is the current category ID.
 Update 05.08.2011 KH: If no category is specified in the array
 
 Filename: rt_lighbox_prev_next_all.php
 Folder:   /template/inc_script/frontend_render/
 Switch:   $phpwcms['allow_ext_render'] = 1; (/config/phpwcms/conf.inc.php)
 
**********************************************************************************************/
 
// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
  if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day."); }
// -------------------------------------------------------------------------------------------
 
// ===== CUSTOM INPUT ========================================================================
 
// ------ true = include active,   false = exclude active
$inc_categories    = true;
 
// ------ Fill in your inc/excluded categories e.g. array(7,23,16,25,33)
$_categories    = array(  );
 
// ===========================================================================================
 
 
 
$cat_id     = $content['cat_id'];    // current category ID
 
if (count($_categories) == 0 ) $_categories[0] = $cat_id;  // Update 05.08.2011 KH: If no category is specified in the array
 
if ($inc_categories ) {  // include active?
 
    if ( in_array($cat_id, $_categories) ) {
 
        $content['all'] = preg_replace('/rel="lightbox\[(.*?)\]"/i',
            'rel="lightbox[catid-'.$cat_id.']"', $content['all']);  // fill content
    }
}
else { // exclude active!
 
    if ( !in_array($cat_id, $_categories) ) {
 
        $content['all'] = preg_replace('/rel="lightbox\[(.*?)\]"/i',
            'rel="lightbox[catid-'.$cat_id.']"', $content['all']);  // fill content
    }
}
 
// -----------[ CLOSE ]----------------
?>
english/phpwcms_replacer_rts/frontend_render/lightbox-prev-next-threading.txt · Last modified: 2018/06/03 18:09 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0