Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2020-03-06 18:41:18

wrietvel
Member
Registered: 2014-07-25
Posts: 22

No Right Click Images

I can hardly imagine that I am the first to pose this question, but I can not find a topic on this, so here goes.
In Backlight2, using the default page and default album, any visitor of the webpage, looking at the full screen gallery, can just right-click on any image and copy it. In Wordpress there is the "No Right Click Images" plugin, which blocks this. Is there any solution for this in the non Wordpress environment of Backlight2?
Thanks,
WimR.

Last edited by wrietvel (2020-03-06 18:58:54)

Offline

#2 2020-03-06 21:56:59

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: No Right Click Images

this is not supported in Backlight, though you can use phplugins to implement it.
Here is some old CE 4 documentation on doing it : http://ce4.theturninggate.net/docs/doku … ntext_menu

Probably use the scripts hook instead for BL 2

And you would need to update the phplugins function syntax: http://backlight.theturninggate.net/doc … _phplugins


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2020-03-09 01:18:24

mad
Member
From: Arkansas
Registered: 2014-01-03
Posts: 154
Website

Re: No Right Click Images

Actually, for each of your albums you can put the following in your album copy settings main copy window to have no right click images on the page/album.  I have this currently implemented on my site.
<script>
        window.oncontextmenu = function () {
            return false;
        }
    </script>

Offline

#4 2020-03-09 12:48:30

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: No Right Click Images

mad wrote:

Actually, for each of your albums you can put the following in your album copy settings main copy window to have no right click images on the page/album.  I have this currently implemented on my site.
<script>
        window.oncontextmenu = function () {
            return false;
        }
    </script>

Or use phplugins to automatically insert the code on each page:

function scripts() { 
   echo '<script> window.oncontextmenu = function () { return false; } </script> ';
   return false;
}

Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#5 2020-03-09 16:54:31

chumby
Member
Registered: 2014-10-23
Posts: 188

Re: No Right Click Images

That's good to know, Daniel.

If you had more than one script, Daniel, can you load them all into that one function?  And then they will work for all pages?

Cheers
Chumby

Offline

#6 2020-03-09 18:19:02

wrietvel
Member
Registered: 2014-07-25
Posts: 22

Re: No Right Click Images

Thanks all. Works fine.

Offline

#7 2020-03-09 21:32:50

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: No Right Click Images

chumby wrote:

That's good to know, Daniel.

If you had more than one script, Daniel, can you load them all into that one function?  And then they will work for all pages?

Cheers
Chumby

Yes, just make sure you don’t use the scripts hook more than once


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

Board footer

Powered by FluxBB