ElkArte Community

Extending Elk => Addons => Topic started by: Spuds on April 07, 2021, 06:03:43 pm

Title: [ADDON] Levertine Gallery
Post by: Spuds on April 07, 2021, 06:03:43 pm
Levertine Gallery 1.2.1

License
This ElkArte addon is released under a LGPL V3 (https://opensource.org/licenses/LGPL-3.0) license

Introduction
First, and most importantly, a big shout out to @Arantor who allowed me to make this adaption available to the community, as well as writing the original SMF version.  I know not everyone appreciates nor understands how much time and effort goes into writing programs like this, but understand the original effort on this was significant, and getting it for free, well, c'est la treat especial!

The main obstacle in making this available was a dependency library used in the original which was not FOSS and had certain conditions for it to be included/distributed.  This version removed that library (its the main uploading facility) and replaced it with an MIT licensed program.  It was not a direct drop in so I'm expecting some bumps in the road.

Changes from the original?  Vary from cosmetic (elk look and feel) to the above structural change of the uploader. All dependencies have been updated to the latest versions, and if they were no longer maintained, replacements were used. Any < PHP7 support or flash support has been redacted. I've also done some integration with the ElkArte core in areas.  As an example the original had a separate likes and notification system (comments, new items).  These features are still in place but now will act no differently then other ElkArte notifications (likes, buddy, quotes, mentions, etc).

Please consider this Beta code and feel free to report and provide fixes to bugs as you find them .... there will be bugs.  Again THIS IS FOR TESTING.  I have converted all the necessary parts but there will be some glitches, that's  just a fact.  The install and uninstall function shave not been heavily tested, so use this on your test sites only.

IMPORTANT: You need to be running ElkArte version 1.1.7 and PHP7 for this to work, ha take that! While doing the adaption I found a few areas that should have worked but did not so I fixed them in 1.1.7 since I could.  No it will not run on 1.0 or 1.1.6, or PHP5, as in ever.

Not tested are all of the importers.  I did import an old Aeva gallery and that worked perfectly (copied the tables to my Elk install and the mgal directory) but that was all.


Features
Levertine Gallery is a modern gallery solution for ElkArte 1.1.7+

Of course, all the fundamental things you might expect as well, including:
All come as standard and are ready to go as soon as you install and start uploading items!


Translations:

Repo / Download
https://github.com/Spuds/Elk_Gallery/releases/tag/1.2.1
Title: Re: Levertine Gallery
Post by: Spuds on April 07, 2021, 06:04:31 pm
@tino  there is a TP gallery module that I have not tested so if you get a chance :D

For SP I decided to update the existing gallery block in SP-Elk and remove the code from here.  Said differently the portal is gallery aware instead of the gallery being portal aware.  It was just cleaner that way for me but we can support either.
Title: Re: Levertine Gallery
Post by: badmonkey on April 07, 2021, 07:06:45 pm
This sounds amazing! Thanks for all your hard work. A thorough, uh, test is in order. ;D
Title: Re: Levertine Gallery
Post by: Steeley on April 07, 2021, 07:25:00 pm
Pictures, or File gallery also?

Title: Re: Levertine Gallery
Post by: Spuds on April 07, 2021, 07:31:54 pm
Pictures, files, audio, video ... its up to you what to allow.

It will also create thumbnail images for PDF files, probably others as well, so if you add a PDF to an album you will see a thumbnail of the first page of the PDF which is pretty sweet.
Title: Re: Levertine Gallery
Post by: tino on April 07, 2021, 07:39:44 pm
Quote from: Spuds – @tino  there is a TP gallery module that I have not tested so if you get a chance :D

For SP I decided to update the existing gallery block in SP-Elk and remove the code from here.  Said differently the portal is gallery aware instead of the gallery being portal aware.  It was just cleaner that way for me but we can support either.

It's complaining about needing MySQL/MariaDB to function correctly. Do you have a public repo, or do I have permission to change the code to support pgSQL?
Title: Re: Levertine Gallery
Post by: Spuds on April 07, 2021, 07:42:44 pm
I forgot it had that dependency.  I honestly don't recall why or if that is still needed.

The current repo is on bitbucket, do you have an account?  I had it private while the license issues were ironed out.
Title: Re: Levertine Gallery
Post by: tino on April 07, 2021, 08:04:00 pm
The add new Album link doesn't appear to work, also the tick and cross for the GD / Imagik are a bit large ;-)

I'll look at it more later, the TinyPortal stuff will need a slight change but I can do that when I get the chance as its 01:00 here and I need sleep.
Title: Re: Levertine Gallery
Post by: Spuds on April 07, 2021, 08:16:20 pm
Be sure and check permissions in the admin media section, I know I've been adding / deleting albums

The big icons sounds are a sign of a missing CSS file .... which page are you seeing this on?  

ETA: Ah those must be on the admin support block.  Mine look normal.  Maybe I missed a file, to check (if they are large its missing the css declaration)
Title: Re: Levertine Gallery
Post by: tino on April 07, 2021, 08:32:03 pm
Quote from: Spuds – Be sure and check permissions in the admin media section, I know I've been adding / deleting albums

The big icons sounds are a sign of a missing CSS file .... which page are you seeing this on?  

ETA: Ah those must be on the admin support block.  Mine look normal.  Maybe I missed a file, to check (if they are large its missing the css declaration)

Yeh, the css is missing.

I’m admin so I guess permissions are over ridden as I couldn’t see any specific for admin.

I’ll debug more later so I can help, but I think the controller isn’t loading with the seo url. It’s also not the latest version of 1.1.7 ( one just behind ) on that install so it might be that.
Title: Re: Levertine Gallery
Post by: Spuds on April 07, 2021, 08:42:08 pm
Thanks for helping with the debug

I have done a fresh installed in a bit and had been working on my active install, so there is always the chance I fixed something and did not commit it. 

I just did a fresh 1.1.6 to 1.1.7 install and then levgal ... icons looked normal so something is going on, but that is why I said its for testing, different setups, different results !  Let me know what you find, or just commit it.

ETA:  The latest 1.1.7 should have only fixed the ability to unsubscribe to emails via the link (for levgal)
Title: Re: Levertine Gallery
Post by: Spuds on April 07, 2021, 08:57:29 pm
I pulled that package until I run through a couple of new/empty gallery issues.  I had not done a "from scratch" install in some time and there are a couple of fixes needed for fresh installs.   Will update soon.
Title: Re: Levertine Gallery
Post by: tino on April 08, 2021, 07:51:10 am
Updating to the latest version of 1.1.7 resolves the issues I raised, not quite sure how mind.

You have these that you raised in your last post.

Code: [Select]
Database error, given array of integer values is empty. (album_list) when there isn't any album.

Did you want me to send a PR with fixes for those or have your already sorted them?
Title: Re: Levertine Gallery
Post by: Spuds on April 08, 2021, 09:50:06 am
I just pushed those changes ... It should fix that and several other new install / empty gallery issues.  I'll attach the updated package to the first post.
Title: Re: Levertine Gallery
Post by: tino on April 08, 2021, 11:10:50 am
Quote from: Spuds – I just pushed those changes ... It should fix that and several other new install / empty gallery issues.  I'll attach the updated package to the first post.

I'll leave my PR open against your repo and you can cherry pick the content out of it that's useful. The GROUP BY fixes will also help when running strict mode in MySQL.
Title: Re: Levertine Gallery
Post by: Spuds on April 08, 2021, 02:08:29 pm
Merged it (it fixed some additional empty issues) and updated the first post with the new package
Title: Re: Levertine Gallery
Post by: tino on April 08, 2021, 02:52:47 pm
Quote from: Spuds – Merged it (it fixed some additional empty issues) and updated the first post with the new package

I fixed the block code logic on the TinyPortal side and the snippets work correctly.
Title: Re: Levertine Gallery
Post by: Steeley on April 08, 2021, 06:39:04 pm
(My email reply didn't post, so, this time manually..)

Quote from: Spuds – Pictures, files, audio, video ... its up to you what to allow.

It will also create thumbnail images for PDF files, probably others as well, so if you add a PDF to an album you will see a thumbnail of the first page of the PDF which is pretty sweet.

Way Cool -  In my younger days I'd be all over this beta test (I was involved in what became RBBS while it was still on CP/m and used a Bell acoustic coupler), but now I'm old, tired and suffer from CRAFT so I'll let's ya'll debug it while I sip my Paddy and patiently lurk - it will be the "killer-ap" driver for me to upgrade EA to 1.17.
Title: Re: Levertine Gallery
Post by: Spuds on April 08, 2021, 07:32:44 pm
HA, I was a Trash 80 guy using Connection80 and Bullet80 stuff before I spun my own.  And I was rocking a Hayes 300 baud Smartmodem that cost me damn fortune LOL
Title: Re: Levertine Gallery
Post by: badmonkey on April 08, 2021, 10:10:12 pm
It's in the test phase as we speak!! A couple of items:

How are gallery managers selected? Apparently a couple of membergroups were automagically selected upon install, not necessarily desired groups to manage the gallery.  ;D  Oh, and not all membergroups are shown in Media Permissions?

Also, oddly a couple animated gif smileys flash or are invisible in the post box. Equally as odd not all animated gif smileys are affected.

Otherwise, so far, so good! Thanks spuds!!!
Title: Re: Levertine Gallery
Post by: Steeley on April 09, 2021, 01:11:36 am
[Don't know why email replies aren't going through - not sure if it's just this board, or all of EA..  used to work. Back to manual posting..]

Quote from: Spuds – HA, I was a Trash 80 guy using Connection80 and Bullet80 stuff before I spun my own.  And I was rocking a Hayes 300 baud Smartmodem that cost me damn fortune LOL

Fortune indeed - $600 for a 300 baud Smartmodem on special, but compared, to the $2400 for a Xerox 16/8 (Z-80 and 8086 dual processors with a 10 Meg HD - will I ever need that much storage ? ? ? )  that did both CP/M and DOS (2.0) simultooneously and another $1200 for a Diablo 630 wide-carriage daisy printer  - I was stylin then!

Worth it though - Didn't have to rush home from work to make my scheduled file transfers any more  :D 
Title: Re: Levertine Gallery
Post by: radu81 on April 09, 2021, 03:05:49 am
Wow, I can't believe this is true, we are finally having a gallery add-on for Elkarte. I will surely test it and use it in the future.
Thank you @Arantor‍ & @Spuds‍ far making this possible.
Title: Re: Levertine Gallery
Post by: radu81 on April 09, 2021, 09:52:51 am
After some quick tests I have some questions:

Reports:
Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 09:54:16 am
Quote from: badmonkey – It's in the test phase as we speak!! A couple of items:

How are gallery managers selected? Apparently a couple of membergroups were automagically selected upon install, not necessarily desired groups to manage the gallery.  ;D  Oh, and not all membergroups are shown in Media Permissions?
I've only installed it a few times on kind of empty forums and I don't think it set any default groups for me, so I'll have to check on that.  I know it does not show post count groups (it can but it does not by default), are there other groups missing?
Quote from: badmonkey – Also, oddly a couple animated gif smileys flash or are invisible in the post box. Equally as odd not all animated gif smileys are affected.

Otherwise, so far, so good! Thanks spuds!!!
Are these animated smileys in the editor, and if so are they always shown or in the popup?  Just so I can try and reproduce (the error that is :D)
Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 10:03:02 am
Quote from: radu81 – After some quick tests I have some questions:
  • There is a tag cloud, but how can we use tags? tags are applied to albums or single items?
You can apply tags to items when you add them or edit them.  I don't believe there are any restrictions on the tags, such as predefined lists which might be a nice add.
Quote from: radu81 –
  • there is no way to apply dimension limits (resizing) for administrators. Is this normal?
I think the intention was admins are supermen and no restrictions really apply.
Quote from: radu81 –
  • any way to see a list of all albums from all users? not based on members alums
Media->See Albums should show you all of them.  You can then fine tune using the side taskbar to drill down to specific members or groups.
Quote from: radu81 –
  • any plan to use categories for albums?
I prbably need some more clarifcation on this.  You should be able to set up your albums and then set permissions to achieve this, at least I think so.
Quote from: radu81 –
Reports:
  • I guess there is a bug, I checked twice the permissions and as a registered member I can only add an items as embeded videos, but not jpg files. Am I missing something? If I give this permission " Groups that can manage the gallery" to regular members I can upload pictures.

I'll check on that now, sounds like a small bug
Title: Re: Levertine Gallery
Post by: radu81 on April 09, 2021, 10:12:00 am
Quote from: Spuds – I'll check on that now, sounds like a small bug
Sorry, not a bug, my mistake, I removed the limits for registered members. After adding    Maximum pixel size & Maximum file size I can add jpg files.

anoter question: this add-on resize the images based on "Maximum pixel size" set in Media Quotas?
Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 10:50:40 am
Quote[Don't know why email replies aren't going through - not sure if it's just this board, or all of EA..  used to work. Back to manual posting..]
Duplicate post complements of the PBE function .. I found that message in the Gmai Spam.  Since it posted I'm going to assume that was the only issue (well other than it doing a crappy job seeing the original quote and dealing with it)
Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 10:54:53 am
Quote from: radu81 – Sorry, not a bug, my mistake, I removed the limits for registered members. After adding    Maximum pixel size & Maximum file size I can add jpg files.

anoter question: this add-on resize the images based on "Maximum pixel size" set in Media Quotas?
Sounds like a feature request ;) TBH I'm not sure if it does that or not, have to check.  It does handle auto rotation fixes.
 
Title: Re: Levertine Gallery
Post by: radu81 on April 09, 2021, 11:25:19 am
Quote from: Spuds – Sounds like a feature request ;) TBH I'm not sure if it does that or not, have to check.  It does handle auto rotation fixes.
I'd say resizing images it's a nice feature for a gallery. I am not sure there is image resizing and I explain why:
- If I upload a single image bigger than the limits set up in ACP it tells me that the image cannot be uploaded
Code: [Select]
Something went wrong while uploading this item:
    The image you tried to upload is too big.
- If I use the Bulk image to upload some images the total size of uploaded images is smaller than the total size of the original images. Anyway I cannot upload them and check the size, there is no Continue button. Here a screenshot
(Link-6997)
as you can see the total size of the original images is about 10 MB, but in the bottom I see only 2,5 MB.
Title: Re: Levertine Gallery
Post by: badmonkey on April 09, 2021, 12:29:03 pm
@radu81‍ the gallery uses dropzone.js. Therefore it may be possible to utilize client side resizing. That may be advantageous in saving server cpu (let the user's machine do the heavy lifting!), saves bandwidth (nice for mobile users with spotty connections), and saves disk space (the original goal, right?). A con is it applies to all users. I plan to work on such configurations later. 

Oh, another potential configurable in DZ is the Begin Upload button may be eliminated. Uploads begin upon file selection.
Title: Re: Levertine Gallery
Post by: badmonkey on April 09, 2021, 12:48:03 pm
Quote from: Spuds –
I've only installed it a few times on kind of empty forums and I don't think it set any default groups for me, so I'll have to check on that.  I know it does not show post count groups (it can but it does not by default), are there other groups missing?



Are these animated smileys in the editor, and if so are they always shown or in the popup?  Just so I can try and reproduce (the error that is :D)

No, it's only post based membergroups missing. That is not a big deal for my sites. The puzzling part is the chosen manager groups. Neither group posses other moderation or administrative powers.

The smileys may make a...get this...monkey of me. They are working on my mobile upon second glance. The original observation was made on a Windows 10 laptop. Perhaps a caching issue popped up, or simply a glitch in the matrix. Future reports forthcoming as appropriate. ;D
Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 01:48:11 pm
Quote from: badmonkey – the gallery uses dropzone.js. Therefore it may be possible to utilize client side resizing. That may be advantageous in saving server cpu (let the user's machine do the heavy lifting!), saves bandwidth (nice for mobile users with spotty connections), and saves disk space (the original goal, right?). A con is it applies to all users. I plan to work on such configurations later.
Correct.  It uses client side now to create the thumbnails you see in the GUI, but that is all I use them for.   I think it could be an option for some sites but I did not want to do that as a gallery default as the client side resize is of much lower quality than what will happen server side.  I'm also not sure it will maintain any meta/exif data and if not you will loose that info.  So probably an option for some sites but not all.   Keep us up to date on what you do.

Also I'm probably going to add 4:2:0 subsampling on the save to improve compression and save some space.  Given we are dealing mostly with jpeg images enough data has been lost that 4:2:0 will not be noticed at all.
QuoteOh, another potential configurable in DZ is the Begin Upload button may be eliminated. Uploads begin upon file selection.
That's what it does on the single add page, the save button there is for all of the other meta data.  On multi I have the submit button to begin just to give the opportunity to add/remove.
Quote from: badmonkey – No, it's only post based membergroups missing. That is not a big deal for my sites. The puzzling part is the chosen manager groups. Neither group posses other moderation or administrative powers.
Well I found one bug I introduced and it has to do with me not maintaining groupid's during a sort which causes some anomalies as in its completely wrong LOL.  I'll update with a new package this evening.
Quote from: badmonkey –
The smileys may make a...get this...monkey of me. They are working on my mobile upon second glance. The original observation was made on a Windows 10 laptop. Perhaps a caching issue popped up, or simply a glitch in the matrix. Future reports forthcoming as appropriate. ;D

I'll take a look as well, could be some cache issue as this adds several new style sheets to the mix.
Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 01:53:48 pm
Quote from: radu81 – as you can see the total size of the original images is about 10 MB, but in the bottom I see only 2,5 MB.
There are some oddities with the total progress bar and chunked uploads, and images that size will be chunked, sent in parallel and recombined on the server.  That is how it can send large files w/o tripping php upload limits, plus its fast.  dropzone made a recent fix that improved things in this regard, but there are also issues when things fail/die.  I'll do some more checking on this.
Title: Re: Levertine Gallery
Post by: Steeley on April 09, 2021, 02:40:10 pm
Quote from: Spuds –
Quote[Don't know why email replies aren't going through - not sure if it's just this board, or all of EA..  used to work. Back to manual posting..]
Duplicate post complements of the PBE function .. I found that message in the Gmai Spam.  Since it posted I'm going to assume that was the only issue (well other than it doing a crappy job seeing the original quote and dealing with it)

The "quote formatting" was my client, not EA..

OK, both email replies posted (apparently with admin help), I'll go back and "clean up" the thread..
Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 05:31:16 pm
I think the issues that @radu81 posted have been fixed now, I'll post the update soon and then go to find more opportunities.

The issue in this case is that the file width and height are not available to check until after the client side thumbnail is complete.  I was checking those sizes but not specifically waiting for the thumbnail event.  That little tidbit is buried in the docs. 

Now the form will reject adding the file and it will not attempt to upload.   If you get all hackey and post yer own, the server will still check and reject.  Its here we find bug number 2, it did reject it but the upload UI was not showing failed and left the spinners in place.  That is also fixed.

Title: Re: Levertine Gallery
Post by: Spuds on April 09, 2021, 08:29:37 pm
OK the first post has been updated with todays batch of fixes .... the multi upload file size check ended up a bit more challenging then  first though but it should be sorted.

@tino when you noted you had TP gallery fixed, did you do that with TP gallery block, I'm really asking if I need to include the current TP files with this or can they be removed now?
Title: Re: Levertine Gallery
Post by: tino on April 09, 2021, 09:09:23 pm
I used the block codes you had, there was a bug in the TinyPortal logic. I can add them as part of the default block codes and you can remove them if you’d like.

I’m reworking TinyPortal so you can upload new ones easily anyway.
Title: Re: Levertine Gallery
Post by: radu81 on April 10, 2021, 05:22:29 am
For categories I mean categories for albums, or sub-albums as they are called in Aeva. Usually categories are created by admins, and members needs to choose a category when they are creating a new album.In this way I can keep more organised the category.
I looked at the persmissions but there is no way to make a sub-album.
Title: Re: Levertine Gallery
Post by: Spuds on April 10, 2021, 09:19:48 am
You can have sub albums.  What you need to do is add a few albums under a user or group or ownership level.

Then when you view the albums of that user or group you will see on the side an arrange albums option, choose that.  You are now in a drop and drag interface like in the manage boards area of the APC.  Simply drag an album towards the right and drop in on the album you want it to be a child of.  You can have many levels as well.

The album order shown here is maintained, so its up to you to sort them however you want and that is how they will be displayed.

ETA:  that D&D is not ajax, so arrange it like you want and click save !
Title: Re: Levertine Gallery
Post by: Spuds on April 10, 2021, 09:36:00 am
I just did a quick package refresh on the first post.  When I made the WxH size check updates for bulk upload I neglected to make a minor change in the single add area which would prevent it from working.
Title: Re: Levertine Gallery
Post by: Spuds on April 10, 2021, 09:38:48 am
Quote from: tino – I used the block codes you had, there was a bug in the TinyPortal logic. I can add them as part of the default block codes and you can remove them if you’d like.

I’m reworking TinyPortal so you can upload new ones easily anyway.
Honestly its however you would like it to be.  I think it cleaner for the portals to be gallery aware instead of the gallery searching for an installed portal and adding blocks.
Title: Re: Levertine Gallery
Post by: tino on April 10, 2021, 09:43:50 am
Quote from: Spuds –
Quote from: tino – I used the block codes you had, there was a bug in the TinyPortal logic. I can add them as part of the default block codes and you can remove them if you’d like.

I’m reworking TinyPortal so you can upload new ones easily anyway.
Honestly its however you would like it to be.  I think it cleaner for the portals to be gallery aware instead of the gallery searching for an installed portal and adding blocks.

Fine with me. I’ll add the blocks to the next release of TinyPortal.
Title: Re: Levertine Gallery
Post by: tino on April 10, 2021, 01:51:33 pm
Quote from: tino –
Quote from: Spuds –
Quote from: tino – I used the block codes you had, there was a bug in the TinyPortal logic. I can add them as part of the default block codes and you can remove them if you’d like.

I’m reworking TinyPortal so you can upload new ones easily anyway.
Honestly its however you would like it to be.  I think it cleaner for the portals to be gallery aware instead of the gallery searching for an installed portal and adding blocks.

Fine with me. I’ll add the blocks to the next release of TinyPortal.

Are you keeping the LevGal_Portal_TinyPortal functions? I have added the tp-files/tp-blockcodes to the next release, but not those functions (yet)
Title: Re: Levertine Gallery
Post by: Spuds on April 10, 2021, 06:09:45 pm
I have not removed anything as of yet.   Certainly no problem keeping that file in place or whatever else you need.

The TP support was clean, it was the SP support used an eval() due to the way SP worked on SMF, but it was not needed for the Elk version, plus the Elk version already had an (unused) gallery block that I could finally actually use!
Title: Re: Levertine Gallery
Post by: Spuds on April 10, 2021, 07:57:05 pm
I updated the first post with todays updates.

This new version adds the Image resize function.  There is a option under the admin quota area, which, when enabled, will resize any images (jpg, png) to fit within the defined quota WxH limits instead or rejecting them.  Once resized it will still honor other limits and reject if its still over those.

One note is that if using GD you will loose Exif data for any images that get resized.  If you have Imagick then the data is retained.

There were a couple of other minor tweaks as well.

Enjoy!
Title: Re: Levertine Gallery
Post by: radu81 on April 11, 2021, 07:13:31 am
Thank you Spuds! I just tested and the images are correctly resized for registered users. Is there a way to set quotas also for admins and moderators?
Title: Re: Levertine Gallery
Post by: Arantor on April 11, 2021, 07:25:15 am
Nicely done :)

One thought: if you're going to do client side resampling, it might be best to make this configurable in the case that someone wants their photo to be uploaded unchanged (e.g. photography forum, technical forum uploading a huge diagram etc.) - I originally tested this stuff with 20MB JPEG files (required 350MB RAM to resize on the server) because one of the original users wanted their paid commission art to be uploaded without changes.

Sorry you had to fix strict mode stuff... but in 2014 when this was written, strict mode wasn't a thing :(
Title: Re: Levertine Gallery
Post by: badmonkey on April 11, 2021, 10:21:09 am
Thanks for the update @Spuds‍ 

The gallery manager membergroup issue is resolved. 

Does the resize occur client side, or server side? The upload makes it appear to occur server side? 

Would it be possible to apply quotas to gallery managers as well? Managers images won't be resized as quotas do not apply to them. Or I'm doing it wrong. ;D
Title: Re: Levertine Gallery
Post by: Arantor on April 11, 2021, 12:49:10 pm
The original point was that quotas shouldn't apply to managers - they're there to manage the thing and experience suggests that admins/similarly empowered users in the right context shouldn't just have limits applied to them because it tends to be confusing.

But I may be misremembering how it was originally implemented vs whatever may have been changed in this version.
Title: Re: Levertine Gallery
Post by: Spuds on April 11, 2021, 12:55:11 pm
Quote from: radu81 – Thank you Spuds! I just tested and the images are correctly resized for registered users. Is there a way to set quotas also for admins and moderators?
Admins are basically limitless right now in terms of permissions and quotas.  I'm sure it possible to add quota to admins, I'm just not sure how much work that would be ATM. 
Moderators are really a board permissions group.  There can't be many moderators so I think you could add a new member group and simply add moderators to that as well.  Then set the quota for the moderators gallery group.  I think that would work.
Quote from: badmonkey – Does the resize occur client side, or server side? The upload makes it appear to occur server side?
Thats all server side manipulation at this time. 
Quote from: badmonkey – Would it be possible to apply quotas to gallery managers as well? Managers images won't be resized as quotas do not apply to them. Or I'm doing it wrong. ;D
I think once you are assigned as a manager you are given admin like permissions.  So this is somewhat a variation of radu81's question as well.   Bit of a trust but verify thing :D  I think it would be easier to set the quotas and permissions for that manager group instead of making them managers.  You can get almost all (maybe even all)  of the capabilities assigned that way and have your quotas.
Quote from: Arantor – Nicely done :)

One thought: if you're going to do client side resampling, it might be best to make this configurable in the case that someone wants their photo to be uploaded unchanged (e.g. photography forum, technical forum uploading a huge diagram etc.) - I originally tested this stuff with 20MB JPEG files (required 350MB RAM to resize on the server) because one of the original users wanted their paid commission art to be uploaded without changes.

Sorry you had to fix strict mode stuff... but in 2014 when this was written, strict mode wasn't a thing :(
Thanks, it was all actually a quite a bit of fun! (well maybe not the old template markup :P)   Good points on the client side resize, right now it should only change images that are over quota but I need to do more testing, especially with very large files.
Title: Re: Levertine Gallery
Post by: Spuds on April 11, 2021, 01:24:26 pm
Quote from: Arantor – The original point was that quotas shouldn't apply to managers - they're there to manage the thing and experience suggests that admins/similarly empowered users in the right context shouldn't just have limits applied to them because it tends to be confusing.

But I may be misremembering how it was originally implemented vs whatever may have been changed in this version.
That should all be the same, once in the lgal_manage group you are set free.

The only permission item/group I changed/add was allowing the selection of group "0" to allowed ownership groups.  I have not centralized that update just yet.  I added first to see how many times empty() would poke me and that change was also the cause of the error @badmonkey reported as I sorted but did not keep the keys intact  :-[
Title: Re: Levertine Gallery
Post by: Spuds on April 11, 2021, 07:48:07 pm
Updated the first post with todays updates. 

changed the admin menu icons to match the rest of elk,
changed the way bulk upload errors are displayed
prevent the upload from starting (for valid files) when an error occurred queueing a bad file
misc css tweaks
Title: Re: Levertine Gallery
Post by: radu81 on April 12, 2021, 03:05:39 am
You're too fast Spuds, I didn't had time to test the previous version and now there is a new one :D

Don't know if it's easy to fix but I report it: on mobile the blocks on the right should go on bottom

P.S. @Spuds in the future, if you'll make chages to language files can you please warn in this topic? Thank you
Title: Re: Levertine Gallery
Post by: Spuds on April 12, 2021, 09:06:36 am
I've been slow on doing any mobile testing, need to start looking at that.  I'll try to remember on the language tweaks/adds
Title: Re: Levertine Gallery
Post by: Arantor on April 12, 2021, 05:44:31 pm
Quote from: Spuds – The only permission item/group I changed/add was allowing the selection of group "0" to allowed ownership groups.  I have not centralized that update just yet.  I added first to see how many times empty() would poke me and that change was also the cause of the error @badmonkey reported as I sorted but did not keep the keys intact  :-[

In the original model, 0 for ownership was for 'site ownership' so that if people deleted accounts or left groups, the content wouldn't just disappear into the ether. I vaguely remember the model supporting ownership by group (not handled the same way) but it's been a very, very long time and I am probably misremembering.

I know I specifically built it to support multiple shared ownership at the account level, and/or ownership by a single group. I'm not sure what you'd need to change there unless you wanted to allow owner-by-multiple-groups and even then I think there might be easier ways to do that by expanding the block of data for album ownership rather than trying to repurpose owner id - again if memory serves. The main drama of multi ownership is the fact that multiple owners imply multiple hierarchies in which an album can live, something coped for with multiple account owners, but not group owners.
Title: Re: Levertine Gallery
Post by: Spuds on April 12, 2021, 09:45:36 pm
First post updated with a version that adds some basic media queries for better mobile support
Title: Re: Levertine Gallery
Post by: Spuds on April 12, 2021, 10:05:24 pm
Quote from: Arantor – In the original model, 0 for ownership was for 'site ownership' so that if people deleted accounts or left groups, the content wouldn't just disappear into the ether. I vaguely remember the model supporting ownership by group (not handled the same way) but it's been a very, very long time and I am probably misremembering.
At first I though site ownership would be to allow anyone to be able to read/write to that album but then realized that it was intended as you describe.  From what I've seen only gallery managers/admin can write items to a site owned album.  I did my best to verify behaviors on a test smf 2.0 site with levgal and compare the interaction with the elk version.

Quote from: Arantor – I know I specifically built it to support multiple shared ownership at the account level, and/or ownership by a single group. I'm not sure what you'd need to change there unless you wanted to allow owner-by-multiple-groups and even then I think there might be easier ways to do that by expanding the block of data for album ownership rather than trying to repurpose owner id - again if memory serves. The main drama of multi ownership is the fact that multiple owners imply multiple hierarchies in which an album can live, something coped for with multiple account owners, but not group owners.
What I did was add group 0 to the allowed owner group list,  My though was  I did not see a way to have an album that any "registered" members could read and write to.  One could add all valid members to an approved group, or if using post count groups expose those group names, but that IMO starts to get a bit overwhelming for a typical user.   Perhaps another way would be to have a simple join/request group for that.   I'm not sure one would really want an open album like group 0 membership implies.
Title: Re: Levertine Gallery
Post by: lurkalot on April 13, 2021, 03:41:48 am
Quote from: tino – The add new Album link doesn't appear to work, also the tick and cross for the GD / Imagik are a bit large ;-)

I'll look at it more later, the TinyPortal stuff will need a slight change but I can do that when I get the chance as its 01:00 here and I need sleep.

I just tried this on two installs, both on different servers and both 1.1.6 - 1.1.7 then levgal, I'm seeing exactly the same issues as you were tino.   This is with or without TP installed.  No errors in log.

From the media dropdown menu the only buttons that do anything are the "My Media" ones, all the others just return me to the forum index.  And as you mentioned, also the tick and cross for the GD / Imagik are huge when you install it.
Title: Re: Levertine Gallery
Post by: radu81 on April 13, 2021, 04:10:47 am
Quote from: Spuds – You can have sub albums.  What you need to do is add a few albums under a user or group or ownership level.

Then when you view the albums of that user or group you will see on the side an arrange albums option, choose that.  You are now in a drop and drag interface like in the manage boards area of the APC.  Simply drag an album towards the right and drop in on the album you want it to be a child of.  You can have many levels as well.

The album order shown here is maintained, so its up to you to sort them however you want and that is how they will be displayed.

ETA:  that D&D is not ajax, so arrange it like you want and click save !
Not very intuitive...  :-\ and I get an error if I try to view and album with 2 sub-albums.
(Link-7009)
in Elkarte error log:
    Tipo di errore: Generale
    Warning: Invalid argument supplied for foreach()
    /index.php?action=media;sa=album;item=7
    File: /themes/default/levgal_tpl/LevGal-Album.template.php
    Line: 45
I am using the latest version of Levgal
Title: Re: Levertine Gallery
Post by: tino on April 13, 2021, 08:27:12 am
Quote from: lurkalot –
Quote from: tino – The add new Album link doesn't appear to work, also the tick and cross for the GD / Imagik are a bit large ;-)

I'll look at it more later, the TinyPortal stuff will need a slight change but I can do that when I get the chance as its 01:00 here and I need sleep.

I just tried this on two installs, both on different servers and both 1.1.6 - 1.1.7 then levgal, I'm seeing exactly the same issues as you were tino.   This is with or without TP installed.  No errors in log.

From the media dropdown menu the only buttons that do anything are the "My Media" ones, all the others just return me to the forum index.  And as you mentioned, also the tick and cross for the GD / Imagik are huge when you install it.

I had to install the latest 1.1.7 patch then install levertine for it to work. I never worked out why it failed initially as is just worked then.

Check to make sure the permissions on the directories are ok. I think the css issue was due to the minify css not being refreshed.

Title: Re: Levertine Gallery
Post by: Spuds on April 13, 2021, 09:05:22 am
Not obvious that is what you are supposed to do at first, but after that its like other D&D interfaces for folder arrangement.
Quote from: radu81 – and I get an error if I try to view and album with 2 sub-albums.
[attach type=thumb]7009[/attach]
in Elkarte error log:
    Tipo di errore: Generale
    Warning: Invalid argument supplied for foreach()
    /index.php?action=media;sa=album;item=7
    File: /themes/default/levgal_tpl/LevGal-Album.template.php
    Line: 45
I am using the latest version of Levgal
Have not been able to reproduce.
Title: Re: Levertine Gallery
Post by: lurkalot on April 13, 2021, 01:26:30 pm
Quote from: tino –
I had to install the latest 1.1.7 patch then install levertine for it to work. I never worked out why it failed initially as is just worked then.

Check to make sure the permissions on the directories are ok. I think the css issue was due to the minify css not being refreshed.


Thanks tino.  That is exactly what I did.  Unless there's a later 1.1.7 patch somewhere, I go mine from the 1.1.7 patch testing topic. 

I have done this on two different servers and have the exact same results.   I did just get an error, though not sure what I did to get it,

Notice: Undefined variable: unseen
http://lts4.xxxxxxxxx.com/testsite9/index.php?
File: /home/xxxxxxxxxxxxxxxxxxxxxx/htdocs/testsite9/sources/levgal_src/Model/Unseen.php
Line: 54
Title: Re: Levertine Gallery
Post by: Spuds on April 13, 2021, 01:31:39 pm
@radu81 I was able to finally repo that issue and its fixed

@lurkalot the big icons has to be a  CSS refresh issue.  It has a stale on the load so it should not need a hard refresh but thats the way it goes sometimes ... I also noticed one css load error that I fixed.  

On the other issue I have no idea.  I've done fresh installs w/o issue and full removal and install w/o issue, so not sure what my be going on.  I'll need someone experiencing the issue to debug if I can't duplicate it.


ETA: that unseen error looks like a small bug that I'll fix today
Title: Re: Levertine Gallery
Post by: lurkalot on April 13, 2021, 05:22:46 pm
Quote from: Spuds – @radu81 I was able to finally repo that issue and its fixed

@lurkalot the big icons has to be a  CSS refresh issue.  It has a stale on the load so it should not need a hard refresh but thats the way it goes sometimes ... I also noticed one css load error that I fixed.  

On the other issue I have no idea.  I've done fresh installs w/o issue and full removal and install w/o issue, so not sure what my be going on.  I'll need someone experiencing the issue to debug if I can't duplicate it.


ETA: that unseen error looks like a small bug that I'll fix today

Ok, this is really weird, just done another install on my local, and exactly the same.  Thing is I've been using Levgal on SMF and have done since Pete released it years ago, so not a complete stranger to Levgal.  Just can't get this to play ball.  

The big icon issue, I would have thought if it were a browser cache issue then opening that page in a browser not used before would the icons would be the right size, but tried this, and they are still huge. 

My local is running this,
Version Information:
This version: ElkArte 1.1.7 (more detailed)
Current version: 1.1.6
GD version: bundled (2.1.0 compatible)
MySQL version: 5.7.24
PHP: 7.2.19 (apache2handler) (more detailed)
Server version: Apache/2.4.35 (Win64) OpenSSL/1.1.1b PHP/7.2.19
Version Information: Windows NT MICKS 10.0 build 18363 (Windows 10) AMD64

My live test site is running this,
Version Information:
This version: ElkArte 1.1.7 (more detailed)
Current version: 1.1.6
GD version: bundled (2.1.0 compatible)
MySQL version: 5.6.48-88.0
PHP: 7.4.8 (apache2handler) (more detailed)
Server version: Apache
Version Information: Linux freeweb15-1.byetcluster.com 2.6.32-896.16.1.lve1.4.54.el6.x86_64 #1 SMP Wed May 2 07:43:19 EDT 2018 x86_64
Server Load: 3.07
Title: Re: Levertine Gallery
Post by: Spuds on April 13, 2021, 06:17:09 pm
The big icons will only be caused when the CSS is not loaded.  They are SVG icons and need to have a width set of they will scale to fill their element, large icons = css not loaded.

I don't have anything running on Apache, I can try that but be surprised if that was the cause.

Is there anything in the server php error log? 
Title: Re: Levertine Gallery
Post by: badmonkey on April 13, 2021, 07:46:38 pm
Dumb question, but did you restart apache/php? 
Title: Re: Levertine Gallery
Post by: lurkalot on April 14, 2021, 04:47:42 pm
Quote from: badmonkey – Dumb question, but did you restart apache/php?

Well my local I have, but I have no control over that on my hosted test sites.   I'm curious though, as I've installed it on three different servers, two hosted and one local and exactly the same results.  Is anyone else testing this on the same server set up as me. ?
Title: Re: Levertine Gallery
Post by: Spuds on April 14, 2021, 05:18:57 pm
Is there anything in the server php error or access logs ? ?  Make sure you have error reporting enabled in your php.ini file for that local box as well so it outputs something we can act on.

Quote from: lurkalot – Well my local I have, but I have no control over that on my hosted test sites.   I'm curious though, as I've installed it on three different servers, two hosted and one local and exactly the same results.  Is anyone else testing this on the same server set up as me. ?
I've installed it on the following configs, first up an old 16.04 ubuntu with PHP 7.2 and MySQL 5.7
Code: (This one had a beta 1.1.6, so uninstall beta, install 1.1.6 then patch to 1.1.7) [Select]
This version: ElkArte 1.1.7
Current version: 1.1.6
GD version: 2.3.0
Imagick version: ImageMagick 6.8.9-9 Q16 x86_64 2020-12-04 http://www.imagemagick.org
MySQL version: 5.7.33-0ubuntu0.16.04.1
Alternative PHP Cache: 5.1.19
Memcached: 1.4.25
Zend OPcache: 7.2.34-18+ubuntu16.04.1+deb.sury.org+1
PHP: 7.2.34-18+ubuntu16.04.1+deb.sury.org+1 (fpm-fcgi)
Server version: nginx/1.16.1
Next up is my home server with is running docker containers, so this is an Alpine version in the containers.  This is mariaDB 10.5 and PHP 7.4, mostly the latest versions of items
Code: [Select]
This version: ElkArte 1.1.7
Current version: 1.1.6
GD version: bundled (2.1.0 compatible)
Imagick version: ImageMagick 7.0.10-48 Q16 x86_64 2020-12-12 https://imagemagick.org
MySQL version: 10.5.8-MariaDB-1:10.5.8+maria~focal
Alternative PHP Cache: 5.1.19
Zend OPcache: 7.4.13
PHP: 7.4.13 (fpm-fcgi)
Server version: nginx/1.19.3
And last up is a ubuntu 20.04 box W/mariaDB 10.3, php 7.4, pure long term support packages here.
Code: [Select]
This version: ElkArte 1.1.7
Current version: 1.1.6
GD version: 2.2.5
Imagick version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
MySQL version: 10.3.25-MariaDB-0ubuntu0.20.04.1
Alternative PHP Cache: 5.1.18
Memcache: 1.5.22
PHP: 7.4.3 (fpm-fcgi)
Server version: nginx/1.19.7

So the main deltas are 1) iMagick, 2) Nginx vs Apache, 3) PHP (apache2handler vs fpm-fcgi) None of which I can really see making the difference.  I'd also be curious if anyone is running apache / apache2handler has tested the addon.
Title: Re: Levertine Gallery
Post by: tino on April 14, 2021, 07:18:31 pm
I’m using Apache, as I said I had the error on first install then it resolved itself.

I know on YAPortal which used a similar SEO link I needed to do this for it to work as I’d expect. https://github.com/tinoest/YAPortal/blob/ce6a6dd4c7f2e54cb663560046bac2caf837e053/sources/YAPortal.integrate.php#L74
Title: Re: Levertine Gallery
Post by: Spuds on April 14, 2021, 09:08:43 pm
Nods ... thats one of the 1.1.7 changes I made.

cleanRequest(); was being called before integrate_pre_include and I moved it after that call.  That allows $_SERVER['REQUEST_URI'] and other global add/change/stuffing by pre_inculde calls to be accounted for (and validated) and made available for the Request and httpReq classes on bringup.

I can add another $_SERVER['REQUEST_URI'] but would of course like to know why.
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 02:44:30 am
Quote from: Spuds – Is there anything in the server php error or access logs ? ?  Make sure you have error reporting enabled in your php.ini file for that local box as well so it outputs something we can act on.

Sorry, no there's nothing in my server logs.   It's just like all the links in the main dropdown menu just don't do anything except take me back to forum index.  The only links that seem to work are the "My Media" ones. 
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 03:53:12 am
If it's of any help, here's a live test site where you should see what's happening when you click on the Media menu items.  This test site is only on a crappy free host, and has TinyPortal installed so instead of taking you to the forum index when clicking on a media menu item it will take you to home page.  http://lurkts1.epizy.com/ts12/
Title: Re: Levertine Gallery
Post by: Steeley on April 15, 2021, 04:34:59 am
Quote from: lurkalot – If it's of any help, here's a live test site where you should see what's happening when you click on the Media menu items.  This test site is only on a crappy free host, and has TinyPortal installed so instead of taking you to the forum index when clicking on a media menu item it will take you to home page.  http://lurkts1.epizy.com/ts12/

Media gets nowhere as guest as you described, and if you log-in, there is no media option at all.

FWIW, TinyPortal from the user profile seems to work once logged in, but requires log-in and then it gongs, says no admittance, can't even ack that it exists..  (like, admin only unless it's selected while in your profile)   ::)

 Groping it in the dark, my guess is permissions are goofy..
