TinyPortal

Development => Block Codes => Topic started by: akulion on September 25, 2006, 11:55:36 AM

Title: Anti-Theft Block
Post by: akulion on September 25, 2006, 11:55:36 AM
Sick of people stealing your images?  :tickedoff:

Tired of having your forum posts and content copied?   :'(

Well then this is for you....

Demo (http://path-to-peace.net/misc/anti_theif.html)

It will cause a hinderance for people to right click or copy images or text from your page. Making it a whole lot more difficult for them to steal stuff.

Install:

Create a SCRIPT block (a side block preferrably one which is visible in all sections of your site)

Insert this code into it:


<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>



Activate and enjoy.

Aku

Team Edit: To correct spelling in title.
Title: Re: Anti-Theif Block
Post by: stormlrd on September 25, 2006, 12:14:40 PM
Nice one
Title: Re: Anti-Theif Block
Post by: rctxtreme on September 25, 2006, 12:16:11 PM
Hooray, Dynamic Drive finally made it work with FF
Title: Re: Anti-Theif Block
Post by: Porky on September 25, 2006, 12:18:36 PM
wow they even made the space bar release command inop as welll really good job
Title: Re: Anti-Theif Block
Post by: akulion on September 25, 2006, 12:23:05 PM
there is another bit of code im looking for

i saw it on a page recently

it disables viewing of page source in the persons browser

If i find it ill add it here :up:
Title: Re: Anti-Theif Block
Post by: whoesa on September 25, 2006, 12:36:42 PM
Very cool, thx!  ;)
Title: Re: Anti-Theif Block
Post by: JPDeni on September 25, 2006, 12:54:29 PM
If you get the "no viewing source" one going, make sure that whoever uses it disables it if they have problems on their site and ask for help. Viewing the source is the first step in troubleshooting for me.
Title: Re: Anti-Theif Block
Post by: akulion on September 25, 2006, 12:57:34 PM
no luck yet finding even any info about that one lol
Title: Re: Anti-Theif Block
Post by: dirt on September 25, 2006, 05:13:45 PM
very nice mod!  :up:
Title: Re: Anti-Theif Block
Post by: Mitchâ„¢ on September 25, 2006, 05:51:29 PM
This is a very cool block! Thanks!
Title: Re: Anti-Theif Block
Post by: Paulie on September 25, 2006, 06:49:44 PM
Oooh i like this......
Title: Re: Anti-Theif Block
Post by: Max on September 27, 2006, 01:05:09 PM

Yea pretty good script.. dosent stop you from viewing the source :P
Title: Re: Anti-Theif Block
Post by: akulion on September 27, 2006, 01:15:27 PM
yea i wasnt able to find the "stop source code" code

but still atleast this will slow the theif down lol
Title: Re: Anti-Theif Block
Post by: Xarcell on September 27, 2006, 03:33:03 PM
one major problem with these kind of scripts. It also keep you from highlighting/copying text.

I guess it would be good for articles, keep people from stealing copyrighted content as well.
Title: Re: Anti-Theif Block
Post by: akulion on September 27, 2006, 03:49:33 PM
yea that can be pretty annoying for webmasters especially who may need to right click or copy cetain text

but then again everything has a price i guess
Title: Re: Anti-Theif Block
Post by: IchBin on September 27, 2006, 05:32:15 PM
I have a firefox extension that can turn javascript off on the tab. I also run the no script extension that doesn't allow scripts to run on a site unless I allow it. I love having a browser that is so customizable. :)
Title: Re: Anti-Theif Block
Post by: akulion on September 27, 2006, 11:36:18 PM
yea firefox is the best

especially considering the last IE bug that allowed 1000's of peoples compters to get hacked...it was on BBC today
Title: Re: Anti-Theif Block
Post by: Jump1979man on September 28, 2006, 02:41:07 AM
this works pretty good but you can still however hover over some images and the windows box shows up in the top left of the image and you can save, print, send the image through email, and open my images folder......
Title: Re: Anti-Theif Block
Post by: akulion on September 28, 2006, 02:45:08 AM
Quote
this works pretty good but you can still however hover over some images and the windows box shows up in the top left of the image and you can save, print, send the image through email, and open my images folder......

