vForums Support > Programming & Coding :: Code Requests & Support :: > [F] Sopt Copying and Pasting[Support]

[F] Sopt Copying and Pasting[Support] - Posted By Samoht™ (goakyl) on 23rd Mar 08 at 2:48am
Was Posting by Slushiie™ -- Today at 1:52am
Quote:
This will stop people copying and pasting from the posts on your board...

Put it in your Global Footer....


<script ltype="text/javascript">
<!--
/*
Stop copying and pasting posts
Copyright © Chase 2007-2008
Please keep this header intact
*/

if(location.href.match('action=display'))
{
var posts = document.getElementsByTagName('font');
for(t=0; t<posts.length; t++)
{
if(posts[t].innerHTML.match('google_ad_section_start'))
{
posts[t].parentNode.onmouseup = function(){this.onmousemove = '';}
posts[t].parentNode.onmousedown = function(){var c = 0;var post = this.innerHTML;this.onmousemove = function(){c++;if(c<2){alert('No copying please');this.innerHTML = post;}}}
}}}
// -->
</script>


Was posted by Wrighty
Quote:
This code wont work on vF.


--
I had tested this code on my test board, and it worked perfectly. Yes, it does work with vForums.

Re: Sopt Copying and Pasting[Support] - Posted By Marc (cr0w) on 23rd Mar 08 at 2:50am
I see no reason whatsoever as to why this would work on VF; no URL on VF uses "action=display", it would be "/action/view_topic/". {Wink}

Also, the code seems to be in there twice. There's a few spelling errors, too. {Wink}

Can I get a link to the test board where this works?

Note: In the future, to link to a user's profile, simply use [user][/user] tags. {Wink}

Ross
Marc
Samoht™

{Smile}

Re: Sopt Copying and Pasting[Support] - Posted By Samoht™ (goakyl) on 23rd Mar 08 at 2:54am
Yes..I accidently put the code twice. {Rolleyes}
Test Board... Also, when I first put in the code it worked, for some odd reason, then it quite working...So it doesn't work now..Im pretty sure it was small glitch in the system. {Tongue Out}

Re: Sopt Copying and Pasting[Support] - Posted By Marc (cr0w) on 23rd Mar 08 at 2:59am
Anyway, to fix it:

Fix the URL check, for starters. {Wink}

Rather than looking for a font tag, just look for a TD.

Rather than checking for the "google_ad_section_start", simply look for a TD with a className of "post".


That's all I can spot off the bat that needs to be changed, so try that and we'll see if it works. {Smile}

Re: Sopt Copying and Pasting[Support] - Posted By Samoht™ (goakyl) on 23rd Mar 08 at 3:19am
Mkay..Thanks Crow, I'll get on that right away. Smiley

Re: Sopt Copying and Pasting[Support] - Posted By Marc (cr0w) on 23rd Mar 08 at 3:23am
No worries. {Smile}