Title: Re: Levertine Gallery
Post by: tino on April 15, 2021, 06:10:09 am
Quote from: Spuds – Nods ... thats one of the 1.1.7 changes I made.

cleanRequest(); was being called before integrate_pre_include and I moved it after that call.  That allows $_SERVER['REQUEST_URI'] and other global add/change/stuffing by pre_inculde calls to be accounted for (and validated) and made available for the Request and httpReq classes on bringup.

I can add another $_SERVER['REQUEST_URI'] but would of course like to know why.

That explains why it didn’t work then did work for me.

Doesn’t help @lurkalot mind.

Can you provide admin access to the physical server @lurkalot to someone? Preferably if it’s me ssh access as I don’t know how to use a GUI 😳
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 07:28:51 am
Quote from: Steeley –
Quote from: lurkalot – If it's of any help, here's a live test site where you should see what's happening when you click on the Media menu items.  This test site is only on a crappy free host, and has TinyPortal installed so instead of taking you to the forum index when clicking on a media menu item it will take you to home page.  http://lurkts1.epizy.com/ts12/

Media gets nowhere as guest as you described, and if you log-in, there is no media option at all.

FWIW, TinyPortal from the user profile seems to work once logged in, but requires log-in and then it gongs, says no admittance, can't even ack that it exists..  (like, admin only unless it's selected while in your profile)   ::)

 Groping it in the dark, my guess is permissions are goofy..

