Jump to content

richt click disable


Guest

Recommended Posts

Hi!

I'd like to disable the "save image as" option from the mouse ricght click button. Any sugestions where i can find tuturial for that?

doesn't seem to find it anywhere... Probably not searching properly. Any tip would be apreciated...

Tkx

Pardon__me

Link to comment
Share on other sites

Just put this into your header.inc.php (somwhere between the <head> and </head>

Ie right under the:

<style type="text/css">

<!--

@import url(<?echo"$site_url";?>/admin/style.css);

-->

</style>

put:

<script language="JavaScript1.2">

<!--

var msg = "I am glad you liked my photos.";

if(document.layers) window.captureEvents(Event.MOUSEDOWN);

function no_click(e){

if (navigator.appName == 'Netscape' && ( e.which == 2 || e.which == 3))

{

  alert(msg);return false;

}

if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))

{

   alert(msg);return false;

}

}

window.onmousedown=no_click;

document.onmousedown=no_click;

//-->

</script>

But if somone with a little know how realy want to take sombodys photos, there is no way to stop them. (Worst case: they can use a screen capture.)

But this could work for the "beginners" or people that dont want to put any work into it... and you give people a signal, that you dont want them to take your photos

Link to comment
Share on other sites

i have disable right click on images installed on my site. This script prevents right clicks on images only.

Ideally you really want to only use this script if you have img src hotlink protection enabled on your site or really there is no use for it. As was mentioned previously, a screen cap can be taken if they really want it, but go through the source code on my site and find the html for an image and you're forbidden.

<script language="JavaScript1.2">



/*disable right click on images

*/



var clickmessage="These images are copyright mysite.com produced by whateversitemadethem.com. Use or manipulation of these images and the images of our affiliates without consent is prohibited. Please contact [email protected] to obtain copies."



function disableclick(e) {

if (document.all) {

if (event.button==2||event.button==3) {

if (event.srcElement.tagName=="IMG"){

alert(clickmessage);

return false;

}

}

}

else if (document.layers) {

if (e.which == 3) {

alert(clickmessage);

return false;

}

}

else if (document.getElementById){

if (e.which==3&&e.target.tagName=="IMG"){

alert(clickmessage)

return false

}

}

}



function associateimages(){

for(i=0;i<document.images.length;i++)

document.images[i].onmousedown=disableclick;

}



if (document.all)

document.onmousedown=disableclick

else if (document.getElementById)

document.onmouseup=disableclick

else if (document.layers)

associateimages()

</script>

Edited by asillyshopper
Link to comment
Share on other sites

Or use mozilla... I have no problem right clicking on any image and downloading it. Just tested that on asillyshopper's site. I get a warning pop-up message, but then I can continue with my download of the image.

Link to comment
Share on other sites

I am guessing that if they really wanted it, they can go through all the HTML of your site, then find where the image is located. Then type in http://yoursite.com/images/thepicture.jpg and bam, you have the picture...

chris...

Yes...... and most of this scripts only works in Internet Explorer.

Havent seen any for Opera yet ... not even one that gives a warning ......

