how can use lightbox5 in joomla3

72 views Asked by At

I am using lightbox6.0 (free). this software create a module(lightbox module only) for joomla2.5. but I want to install to jooomla3.3. How can change it and use in joomla3. when I instal module in joomla3 I have this error in view:

 addScript(JURI::base() . "modules/mod_visuallb/engine/js/vlbdata{$galid}.js"); ?> 

mod_visullb1.php:

<?php
/**
* @title        VisualLightBox gallery module
* @version      1.1.0
* @website      http://www.visuallightbox.com
* @copyright    Copyright (C) 2012 VisualLightBox.com. All rights reserved.
*/

defined('_JEXEC') or die('Restricted access');
$document           = JFactory::getDocument();
$galid              = $params->get('galid', "1");
$document->addStyleSheet(JURI::base() . 'modules/mod_visuallb1/engine/css/visuallightbox.css');
$document->addStyleSheet(JURI::base() . "modules/mod_visuallb1/engine/css/vlightbox{$galid}.css");

//$document->addScript(JURI::base() . 'modules/mod_visuallb/engine/js/jquery.min.js');
//$document->addScript(JURI::base() . 'modules/mod_visuallb/engine/js/visuallightbox.js');
?>
<script type="text/javascript">
if (!window.jQuery || !jQuery.visualLightBox) document.write(
    (!window.jQuery?
            '<scr'+'ipt src="<?=JURI::base()?>modules/mod_visuallb1/engine/js/jquery.min.js"></scr'+'ipt>' 
        +   (window.$?('<scr'+'ipt>jQuery.noConflict()</scr'+'ipt>'): '') :'')
    +   '<scr'+'ipt src="<?=JURI::base()?>modules/mod_visuallb1/engine/js/visuallightbox.js"></scr'+'ipt>' 
);
</script>
<?
require(JModuleHelper::getLayoutPath('mod_visuallb1'));

//$document->addScript(JURI::base() . "modules/mod_visuallb/engine/js/vlbdata{$galid}.js");
?>

I left my module here

1

There are 1 answers

0
Jwaa On

I know this is long overdue, but for in case someone else needs this, here's one solution. The problem is that the PHP label is missing on the second set of :

Was:

<? require(JModuleHelper::getLayoutPath('mod_visuallb1'));

Should be:

<?PHP require(JModuleHelper::getLayoutPath('mod_visuallb1'));

That will correctly enclose the PHP code and allow the module to display. I tried this on Joomla 3 and was able to see the gallery with no problems