Yes, I only gave guest permission to view gallery. Hence why no access while logged in as regular. Just so you guys could see it..

TP, waiting for RC3 ATM. Will uninstall that one actually.
Title: Re: Levertine Gallery
Post by: Spuds on April 15, 2021, 08:54:55 am
Strange for sure.  

I see the server responds with a 302 requesting the gallery css file (main.css?1.1.1) and then a 404.  What is strange is that its requesting it from the wrong location and a 302 response is not from the gallery.

If i navigate directly to http://lurkts1.epizy.com/ts12/themes/default/levgal_res/main.css I see the file, but the server is requesting it from http://lurkts1.epizy.com/ts12/themes/default/css/main.css And its not there of course. Almost seems its fighting TP.
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 09:46:27 am
Quote from: Spuds – Strange for sure.  

 Almost seems its fighting TP.

Thanks. It did the same before I installed TP.   I'll set up another fresh install tonight when I get home from work, and install just the 1.1.7 patch and legal.  That is what I did on this one originally.
Title: Re: Levertine Gallery
Post by: tino on April 15, 2021, 10:19:59 am
Quote from: lurkalot –
Quote from: Spuds – Strange for sure.  

 Almost seems its fighting TP.

Thanks. It did the same before I installed TP.   I'll set up another fresh install tonight when I get home from work, and install just the 1.1.7 patch and legal.  That is what I did on this one originally.

