MG 2.2 Media Gallery 2.2 - Lightbox navigation, attachment mirroring and more!

lightbox_5.pngXenForo Media Gallery (XFMG) 2.2 sees a range of new features and improvements. Some of these are a result of new integrations with XenForo 2.2 itself, while others are exclusive new features to XFMG itself.

Lightbox navigation​

Starting with XenForo 2.2 we are introducing a brand new lightbox which as well as being a much improved user experience also affords us some flexibility in how and where we use the lightbox.

One such use case which we couldn't resist treating you to for XFMG 2.2 is of course navigating through media items in the media gallery. Before we get into it, this is what the experience looks like.


lightbox_1.png lightbox_2.png lightbox_3.png lightbox_4.png lightbox_5.png lightbox_6.png


The lightbox as used in the media gallery supports all media types including media embeds, video and audio.

By default the lightbox opens up a very useful sidebar which displays most of the information and functionality that you get if you go to the full media page. If you prefer not to view that information then you can collapse the sidebar. Sections within the sidebar can be expanded and collapsed as required and we remember your preferences here so only the relevant sections are displayed.

The lightbox will initially only contain the items from the current page but, as you can see in the video, you can continue navigating beyond the page you're on and we will load additional items from the subsequent page dynamically.

If you need to view the full media details and access the full functionality you just need to click the "New window" icon in the lightbox toolbar or click the caption of the image.

You can navigate through any media list in this way be that the list of media in an album or category, all media in the New media page or the entire media gallery via the media index.

We think this is an awesome way to navigate through the media gallery but if you prefer to keep things as they are (we won't be offended!) then you can disable it:

localhost_22x_admin.php_options_groups_xfmg_.png

We should also take this opportunity to note that all of the lightbox functionality you see here is a general concept baked into the core lightbox itself so should any add-on developers which to add a similar navigation or sidebar concept to their existing lightbox implementations then this should be fairly trivial to do.

Attachment mirroring​

For a very long time you have been telling us that you would like to have a slightly closer relationship between attachments in threads and posts and the media gallery, and the new "Attachment mirroring" system in XFMG 2.2 aims to somewhat bridge that gap. It starts with a forum-level or media category-level configuration:

localhost_22x_admin.php_media-gallery_categories_nature.4_edit.png

While viewing a media category you can pick which forums attachments are mirrored from...

localhost_22x_admin.php_forums_travel-and-nature-forum.2_edit.png

... and while viewing a forum you can pick which media category attachments are mirrored to.

Once you have specified which media category your forum should mirror attachments to, any attachments which are added to posts in that forum will be automatically created as media items in the specified gallery.

As an example, here is a post containing an image I have attached inside the "Travel and nature" forum:

1595337617664.png

And here it is now displayed in the media gallery:

localhost_22x_media_navagio-jpg.134_ (2).png

As you can see here we make display a clear reference to the fact that the media item originated from a particular thread with the "Originally posted in: Thread 'Travel photos'" line. Thins links and takes you straight back to the post where the attachment was originally posted.

While viewing the thread, we also make clear that the attachment has been also posted over in the media gallery too. Of course images open up in the lightbox and when you do so, the media information opens up in the sidebar with an additional link that links back to the full media gallery view if needed:


But what about all of those existing threads with great images you might want to bring over to the media gallery? We've added a rebuild which will take care of that for you:

1595339325217.png

This allows you to have old items that were not yet mirrored synced into the media gallery, plus it will move or remove items from the media gallery as applicable if you disable mirroring or change the target category.


But wait... there's more!​

In addition to these great features we have also added (or in the process of adding) support for the following previously announced XF 2.2 features including:
 
are there any permission concerns? If you mirrored a private forum, I assume any attachments would be public on the media gallery side?
 
Technically, yes. So you just make sure you don't do that 🙂

The "Test messages" forum here is only visible to registered members so by virtue of that I also made the "Test mirroring" media gallery category only visible to registered members too.
 
Is the mirroring making a copy of the physical attachment file (so you end up with two copies of the same image) or does it create a new MG pointer to the existing attachment entry?🤔 For those with a lot of images in forums, it'd be good if the MG mirror was a virtual mirror with the MG entry linked to the attachment so we still only have one physical file.
 
After mirroring successfully, my tests say:

If image in post is deleted OR the post itself is deleted -> MG item also gets deleted
If MG item gets deleted -> the image in post still stays

So there is one sided synchronisation.

The attachment data entries are shared.

What does this mean?
 
So it's actually uploaded both sides, means more usage of disk by uploading same attachments in both sides.
 
I have a question about the rebuild option which I can't test.

Imagine me posting 10 images which get mirrored. So 10 new media items are created.

Let's say I go and delete 3 media items. According to my test the 10 images will still be there inside the post, but there are only 7 media items now.

Now what happens when I run the rebuild option?

Will the rebuild create the missing 3 media items or skip them as I intentionally deleted them before?
 
No, it's a single physical file on the server.
My test shows this:

Originally attached in post:
https://xenforo.com/community/attachments/download-1-jpg.230926/

MG image:
https://xenforo.com/community/media/download-1-jpg.3196/ not sure about this one, full size image?
https://xenforo.com/community/data/xfmg/thumbnail/3/3196-b15ddaa336376c8a17fda431b17124b9.jpg?1595428763 but this one is a thumbnail separately uploaded in MG.
 
cant even express how happy i am to wake up and see this today!

however its one other HUGE MAJOR issue i hope can be included....

when we first migrated to xenforo, with several hundred thousand gallery images, we were told due to the way you index, we would basically HAVE TO hide most of our content and only display recent content, by date....

of course that is no good, what use is having a wide library nobody can see!

as of now, it takes a SOLID 10 seconds or more first time gallery page loads...i suspect that when we rebuild attachment mirrors that will essentially double our gallery size to over a half million images....which is going to make this problem worse i suspect...

beyond the initial lag of XFMG being served, it basically sticks on the main forum page, so it isnt entirely clear the page is even loading to some...we feel it is a MAJOR deterrent from using and browsing the gallery atm...

any chance this can be improved?


...so happy to see these XFMG improves i will just say again....thank you and keep up the exciting work :)
 
