warrenerjm Posted August 1, 2006 Share Posted August 1, 2006 Hi From reading the forum I think I have found the code which is involved in the "click to enlarge" picture in product_info. <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> <?php } ?> I thought this might help me, but it doesn't, so I am asking for your help. :D I want a new page (sorted) with a table, with two columns & unknown rows yet (sorted). In the second column I want text, but in the first column (heres where I need the help) I would like to put a picture (suitable size) with click to enlarge. I don't know what parts of the above code I can use or modify & would be very grateful if someone could help me out with this please? :D :D Thanks Julie Link to comment Share on other sites More sharing options...
rabbitseffort Posted August 1, 2006 Share Posted August 1, 2006 if you search google for java scripts for pop up windows you will find what you need "I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings." ---Margaret Mead--- "The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer. --Ken Kesey" Link to comment Share on other sites More sharing options...
warrenerjm Posted August 2, 2006 Author Share Posted August 2, 2006 if you search google for java scripts for pop up windows you will find what you need Thank you Rabbit. Did that & this was the one I understood! :lol: Does it look right? I also assume that this will only work with the "Click to enlarge" text link & not if you click on the picture? :huh: Any hints on that plaese? <script type="text/javascript"> //JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com) //Visit JavaScriptKit.com for free JavaScripts //This notice must stay intact for legal use function openpopup(popurl){ var winpops=window.open(popurl,"","width=600px,height=400px,resizable") } </script> <a href="java script:openpopup('http://www.mysite.co.uk/images/example.jpg')">Click here to enlarge</a> I'll keep looking. Thanks for your pointer. Julie Link to comment Share on other sites More sharing options...
warrenerjm Posted August 6, 2006 Author Share Posted August 6, 2006 Thank you Rabbit. Did that & this was the one I understood! :lol: Does it look right? I also assume that this will only work with the "Click to enlarge" text link & not if you click on the picture? :huh: Any hints on that plaese? <script type="text/javascript"> //JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com) //Visit JavaScriptKit.com for free JavaScripts //This notice must stay intact for legal use function openpopup(popurl){ var winpops=window.open(popurl,"","width=600px,height=400px,resizable") } </script> <a href="java script:openpopup('http://www.mysite.co.uk/images/example.jpg')">Click here to enlarge</a> I'll keep looking. Thanks for your pointer. Julie Oh bother :( I have tried lots of sites & lots of different java script pop up window generators & they all result in an error message. OK so I'm doing something wrong!! :P BUT I do not know what :blush: This is all so I can show more smaller pictures in my gallery, that can be shown larger in a pop up window. I could use target="_blank" but I do not want to create a new page for every single one. Bit of overkill. I am using the code in my /includes/languages/english/gallery.php which I assume is what I need to do :blink: Also tried it inside a table & outside. Please could someone show me the direction of a good, easy to understand site or give me a few more clues on what I should be doing? Thanks ;) Julie Link to comment Share on other sites More sharing options...
choosealogin Posted August 6, 2006 Share Posted August 6, 2006 What kind of error do you get? I used this (I put it outside of the php, I seem to remember a problem otherwise, can't recall) <script language="javascript"> /* Auto center window script- Eric King (http://redrival.com/eak/index.shtml) Permission granted to Dynamic Drive to feature script in archive For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com */ var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) } </script> And then where I needed the link: '<a href="' . tep_href_link('popup_shipping.php') . '"onclick="NewWindow(this.href,\'name\',\'300\',\'550\',\'yes\');return false">' . 'Click for Shipping Rates' . '</a>' Your link is more like a basic link, so I guess that might be <a href="http://www.mysite.co.uk/images/example.jpg" onclick="NewWindow(this.href,\'name\',\'600\',\'400\',\'yes\');return false">Click here to enlarge</a> That's assuming the link is within php code. That might be part of your trouble now. (backslahes needed) Link to comment Share on other sites More sharing options...
warrenerjm Posted August 6, 2006 Author Share Posted August 6, 2006 What kind of error do you get? I used this (I put it outside of the php, I seem to remember a problem otherwise, can't recall) <script language="javascript"> /* Auto center window script- Eric King (http://redrival.com/eak/index.shtml) Permission granted to Dynamic Drive to feature script in archive For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com */ var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) } </script> And then where I needed the link: '<a href="' . tep_href_link('popup_shipping.php') . '"onclick="NewWindow(this.href,\'name\',\'300\',\'550\',\'yes\');return false">' . 'Click for Shipping Rates' . '</a>' Your link is more like a basic link, so I guess that might be <a href="http://www.mysite.co.uk/images/example.jpg" onclick="NewWindow(this.href,\'name\',\'600\',\'400\',\'yes\');return false">Click here to enlarge</a> That's assuming the link is within php code. That might be part of your trouble now. (backslahes needed) Hi Mark Thanks for helping me. :thumbsup: One error was a T-STRING. Can you just confirm what files I should be using please as the includes/languages/english/gallery.php doesn't have any ?php stuff. Should I put the first code in gallery.php & the second code link in includes/languages/english/gallery.php & if so where about's in that file do I put the first code. Sorry that was badly explained, so I hope you understand what I am on about! :blink: Thanks Julie Link to comment Share on other sites More sharing options...
choosealogin Posted August 6, 2006 Share Posted August 6, 2006 Yes, you're right. Try putting the first part (starting w/ <script language="javascript">) before the closing head tag (</head>) near the top of catalog/gallery.php. putting the links in includes/languages/english/gallery.php should be fine. Those apostrophes will still need to be escaped, like mine were, as that stuff in the language file is within php (hard to notice ...just one beginning tag at the very top and a closing one at the end). Link to comment Share on other sites More sharing options...
warrenerjm Posted August 6, 2006 Author Share Posted August 6, 2006 Yes, you're right. Try putting the first part (starting w/ <script language="javascript">) before the closing head tag (</head>) near the top of catalog/gallery.php. putting the links in includes/languages/english/gallery.php should be fine. Those apostrophes will still need to be escaped, like mine were, as that stuff in the language file is within php (hard to notice ...just one beginning tag at the very top and a closing one at the end). Mark You are GREAT :thumbsup: Thank you for sharing that with me. I added an <IMG SRC=>to get the picture on the page too, but that worked great. Had a look at your site, which looks great. As you had two pop ups on one page I assume this will work with more pictures on the same page? I do not have to amend anything to say 1..2..3etc? This is a different unrelated question, but I like how you have the "Tell a Friend" button in the middle bar & not in a box under one of the columns. Hope this isn't too cheaky but how did you do that? Contribution or your own coding? I want to shorten my left column as I too have switched off the right hand column. Thanks for your help with the original question anyhow. Julie Link to comment Share on other sites More sharing options...
choosealogin Posted August 6, 2006 Share Posted August 6, 2006 Thanks Julie. I'm glad it worked. I forgot about your <img> tags...but you got it so that's cool. :D You're right, the JS code will be there for you throughout that gallery page, as you need it...no other amendments needed. The tell a friend button is a thing I came up with...nothing too fancy, it might exist elsewhere, but I couldn't find anything at the time. The code for that button is like this <td class="main" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL') . '">' . tep_image_button('tellafriendbutton.gif',BOX_HEADING_TELL_A_FRIEND) . '</a>'; ?></td> Then you need a tellafriendbutton.gif button in your includes/languages/english/images/buttons/ directory. That should do it. :) Mark You are GREAT :thumbsup: Thank you for sharing that with me. I added an <IMG SRC=>to get the picture on the page too, but that worked great. Had a look at your site, which looks great. As you had two pop ups on one page I assume this will work with more pictures on the same page? I do not have to amend anything to say 1..2..3etc? This is a different unrelated question, but I like how you have the "Tell a Friend" button in the middle bar & not in a box under one of the columns. Hope this isn't too cheaky but how did you do that? Contribution or your own coding? I want to shorten my left column as I too have switched off the right hand column. Thanks for your help with the original question anyhow. Julie Link to comment Share on other sites More sharing options...
choosealogin Posted August 6, 2006 Share Posted August 6, 2006 I also realized, as I was pasting the code for you ...that I neglected to make use of the 'name' call in the JS :huh: I think that names the window, for the top browser title bar...haven't fixed that yet...but I think that's what it is. onclick="NewWindow(this.href,\'name\',\'300\',\'550\',\'yes\') Link to comment Share on other sites More sharing options...
warrenerjm Posted August 6, 2006 Author Share Posted August 6, 2006 Thanks Julie. I'm glad it worked. I forgot about your <img> tags...but you got it so that's cool. :D You're right, the JS code will be there for you throughout that gallery page, as you need it...no other amendments needed. The tell a friend button is a thing I came up with...nothing too fancy, it might exist elsewhere, but I couldn't find anything at the time. The code for that button is like this <td class="main" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL') . '">' . tep_image_button('tellafriendbutton.gif',BOX_HEADING_TELL_A_FRIEND) . '</a>'; ?></td> Then you need a tellafriendbutton.gif button in your includes/languages/english/images/buttons/ directory. That should do it. :) Mark Sorry I have been awhile replying. Lost my buttons!! :lol: Another great addition. Thank you. :thumbsup: Another box bites the dust! Getting there. Julie Link to comment Share on other sites More sharing options...
warrenerjm Posted August 6, 2006 Author Share Posted August 6, 2006 I also realized, as I was pasting the code for you ...that I neglected to make use of the 'name' call in the JS :huh: I think that names the window, for the top browser title bar...haven't fixed that yet...but I think that's what it is. onclick="NewWindow(this.href,\'name\',\'300\',\'550\',\'yes\') Ok My pop up window says the path details. ie: www.mysite/images/example.gif I shall have ago searching for the meaning of name & how to change the description at the top of the pop up window. Could this be used more for SEO (key in a keyword for that image) or am I just talking nonsence? :blush: I'll let you know what I find. Thank you for efforts Mark. Really appreciate it. :thumbsup: Julie Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.