Could it be either the patch isn’t the right one or it didn’t apply correctly? As there are/were fixes for other css directories in that 1.1.7 I thought?
Title: Re: Levertine Gallery
Post by: tino on April 15, 2021, 11:06:10 am
I've managed to recreate the error again. Now to debug why it's failing.

QuoteThis version: ElkArte 1.1.7 (more detailed)
Current version: 1.1.6
GD version: 2.2.5
MySQL version: 10.3.27-MariaDB-0+deb10u1
Alternative PHP Cache: 5.1.17
Zend OPcache: 7.3.27-1~deb10u1
PHP: 7.3.27-1~deb10u1 (apache2handler) (more detailed)
Server version: Apache/2.4.38 (Debian)
Version Information: Linux tinyportal 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64
Server Load: 0.17

I got the latest download of elkarte from the main site. https://github.com/elkarte/Elkarte/releases/download/v1.1.6/ElkArte_v1-1-6_install.zip

Created a tar.gz of the latest levertine gallery from bitbucket and uploaded that to the packages directory, saw that it wouldn't install so got the latest patch from here https://www.elkarte.net/community/index.php?action=dlattach;topic=5914.0;attach=6841

Applied that, then installed levertine. The CSS isn't correct and also the links don't work.

TinyPortal has not been installed or used at all on this, it's a completely new install so that's not the cause of this issue.
Title: Re: Levertine Gallery
Post by: tino on April 15, 2021, 11:12:52 am
To update, calling cleanRequest() at the end of parseURL in the bootstrap fixes the url issue.

I think there is something wrong with the patch.

Edit:

It was meant to be this patch it turns out.

https://www.elkarte.net/community/index.php?action=dlattach;topic=5914.0;attach=6992

So I would guess @lurkalot has the first one in the topic, not the last one.

@spuds, could you update the first post for 1.1.7 to include the latest copy of the patch? I think that might help, if @lurkalot does confirm this is the issue.
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 12:43:56 pm
Quote from: tino – So I would guess @lurkalot has the first one in the topic, not the last one.

Thank you, I'll give this a try in a few minutes.  I did indeed use the patch attched to the first post in that topic,..
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 01:34:45 pm
Quote from: tino –
@spuds, could you update the first post for 1.1.7 to include the latest copy of the patch? I think that might help, if @lurkalot does confirm this is the issue.

Confirmed, I'm an idiot.  Works nicely when using the latest 1.1.7 patch, thank you tino.  ;)

I'm so used to grabbing the latest zip from the first post like we do when testing over at tinyportal.net I should have read the whole topic in this case.   Apologies everyone.
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 02:44:48 pm
OK, a couple of issues so far.  Uploading a image give me this error on page, nothing in error log.

"Something went wrong while uploading this item:
Something went wrong with the upload (invalid async). If the error continues contact the administrator."

And:  clicking the Gallery Stats gives me an error on page, and error in log.

"An Error Has Occurred
Division by zero"

Error log says,

Warning: Division by zero
http://lurkts1.epizy.com/ts12/index.php?action=media;sa=stats
File: /home/vol7_2/epizy.com/epiz_28298983/htdocs/ts12/sources/levgal_src/Model/Stats.php
Line: 198

Code: [Select]
182:				);
183: $max = 0;
184: $temp = array();
185: while ($row = $db->fetch_assoc($request))
186: {
187: $temp[] = $row;
188: if ($row['count'] > $max)
189: {
190: $max = $row['count'];
191: }
192: }
193: $db->free_result($request);
194:
195: // Now to add percentages.
196: foreach ($temp as $k => $v)
197: {
198: $temp[$k]['percent'] = round($v['count'] / $max * 100);
199: $temp[$k]['count_format'] = comma_format($v['count']);
200: $temp[$k]['item'] = '<a href="' . $scripturl . '?media/album/' . (!empty($v['album_slug']) ? $v['album_slug'] . '.' . $v['id_album'] : $v['id_album']) . '/">' . $v['album_name'] . '</a>';
201: }
202: cache_put_data($cache_key, $temp, $cache_ttl);
203: }
204:
205: return $temp;
206: }
207:
208: public function getTopItemsByComments()
209: {
210: global $scripturl;
211:
212: $db = database();
213:
214: $cache_ttl = 360;
215: $cache_key = 'lgal_top_items_by_comments-' . $this->groups;
216: if (($temp = cache_get_data($cache_key, $cache_ttl)) === null)
217: {
218: $album_list = $this->getVisibleAlbums();
Title: Re: Levertine Gallery
Post by: Spuds on April 15, 2021, 04:33:19 pm
Quote from: tino – , could you update the first post for 1.1.7 to include the latest copy of the patch? I think that might help,
Will do ... I'd been posting new versions in the thread as it progressed but should have removed the old or simply only updated the first.  Anyway sloppy on my part
.
Quote from: lurkalot – Works nicely when using the latest 1.1.7 patch, thank you tino.  ;)
Awesome, glad it worked with the right level of everything and it was not some hard to figure out server contig issue.
The div by zero thing I fixed on my local, maybe on bitbucket as well.  Anyway its an empty gallery issue. 
Not sure on the invalid async, was that using the bulk or single add item?  Also what was the size of the file so I know if it was trying to chunk or not.  Either way I think I need to post the latest zip package to make sure we are all on the same level (to the first post of course ;D )
 
Title: Re: Levertine Gallery
Post by: lurkalot on April 15, 2021, 04:51:22 pm
Quote from: Spuds –
Not sure on the invalid async, was that using the bulk or single add item?  Also what was the size of the file so I know if it was trying to chunk or not.  Either way I think I need to post the latest zip package to make sure we are all on the same level (to the first post of course ;D )
 

Thanks. I was using the single add item.  File was a jpg image of around 140kb
Title: Re: Levertine Gallery
Post by: Spuds on April 19, 2021, 09:38:01 pm
Updated the first post with the current state of the addon.
Title: Re: Levertine Gallery
Post by: Spuds on April 30, 2021, 03:04:14 pm
And another update.  This one should fix a couple of rather annoying bugs I created with the new uploader.

1) Small (read below chunk size) files were failing with invalid async message.  This due to a missing post value
2) Non image files were failing be be accepted.  This due to the change to wait for the browser thumbnail generation to complete  which is needed to get the WxH of the supplied image.   Unfortunerly the on thumbnail event only fires for valid thumbnails.  So this change has it emit that event or all files so that the form acceptance code always runs.
3) With #2 I also supplied some generic thumbs for non image files, looks nicer in the upload form.

See the first post for the file.
Title: Re: [ADDON] Levertine Gallery
Post by: radu81 on May 17, 2021, 09:42:47 am
Italian translation, work in progress https://github.com/radu81/Traduzione-Levertine-Gallery-Elkarte
Title: Re: [ADDON] Levertine Gallery
Post by: Arantor on May 17, 2021, 03:06:02 pm
At this stage I can't help but feel that the name possibly should be changed seeing how it was originally named after an intended SMF fork...

A lever is a type of simple machine, and a tine is the prong of a fork... but if you're happy with the name, keep it :P
Title: Re: [ADDON] Levertine Gallery
Post by: radu81 on May 17, 2021, 03:49:36 pm
I had no idea about the signification of the name ;)
Title: Re: [ADDON] Levertine Gallery
Post by: Steeley on May 17, 2021, 10:51:18 pm
Quote from: Arantor – At this stage I can't help but feel that the name possibly should be changed seeing how it was originally named after an intended SMF fork...

A lever is a type of simple machine, and a tine is the prong of a fork... but if you're happy with the name, keep it :P

Well that's a let down.. I thought it was named after Levertine, the Flaming Sword of the Norse God Tyr, who lost it (and his hand - the origin of the term "wolf-joint" of the wrist) to the wolf Fenrir while it was being subdued by the other Gods (omitted from the Prose Edda, but alluded to in the earlier Poetic Edda in the original text of the Codex Regius. although sometimes interpreted to reference the sword of Víðarr, Odin's son, who uses it to avenge Odin's death to Fenrir at the battle of Ragnarök.

It was told to be the equal to Thor's Hammer until it was lost and believed ended up in Niflheim, secreted away by the dragon  Nidhug into the spring Hvergelmir, which causes it to boil, and which Nidhug remained ever vigilant over.

But, tang on a simple tool? Well, OK..
Title: Re: [ADDON] Levertine Gallery
Post by: radu81 on June 04, 2021, 08:34:33 am
No problem  for the name, choose the one that fits best. If the word "levertine" has no sense to be used in Elkarte I propose something simple like "Elkarte Media" or "Elkarte Gallery" or "ELK Media Gallery" or "ElkGallery", etc .... I hope Arantor is agree with that,

I was working on the italian translation of this add-on and I see there is a part in the gallery that should display the latest news from levertine.com. I don't know what @Arantor‍ intend to do with that domain, but now there is nothing there. If the site won't be updated I guess that part "News from Levertine.com could be removed from the add-on and translations.
Title: Re: [ADDON] Levertine Gallery
Post by: Arantor on June 04, 2021, 01:18:50 pm
Well, I still own the domain but for some reason it's throwing 500s and since there's been no updates on it in forever, there's probably not a lot of reason to have it call 'home' for news.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on June 04, 2021, 06:37:51 pm
I'd have to double check but I'm pretty sure I disabled the call home for news.  What I should do is change it, like I did for SP, to grab the latest release info from github.

No idea on the name,  Along the lines of ElkArte then it could be ElkArte Galeria, but I'm fine with Levertine.

Title: Re: [ADDON] Levertine Gallery
Post by: augras on December 21, 2021, 12:26:54 pm
Hi,
Here the french files for this great addon.
Philippe
Title: Re: [ADDON] Levertine Gallery
Post by: McFly on February 13, 2022, 01:21:49 pm
Well, it's a fine piece of work. Unfortunately the import from Aeva 1.4 does not work. On one of my test sites I have an Aeva gallery with 84 categories with a total of almost 4000 images. Took almost two hours, only to find that while the categories were transferred correctly (even with subdirectories), the content was not.