ive modified the script in the main post (post #1) to prevent the image tool bar from popin up

try it and lemme know
Title: Re: Anti-Theif Block
Post by: rctxtreme on September 28, 2006, 07:46:45 AM
QuoteUsers may NOT, however, redistribute or repost/ resell for download any DHTML script found on Dynamic Drive. Redistribution is defined as re-offering our scripts for download in any fashion, whether on a competing web site, an application that generates code snippets, or a CD-ROM collection of CSS/JavaScript codes etc. Some examples of what is acceptable and what is not are:

    * Acceptable:
      -Use our DHTML scripts on any personal or commercial web site to aid in its functionality/ usability.
      -As a web designer, use our DHTML scripts in your paid projects for your client web sites.
      -As a software developer, use our DHTML scripts within a application/ program as part of its interface, such as a CSS menu being used as the program's navigation interface. The program itself can be distributable.

      In all cases above, the credit notice within the script must remain intact and unaltered.
    * Not Acceptable:
      -Put our DHTML scripts on another script library or webmaster type site for others to download.
      -Use our DHTML scripts in any type of service or application whereby our codes are part of the product offerings themselves.
      -Put our DHTML scripts in any other types of medium for direct redistribution, such as a CD-ROM that consists of, but not limited to, webmaster codes and web graphics.

Oh dear... you've broken the terms of use.
Title: Re: Anti-Theif Block
Post by: akulion on September 28, 2006, 12:57:36 PM
read the last part in "acceptable" I am guessing that applies to us as software developers:

Quote
As a software developer, use our DHTML scripts within a application/ program as part of its interface, such as a CSS menu being used as the program's navigation interface. The program itself can be distributable.

      In all cases above, the credit notice within the script must remain intact and unaltered.

After all we arent claiming their scripts as our own and all copyrights are left intact and distributed as part of block code snippets under which case as it says: The program itself can be distributable.
Title: Re: Anti-Theif Block
Post by: Jump1979man on September 28, 2006, 07:20:07 PM
Quote from: akulion on September 28, 2006, 02:45:08 AM
Quote
this works pretty good but you can still however hover over some images and the windows box shows up in the top left of the image and you can save, print, send the image through email, and open my images folder......

ive modified the script in the main post (post #1) to prevent the image tool bar from popin up

try it and lemme know


Yes that works....thanks.
Title: Re: Anti-Theif Block
Post by: Svaha on September 28, 2006, 08:43:01 PM
I gave this up, it's impossible to prevent people from copying your images/textfiles, for instance I have this little button on my browser 'enable right click', and what you see in your browser is also stored on you hard disk.
What I did is : some rewrite rules to prevent hot linking, images in a low quality so they are only good for internet use, an index file in every directory so you can't see a listing with your browser.. that kind of stuff.
Title: Re: Anti-Theif Block
Post by: akulion on September 28, 2006, 09:51:05 PM
:2funny: the determined theif will always get to u

believe me...ive had a few
Title: Re: Anti-Theif Block
Post by: Svaha on September 28, 2006, 11:03:54 PM
Hahaha, yes that is true
Title: Re: Anti-Theif Block
Post by: Joramilea on October 18, 2006, 02:57:54 AM
I must thank you for this!  I had javascript running on each page to disable the right click and was dreading how to move it to my new TP/SMF ran site.

Made a new block in the center. turned off title and stuff.... and I only have it active in articles that I don't want images copies or Hyperlinked from.

I know this doesn't stop them completely... but it does slow them down..  ctrl + print screen open in a new window.. it's a pain.  crop image...  have done this for tutorials for programs and it's a pain.. grabbing it from the source to hyperlink is also a pain to go through the code to look for the art you want to link to so you don't have to host it.  It's just a big pain.. but if someone really wants something off your site they will get it.  This stops the lazy people.

Thanks again for sharing this!
Title: Re: Anti-Theif Block
Post by: akulion on October 18, 2006, 08:07:13 AM
welcome :up:
Title: Re: Anti-Theif Block
Post by: superQ on October 20, 2006, 11:40:25 PM
I have no problem getting anything I want off the demo in the first post :o. I use Maxthon Browser mostly ;). How many people still use just IE :down:. Have that enable right click button,but don't need it to C+Paste the text.  :(
Title: Re: Anti-Theif Block
Post by: akulion on October 20, 2006, 11:44:01 PM
yea the script is more of a "deterrant" as opposed to a fool proof setup

There is always a way around everything lol
Title: Re: Anti-Theif Block
Post by: TolerancE on October 20, 2006, 11:48:11 PM
works like a charm!!!!
Title: Re: Anti-Theif Block
Post by: superQ on October 21, 2006, 12:24:35 AM
I doubt anyone will be stealing any of my stuff anyway---you, on the otherhand,got some real good stuff to steal.

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.free-animations.co.uk%2Fpeople_uniform%2Fimages%2Funiform_10.gif&hash=5645c765502bb711af2c0b21006c13ddab40e9dd)
Title: Re: Anti-Theif Block
Post by: akulion on October 21, 2006, 12:25:25 AM
well ive already been robbed several times lol
Title: Re: Anti-Theif Block
Post by: copter on October 30, 2006, 04:37:32 PM
Yup thats true >:(

And this is an excellent mod just what we need - some people are just too lazy to make their own things and thats what gets to me :tickedoff: especially after so much hard work goes into it
Title: Re: Anti-Theif Block
Post by: WarBirD on October 30, 2006, 05:52:17 PM
That is cool but I think i found a weakness. You know for Firefox the plugin NO SCRIPT, its actually a good script. Blocks Java Scripts on Sites I surf, until I allow it. Some sites really do have shitty things in JAVA there.

So, I got to your example page and I could save it all, until I allowed the JAVA script on your Site. So, I guess thats easy to avoid then. Or do you have a solution for that ?

WarBirD
Title: Re: Anti-Theif Block
Post by: akulion on October 30, 2006, 05:59:07 PM
Quote from: Aku on October 20, 2006, 11:44:01 PM
yea the script is more of a "deterrant" as opposed to a fool proof setup

There is always a way around everything lol

thats the bottom line really lol
Title: Re: Anti-Theif Block
Post by: edgeonline on December 08, 2006, 09:22:35 PM
definately a deterrant. Peeps will just google and find the trick to get around it if they don't already know. But for the lazy, it works great!
Title: Re: Anti-Theif Block
Post by: mandos on December 08, 2006, 10:19:26 PM
you do know that it is very very very easy to "steal" the text or the picture by looking at the source code of the page???

I mean, nice script, but I find it useless!
After all once I put something online I know there is a very good chance that someone will copy it!

My opinion :)
Title: Re: Anti-Theif Block
Post by: G6Cad on December 08, 2006, 10:21:18 PM
By looking at the sourse code wont allowe you to download it, the code are just text, not the image itself, you might have the path, but still cant download the image ;)
Title: Re: Anti-Theif Block
Post by: mandos on December 08, 2006, 10:27:57 PM
i'm pretty sure it easy to download the image once you have it's path

