Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jul 2006
    Posts
    93
    Plugin Contributions
    0

    Default No right-click on lightbox

    I am using Lightbox to show the large version if images on my site. I want to add oncontextmenu="return false" to the <img> tag for all large images. how do I do this with Lightbox?

  2. #2
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: No right-click on lightbox

    You dont want users to save images?
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  3. #3
    Join Date
    Jul 2006
    Posts
    93
    Plugin Contributions
    0

    Default Re: No right-click on lightbox

    Nope! It's a photography site. :)

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: No right-click on lightbox

    Quote Originally Posted by joshlfisher View Post
    Nope! It's a photography site. :)
    The thing is, there is no way to prevent users from doing that at all, it can only work for novice computer users who do not know how to work around this.

    You may read this for more info:
    http://javascript.about.com/library/blnoright.htm

    If you still want to do it, let us know.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Jul 2006
    Posts
    93
    Plugin Contributions
    0

    Default Re: No right-click on lightbox

    Yeah, I've read a bunch of stuff on this. All I want to do is disable right click on the large images only. What is need to know is Which file has the <img> tag for the large image links? Keeping in mind I am using the Zen Lightbox addon. All I want to do is put
    Code:
    oncontextmenu="return false"
    in the <IMG> tag for the large images.

  6. #6
    Join Date
    Jul 2006
    Posts
    93
    Plugin Contributions
    0

    Default Re: No right-click on lightbox

    Can anyone help me please? I'm just trying to figure out where the <IMG> tag is for the large product photos. I have Zen Lightbox installed, and I need to edit the <IMG> tag.

  7. #7
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: No right-click on lightbox

    there are 2 files you want to check: 1 in the modules, and another in the templates folder. The files names contain something like this: main_product_image.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  8. #8
    Join Date
    Jul 2006
    Posts
    93
    Plugin Contributions
    0

    Default Re: No right-click on lightbox

    I have spent a couple hours looking through all the files that might be related.

    I found this in tpl_modules_main_product_image:
    Code:
    if (ZEN_LIGHTBOX_STATUS == 'true') {
    
    echo '<script language="javascript" type="text/javascript"><!--
    document.write(\'<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" oncontextmenu="return false" rel="lightbox[gallery]" title="' . addslashes($zen_lightbox_products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>\')//--></script>';
    
    } else {
    
    echo '<script language="javascript" type="text/javascript"><!--
    document.write(\'<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')" oncontextmenu="return false">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>\')//--></script>';
    But this just generates the 'larger image' link that shows a lightbox with the large image. What I need to edit is the <IMG> tag that lightbox uses to show the large image.

    Here is some sample source code:

    Code:
    <!-- bof Zen Lightbox v1.4 aclarke 2007-09-15 -->
    <script language="javascript" type="text/javascript"><!--
    document.write('<a href="images/floral/a_bucket_of_sun.jpg" oncontextmenu="return false" rel="lightbox[gallery]" title="A Bucket of Sun"><img src="bmz_cache/e/ed5a7180c0d95ab16982d572a69bc0cd.image.93x120.jpg" alt="A Bucket of Sun" title=" A Bucket of Sun " width="93" height="120" /><br /><span class="imgLink">larger image</span></a>')//--></script><!-- eof Zen Lightbox v1.4 aclarke 2007-09-15 -->
    <noscript>
    <a href="http://throughmylensphotography.com/index.php?main_page=popup_image&amp;pID=1" target="_blank"><img src="bmz_cache/e/ed5a7180c0d95ab16982d572a69bc0cd.image.93x120.jpg" alt="A Bucket of Sun" title=" A Bucket of Sun " width="93" height="120" /><br /><span class="imgLink">larger image</span></a></noscript>
    </div><!--eof Main Product Image-->
    The highlighted code is a link to the large image. I need this image to have the
    Code:
    contextmenu="return false"
    property.

    This is the CSS tree for the element that holds the large image:
    Code:
    html > body #productinfoBody > div #lightbox > div #outerImageContainer > div #imageContainer > div #hoverNav
    Can I add the
    Code:
    contextmenu="return false"
    to that CSS element?

    All I want to do is disable the right-click menu on the large images.

  9. #9
    Join Date
    Jul 2006
    Posts
    93
    Plugin Contributions
    0

    Default Re: No right-click on lightbox

    Any LightBox experts that can help me with this? :)

  10. #10
    Join Date
    May 2008
    Posts
    1
    Plugin Contributions
    0

    Default Re: No right-click on lightbox

    I was looking for the same answer here...in the end I found it out myself

    you should go to :

    includes/templates/(your template)/popup_image/tpl_main_page.php

    just add oncontextmenu="return false" in the body id:

    PHP Code:
    <body id="popupImage" class="centeredContent" onload="resize();" oncontextmenu="return false"

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Exclude product Image from lightbox when i click on it...
    By oberheimer in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Nov 2011, 12:07 PM
  2. No right click
    By hara in forum General Questions
    Replies: 4
    Last Post: 11 Jun 2011, 08:47 PM
  3. Make .mp3 songs downloadable at left click like .zip not right click and SAVE LINK AS
    By yarilo111 in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 29 May 2009, 10:45 PM
  4. no right click
    By traders in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Nov 2007, 01:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR