Phoca
Phoca Seal

How to disable "save image as" in right click?

Before you ask see the Phoca Gallery User Manual

Hi there...

Postby gimmmo on 13 Dec 2007, 00:10

Hi there...

I do not want people to download my photo (even the thumbnail) by right clicking and "save image as" ...

How to do it?

gimmmo
gimmmo
Phoca Newbie
Phoca Newbie
 
Posts: 5
Joined: 11 Dec 2007, 23:46
Location: Singapore

Google Ads


Original Ima

Postby Jan on 13 Dec 2007, 00:23

Original Images: You can disable 'download icon' - download link to original image in 'component parameters'... Users will not have access to original images.

Thumbnail images: If you want to disable right mouse clicking and 'saving image as', you can use 'Disable right mouse click JavaScript' (e.g. from http://www.dynamicdrive.com) to disable right mouse clicking but there are other ways how to download images ...

Jan
If you find some Phoca extensions useful, please vote for them on: extensions.joomla.org
User avatar
Jan
Phoca Hero
Phoca Hero
 
Posts: 32817
Joined: 10 Nov 2007, 18:23
Location: Czech Republic

Hi Jan.T

Postby gimmmo on 13 Dec 2007, 00:27

Hi Jan.

Thanks very much for your quick answer... I appreciate it

Great job for phoca gallery..
gimmmo
Phoca Newbie
Phoca Newbie
 
Posts: 5
Joined: 11 Dec 2007, 23:46
Location: Singapore

Re: How to disable "save image as" in right click?

Postby Buba_Smith2 on 20 Jan 2011, 23:40

You can get plugins for joomla to disable the right-click feature on the entire website. That said, however, they don't seem to have any effect on the phoca-gallery details popup. To remedy this, you will need to modify a part of the code. (This is easy to do/undo so don't panic) Find the file /(your joomla site)/components/com_phocagallery/views/detail/tmpl/default.php and edit the second line of the file as such:
BEFORE
Code: Select all
<?php defined('_JEXEC') or die('Restricted access');

echo '<div id="phocagallery">';
if ($this->tmpl['backbutton'] != '') {
   echo $this->tmpl['backbutton'];
}

AFTER
Code: Select all
<?php defined('_JEXEC') or die('Restricted access');
echo '<script language=JavaScript>
<!--
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>';

echo '<div id="phocagallery">';
if ($this->tmpl['backbutton'] != '') {
   echo $this->tmpl['backbutton'];
}


This should disable right-clicking on the pop-up page and not interfere with any of the settings. The users can still access the images directly by extracting the url from the page source or page info in certain browsers. This is unavoidable. The script above will keep the average user out though.
Buba_Smith2
Phoca Newbie
Phoca Newbie
 
Posts: 1
Joined: 20 Jan 2011, 23:08

Re: How to disable "save image as" in right click?

Postby Jan on 21 Jan 2011, 21:43

Ok, thank you for this guide.

Jan
If you find some Phoca extensions useful, please vote for them on: extensions.joomla.org
User avatar
Jan
Phoca Hero
Phoca Hero
 
Posts: 32817
Joined: 10 Nov 2007, 18:23
Location: Czech Republic

Re: How to disable "save image as" in right click?

Postby grimgrin on 05 Jun 2011, 05:54

Buba_Smith2 wrote:You can get plugins for joomla to disable the right-click feature on the entire website. That said, however, they don't seem to have any effect on the phoca-gallery details popup. To remedy this, you will need to modify a part of the code. (This is easy to do/undo so don't panic) Find the file /(your joomla site)/components/com_phocagallery/views/detail/tmpl/default.php and edit the second line of the file as such:
BEFORE
Code: Select all
<?php defined('_JEXEC') or die('Restricted access');

echo '<div id="phocagallery">';
if ($this->tmpl['backbutton'] != '') {
   echo $this->tmpl['backbutton'];
}

AFTER
Code: Select all
<?php defined('_JEXEC') or die('Restricted access');
echo '<script language=JavaScript>
<!--
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>';

echo '<div id="phocagallery">';
if ($this->tmpl['backbutton'] != '') {
   echo $this->tmpl['backbutton'];
}


This should disable right-clicking on the pop-up page and not interfere with any of the settings. The users can still access the images directly by extracting the url from the page source or page info in certain browsers. This is unavoidable. The script above will keep the average user out though.


Hmmm... The code you provided doesn't seem to do the trick. Right-click menu still not disabled.
grimgrin
Phoca Newbie
Phoca Newbie
 
Posts: 1
Joined: 05 Jun 2011, 05:45

Re: How to disable "save image as" in right click?

Postby vinitdesai on 10 Oct 2011, 06:08

I got success with this by hacking one of the Phoca Component File.

Add the below given code in the following file on first line :)

components/com_phocagallery/views/detail/tmpl/default.php

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($){
jQuery('img').bind('contextmenu', function(e){
return false;
});
});
</script>
vinitdesai
Phoca Newbie
Phoca Newbie
 
Posts: 1
Joined: 10 Oct 2011, 05:46

Re: How to disable "save image as" in right click?

Postby Jan on 12 Oct 2011, 21:54

Hi, thank you for the info, I will add it to the tips.

Thank you, Jan

http://www.phoca.cz/documents/2-phoca-g ... t/511-tips (2)
If you find some Phoca extensions useful, please vote for them on: extensions.joomla.org
User avatar
Jan
Phoca Hero
Phoca Hero
 
Posts: 32817
Joined: 10 Nov 2007, 18:23
Location: Czech Republic

Re: Original Ima

Postby arangiesjb on 02 Feb 2013, 20:15

Jan wrote:Original Images: You can disable 'download icon' - download link to original image in 'component parameters'... Users will not have access to original images.

Thumbnail images: If you want to disable right mouse clicking and 'saving image as', you can use 'Disable right mouse click JavaScript' (e.g. from http://www.dynamicdrive.com) to disable right mouse clicking but there are other ways how to download images ...

Jan


Hi Jan, I just started using Phoca Gallery, I would like to try and prohibit people downloading the main images, I read the quoted answer you gave but I am unable to find the options you were talking about, where do i need to go to find these options?
arangiesjb
Phoca Newbie
Phoca Newbie
 
Posts: 1
Joined: 02 Feb 2013, 20:11

Re: How to disable "save image as" in right click?

Postby Benno on 03 Feb 2013, 15:18

@arangiesjb
backend --> Components --> Phoca Gallery --> Phoca Gallery Control Panel --> Options --> Display --> Category View Settings --> Display Download Icon=Hide
Save & Close

See also: 2. How to disable "save image as" after right clicking http://www.phoca.cz/documents/2-phoca-gallery-component/511-tips

Kind regards,
Benno
If a problem has been solved, please post this, because your solution may also be important for other users. Thank you!
User avatar
Benno
Phoca Hero
Phoca Hero
 
Posts: 4331
Joined: 04 Dec 2008, 11:58
Location: Germany

Next

Return to Phoca Gallery

Who is online

Users browsing this forum: Bing [Bot], Google Adsense [Bot], Yahoo [Bot] and 6 guests