http://path-to-peace.com/60.gif ;)
(right click on it, and save it! or wget/flashget it!)

PS: I already had that image... :P
Title: Re: Anti-Theif Block
Post by: Thurnok on December 09, 2006, 01:46:06 AM
Actually, its easier than many people realize.  By viewing the image, you in fact already have it!  It's in your browser cache, and you can simply copy it from there to any directory with any filename you like.

There are in fact, a number of utilities that allow you to view your browser of choice's (IE, FF, Mozilla, Opera, etc) cache in a multiformat viewer/editor.
Title: Re: Anti-Theif Block
Post by: darakhshan on December 12, 2006, 09:44:43 PM
I installed this mod but it does not seem to be a good idea
why because the copy and paste option inside posting is also desable
some people might copy some thing and want to pase it here and send it
but the forum is locked. I am using some thing similary in phpbb but as I can put it inside templete only the forum is effected and not the posting
any way we can over come that?
Title: Re: Anti-Theif Block
Post by: G6Cad on December 12, 2006, 09:58:24 PM
Thats the reason we dont use it our selfs  :2funny:
Title: Re: Anti-Theif Block
Post by: darakhshan on December 12, 2006, 10:09:38 PM
yes it is really funy ;D
Title: Re: Anti-Theif Block
Post by: akulion on December 13, 2006, 03:10:09 AM
:2funny: I remember when I first used this on my forum..there was a riot people couldnt copy and paste lol
Title: Re: Anti-Theif Block
Post by: OzButcher on December 30, 2006, 10:59:30 AM
'File > Save page' and you have most of the site and all images in a folder. :( Would be good if this and the source could be turned off.
Title: Re: Anti-Theif Block
Post by: vanguard on February 27, 2007, 04:31:15 AM
Just make the script in a block NOT visible in the forums.

Thank you for the script!!!!!!!
Title: Re: Anti-Theif Block
Post by: ianus on February 27, 2007, 10:24:11 AM
Greetings!

Would it be possible to add something like
if user is guest - activate, else do nothing

I like the idea in general, but I need the right klick to keep my own page up to date
Title: Re: Anti-Theif Block
Post by: IchBin on February 27, 2007, 05:35:35 PM
You'd have to make it a phpbox type.

if ($context['user']['is_guest'])
{
echo '<all code goes in between these two apostrophe's>';
}
Title: Re: Anti-Theif Block
Post by: ianus on February 28, 2007, 06:04:21 AM
Greetings!

Now itââ,¬â,,¢s official! You share your knowledge with the most stupid person on this planet.

I copied your php, have a look at the frontpage. Nothing happens.
Of course, itââ,¬â,,¢s php, so switch from scriptbox to php box. Nothing happens.
Next try, creating a thief.html with all the code in it and try include http: etc ââ,¬â€œ nothing.

Well and? I do all the testing as admin and forgot to log out. Brilliant ianus really!

Your code is working of course. Thanks a lot for it.
Title: Re: Anti-Theif Block
Post by: babjusi on May 14, 2007, 07:40:35 PM
thank you for this, I needed s.th. like this for my site
Title: Re: Anti-Theif Block
Post by: dfm on August 21, 2007, 08:02:48 AM
Quote from: korea on December 12, 2006, 09:44:43 PM
I installed this mod but it does not seem to be a good idea
why because the copy and paste option inside posting is also desable
some people might copy some thing and want to pase it here and send it
but the forum is locked. I am using some thing similary in phpbb but as I can put it inside templete only the forum is effected and not the posting
any way we can over come that?

Hi all, from one very NON technical person...is there a way to enable paste but disable copy ...because as mentioned in the above post....although this stops copying, it also stops the vast majority of our users pasting things they want to bring IN to the forum!


Thank you in anticipation.
Title: Re: Anti-Theif Block
Post by: IchBin on August 21, 2007, 10:18:20 PM
ctrl + c = copy, ctrl + v = paste. :)

I've never seen such a script. You'd have better luck searching at script sites for such things.
Title: Re: Anti-Theif Block
Post by: dfm on August 22, 2007, 12:23:02 AM
Thank you IchBin.... :)
Title: Re: Anti-Theif Block
Post by: Craven on November 08, 2007, 07:03:27 PM
Quote from: IchBinâ,,¢ on February 27, 2007, 05:35:35 PM
You'd have to make it a phpbox type.

if ($context['user']['is_guest'])
{
echo '<all code goes in between these two apostrophe's>';
}

What if I don't want guest or regular members stealing the code but admins can use the feature?
Title: Re: Anti-Theif Block
Post by: IchBin on November 08, 2007, 10:56:37 PM
Try this:

global $context;

if ($context['user']['is_guest'] && !$context['user']['is_admin'])
echo 'all the code in between here';
Title: Re: Anti-Theif Block
Post by: Craven on November 08, 2007, 11:41:40 PM
This works good... However I would like to block everyone but admins and a few select member groups.

Because what you have there is only blocking a guest
Title: Re: Anti-Theif Block
Post by: pass25 on November 11, 2007, 01:33:03 AM
Hi,

Where can i create those parameters? Im new in smf, and i dont now here can i put that code!

If someone can explain to me, i apreciate!

Thank!
Title: Re: Anti-Theif Block
Post by: IchBin on November 11, 2007, 01:54:47 AM
Create what parameters? Please be specific pass25.

To add additional groups you'll need to define an array.

global $context, $user_info;
$groups = array(5,7);

if ($context['user']['is_guest'] || array_intersect($groups, $user_info['groups']))
echo ' your stuff here';


5 and 7 are the group ID's that this will show for. So whichever group ID you don't want it to work on, don't add the number to the array.
Title: Re: Anti-Theif Block
Post by: pass25 on November 11, 2007, 02:05:54 AM
Hi,

Sorry, i dont now where to put this:

Quote<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>

and this:

Quoteglobal $context, $user_info;
$groups = array(5,7);

