Hello!
I'm new to Piwigo, and currently building a website for it. It is not yet public.
I have some javascript that prevents right-clicking, dragging, and Ctrl+C, and I want to apply it to my Piwigo gallery. Can someone advise where to place the script in the Piwigo files?
Thanks!
Offline
That approach is quite futile anyway. Anything displayed on the screen can be screenshot'ed and page source can be inspected, JavaScript deactivated and rewritten and images downloaded by their URIs
Offline
Yes, but I'd still like to know how to do it.
Anyone?
Offline
You could try to load it in the page banner, which is displayed on top of every page, under Admin -> Configuration -> Options, tab General; like
<script type="text/javascript" src="/path/scriptfile.js"></script>
Don't know if that actually works, just an idea. Other simple HTML code works there (it's all in a <div id="theHeader"> element). The script path needs to be an absolute path, or otherwise you'd have to determine the proper relative path (../../) for nested albums.
Offline
as erAck posts those attempts are rather futile to protect site and files. It is also known as Web scraping.
Sites can, with some limitations, even be copied offline with tools like HTTrack... https://www.httrack.com/ or https://websitedownloader.io/ and more at https://www.toolsbug.com/website-copier-online.php
Check how that works in order to prevent it. Not easy.
Last edited by homdax (2021-04-07 07:46:17)
Offline
Hello,
Best way to keep things secret is to not publish them on the web. There will always be a way to pick and copy them.
Offline
I appreciate everyone's feedback on what I'm doing, but I'm well aware of all those things.
Regardless of your personal opinions on the subject, I would very much like to know how to do what I asked anyway.
Why, when someone asks for help, do so many people feel they need to reply with unhelpful comments??? Your idea of help isn't really help.
Offline
erAck wrote:
You could try to load it in the page banner, which is displayed on top of every page, under Admin -> Configuration -> Options, tab General; like
Code:
<script type="text/javascript" src="/path/scriptfile.js"></script>Don't know if that actually works, just an idea. Other simple HTML code works there (it's all in a <div id="theHeader"> element). The script path needs to be an absolute path, or otherwise you'd have to determine the proper relative path (../../) for nested albums.
Thanks. I tried that but it didn't work - but only due to a brain fart, lol. I will try again soon, and let you know either way. :)
Offline
cbiweb wrote:
I appreciate everyone's feedback on what I'm doing, but I'm well aware of all those things.
Regardless of your personal opinions on the subject, I would very much like to know how to do what I asked anyway.
Why, when someone asks for help, do so many people feel they need to reply with unhelpful comments??? Your idea of help isn't really help.
Because there is nothing practical to be done about protecting the content of a site that is exposed to the general Internet.
You asked about right-click and got an answer.
A search on Google for "prevent right-click on site" gave a BILLION results (seriously) and among the very top (after narrowing to last year):
https://neuronthemes.com/how-to-disable … ght-click/
but also:
"How to Copy Content from Right-Click Disabled Webpages?"
Last edited by homdax (2021-04-07 16:33:56)
Offline
homdax wrote:
...You asked about right-click and got an answer...
I did not ask about right-click. I clearly said I already have a script that prevents that and more.
My question is where in the files to put the script.
I don't care that anyone thinks it's futile, I care that I want to be helped.
I asked for help, not opinions.
So again, anyone who has trudged through this thread so far, if YOU know the actual answer, please share.
If you happen to read this far and don't know the answer, please move on.
Last edited by cbiweb (2021-04-07 17:10:26)
Offline
cbiweb wrote:
Why, when someone asks for help, do so many people feel they need to reply with unhelpful comments???
Probably because often enough people asking for such thing are not aware that it doesn't prevent anything but the dumbest approach even if it was correctly implemented.
Offline
Zentalquabula wrote:
https://piwigo.org/ext/extension_view.php?eid=582
Thank you, Zentalquabula! That's super helpful and works perfectly!
Offline