MG 2.0 Disable right click on images?

BobHarbison

Active member
Is there a way to disable image downloading? Yes, I know, if somebody wants it bad enough, they'll get it. But I'd like to at least get rid of the ability to simply right click and have the option to download it. Is that possibly in XFMG2?

I'm going to install the gallery in a photography forum, and they get touchy about that sort of thing.
 
What you have said is right, you just can't prevent the image from being taken, regardless of whether you prevent the context menu or not.

Though, if you're certain you want to do it, you can do it by editing the template.

Edit the template xfmg_media_view_macros and find:
HTML:
<img src="{{ link('media/full', $mediaItem, {'d': $mediaItem.last_edit_date ?: null}) }}" class="js-mediaImage" />
And replace with:
HTML:
<img src="{{ link('media/full', $mediaItem, {'d': $mediaItem.last_edit_date ?: null}) }}" class="js-mediaImage" oncontextmenu="return false" />
 
What you have said is right, you just can't prevent the image from being taken, regardless of whether you prevent the context menu or not.

Though, if you're certain you want to do it, you can do it by editing the template.

Edit the template xfmg_media_view_macros and find:
HTML:
<img src="{{ link('media/full', $mediaItem, {'d': $mediaItem.last_edit_date ?: null}) }}" class="js-mediaImage" />
And replace with:
HTML:
<img src="{{ link('media/full', $mediaItem, {'d': $mediaItem.last_edit_date ?: null}) }}" class="js-mediaImage" oncontextmenu="return false" />

is this still works on xf 2.2 ?
 
Top Bottom