News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

FancyBox 4 SMF

Started by Bugo, January 12, 2012, 04:28:36 PM

Previous topic - Next topic

guldam

Has anyone tried to update jQuery for the FancyBox Mod? There are security holes in jquery-1.9.1.min.js that I'd like to get rid of.

Diego Andrés

This mod doesn't include jQuery... anymore at least.
It's only compatible with SMF 2.1 and that's already using 3.6.0

SMF Tricks - Free & Premium Responsive Themes for SMF.

efk

Is it compatible with 2.0.x ?

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Dave J

There seems to be an issue with this mod. It works out of the box on a clean install of 2.1.1 but it's not working correctly on a site that's been upgraded from 2.0.19 to 2.1.1.

I have now tried this twice on my test site with the same results each time.

Using the default 2.1.1 theme I created a post 'Testing FB' I then inserted 2 images. With FB not installed the images look fine, see 'FBuninstalled' but with FB installed all I see is what's in the 'FB2' image

'FB3' shows the settings I have for the mod.

There are no other mods installed 'FB1' and there are no errors reported.

link to test site https://www.davejohnson.co.uk/testing/index.php

Bugo

Class-FancyBox.php, find
public function attachBbcValidate(string &$returnContext, array $currentAttachment, array $tag, string $data, array $disabled, array $params)and replace with
public function attachBbcValidate(string &$returnContext, array $currentAttachment, array $tag, string $data, ?array $disabled, array $params)

Dave J

Thanks Bugo, I check it out later

Dave J

Thank you Bugo, everything is working fine now.

Shades.

I know this says compatible with 2.1.1 but I have it installed on 3 different 2.1.3 forums and 2 of them work just fine with no errors, but one of them is giving me errors in board=1.0. :o

QuoteError
Type of error
Undefined_vars
Error message
2: Undefined array key "href"
File
/home/******/public_html/Sources/Class-FancyBox.php
Line
159
URL of page causing the error
https://******.com/index.php?board=1.0

Backtrace information
#0: smf_error_handler()
Called from /home/******/public_html/Sources/Class-FancyBox.php on line 159
#1: attachBbcValidate()
Called from /home/******/public_html/Sources/Subs.php on line 5836
#2: call_integration_hook()
Called from /home/******/public_html/Sources/Subs.php on line 1815
#3: {closure}()
Called from /home/******/public_html/Sources/Subs.php on line 3643
#4: parse_bbc()
Called from /home/******/public_html/Sources/MessageIndex.php on line 502
#5: MessageIndex()
Called from /home/******/public_html/index.php on line 192

Any ideas please? O:)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

Quote from: Shades. on January 05, 2023, 10:13:02 AMI know this says compatible with 2.1.1 but I have it installed on 3 different 2.1.3 forums and 2 of them work just fine with no errors, but one of them is giving me errors in board=1.0. :o

QuoteError
Type of error
Undefined_vars
Error message
2: Undefined array key "href"
File
/home/******/public_html/Sources/Class-FancyBox.php
Line
159
URL of page causing the error
https://******.com/index.php?board=1.0

Backtrace information
#0: smf_error_handler()
Called from /home/******/public_html/Sources/Class-FancyBox.php on line 159
#1: attachBbcValidate()
Called from /home/******/public_html/Sources/Subs.php on line 5836
#2: call_integration_hook()
Called from /home/******/public_html/Sources/Subs.php on line 1815
#3: {closure}()
Called from /home/******/public_html/Sources/Subs.php on line 3643
#4: parse_bbc()
Called from /home/******/public_html/Sources/MessageIndex.php on line 502
#5: MessageIndex()
Called from /home/******/public_html/index.php on line 192

Any ideas please? O:)

Still getting these errors! Any help please? O:)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

brynn

I'm also getting errors.

Forum version 2.1.3
themes Curve2 and Repulse

other mods
SMF Gallery Lite 7.1
SVG as Image Attachment 1.5 (updated for us)
First Topic Image Rotator 1.3.1

We think this mod may have broken the SVG Attachments mod, but we're not experts.  SVG images are not displayed when inserted into a message (they were before installing Fancy Box).  Also, regarding non-SVG images, sometimes the Fancy Box mod displays all the images in a topic, but not always. We have not figured out why yet.

Note, we probably won't keep all these mods.  For now, we're testing on a private forum. But we do want to keep the one that seems to have been broken by Fancy Box.

Here's a screenshot of the error message.  It looks like the same as Shades. reported above.  It looks like 2 of these are generated each time someone clicks on an image. 

Do you want the backtrace too? Please let me know what further info I can provide for you.



Thank you very much!

Bugo

I need your modified SVG as Image Attachment package for testing.

brynn

Aah, ok.  I just retested, before asking you to look more closely.  It seems to be working fine now, as far as the SVG files being displayed properly.

However, we still have the problem with all the errors.  Can that part be fixed?

Thanks again!

Bugo

I'll see what I can do at my leisure.

brynn


Bugo


brynn

Hi Bugo,
Thanks for your reply.  Really appreciate it.

Unfortunately, it did not help.  We are still getting one error for each image. It looks like the same error as before.

Hhmm, your attachment feature works a little different than ours.... Or maybe I'm missing a script... 
Ok, here it is again:

You cannot view this attachment.

Rick53

Recently I discovered the following bug:
A post has multiple images. If I click on one, then it is displayed in normal size, as before. But the arrows on the left and right edge to switch to the next / previous image are missing. Instead, I have to close the tab and click the next image in the post.

SMF2.1.3, PHP8

Rick53

Addendum: The bug is only on the PC, not on the smartphone

brynn

I'm not sure if it matters, so I mention it just in case it helps.

I can't really "read" PHP. But just from the part of the code that's edited in the above fix, it appears to involve attachments.

But we get the errors for any image, whether it's only inserted, or attached, or attached and then inserted. 

Sometimes it only gives one error for an image.  But other times it gives a few.

I just realized, I should probably not post these full errors, without hiding my IP address and maybe some other things.  But we cannot edit these messages after a few minutes.

At the times when it gives a few errors, it seems to "register" them while I'm uploading the image or maybe posting it.  At first, I thought the errors were coming when we use the mod, or in other words, click on an image.  But this one seems to have happened while I was composing the message or uploading the image or posting the image (I'm not sure exactly what it means, but it's a little different from the others):

You cannot view this attachment.

But it's always, always that line 159.  No matter what causes it, that's the culprit, it seems.

And one more thing I noticed.  Maybe it's not important, but just in case.  Sometimes the errors are shown immediately.  But other times, it might be 5 or 10 minutes before they show up in the log.

Oh!  I just thought of something.  When I'm composing a message, I often use the preview.  Maybe it's the preview that triggers the error?  Maybe that's where the multiple errors are coming from???

Well ok.  Let me know if I can provide any further info.

Thanks again!  :D

PS - We may be having the same problem as Rick53.  Sometimes it does not show an image that's clearly in the topic.  But the mod does not show it.  If that happens, then there's a missing arrow.  We have not figured out why some images are not showing in the mod.

We could probably live with a missing image here and there.  But the errors are a problem for us.  We have not tested on phones.

Thanks again!

Advertisement: