1
   

Preventing Select/Copy messages of a specific topic

 
 
turna
 
Reply Tue 2 Aug, 2005 05:09 am
Hello

is there any way to do this? We want to disallow select/copy options on some topics only not all forum.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 1,063 • Replies: 7
No top replies

 
Craven de Kere
 
  1  
Reply Tue 2 Aug, 2005 04:09 pm
You would need to insert some javascript for particular topics. And the javascript would likely be browser specific (usually they only work on IE and not Firefox etc).

And given that this is done client-side it can be defeated by the average user within 30 seconds if they are told how to turn off javascript.

In short, this is not a worthwhile endeavor for most sites (and one I can't justify the time to work on myself).

But if you really want to do it, here's how.

1) Find/write a javascript that disables selection/copy. I suspect you may not have the ability to do this with many browsers.

2) Use scripting to insert this script only in certain topics. Use a database field to determine which topics.
0 Replies
 
turna
 
  1  
Reply Wed 3 Aug, 2005 04:36 am
Thank you
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 3 Aug, 2005 08:39 pm
Here is an example of the javascript side of it:

http://javascript.internet.com/page-details/no-right-click.html
0 Replies
 
turna
 
  1  
Reply Fri 5 Aug, 2005 08:33 am
since this is not working with firefox (as you mentioned) it will be not ok for me. Thank you for your help.
0 Replies
 
nighthawk
 
  1  
Reply Sat 6 Aug, 2005 11:27 am
alternatively you you could display the title as an image rather than text, that will prevent copy/paste of a topic.

PHP has some very simple functions that will allow you to genenate images on the fly.
0 Replies
 
turna
 
  1  
Reply Sun 7 Aug, 2005 01:09 am
Sounds like good man! do you have any advice about script or php code to convert text to image?
0 Replies
 
nighthawk
 
  1  
Reply Sun 7 Aug, 2005 09:18 am
its pretty straight forward......You need to put all the code to actually generate the image into a PHP file by itself, this file should then define its output as an image, and cannot output any text (so dont put any "echo"s in there..)

In your forum code you would then link in the image as follows:

Code:
<img src='generateImage.php?text=Text to convert to string'>


Just simply pass in the text you need to use in the image (ie the topic title).

The php file "generateImage" will then look something like this:

Code:
$text_to_display = $_GET["text"];
$image = ImageCreateTrueColor(200,20); // create an image of specified size
$white=ImageColorAllocate($image,255,255,255); // create a white colour to use as a background colour
$black=ImageColorAllocate($image,0,0,0); // text colour

ImageFilledRectangle($image,0,0,200,20, $white); // fill in the background colour

ImageString($image,2,2,10,$text_to_display,$black); // i think the first number is size of text, other two are position to start displaying text

// finally.......display image

Header('Content-type: image/png');

ImagePNG($image);



I havent checked the above code works, but its taken from a file i wrote so should be fine.Might need to play around with the text locations etc to make sure the text displays properly!
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » Preventing Select/Copy messages of a specific topic
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/02/2024 at 05:07:12