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



<?php defined('_JEXEC') or die('Restricted access');
echo '<div id="phocagallery">';
if ($this->tmpl['backbutton'] != '') {
echo $this->tmpl['backbutton'];
}
<?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'];
}


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.

<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>


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

Users browsing this forum: Google Adsense [Bot] and 5 guests
See Phoca demo sites:
See Phoca documentation:
See Phoca Download: