WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

Du bist nicht angemeldet.

#1 19.07.2018 15:53:20

casi
Mitglied

Lightbox2

Hi. I have updated a Baker 2.8.3 site to WBCE. The module Lightbox2 does not work properly anymore. Is therea fix or a new download? thank you.

Offline

#2 19.07.2018 16:10:02

casi
Mitglied

Re: Lightbox2

PHP7.2 - Fatal error: Uncaught Error: Call to undefined function eregi() in /modules/lightbox2/view.php:69 Stack trace: #0 /framework/frontend.functions.php(308): require() #1 /templates/folgeseite/index.php(118): page_content(1) #2

Offline

#3 19.07.2018 21:02:24

florian
Administrator

Re: Lightbox2

The module loads an lightbox script from the stone age which causes issues with the colorbox and jquery scripts which are included in WBCE.
So remove the lines

	echo '<link rel="stylesheet" type="text/css" href="' . WB_URL . '/modules/lightbox2/frontend.css" media="screen" />';
	echo '<script src="' . WB_URL . '/modules/lightbox2/js/prototype.js" type="text/javascript"></script>' . "\n";
	echo '<script src="' . WB_URL . '/modules/lightbox2/js/scriptaculous.js?load=effects" type="text/javascript"></script>' . "\n";
	echo '<script src="' . WB_URL . '/modules/lightbox2/js/lightbox.js" type="text/javascript"></script>' . "\n";

in the view.php completely.

Then, change

echo '<a href="' . WB_URL . $gallery_path . $img_list[$img_count] . '" class="lb_image_link" rel="lightbox[' . $gallery_name . ']" title="' . $gallery_name . '"><img class="lb_image" src="' . WB_URL . $thumb_path . $img_list[$img_count] . '" border="0" /></a>';

to

echo '<a href="' . WB_URL . $gallery_path . $img_list[$img_count] . '" class="colorbox" rel="lightbox[' . $gallery_name . ']" title="' . $gallery_name . '"><img class="lb_image" src="' . WB_URL . $thumb_path . $img_list[$img_count] . '" border="0" /></a>';

Replace the line

if (eregi($pattern, $file) && $image_info = getimagesize($WB_PATH.$gallery_path.$file)) {

with

if (preg_match('%'.$pattern.'%', $file) && $image_info = getimagesize($WB_PATH.$gallery_path.$file)) {

Beitrag geändert von florian (20.07.2018 08:44:16)

Online

#4 20.07.2018 07:26:48

casi
Mitglied

Re: Lightbox2

Thanks Florian. After the changes the page is empty. No pictures displayed. Could you recommend a better module and replace lightbox2?

Offline

#5 20.07.2018 07:48:03

florian
Administrator

Re: Lightbox2

After the changes the page is empty. No pictures displayed

i would like to fix this error first before recommending any other module.
Does the frontend template of the site include the lines

<?php
if (function_exists('register_frontend_modfiles')) {
	register_frontend_modfiles('css');
	register_frontend_modfiles('jquery');
	register_frontend_modfiles('js');
} ?>

in the <head> ?

Online

#6 20.07.2018 08:37:16

casi
Mitglied

Re: Lightbox2

The line with jquery was missing and I have added it to the template. But there is still no content displayed, with PHP 5.6 and PHP 7.2...

Offline

#7 20.07.2018 08:43:10

florian
Administrator

Re: Lightbox2

Sorry, I had a copy & paste error in my answer above. The line

if (eregi($pattern, $file) && $image_info = getimagesize($WB_PATH.$gallery_path.$file)) {

should be changed to

if (preg_match('%'.$pattern.'%', $file) && $image_info = getimagesize($WB_PATH.$gallery_path.$file)) {

Online

#8 20.07.2018 08:47:15

casi
Mitglied

Re: Lightbox2

still empty, no pictures displayed...

Offline

#9 20.07.2018 08:48:49

florian
Administrator

Re: Lightbox2

Well, then forget it, it's a crappy, outdated module anyway.
Use MiniGallery.

Online

#10 20.07.2018 08:49:22

casi
Mitglied

Re: Lightbox2

Thanks  smile

Offline

#11 20.07.2018 08:54:52

florian
Administrator

Re: Lightbox2

Another option is the Brax Highslide Gallery Module
https://addons.wbce.org/pages/addons.ph … em&item=63
it looks exactly the same (like the LB2 module) in the backend and you don't need to upload the images again.

Beitrag geändert von florian (20.07.2018 08:55:15)

Online

#12 20.07.2018 11:00:50

casi
Mitglied

Re: Lightbox2

Thank you. What is the better approach: 1. Update all galleries in WB2.8.3 or 2. update to WBCE first and then start changing the galleries?

Offline

#13 20.07.2018 11:13:34

florian
Administrator

Re: Lightbox2

I would always update/migrate the core first and then the modules, so you could do a complete rollback if necessary (assuming you have a backup).

Online

Liked by:

stefanek

Fußzeile des Forums

up