Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2017-09-13 17:56:48

randyhoffner
Member
Registered: 2017-07-01
Posts: 67

Disable right click on jpgs

Has anybody ever tried disabling right click on jpgs, presenting a message that this image is copyrighted?  I know this can be gotten around, but at least it would slow those who would rip you off.  I have found javascript online that does so, and I suppose it can be incorporated into the php file, but have not seen anybody actually do it.  Except 500px, who does do it.

Randy Hoffner

Last edited by randyhoffner (2017-09-13 17:57:10)

Offline

#2 2017-09-13 19:08:53

Matthew
Administrator
From: Seoul, South Korea
Registered: 2012-09-24
Posts: 5,258
Website

Re: Disable right click on jpgs


Campagna Pictures, http://campagnapictures.com
The Turning Gate, http://theturninggate.net

Offline

#3 2017-09-13 22:38:11

charlie.choc
Member
From: Marietta, GA
Registered: 2014-01-09
Posts: 359
Website

Re: Disable right click on jpgs

smile

Offline

#4 2017-09-19 15:37:53

randyhoffner
Member
Registered: 2017-07-01
Posts: 67

Re: Disable right click on jpgs

Thanks Matthew and Charlie.  I'll give it a go.  (I've been a little preoccupied).

Randy

Offline

#5 2017-09-19 16:02:51

Matthew
Administrator
From: Seoul, South Korea
Registered: 2012-09-24
Posts: 5,258
Website

Re: Disable right click on jpgs

I wish you wouldn't, but you do you.


Campagna Pictures, http://campagnapictures.com
The Turning Gate, http://theturninggate.net

Offline

#6 2017-09-19 16:10:53

randyhoffner
Member
Registered: 2017-07-01
Posts: 67

Re: Disable right click on jpgs

Yes, I get that.  Maybe I will just be content with watermarks and metadata.  Never really thought of it as purposefully breaking the browser, but I see it.

Offline

#7 2018-01-26 01:46:53

deanjm
Member
Registered: 2017-11-10
Posts: 9

Re: Disable right click on jpgs

I appreciate the reasoning against it but I would also like to disable the context menu. I have followed the instructions in the link above and added the code to a copy of the phplugins-sample.php file which I have renamed to my-phplugins.php and in the Backlight page template I have enable PHPlugins and included my-phplugins.php however, it doesn't appear to work. Is there something else that I need to enable?

My site is http://freshphoto.co.uk

Last edited by deanjm (2018-01-26 01:47:42)

Offline

#8 2018-01-26 01:52:23

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

Re: Disable right click on jpgs

I don't see the script appearing in the source code of your page.

the code referenced in that article uses a phplugins hook from the CEx days (ttg_body_bottom_) That hook does not exist in Backlight. Use ttg_scripts instead.


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

Offline

#9 2018-01-26 05:53:58

deanjm
Member
Registered: 2017-11-10
Posts: 9

Re: Disable right click on jpgs

Hi Rod , many thanks for the reply that did the trick.

Last edited by deanjm (2018-01-26 05:57:02)

Offline

#10 2018-01-26 05:57:27

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

Re: Disable right click on jpgs

instead of the ttg_body_bottom hook used in the code from the tutorial, use ttg_scripts instead

Instead of this:

function ttg_body_bottom( $style, $path ) {

Use this:

function ttg_scripts( $style, $path ) {

all the available hooks are listed in any of the phplugins files inside the backlight/custom/phplugins/ folder


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

Offline

Board footer

Powered by FluxBB