@Veer
It's two different URLs (which isn't ideal) but on the server there is only one file.

@Chris D
How does this URL effect affect SEO, doesn't this effectively create duplicated media content?
 
Last edited:
Just to be totally clear, a normal attachment creates two files:

1. The thumbnail
2. The full-sized image

A media gallery item creates one additional file:

3. A media gallery thumbnail

This has always been the case. Attachments mirrored to the media gallery also create that additional thumbnail file but no other additional files are created.
 
Last edited:
Attachment mirroring is awesome and a really long-awaited feature!

Now if we could also get an option for users to upload straight from a post to a specific category or album it would be perfect, but let's see what Add-on authors (or XFMG 2.3?) can come up with.

Keep up the good work (y)

definitely yes this as well....it is great to have a default category but its easy to see in some cases where users may upload images best fit in 2 different categories in the same topic...or albums already created they want to add to for that specific thread etc...

its so close tho....where one day it can all be tied together as one....love seeing things develop in this direction.
 
This has always been the case. Attachments mirrored to the media gallery also create that additional thumbnail file but no other additional files are created.
Hmm, but doesn't it also create another (two) URLs for the full sized image?

https://xenforo.com/community/attachments/download-1-jpg.230926/ (attachment in post)
vs.
https://xenforo.com/community/attachments/download-1-jpg.230927/ (underlaying attachment for media item)
vs.
https://xenforo.com/community/media/download-1-jpg.3196/ (media item ful image url)
 
Yes, but it's not a separate file -- it's just an additional xf_attachment record (which is quite important for various reasons, but notably permissions). The data records are shared.
 
This is THE BOMB! Now if we could get thread prefixes to work with category or album destination that would be BOMB DIGGITY! Since a lot of us use prefixes for categorization already. :)
 
Last edited:
Yes, but it's not a separate file -- it's just an additional xf_attachment record (which is quite important for various reasons, but notably permissions). The data records are shared.
I wasn't talking about duplicate storage but duplicate URLs.

So if we have 3 different URLs for the same underlying data file, does this cause any problems with indexing on search engines (duplicate content)?
Does it cause browsers to download content twice (if the user has read the post and visits the media item page)?
 
Yes but that doesn’t get negated by the fact that the duplicate URLs are necessary for the reasons already mentioned.
 
Top Bottom