surfalot Posted October 5, 2006 Author Share Posted October 5, 2006 change echo '<a href="'.tep_href_link('popup_image.php','pID='.$PID.'&invis='.$back).'">previous</a> '; to echo '<a href="'.tep_href_link('popup_image.php','pID='.$PID.'&invis=1').'">view back</a> '; change echo '<a href="'.tep_href_link('popup_image.php','pID='.$PID.'&invis='. $next).'">next</a>'; to echo '<a href="'.tep_href_link('popup_image.php','pID='.$PID.'&invis=2').'">close up</a>'; where you see invis= in each line, just add the image number to it like invis=1 for the first image spot you fill and invis=2 for the second image spot you fill, etc. invis=0 is the original default image. So you can have all three links on the popup. This will, of course, be the format for every product after these changes. So put your back view in the first spot and the close up in the second More Pics 6 image spot. Quote Link to comment Share on other sites More sharing options...
yuck_fou Posted October 6, 2006 Share Posted October 6, 2006 Hello, I'm just wondering that is it possible to put a border round just the image in the popup window? I've tried to do this in the popup_image.php but it also puts a border round the left and right arrows too. any ideas would be welcoming. Regards, Mike. :blush: Quote Link to comment Share on other sites More sharing options...
yuck_fou Posted October 6, 2006 Share Posted October 6, 2006 Also... I don't know if it's just me but in internet explorer 7 the popup image is missing at the bottom. I think it's got something to do with the address bar being there. In FireFox it's perfect. does anyone have any ideas? Thanks! :blink: Quote Link to comment Share on other sites More sharing options...
romie26 Posted October 8, 2006 Share Posted October 8, 2006 Is this contribution compabile whit easy populate ? Does a contribution exist to adapt easy populate for managong the pictures ? Thanks for your help Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 8, 2006 Author Share Posted October 8, 2006 I don't know if it's just me but in internet explorer 7 the popup image is missing at the bottom. I think it's got something to do with the address bar being there. In FireFox it's perfect. does anyone have any ideas? if you need to put more space at the bottom of your popup see post 378 Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 8, 2006 Author Share Posted October 8, 2006 I'm just wondering that is it possible to put a border round just the image in the popup window? I've tried to do this in the popup_image.php but it also puts a border round the left and right arrows too. you can add a style to the image output in the popup_image.php file. change: echo '<tr><td align="center"><img src="' . $img . '"></td>'; to: echo '<tr><td align="center"><img src="' . $img . '" style="border: 1 solid #999999;"></td>'; see this page for style help Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 8, 2006 Author Share Posted October 8, 2006 Is this contribution compabile whit easy populate ?Does a contribution exist to adapt easy populate for managong the pictures ? no, you would need to do some integration and add the more pics 6 fields to easy populate. Quote Link to comment Share on other sites More sharing options...
yuck_fou Posted October 8, 2006 Share Posted October 8, 2006 you can add a style to the image output in the popup_image.php file.change: echo '<tr><td align="center"><img src="' . $img . '"></td>'; to: echo '<tr><td align="center"><img src="' . $img . '" style="border: 1 solid #999999;"></td>'; see this page for style help Many thanks surf for your repliy! I fixed the popup size problem by adding this code: if (navigator.appName == 'Netscape') i=40; if (window.navigator.userAgent.indexOf("SV1") != -1) s=20; //This browser is Internet Explorer in SP2. if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+130-i+s); Just under in popup_image.php if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+125-i); Also the border worked great in IE but doesn't work in FireFox. Have you an ideas on a firefox border soulution? Many thanks. Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 8, 2006 Author Share Posted October 8, 2006 you can add a table around the image with a background color and a cellpadding of 1. that should work in any browser. Quote Link to comment Share on other sites More sharing options...
hankster6911 Posted October 9, 2006 Share Posted October 9, 2006 Thanks so much surfalot, thats just what she wanted (for now) :), had a difficult time getting this and header tags to go together in admin/categories, but all works great now! Wendy Quote Link to comment Share on other sites More sharing options...
tino2006 Posted October 9, 2006 Share Posted October 9, 2006 If I have already updated the language files etc from original OS install, how can I install this without losing the changes?? Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 10, 2006 Author Share Posted October 10, 2006 (edited) If I have already updated the language files etc from original OS install, how can I install this without losing the changes?? First, you want to make a complete backup of your site/shop. Don't forget the database backup. Set this backup aside in case you need to bring back a file that is not working and start over. Get yourself WinDiff (free, maybe at sourceforge.net) and learn how to use it. It wll allow you to compare two files side-by-side and merge changes from contribution files into your changed shop. Some of it can get tricky, sometime you need to merge changes to the same line. This is the preferred method for those of us that have more time than money. I use Beyond Compare, but that's not free. Edited October 10, 2006 by surfalot Quote Link to comment Share on other sites More sharing options...
ozziweb Posted October 10, 2006 Share Posted October 10, 2006 (edited) Great Mod thanks! Edited October 10, 2006 by ozziweb Quote Link to comment Share on other sites More sharing options...
MICROSERVE Posted October 11, 2006 Share Posted October 11, 2006 Hey, great mod - really. I've had a problem. I've inserted data from another datebase through perl-scripts. Unfortunalety the users have inserted not in the right order. For example they insterted pics only in sub_image2, sub_image4 and sub_image5. So the popup-window was broken. I've written a little perl-script to correct the order (feel free to give me feedback). But I also have one question. Have anyone a patch or something for the following problem: I resize the Images in the preview through SMALL_IMAGE_WIDTH/HEIGHT. If the user wants to see it full-size he need to click. The problem is the Image has always the original size >_< Thats especially a problem when you're at the index.php So I want thumbnails in the preview. Does anyone know how to do that. It would be enough if the path is different in the Preview (for example: /images/thumbs/image001.jpg) and the fullscreen view (/images/image001.jpg). Then I can write a small script to create thumbs use image-magick. Thanks, Mike Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 11, 2006 Author Share Posted October 11, 2006 I resize the Images in the preview through SMALL_IMAGE_WIDTH/HEIGHT. If the user wants to see it full-size he need to click. The problem is the Image has always the original size >_< Thats especially a problem when you're at the index.php So I want thumbnails in the preview. Does anyone know how to do that. It would be enough if the path is different in the Preview (for example: /images/thumbs/image001.jpg) and the fullscreen view (/images/image001.jpg). When installed correctly, it should work as the original osC code does. That is, in the product_info.php the more pics should be the size defined in SMALL_IMAGE_WIDTH/HEIGHT. have you been through the More Pics settings in your admin configuration? If you want to use pre-shrunk thumbnails, there are quick-fix directions included in the package the will help you modify the code to do that. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 15, 2006 Share Posted October 15, 2006 Hi folks I am trying to make a small modification to the more pics contribution I am trying to show information which is conditional on the manufacturer for the selected product Therefore the logic I am using is Find out what the manufacturer's ID is Use an IF ELSE statement to select the action I have been able to create the information ok but am having trouble with the syntax of the code. I have modelled the code on Surfalot's code earlier in the contribution but dont get any sense. I have tried outputting the code to screen in an effort to understand but I am going nowhere fast The code is ?php $product_mnftr_query = tep_db_query("select manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $mnftr_info = tep_db_fetch_array($product_mnftr_query); if ($mnftr_info['//PUT HARDCODED MNFTR ID HERE'] != ''){ echo '<a href="java script:popupWindow1(\'' . tep_href_link(FILENAME_MYLERBITS_HELP) . '\')"> <font color="#0000FF"> Click Here For Help With Myler Bits</font> </a>'; }elseif ($mnftr_info['//PUT HARDCODED MNFTR ID HERE'] != ''){ // PUT ACTION HERE; } echo "$mnftr_info" ?> The first part is to get the data The second part is to load the data to a variable And the third is the action to be taken with the echo statment to try and see whether I am getting sense. All I get on the screen is "array" I would be very grateful for guidance on how I might achieve this, what I am doing wrong and any resource where I can learn more about PHP code (for beginners) Thank you Quote Link to comment Share on other sites More sharing options...
pimpton Posted October 15, 2006 Share Posted October 15, 2006 I installed More_pics_6 v1.2b For osC 2.2 MS2 and trying to install Ajax Popup Image 1.2. I am stuck at the point of adding code to ---- catalog/product_info.php---- ---Around line 108 find: If new installation of AJAX Popup Image find: 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 cannot locate the particular code above in ---- catalog/product_info.php---- to make chages to add Ajax Popup Image 1.2. contribution. Here is my code from ---- catalog/product_info.php------- <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { // BOF: More Pics 6 Added: , p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6 $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); // EOF: More Pics 6 $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } // BOF: More Pics 6 $mopics_image_width = (MOPICS_RESTRICT_IMAGE_SIZE=='true'?SMALL_IMAGE_WIDTH:''); $mopics_image_height = (MOPICS_RESTRICT_IMAGE_SIZE=='true'?SMALL_IMAGE_HEIGHT:''); if (MOPICS_SHOW_ALL_ON_PRODUCT_INFO=='true') { $mopics_output = ''; $mo_row = 1; $mo_col = 1; $mopics_images = array(); if (tep_not_null($product_info['products_image']) && MOPICS_GROUP_WITH_PARENT == 'true') { $mopics_images[] = $product_info['products_image']; } for ( $mo_item=1; $mo_item<7; $mo_item++ ) { if (tep_not_null($product_info['products_subimage'.$mo_item])) { $mopics_images[] = $product_info['products_subimage'.$mo_item]; } } $mopics_count = sizeof($mopics_images); if (tep_not_null($product_info['products_image'])) { $mopics_output .= '<table border="0" cellspacing="0" cellpadding="6" align="'.MOPICS_TABLE_ALIGNMENT.'">'."\n"; } for ( $mo_item=0; $mo_item<$mopics_count; $mo_item++ ) { if ($mo_row<(MOPICS_NUMBER_OF_ROWS+1)) { if ($mo_col==1) {$mopics_output.='<tr>';} $mopics_output .= ' <td align="center" class="smallText"><script language="javascript"><!-- document.write(\'<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'].'&invis='.(MOPICS_GROUP_WITH_PARENT=='true'?$mo_item:($mo_item+1))).'\\\')">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], addslashes($product_info['products_name']), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_width), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_height), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>\'); //--></script><noscript> <a href="' . tep_href_link(DIR_WS_IMAGES . $mopics_images[$mo_item]) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], $product_info['products_name'], $mopics_image_width, $mopics_image_height, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a> </noscript></td>'."\n"; if ($mo_col==MOPICS_NUMBER_OF_COLS) { $mo_col=1; $mo_row++; $mopics_output.='</tr>'."\n"; } else { $mo_col++; } } } if ($mo_col!=1){ while (($mo_col++)<(MOPICS_NUMBER_OF_COLS+1)) { $mopics_output.='<td>?</td>'."\n"; } } if (tep_not_null($product_info['products_image'])) { $mopics_output .= '</table>'."\n"; } } // EOF: More Pics 6 ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php // BOF: More Pics 6 ADDED to if statement: && MOPICS_GROUP_WITH_PARENT == 'false' if (tep_not_null($product_info['products_image']) && MOPICS_GROUP_WITH_PARENT == 'false') { ?> <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']), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':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'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> <?php // EOF: More Pics 6 ?> </noscript> </td> </tr> </table> <?php } // BOF: More Pics 6 if (MOPICS_TABLE_LOCATION=='above') { echo ' <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="smallText">'.$mopics_output.'</td> </tr> </table> ?<br>'."\n"; } else if (MOPICS_TABLE_LOCATION=='sides') { echo $mopics_output; } // EOF: More Pics 6 ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } // BOF: More Pics 6 if (MOPICS_TABLE_LOCATION=='below') { echo '?<br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="smallText">'.$mopics_output.'</td> </tr> </table>'."\n"; } // EOF: More Pics 6 ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> I really would appreciate the help. Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 15, 2006 Author Share Posted October 15, 2006 I am trying to show information which is conditional on the manufacturer for the selected product Therefore the logic I am using is Find out what the manufacturer's ID is Use an IF ELSE statement to select the action I have been able to create the information ok but am having trouble with the syntax of the code. I have modelled the code on Surfalot's code earlier in the contribution but dont get any sense. I have tried outputting the code to screen in an effort to understand but I am going nowhere fast you want to so something like this... <?php $product_mnftr_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m where p.manufacturers_id = m.manufacturers_id and products_status = '1' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $mnftr_info = tep_db_fetch_array($product_mnftr_query); if (!empty($mnftr_info['manufacturers_id'])){ // found active product, the manufacturer ID is: $mnftr_info['manufacturers_id'] and the manufacturer's name is: $mnftr_info['manufacturers_name'] echo '<a href="java script:popupWindow1(\'' . tep_href_link('manufacturer_info_'.$mnftr_info['manufacturers_id'].'.php') . '\')"> <font color="#0000FF"> Click Here For Help With ' . $mnftr_info['manufacturers_name'] . '</font> </a>'; } ?> then name your manufacturer info files like this: manufacturer_info_1.php for the manufacturer whos ID is 1 manufacturer_info_2.php for the manufacturer whos ID is 2 etc. Quote Link to comment Share on other sites More sharing options...
surfalot Posted October 15, 2006 Author Share Posted October 15, 2006 I installed More_pics_6 v1.2b For osC 2.2 MS2 and trying to install Ajax Popup Image 1.2. I am stuck at the point of adding code to ---- catalog/product_info.php---- You need to put on your thinking-cap for this one. depending on how you have your More Pics settings set you will need to update 2 places of the More Pics code. The place you are looking for is after: // BOF: More Pics 6 ADDED to if statement: && MOPICS_GROUP_WITH_PARENT == 'false' and before the following: <?php // EOF: More Pics 6 ?> It is slightly modified from the original code you are looking for, but should be similar enough to merge the code. the other location you will need to add the Ajax link to is this code on that page: $mopics_output .= ' <td align="center" class="smallText"><script language="javascript"><!-- document.write(\'<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'].'&invis='.(MOPICS_GROUP_WITH_PARENT=='true'?$mo_item:($mo_item+1))).'\\\')">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], addslashes($product_info['products_name']), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_width), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_height), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>\'); //--></script><noscript> <a href="' . tep_href_link(DIR_WS_IMAGES . $mopics_images[$mo_item]) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], $product_info['products_name'], $mopics_image_width, $mopics_image_height, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a> </noscript></td>'."\n"; It is actually the same code as above, but it was packaged to be added to the $mopics_output variable and displayed (echo-ed) at a later place in the file. I don't know anything about that Ajax package, so I won't be much more help. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 20, 2006 Share Posted October 20, 2006 you want to so something like this... <?php if (!empty($mnftr_info['manufacturers_id'])){ // found active product, the manufacturer ID is: $mnftr_info['manufacturers_id'] and the manufacturer's name is: $mnftr_info['manufacturers_name'] echo '<a href="java script:popupWindow1(\'' . tep_href_link('manufacturer_info_'.$mnftr_info['manufacturers_id'].'.php') . '\')"> <font color="#0000FF"> Click Here For Help With ' . $mnftr_info['manufacturers_name'] . '</font> </a>'; } ?> then name your manufacturer info files like this: manufacturer_info_1.php for the manufacturer whos ID is 1 manufacturer_info_2.php for the manufacturer whos ID is 2 etc. Thank you Surfalot, I have worked my way through the code and follow the logic. Two queries please The "empty" function. What I have read is that its purpose is to indicate if variable is empty. Does the "!" alter the meaning? I dont understand the logic I see how you have built up "manufacturer_info_1.php" in the "echo" statement. I have registered the filename "manufacturer_info_1.php" etc in filenames.php but when the code is executed I am getting "You don't have permission to access the requested object. It is either read-protected or not readable by the server." As I am using a development copy on the local machine and it is not protected etc, what silly thing have I forgotten do you think? Thankyou and Respect Quote Link to comment Share on other sites More sharing options...
Guest Posted October 20, 2006 Share Posted October 20, 2006 you want to so something like this... <?php if (!empty($mnftr_info['manufacturers_id'])){ // found active product, the manufacturer ID is: $mnftr_info['manufacturers_id'] and the manufacturer's name is: $mnftr_info['manufacturers_name'] echo '<a href="java script:popupWindow1(\'' . tep_href_link('manufacturer_info_'.$mnftr_info['manufacturers_id'].'.php') . '\')"> <font color="#0000FF"> Click Here For Help With ' . $mnftr_info['manufacturers_name'] . '</font> </a>'; } ?> then name your manufacturer info files like this: manufacturer_info_1.php for the manufacturer whos ID is 1 manufacturer_info_2.php for the manufacturer whos ID is 2 etc. Thank you Surfalot, I have worked my way through the code and follow the logic. Two queries please The "empty" function. What I have read is that its purpose is to indicate if variable is empty. Does the "!" alter the meaning? I dont understand the logic I see how you have built up "manufacturer_info_1.php" in the "echo" statement. I have registered the filename "manufacturer_info_1.php" etc in filenames.php but when the code is executed I am getting "You don't have permission to access the requested object. It is either read-protected or not readable by the server." As I am using a development copy on the local machine and it is not protected etc, what silly thing have I forgotten do you think? Thankyou and Respect Quote Link to comment Share on other sites More sharing options...
Guest Posted October 20, 2006 Share Posted October 20, 2006 you want to so something like this... <?php if (!empty($mnftr_info['manufacturers_id'])){ // found active product, the manufacturer ID is: $mnftr_info['manufacturers_id'] and the manufacturer's name is: $mnftr_info['manufacturers_name'] echo '<a href="java script:popupWindow1(\'' . tep_href_link('manufacturer_info_'.$mnftr_info['manufacturers_id'].'.php') . '\')"> <font color="#0000FF"> Click Here For Help With ' . $mnftr_info['manufacturers_name'] . '</font> </a>'; } ?> then name your manufacturer info files like this: manufacturer_info_1.php for the manufacturer whos ID is 1 manufacturer_info_2.php for the manufacturer whos ID is 2 etc. Thank you Surfalot, I have worked my way through the code and follow the logic. Two queries please The "empty" function. What I have read is that its purpose is to indicate if variable is empty. Does the "!" alter the meaning? I dont understand the logic I see how you have built up "manufacturer_info_1.php" in the "echo" statement. I have registered the filename "manufacturer_info_1.php" etc in filenames.php but when the code is executed I am getting "You don't have permission to access the requested object. It is either read-protected or not readable by the server." As I am using a development copy on the local machine and it is not protected etc, what silly thing have I forgotten do you think? Thankyou and Respect Quote Link to comment Share on other sites More sharing options...
Guest Posted October 20, 2006 Share Posted October 20, 2006 you want to so something like this... <?php if (!empty($mnftr_info['manufacturers_id'])){ // found active product, the manufacturer ID is: $mnftr_info['manufacturers_id'] and the manufacturer's name is: $mnftr_info['manufacturers_name'] echo '<a href="java script:popupWindow1(\'' . tep_href_link('manufacturer_info_'.$mnftr_info['manufacturers_id'].'.php') . '\')"> <font color="#0000FF"> Click Here For Help With ' . $mnftr_info['manufacturers_name'] . '</font> </a>'; } ?> then name your manufacturer info files like this: manufacturer_info_1.php for the manufacturer whos ID is 1 manufacturer_info_2.php for the manufacturer whos ID is 2 etc. Thank you Surfalot, I have worked my way through the code and follow the logic. Two queries please The "empty" function. What I have read is that its purpose is to indicate if variable is empty. Does the "!" alter the meaning? I dont understand the logic I see how you have built up "manufacturer_info_1.php" in the "echo" statement. I have registered the filename "manufacturer_info_1.php" etc in filenames.php but when the code is executed I am getting "You don't have permission to access the requested object. It is either read-protected or not readable by the server." As I am using a development copy on the local machine and it is not protected etc, what silly thing have I forgotten do you think? Thankyou and Respect Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2006 Share Posted October 22, 2006 Apologies for the repetition, I pressed the wrong key! Nossum Quote Link to comment Share on other sites More sharing options...
j0s3 Posted October 23, 2006 Share Posted October 23, 2006 Some issues - can anybody hel? I installed the module and i'm having these probs: 1. the image sizes in product_info.php (the page where you view the product and the thumbnails show) are huge! the main image is now 597x448 and the extra images i uploaded are also massive the img settings in admin/configuration seem fine (and havent been changed) so i'm not sure what the problem is many thanks for the support jg Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.