if ($context['user']['is_guest] || array_intersect($groups, $user_info['groups']))
echo ' your stuff here';

In which file do i add those codes? (Example index.themplate.php,...)

Thanks
Title: Re: Anti-Theif Block
Post by: IchBin on November 11, 2007, 02:42:50 AM
Please read the first post. It tells you specifically where to put the code. The second code is what you would use to only display it for certain membergroups. You put the first piece of code where I typed "your stuff here". Since we are adding PHP to this, you'll need to put it all in a phpbox.
Title: Re: Anti-Theif Block
Post by: Craven on November 11, 2007, 04:10:54 AM
Here is the error message that I get now

Parse error: parse error, unexpected T_STRING, expecting ']' in /home/content/B/i/l/BillBarberJr/html/wetworks/Sources/Load.php(1749) : eval()'d code(35) : eval()'d code on line 4
Title: Re: Anti-Theif Block
Post by: Dragooon on November 11, 2007, 04:14:52 AM
Use it in a Script box not PHP Box.
Title: Re: Anti-Theif Block
Post by: Craven on November 11, 2007, 08:55:25 AM
That wouldn't work as I'm wanting to use php to restrict access to certain member groups and allow access for certain member groups.

For instance:
I want to restrict everyone but admins and one other membergroup from having the ability to copy and paste or right click...

But thanks for your help anyways...
Title: Re: Anti-Theif Block
Post by: pass25 on November 11, 2007, 01:51:42 PM
Hi,

Sorry! But i am new in this stuff, and some things i dont now here to put them!

Tank´s, now is working fine!

Title: Re: Anti-Theif Block
Post by: pass25 on November 12, 2007, 05:23:57 PM
Hi,

What do you meen with "your stuff here"?

Quoteglobal $context, $user_info;
$groups = array(5,7);

if ($context['user']['is_guest] || array_intersect($groups, $user_info['groups']))
echo ' your stuff here';

Thanks
Title: Re: Anti-Theif Block
Post by: IchBin on November 13, 2007, 01:03:56 AM
Well, if you want something to show for guest, and the selected user groups, you put whatever code you want where it says "your stuff here" :). In other words, put all your javascript code in between the single quotes.
Title: Re: Anti-Theif Block
Post by: pass25 on November 13, 2007, 12:27:06 PM
Hi,

Is there a way to define wich users can or not be afected by the script?

Some can be normaly in the forum, and some canot use the right buton in the mouse to copy or paste?

Because the forum is new, and i only have 36 members, but i now there are 3 users who cames to my forum only to copy! Because they have forums too!

I try to use the script in the mod global headers and footers and works fine in all forum!

Because a only have the portal in use!

Thanks!
Title: Re: Anti-Theif Block
Post by: IchBin on November 13, 2007, 01:58:44 PM
Change the numbers to match the user ID of the users you need. Add more in the same format if needed.

if ($context['user']['id'] == 13 || $context['user']['id'] == 20 || $context['user']['id'] == 28)
echo 'your javascript here';


Title: Re: Anti-Theif Block
Post by: Dragooon on November 13, 2007, 02:03:49 PM
@IchBin, I think you said it reversed what he/she was asking

Something like
if ($context['user']['id'] != 13 || $context['user']['id'] != 20 || $context['user']['id'] != 28)
echo 'Your JS Here';

If I get it correctly.
Title: Re: Anti-Theif Block
Post by: IchBin on November 13, 2007, 02:12:58 PM
He's asking to only do it for 3 users. Hence the reason I didn't use the !.
Title: Re: Anti-Theif Block
Post by: Dragooon on November 13, 2007, 02:18:41 PM
Oh... I only saw the first para :P
Title: Re: Anti-Theif Block
Post by: pass25 on November 13, 2007, 03:04:28 PM
Hi,

And i put that before or afther this ?


Quote<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>

thanks!
Title: Re: Anti-Theif Block
Post by: Dragooon on November 13, 2007, 03:14:10 PM
Use
if ($context['user']['id'] == 13 || $context['user']['id'] == 20 || $context['user']['id'] == 28)
echo '<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>';

Make sure to replace the IDs
This is untested
Title: Re: Anti-Theif Block
Post by: pass25 on November 13, 2007, 03:25:51 PM
Hi,

I tried to put like you say! The script works but the permissions dont!

It apears in all windows
Quote"if ($context['user']['id'] == 13 || $context['user']['id'] == 20 || $context['user']['id'] == 28)
echo '<head>"

Title: Re: Anti-Theif Block
Post by: IchBin on November 13, 2007, 03:56:41 PM
Show your code that you are using please.
Title: Re: Anti-Theif Block
Post by: pass25 on November 13, 2007, 04:01:01 PM
hi,

I put this one!

Quote from: Dragooon on November 13, 2007, 03:14:10 PM
Use
if ($context['user']['id'] == 13 || $context['user']['id'] == 20 || $context['user']['id'] == 28)
echo '<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>';

Make sure to replace the IDs
This is untested
Title: Re: Anti-Theif Block
Post by: IchBin on November 13, 2007, 04:08:10 PM
Well I don't know what you are doing wrong. Copying and pasting that into a block for me works just fine. Are you using a php block type?
Title: Re: Anti-Theif Block
Post by: pass25 on November 13, 2007, 04:16:51 PM
Hi,

No, i was using as script block! That seems to be the problem!

But in the first post, says
QuoteInstall:

Create a SCRIPT block (a side block preferrably one which is visible in all sections of your site)

In a PHP block type it works fine, thanks!
Title: Re: Anti-Theif Block
Post by: globalreman on November 15, 2007, 05:44:40 PM
Thanks!  I just tried it, and it works! I know its not foolproof, but its really nice! -Thanks -Aaron  ;D
Title: Re: Anti-Theif Block
Post by: FERNSIDEâ„¢ on February 02, 2008, 09:08:47 AM
LOL..

This is sure to get a few of my users ticked off!!   LOL    I love it!! >:D

Is there a way for this to work throughout the whole site??

I have this in the forum, but to use it for every thread/topic/post etc, I'd have to create a block for each one yeah??     If so, anyway around this so it covers the whole site??
Would be a great laugh..  LOL

I realise its limited, and will not completely stop people copying things.
But mate..   The laugh we'll have when people start posting about it will be priceless!!!  LOL

Thanks in advance  :)
Title: Re: Anti-Theif Block
Post by: IchBin on February 02, 2008, 03:55:27 PM
You can put the code in your index.template.php (in the <head> section) manually and it will be on all pages.
Title: Re: Anti-Theif Block
Post by: ACE420 on February 23, 2008, 08:55:58 PM
This is nice tired of peps stealing links and posts   >:( this works grate  ;D
Title: Re: Anti-Theif Block
Post by: tick on February 23, 2008, 09:15:12 PM
This is a neat deterrent.  But very easy to get around if someone has some basic knowledge.   
Title: Re: Anti-Theif Block
Post by: Smoky on February 23, 2008, 10:14:17 PM
trying it out right now!! thanks tons and tons!!!  :P :D

ok i tried it  :2funny: but now i cant highlight any text if i wanted to  :o :2funny:
Title: Re: Anti-Theif Block
Post by: FERNSIDEâ„¢ on February 24, 2008, 01:42:48 AM
LOL

Im pretty sure there is a permissions code somewhere in this thread.
Just have a quick skim through :)
If there isnt...     Sorry :D   lol

If I needed to copy n paste something, I used ctrl + c(to copy) and ctrl + V to paste.  If you edit the post/block etc, you can highlight what you need.
There are other means to do this, but this way seems to be the easiest :)

Had a great laugh with this.
Title: Re: Anti-Theif Block
Post by: tick on February 24, 2008, 01:54:09 AM
All you have to do is disable javascript in your browser window and you can right click on it. :P
Title: Re: Anti-Theif Block
Post by: Rafferty on February 24, 2008, 02:06:31 AM
Well, heres my problem: I have had the anti theif script working fine for a long time now in a script block.

When I add Ichbin's addition
Quoteglobal $context, $user_info;
$groups = array(5,7);

if ($context['user']['is_guest] || array_intersect($groups, $user_info['groups']))
echo ' your stuff here';

Change the box to PHP, I get the following error:
QuoteParse error: syntax error, unexpected T_STRING, expecting ']' in /home/www/xxxxxxxx.org/forum/Sources/Load.php(1859) : eval()'d code(35) : eval()'d code on line 4
Title: Re: Anti-Theif Block
Post by: tick on February 24, 2008, 02:17:49 AM
Post the full code you are using in the [ code ]  [ /code ] brackets.  Without the spaces. 
Title: Re: Anti-Theif Block
Post by: Rafferty on February 24, 2008, 02:31:46 AM
global $context, $user_info;
$groups = array(1,2,11,19);

if ($context['user']['is_guest] || array_intersect($groups, $user_info['groups']))
echo '<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>';
Title: Re: Anti-Theif Block
Post by: tick on February 24, 2008, 03:52:46 AM
Try it this way.

global $context, $user_info;
$groups = array(1,2,11,19);

if ($context['user']['is_guest'] || array_intersect($groups, $user_info['groups']))
echo '<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>';
Title: Re: Anti-Theif Block
Post by: Smoky on February 24, 2008, 06:10:48 AM
thanks guys lol.. i just wanted to play with it.. if someone wants to kype my lil images its ok.. i know the good ones will be watermarked anyway so.. but this is a kewl script.. thanks again!!  :D
Title: Re: Anti-Theif Block
Post by: Rafferty on February 24, 2008, 12:42:37 PM
QuoteTry it this way.

No Errors but the listed groups cannot copy, no one can
Title: Re: Anti-Theif Block
Post by: tick on February 24, 2008, 07:57:26 PM
This should do it.  I tested it this time :)

global $context, $user_info;
$groups = array(1,2,11,19);

if ($context['user']['is_guest'] || array_intersect($groups, $user_info['$groups']))
echo '<head>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script type="text/javascript">

/***********************************************
* Disable select-text script- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script></head>
<body>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(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>
</body>';
Title: Re: Anti-Theif Block
Post by: Rafferty on February 25, 2008, 02:40:40 AM
No success, no errors but now everyone can right click/copy
Title: Re: Anti-Theif Block
Post by: tick on February 25, 2008, 02:46:36 AM
I checked this logged and unlogged and it worked fine for me.  Are you sure you have the right groups numbers in the array?





edit:  I am not a coder so I am just trying things as you would do.  If it is indeed not working right maybe someone would step in and save us.  :)
Title: Re: Anti-Theif Block
Post by: IchBin on February 25, 2008, 02:52:35 AM
How did you get your member group ID numbers Raf? If you'd like I can take a look at it for you. PM the info if you'd like.
Title: Re: Anti-Theif Block
Post by: Rafferty on February 25, 2008, 02:59:54 AM
Absolutely, I use the same groups in the SMF Mod MCLegendII 1.1 which works fine.

The original anti thief snippet also works fine alone but when I add the

global $context, $user_info;
$groups = array(1,2,11,19);

if ($context['user']['is_guest'] || array_intersect($groups, $user_info['$groups']))
echo


It messes up.

I appreciate your help tyvm
Title: Re: Anti-Theif Block
Post by: JPDeni on February 25, 2008, 03:38:10 AM
What sort of block are you using? If you're using IchBin's code, you need to use a php block.
Title: Re: Anti-Theif Block
Post by: Rafferty on February 25, 2008, 03:53:28 AM
php
Title: Re: Anti-Theif Block
Post by: FERNSIDEâ„¢ on May 10, 2008, 03:18:50 AM
Try this mate

global $context, $user_info;
$groups = array(1,2,11,19);

if ($context['user']['is_guest'] || array_intersect($groups, $user_info['groups']))
echo '

ADD ALL OF THE CODE HERE


Hope it works :)

EDIT:   Ooooppss sorry, my baad.
I just saw that this was posted earlier  lol
I think he is getting the post count member groups, and the member groups mixed.
Im not sure how he, or you have this set, but my regular members(post count, not staff) fall under their own group. So have their own number.
Yet if I add the post count membergroups number(say the admin only made 5 posts, and falls in this bracket), then those within this bracket, would be barred!!

If you can understand what I mean, then plz translate lol
Im tired and this may not have come out right :P

Ive attached an image from smf.
Is this comment ok?  If not, I'll remove it.
Thought I'd better ask.
Title: Re: Anti-Theif Block
Post by: Rafferty on May 12, 2008, 02:40:03 AM
Thanks Sabre, yes I'm using the member groups and not the post counted groups. Is that incorrect?
Title: Re: Anti-Theif Block
Post by: FERNSIDEâ„¢ on May 12, 2008, 07:55:56 AM
Hi mate  :)

I am by no means knowledgeable in the coding arena, and only go by trial n error, and through reading the knowledge provided in past posts.

No that thats outta the way, lets get started!! lol

Ok mate, the easiest way(for meee :D) is to add all the "post group numbers" you want stopped, where it states

$groups = array(1,2,11,19);

And thats it bud!!    Mission accomplished without any further coding.
Go have a beer, and marvel at its simplicity!! lol

So Here's the code to add, some of the previous ones didnt work for me:

global $context, $user_info;
$groups = array(ADD POST MEMBER GROUPS HERE  eg. 1, 2, 3, etc etc etc);

if ($context['user']['is_guest'] || array_intersect($groups, $user_info['groups']))
echo '

ADD THE REST OF THE CODE HERE


There is no doubt an easier/ more efficient way to do this, but until the knowledgable speak up, this is what we have  ;)

You could also leave the staff member groups in for good measure :)

Good luck mate  :)

Title: Re: Anti-Theif Block
Post by: thefley on May 12, 2008, 01:24:36 PM
How would I do this in just the SMF pro gallery to keep others from images copies or Hyperlinked from?
Title: Re: Anti-Theif Block
Post by: IchBin on May 12, 2008, 03:07:03 PM
If you are indeed using the SMF gallery mod this code should only work in the gallery.

global $context, $user_info;
$groups = array(ADD POST MEMBER GROUPS HERE  eg. 1, 2, 3, etc etc etc);

if (isset($_GET['action']) && $_GET['action'] == 'gallery'){

    if ($context['user']['is_guest'] || array_intersect($groups, $user_info['groups']))
         echo 'ADD THE REST OF THE CODE HERE BETWEEN THE single quotes';
}
Title: Re: Anti-Theif Block
Post by: Rafferty on May 14, 2008, 02:03:09 AM
TY guys it seems this wouldnt work in my case. Access throughout my forum is based on Membergroup and not post count groups.
Title: Re: Anti-Theif Block
Post by: IchBin on May 14, 2008, 02:12:36 AM
It should work not matter group type. All it checks is the Group ID number. Did you try it?
Title: Re: Anti-Theif Block
Post by: Rafferty on May 14, 2008, 02:20:13 AM
yes as i posted before it doesn't block anyone no matter what groups i put in
Title: Re: Anti-Theif Block
Post by: IchBin on May 14, 2008, 02:38:24 AM
Please post your code.
Title: Re: Anti-Theif Block
Post by: Rafferty on May 14, 2008, 02:44:35 AM
same as i previously posted here:

http://www.tinyportal.net/index.php?topic=8937.80
Title: Re: Anti-Theif Block
Post by: IchBin on May 14, 2008, 02:47:08 AM
Quote from: Rafferty on February 24, 2008, 12:42:37 PM
QuoteTry it this way.

No Errors but the listed groups cannot copy, no one can

Judging by this comment you have me a little confused. Are you trying to block access to the listed groups from copying, or are you trying to allow. The code that I've posted would block access to the said groups. So if you don't want those groups to be blocksed, you need to add everyone to the array that you want to be blocked.
Title: Re: Anti-Theif Block
Post by: Rafferty on May 14, 2008, 02:54:32 AM
so sorry, im a little tired. Yes, it doesnt matter what groups i put in, no one can copy if i have the block active. in other words all groups are blocked no matter what i put in
Title: Re: Anti-Theif Block
Post by: IchBin on May 14, 2008, 02:22:05 PM
Well I don't know what to tell you Rafferty. This code in Ticks post worked just fine for me.
http://www.tinyportal.net/index.php?topic=8937.msg180135#msg180135
Title: Re: Anti-Theif Block
Post by: Rafferty on May 14, 2008, 02:26:32 PM
Thx very much for your help Ich, I guess it just wont work for me
Title: Re: Anti-Theif Block
Post by: IchBin on May 14, 2008, 02:50:02 PM
IF you'd like Rafferty, I could take a look at this sometime today I think. Feel free to PM me a temp admin account if you would like.
Title: Re: Anti-Theif Block
Post by: Ianedres on May 15, 2008, 01:03:02 AM
Can someone spell 'thief' correctly in the topic?  buck2

* Has it really been incorrectly spelled since September '05?? - May be why some search queries come up empty! *
Title: Re: Anti-Theif Block
Post by: bfeo on August 28, 2008, 12:55:12 AM
Lol.  At first I thought it didn't work, until I realized that my script blocker was letting me copy everything.

However, if someone wants the info that bad, they could just save the page.
Title: Re: Anti-Theft Block
Post by: jayc7176 on November 22, 2008, 12:45:15 PM
Thanks for this one - this is Nice.

   Its was bit of a headach as its always active for the Admin.
so i just use the other account to post - i wish there was a way to turn it off for admin like you can for other member groups.
Title: Re: Anti-Theft Block
Post by: ianus on November 23, 2008, 08:56:26 AM
try this

http://www.tinyportal.net/index.php?topic=8937.msg192705#msg192705
Title: Re: Anti-Theft Block
Post by: alan19792008 on January 20, 2009, 12:16:42 PM
is there a snippet of code i can add to this to make a popup saying something like "Sorry but that function is not allowed"
Title: Re: Anti-Theft Block
Post by: FERNSIDEâ„¢ on May 16, 2009, 03:02:46 AM
There is a mod that does exactly that at smf