Opening Full Size Images w/out Popup Opening Full Size Images w/out Popup
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Opening Full Size Images w/out Popup

Started by trekcore, February 06, 2021, 07:55:40 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

trekcore

Hello,

I was wondering if anyone knows how we can modify cpg1.6 so that when you click on a thumbnail, it takes you to the full sized image in the same window (ie, not opening it as a pop up). We don't need it to open in the them, it can just take people directly to the image's url so they just see the image. Thanks!

ron4mac


trekcore

Thanks, that doesn't seem to do what I need.

I've been playing around more today and now I realise I can be more specific. W while back we had a volunteer who knows PHP modify Coppermine so that when you click on the thumbnail, it takes you directly to the image. You can see this in action here if you click any thumbnail: http://tng.trekcore.com/gallery/thumbnails.php?album=2  This contrasts with a newly upgraded CPG 1.6 where if you click on a thumbnail it opens a pop up using displayimage.php: http://snw.trekcore.com/gallery/thumbnails.php?album=7

What we need is to bypass the displayimage.php entirely, which saves us a ton of CPU resources.  However, with upgrading to CPG 1.6, the modifications the volunteer made no longer work. Ie, we have two modified files that we would upload that would bypass displayimage.php and allow the thumbnails to directly link to the images:
1. functions.inc.php (https://drive.google.com/file/d/0B-88YH4hGOimSVlWVnBCYzhTSGc/view?usp=sharing)
2. themes.inc.php (https://drive.google.com/file/d/0B-88YH4hGOimVDdHQjFVRy1od1k/view?usp=sharing)

However, uploading those now to an upgraded CPG 1.6 breaks the gallery and we get an error. We're having difficulty so far getting in touch with that volunteer again (as it was 10+ years ago) and so hoping someone here might be able to help us figure out how to bypass display.php again.

Thanks!

ron4mac

I modified the iZoom plugin to perhaps provide something closer to what you're looking for.

trekcore

Thanks ron4mac, I see the link to the thumbnail just says javascript when the plugin is enabled. Can you confirm this then bypasses displayimage.php?

trekcore

Sorry, I just realized that with this plugin users are not able to save the full size image or open the links in new tabs if they wish. That won't really work for our users.

ron4mac

I'm pretty sure, with some work, the plugin could be made to allow right clicks to download or open the image.

The behavior you are looking for could (and should) be implemented in your theme. It is never a good idea to modify core files in the CPG package.

trekcore

Yeah I totally agree.  Would you have a ballpark estimate in the number of hours of coding it would take to make those changes? I'm not a programmer but I can put a call out to our site's supporters to see if anyone would be up for helping do that.

ron4mac

#8
I would work on your theme but I would much prefer to provide the behavior via a plugin so everyone would be able to use it.

Here is a revamped version of the little iZoom plugin. Images can be right-clicked for contextual actions. Let me know if that meets your requirements.

trekcore

Thanks ron4mac, that's really kind of you to update that. It definitely solves the issue of saving the image, but it still does not allow people to open the images in a new tab if they prefer. Our users often want to open multiple images at once in multiple tabs. Is that possible or does the javascript make that impossible?

ron4mac

Quote from: trekcore on February 10, 2021, 01:28:18 AM
... but it still does not allow people to open the images in a new tab if they prefer.
In all my browsers (Safari,Chrome,Firefox), right-clicking on the zoomed image lets me save the image or open it in a new tab.

trekcore

Apologies for not being clearer. What I mean is users like to be able to right click on the thumbnail itself (not the full sized image) and select "Open Link in a New tab". That way they can open multiple full sized images in multiple tabs easily. Right now doing this will lead to a new tab being opened that says about:blank#blocked I've got your plugin running here if you want to try it: http://prodigy.trekcore.com/gallery/thumbnails.php?album=1

ron4mac

Quote from: trekcore on February 10, 2021, 02:20:48 AM
Right now doing this will lead to a new tab being opened that says about:blank#blocked
Must be a browser thing ... works fine for me with all my browsers.

I'll modify it for you to just open the full image in another window ... like the other site.

trekcore

Hmm, that's odd. Here's a vid I just took showing what happens when I right click on a thumbnail to open in a new window. It happens in Edge and Chrome on my windows comp and in Chrome on my Android. I asked a friend and they said it happens to them as well.

https://drive.google.com/file/d/1d3oBfGFOQN5f1uKxeouCznq5jDFKPB2Z/view?usp=sharing

ron4mac

You're not right-clicking on the zoomed image ... you're right clicking on the thumbnail.

At any rate ... here is a plugin to give you the behavior of your other site.

trekcore

Wow thanks ron4mac, you're amazing! There are lots of Star Trek fans that will appreciate your work!