:(

Link to comment
Share on other sites

I'm not worried about the uh...5% of the computing population that uses other-than IE or Netscape on a regular basis. :(

Nothing is full-proof but it's just useless to install the script if there's no hotlink protection enabled, all it does is cloud the spiders and crawlers from picking up the metatags if there's too much java jumbled in there...

Link to comment
Share on other sites

I'm not worried about the uh...5% of the computing population that uses other-than IE or Netscape on a regular basis. :o

I guess that makes me and booker unique, then ..... he 2,5% and me 2,5% :(

Well, i installed all the browsers i could find, because i do a lot of webpages, so i could se how they came out in diferent browsers....

And i "fell in love" with Opera. Small beautyfull and speedy and with and easy tab-browsing, popupblocking, mouse gestures, easy zooming and others ....

By the way, like your themes......

Link to comment
Share on other sites

Just randomly,

How does one create a site and code it to make it compatible with the popular browsers?

In FireFox for example, pages created using MSFP render badly. (Text size, location and image animation, etc.)

Would I have to use something like Mozilla Composer?

Edited by asillyshopper
Link to comment
Share on other sites

I used the Netscape Composer when I first stared learning how to program HTML. So I probably program directly for mozilla now because of that. And IE generally reads mozilla-styled pages properly, so I've never had any problems.

Mind you, I don't have Opera installed so can't check my webpages against that one. I do use a Mac besides my Windows machine, and there is some fiddling involved with getting Safari to look right. but Mac's Netscape and IE work basically the same as Windows's.

Link to comment
Share on other sites

Wel ..... all browsers would work fine as long as you dont use browser-specific extensions dhtml, Microsoft ActiveX controls and so on... but old fasion clean html.

Frontpage is probably good enough, havent tested it a lot...... but you should be aware of that especially when you are making tabels there, some browsers dont read heights of tabels and cells in %..... so in some cases you need to put a "spacer" in them or they wil "colapse".

So the answer is often.... severe use of spacers :(

W3C (World Wide Web Consortium) and ECMA (European Computer Manufacturer's Association ) have been trying to make a standard.

If you want to test your page for standard , you can do it for free here:

http://validator.w3.org/

It will tel you line for line what is wrong ......

Their main page is here, wit a lot of information:

http://www.w3.org/

What i normally do, is that i make the pages in html, as i think it will work, than look over it in other browsers, and makes the nessesary changes.

But i think it is easier to get experience with it, and to remember the changes, by using a "non wysiwyg" editor....

Link to comment
Share on other sites

That helps. Thank you.

Actually on -->this page

Viewing it in IE is much different than viewing it in FireFox. I was disappointed to see in firefox that the link underlines are forced, and the DHTML comes out a bit funky...not to mention the marquee, which for some reason in firefox...the scroll keeps looping, and it's standard html.

I wanted to avoid making images out of the navigation buttons, but it looks like I'll have to, to make it more compatible. Kind of defeats the purpose of trying to keep load times to a minimum when I feel like a browser has just forced me to make a pages more image-based...and try to keep it looking stylish. :(

I dumped DreamWeaver quite a while back since using FP allowed me to build faster. I may just have to go back to it so the coding is a lot cleaner. I've been grumbling about it all night. meh.

Link to comment
Share on other sites

Just took a look at your coding on that page. For your links, you can still get rid of the underline easily enough without resorting to using images.

Instead of using <span> for the style and color

<a href="http://www.giftideascentral.com/shop_online/view_doc.php?view_doc=1">

<span style="color: #000000; text-decoration: none">

Promotions</span></a>




do this:




<a style="text-decoration: none" href="http://www.giftideascentral.com/shop_online/view_doc.php?view_doc=1"><font color="#000000">

Promotions</font></a>

As for the continuously scrolling header - no idea :(

Link to comment
Share on other sites

Thanks booker.

I think I had tried it with the removal of the span tag and then it didn't work in IE! lol. I'll have to double check that to be sure. I'm not sure that all of the links have the span tag in it for when I was doing comparisons and checking other things...I'd been messing with it on and off over the last week so I don't remember which way I left it.

as for the marquee...maybe it doesn't like the table or something. For that I can animate a gif and set it to loop once to have it view in mozilla the way it does in IE and that should do the trick *hopefully*

...FireFox 1.0 is supposed to be released on the 9th. I didn't read what updates it had or anything to the version out now, but hopefully it will render tables by reading the % widths and a few other things that will help me to enjoy using the browser a bit more...

Link to comment
Share on other sites

Why make it that dificult......... ?

Just put in:

<STYLE>

<!--

A{text-decoration:none}

-->

</STYLE>

..... in the head of your page, and the underline in links will disapear in all browsers...

They retain their coloring, but lose their underline.

Just in case it wold be "somthing special" with your page, i took your code and tested it in Opera and Firefox, and it works fine.

As for your marquee....... it is fine in Opera, but not in firefox.

It also shows up on the right side in the cell, because the width of it is too big (508), and you have been compansating by putting in <p align="right">

If you set the width to 295 and delete the <p align="right"> it will sow up in the center of all browsers.

But it is still "scrolling".

Will try to look into it..

Link to comment
Share on other sites

To: asillyshopper

Firefox read marquee badly, so o cant find anyway of doing that.

The reason is that <marquee> is not html, but a "microsoft thingy".

I guess you have to do it with eighter java or animated gif / or flash.

Made an sugestion for you here:

Little flash

You can choose how many loops you want....

Sorry i could not help with the marquee in FF

omt

Link to comment
Share on other sites

Thanks everyone. B)

I haven't had a chance to do any of the fixes yet as I've been working on some things that had upgraded priority but I'll be reworking the page coding later this morning and let you know how it goes.

omt, for the marquee, thank you for letting me know the tag was a microsoft thing. I thought that the marquee tag was a generic script!

It looks like I'll just end up creating an animated gif vs the flash since the file size and dimensions for what I want it to do are so small.

Thanks for taking the time to make up the flash banner for me. :)

Link to comment
Share on other sites

omt, for the marquee, thank you for letting me know the tag was a microsoft thing. I thought that the marquee tag was a generic script!

It looks like I'll just end up creating an animated gif vs the flash since the file size and dimensions for what I want it to do are so small.

Thanks for taking the time to make up the flash banner for me.  :)

Dont worry....... it only took a few sec of fun ........ B)

By the way, the flash is only 27kb.... and can be done down to about less than 7 kb depending on the features and the size.......

Can you do that small sizes in animated gif ?

(Just asking, cause i never use animated giffs.)

Link to comment
Share on other sites

Hi,

Ok, I've went for omt's script and it disabled right clicking on the entire site. That's ok for me, but... I use Win XP and whenever i hold the cursor over a picture file, that small option window appears with the option to save the file. Is it possible to disable this too?

to asillyshopper:

Ideally you really want to only use this script if you have img src hotlink protection enabled on your site ...

I don't get what you mean by this... also, is it only me or is everyone else able to see his site's pictures? To me they are all red xx...

Tkx,

Pardon__me

Link to comment
Share on other sites

Hi,

Ok, I've went for omt's script and it disabled right clicking on the entire site. That's ok for me, but... I use Win XP and whenever i hold the cursor over a picture file, that small option window appears with the option to save the file. Is it possible to disable this too?

to asillyshopper:

Ideally you really want to only use this script if you have img src hotlink protection enabled on your site ...

I don't get what you mean by this... also, is it only me or is everyone else able to see his site's pictures? To me they are all red xx...

Tkx,

Pardon__me

Try asillyshopper`s script..... i dont know if it disable the imagetoolbar.....

If not, it is kind of easy to disable it.

Put:

<META HTTP-EQUIV="imagetoolbar" CONTENT="no"> into the head of your page.

Then you have to put ; GALLERYIMG="no" into every imagetags.

like: <img src="your_image.gif" GALLERYIMG="no">

In Cubecart, you have to find the plases where the $images is, and put in GALLERYIMG=\"no\"

I guess the important place is in view_product.php

That also give you a chance to choose which immage you want to protect.

(I guess you dont have to protect the thumbs.....)

OMT

Link to comment
Share on other sites

Tkx!

I'll go for that.

One thing though, i should put the <META HTTP-EQUIV="imagetoolbar" CONTENT="no"> code on header.inc or on the header of the page where the image is located?

Pardon__Me

Link to comment
Share on other sites

Tkx!

I'll go for that.

One thing though, i should put the <META HTTP-EQUIV="imagetoolbar" CONTENT="no"> code on header.inc or on the header of the page where the image is located?

Pardon__Me

In header.inc.php because that wil be the header on all pages.

on the other pages, remember the "backlash" before " like\"

omt

Link to comment
Share on other sites

hmmm,

testes it with the code on header.inc and with the GALLERYIMG=\"NO\" only on the view_product page. It looks like every image's imagetoolbar is disable... can u check, please (if u use IE...)

tkx

Pardon__Me

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...