Haven't had the time to read into the process yet. Therefore the simple question: Does anyone have a clue what could have gone wrong?

The server is running the latest Apache with PHP74, MariaDB 10.3. The test forum is a fresh import from SMF 2.0.19 to EA 1.1.18. (See OpenImporter)
Title: Re: [ADDON] Levertine Gallery
Post by: Arantor on February 14, 2022, 03:58:49 am
I originally wrote it several years ago, but it was against the last version of Aeva (2.0?) rather than any older version.

The thing is, the importer was written to assume it had all the files in the local directory (as if you’d literally just uninstalled Aeva and installed LevGal) so if you don’t have the lgal_items folder in the same place on the new site, it probably won’t work correctly. That said I don’t know if Spuds reworked the importer stuff, I’m just going off my original memories of implementation… and even that is hazy now, winter 2014 was a loooooong time ago.
Title: Re: [ADDON] Levertine Gallery
Post by: McFly on February 14, 2022, 04:15:57 am
On the second try, it worked. As soon as you do it right, it works.  :D

The problem was, I had already copied the mgal files to the ELK subfolder and also adjusted the prefix of the Aeva tables in the database, but I had not changed the paths in the Aeva settings.  ::)

I must say though, after first looking over it, that the levertine gallery storage system seems to be extremely different from the Aeva system. Very cryptic. Also the space requirement has increased from 375MB to 450MB.  :o
Title: Re: [ADDON] Levertine Gallery
Post by: Arantor on February 14, 2022, 05:41:58 am
Yes, the storage system is very different. Mostly this is for scalability purposes, most FTP clients get upset if you ask them to handle folders with more than 2000 files in them, which doesn’t seem like a particularly large album when you factor in thumbnails and previews, LevGal was originally tested with half a million files in it, including albums with far more than 2000 items in, just to ensure that FTP would still work.

The way it works splits the files roughly evenly between the folders rather than making albums be folders. It’s the same system that MediaWiki (the software Wikipedia uses) to handle uploads.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on February 14, 2022, 10:24:39 am
Quoteand even that is hazy now, winter 2014 was a loooooong time ago.
Heck I did this 10 months ago and can't remember as much as you can from 2014 LOL 
Title: Re: [ADDON] Levertine Gallery
Post by: McFly on February 15, 2022, 09:17:49 am
Formal German language files for the Levertine Gallery. :)

Installable via the package manager. 8)
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on February 15, 2022, 02:00:27 pm
Awesome, thank you!
Title: Re: [ADDON] Levertine Gallery
Post by: radu81 on February 16, 2022, 02:16:05 am
I just added all the translations to the first post of this topic
Title: Re: [ADDON] Levertine Gallery
Post by: jernatety on April 18, 2022, 08:23:09 am
Hello, I have a couple questions.

I have installed Levertine Gallery on SMF 2.0.19. It works great but there are a couple of issues. On the video viewing page, the item information "Posted By" bit is shifted completely out of the frame. It's not a big deal it just looks odd. The other issue is the bulk uploader. When I click on it, I get a message that I don't have permission to use it, I'm the admin and nobody has permission to add videos except for me. I looked through the Levertine perms but don't see anywhere that I should have to change anything for admin.

Thank you, I greatly appreciate the mod!

Code: [Select]
https://www.youthhockeyinfo.com/index.php?media/item/donnie-salvato-bensalem-owls-goal-3-vs-father-judg.4846/
Title: Re: [ADDON] Levertine Gallery
Post by: Arantor on April 18, 2022, 08:42:23 am
Um… this is the ElkArte forum, for supporting the ElkArte version of things, not the SMF version?
Title: Re: [ADDON] Levertine Gallery
Post by: jernatety on April 18, 2022, 09:03:11 am
I tried responding a couple times and my replies don't show up after using the quick reply. I wasn't aware there was a distinction for support. My apologies, there is no support for the mod at SMF forum so I thought I could ask here where the mod was made.
Title: Re: [ADDON] Levertine Gallery
Post by: Arantor on April 18, 2022, 09:25:52 am
The mod wasn't made here, though. The mod here is a modified version designed for ElkArte (a derivative of SMF), and there is no support here for the original SMF version.
Title: Re: [ADDON] Levertine Gallery
Post by: tino on April 18, 2022, 09:26:33 am
The mod was originally made by @Arantor, this version was converted and is supported by @Spuds. There are numerous differences between the two versions, although they come from the same heritage.

I don’t believe the SMF version is supported anymore other than via general help over at SMF.
Title: Re: [ADDON] Levertine Gallery
Post by: jernatety on April 18, 2022, 09:37:25 am
Okay thank you
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on November 05, 2022, 08:54:05 pm
Been working on an update to the Gallery :smiley_cat:  I'm going to release it as version 1.2.0

Thus far here is what I have done:

Not sure what else I will do at this point, but if you have ideas/suggestions, now is the time
Title: Re: [ADDON] Levertine Gallery
Post by: radu81 on November 06, 2022, 01:19:18 pm
Quote from: Spuds –  
  • Added full My/Member/Site/Group album views to the "See Albums" area.  There was not a "see all" kind of view in the previous release.  (still need to add pagination)
If I am not wrong I asked for this or something similar, I need to test it
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on November 06, 2022, 01:34:28 pm
I'll put up a beta package for testing .... still working through a bunch of other addons that needed minor updates for PHP8+ and/or Elk1.1.9 ... But after that will get this posted
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on November 10, 2022, 10:30:22 pm
Doing a few more updates
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on November 14, 2022, 09:27:19 pm
Here is a preliminary copy of 1.2.0 for testing for those who have time.

I think I've noted the main changes in the above posts, there are lots of little changes as well.  This does have the pagination for user albums (main view and user album view), also noted as a todo in the previous posts.  I'm sure I'll make some more updates before final, but I'm close to moving off this for a bit. 

I've done all my testing on 1..1.9 (also prelim) and PHP 8.1, so that combination should be solid.  I've also tested the importer with avea on this level and it also appears to work fine. 

As noted somewhere back in this thread, when you import an album with PDF files, it will be S L O W .. this is nothing to do with this addon, but with the getid3 library it uses.  PDF's are one of those loose standards so importing takes time as the library simply has to check every bit to get the data it wants, plus it creates are real thumbnail of the file, not just a generic image.  It works fine, but if this is your setup, set timeouts on your web/php server to 300 or you may get the dreaded 504 error due to a timeout.  This is only an issue with importing and large PDF files.

ETA: 1.2.0 Attachment removed, the opportunity to provide feedback has passed !
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on November 24, 2022, 12:17:52 pm
And a few more updates.


I've noted about the slow PDF thumbnail creation, here are the basics.  AFAIK they will only be created when using Imagick not GD.  Imagick will load a PDF file and delegate to ghostscript for the actual creation of the thumbnail (based on the first page of the PDF).  Its ghostscript that, on larger PDF files, really slows down the process.  That said having true image thumbnails for PDF files is very nice and worth the import time.

If you run the importer or simply add a PDF to your existing gallery, and you get the generic PDF icon, and you are sure you are using Imagick, then the issue could be do to Imagick security policies.  In my install they deny (per default) PDF operations, so covers can't extracted.  You have to allow it (by commenting out) in the PDF line in the policy.xml file of Imagick (my was located in etc/Imagemagick-6) YMMV  I also had to increase the allowed memory for a really large PDF, but try the defaults first.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 08, 2023, 05:55:36 pm
Time for another update of where I am on 1.2.0

Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 16, 2023, 09:11:53 pm
I uninstalled this and now I get this error when try to access a topic or try to start a topic.

Code: [Select]
Class '\ElkArte\sources\subs\MentionType\Lgcomment_Mention' not found

Code: [Select]
Type of error: General
Exception: Class '\ElkArte\sources\subs\MentionType\Lgcomment_Mention' not found
/index.php?topic=46.0
File: /sources/modules/Mentions/MentionsModuleAbstract.class.php
Line: 42
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 16, 2023, 09:28:32 pm
Sounds like enabled_mentions key in your settings db table still has Lgcomment in it ... should have been removed during uninstall.  I know that works on the "soon" 1.2 but must have been an error back on the last released or beta version

Using phpmyadmin or adminer or whatever you use, open elkarte_settings table, find the key enabled_mentions it will look something like buddy,mentionmem,quotedmem,lgcomment,likemsg,rlikemsg  and remove lgcomment from the string
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 16, 2023, 09:35:15 pm
Also if you see a lgnew in that string ... remove it
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 16, 2023, 10:03:26 pm
That did the job.
Funny how that was only an issue on one site.
I had it installed on 2 and uninstalled it from both.
The other site didn't have any issues.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 16, 2023, 10:24:32 pm
Glad that worked ... I've made a change for 1.1.10 which will prevent that issue should an addon mess things up :beginner:

It may have been that you did not enable gallery "mentions" on one of the sites.   You can enable gallery notification for its  likes, comments, or new.  If never enabled then likely no problem.   I'm checking the uninstall for the 1.2 version of the gallery as well.
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 17, 2023, 07:33:58 pm
It seems that videos show up way too big.
How would I get them to be max-width 100%?

Also:

Quote from: Spuds –
Quote from: Burke Knight – Yes, I have to use 7.4 due to Levertine, as it sticks at processing images when uploading when using PHP 8.x.
Interesting ... I'm sure I updated everything for 8+, but I may not have done an official release.  I'll look into that.

Any luck on what the issue is on this?
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 17, 2023, 09:30:01 pm
I'll post a preliminary 1.2 tomorrow ...

Lets use that to see what is still broken and what work needs to be done.   I did a lot of changes, then began to use it on one of my sites to help debug and then I got sidetracked !
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 26, 2023, 05:48:43 pm
Took me a couple of days, its that time of year !

Here is a PRELIMINARY 1.2.0 package ... Many updats since 1.1 as outlined in the previous several posts.  I tested this under 8.2 and all seems to be well.

ETA: Updated package in later post
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 26, 2023, 08:56:12 pm
Quote from: Spuds – Took me a couple of days, its that time of year !

Here is a PRELIMINARY 1.2.0 package ... Many updats since 1.1 as outlined in the previous several posts.  I tested this under 8.2 and all seems to be well.

Not sure what is going on, but I'm having such issues with Bulk Upload.
Seems that it'll see and upload only some of what put, and does not seem to matter how many try to do.
Title: Re: [ADDON] Levertine Gallery
Post by: ahrasis on December 27, 2023, 02:25:21 am
Any errors logged?
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 27, 2023, 05:15:14 am

No errors.
Just as can see in the image, it has some that get skipped, that don't show anything for a thumbnail.
However, they will show and upload if try to drop them again after the first batch is done.
It's not due to any settings, as they are all the same as before for files, sizes, etc.

A very strange issue, for sure.  :tongue:
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 27, 2023, 10:31:39 am
I'll do some more checking on the bulk upload.  In that picture it looks like a handful were never sent. 

TBH I don't think I ever dropped 30 items at once  :grin:
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 27, 2023, 11:38:38 am
Quote from: Spuds – In that picture it looks like a handful were never sent.

Exactly. But I'm not sure why.

Quote from: Spuds – TBH I don't think I ever dropped 30 items at once   :grin:

But then, you are not me. 😂
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 27, 2023, 12:11:43 pm
I found at least a bug ....

The issue was with gif files (and probably certain other image types) you can see that in the picture you attached, it had a problem starting at the first gif.  What happened is a "check" event was triggering twice on the same file then trying to queue it twice and causing an error.

Lets try the attached on and see what we get this time.

ETA: 1.2.0 Package released
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 27, 2023, 04:43:52 pm
Quote from: Spuds – Lets try the attached on and see what we get this time.

That did the trick.  :smiley:
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 27, 2023, 05:42:29 pm

When viewing on mobile, the image shows very small. I think I found the fix in main.css

Code: (Find) [Select]
/* This one does 1024 screens at default font size. */
@media screen and (max-width: 64em) {
/* move prev next navigation to below item */
.main_item_container .lg_prev, .main_item_container .lg_next {
display: none;
}

Code: (Add After) [Select]
	.main_item_container {
max-width: 100%;
display: flex;
}
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 27, 2023, 09:26:51 pm
Thank you !
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on December 27, 2023, 10:12:17 pm

You might want to check and be sure that is the best fix.
After all, I am a bit rusty in the ElkArte coding scheme.  :wink:
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on December 31, 2023, 09:24:55 pm
Some more 1.2 updates, should be close to releasing this :pray: These are in addition to all of the changes in the previous posts.


Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 01, 2024, 06:37:39 pm
Fixed a few more small things, mainly around marginally improved TIF image support for the few that want that.  At this point I'm calling it 1.2.0, if there are errors or other features to add, that is what the .0 is for ;)

https://github.com/Spuds/Elk_Gallery/releases/tag/1.2.0
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on January 01, 2024, 08:04:27 pm
Quote from: Spuds – Fixed a few more small things, mainly around marginally improved TIF image support for the few that want that.

If already did the one in this post (https://www.elkarte.net/community/index.php?topic=5969.msg45292#msg45292), and don't need the TIF support, is there really any need to do this one now?
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 02, 2024, 10:15:03 am
The TIF issue was that it showed a broken / no thumbnail in the upload interface, but it the thumbnail complete event was triggering so everything proceeded as normal.

This is really due to poor browser support for TIF images and what is probably a bug in the upload project.  The fix was to show a generic thumbnail when the client fails to create one successfully.   The update works for any client side thumb-nailing that fails so its a good catch net to have in the code.
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on January 02, 2024, 10:24:15 am
Quote from: Spuds – The update works for any client side thumb-nailing that fails so its a good catch net to have in the code.

The only reason asking, is I had done some own modifications, and didn't really want to do them again....LOL
When find some time, I could go and see what I'd need to update.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 02, 2024, 10:51:50 am
You can always use WinMerge to compare the versions .... The above fix was just a few lines added to the (3) .on thumbnail events, two in album and one in item templates.
Title: Re: [ADDON] Levertine Gallery
Post by: radu81 on January 05, 2024, 07:16:02 pm
I believe TIFF files should not be allowed in a web gallery, or at least they should be converted to JPEG/PNG or WebP.
Tif files are mostly used for high quality printing, it's a lossless format, sometimes not even compressed, often in CMYK, could embed colour profile, I really don't know if a cmyk file could be converted to RGB by GD/Imagick and how the results could be. The colours accuracy will surely differ from the original file.
For me it's a no.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 05, 2024, 08:26:42 pm
You have the option to set the file types you allow in your gallery .... just don't select tiff ;)

Yes they are big, like ginormous, lossless files ... I get them when scanning in film negatives or when transferring Cannon CR2 raw files from Abobe Lightroom to other photo plugins that I use.  So I understand their use case, but its not really much use for the web.  I'd have to check what happens when "limits" are in place and you upload a tif, I think it will be converted but would have to check.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 07, 2024, 01:10:57 pm
Bump to 1.2.1 .... https://github.com/Spuds/Elk_Gallery/releases/tag/1.2.1

Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on January 09, 2024, 05:04:33 pm
@Spuds
Is there a way, when having files, such as pdf, to have them open in new tab when they are clicked?
Right now, when they click in the item list, it opens whatever pdf viewer they have in the same tab.
Title: Re: [ADDON] Levertine Gallery
Post by: ahrasis on January 09, 2024, 07:10:01 pm
Quote from: Burke Knight – @Spuds
Is there a way, when having files, such as pdf, to have them open in new tab when they are clicked?
Right now, when they click in the item list, it opens whatever pdf viewer they have in the same tab.
I like to have this as well. Or may be an option to do so.
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 09, 2024, 07:48:48 pm
In LevGal-Item.template.php

Code: (find) [Select]
<a href="' . (!empty($viewInline) ? substr($context['item_actions']['actions']['download'][1], 0, -10) : '') . '">

Code: (replace) [Select]
<a href="' . (!empty($viewInline) ? substr($context['item_actions']['actions']['download'][1], 0, -10) : '') . '" target="_blank">

That will generally affect any non-image files and open them in a new tab ... its that target="_blank" that causes that behavior.  Try that and let me know if that is what you wanted.
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on January 09, 2024, 08:59:26 pm
Quote from: Spuds – That will generally affect any non-image files and open them in a new tab ... its that  target="_blank" that causes that behavior.  Try that and let me know if that is what you wanted.

Works like a charm!
My issue was trying to find where to add the target="_blank" to make it work. I didn't think of that file.  :tongue:
Title: Re: [ADDON] Levertine Gallery
Post by: Burke Knight on January 10, 2024, 12:55:45 pm
Found an issue that may want to look at.

When have site owned albums, in the LevGal sidebar, it uses the logo image from theme settings.
This can cause not being able to actually see it well, due to many logos being a lot wider than their height.
My suggestion, is either have it where they can select an image for site album image in the settings, or edit LevGal-Album.template.php
and change this:

Code: [Select]
	// a site owned album, use site logo if available.
elseif(!empty($context['header_logo_url_html_safe']))
{
echo '
<div class="posted_by">', $txt['lgal_owned_by'], '</div>
<div class="album_owner">
<span class="user_avatar">
<img class="avatar avatarresize" src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" />', '
</span>
<div class="">', $context['forum_name_html_safe'], '</div>
<div class="user smalltext">', sprintf($txt['lgal_see_more'], $scripturl . '?media/albumlist/site/'), '</div>
</div>
<br />';
}

To maybe this:

Code: [Select]
	// a site owned album, use site logo if available.
elseif(!empty($context['header_logo_url_html_safe']))
{
echo '
<div class="posted_by">', $txt['lgal_owned_by'], '</div>
<div class="album_owner">
<span class="user_avatar">
<img class="avatar avatarresize" src="' . $context['favicon'] . '" alt="', $context['forum_name_html_safe'], '" />', '
</span>
<div class="">', $context['forum_name_html_safe'], '</div>
<div class="user smalltext">', sprintf($txt['lgal_see_more'], $scripturl . '?media/albumlist/site/'), '</div>
</div>
<br />';
}

Or possibly, mobile.png
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on January 10, 2024, 03:30:37 pm
:thinking:  Fair point ... $context['favicon'] I think defaults to Mobile.png anyway.  Thanks for the report!
Title: Re: [ADDON] Levertine Gallery
Post by: Spuds on February 13, 2024, 11:54:53 am
Small bump to V1.2.2  ... https://github.com/Spuds/Elk_Gallery/releases/tag/1.2.2