Guest Posted January 2, 2007 Share Posted January 2, 2007 here is the way it looks now: Here is the way I want it to appear I have looked in my product_info.php files, and the options_images.php files, and fooled with everything I could think of to make it not centered. Here is the options_images.php file if you are feeling ambitious. My gut tells me the answer is there. As you can see i have been playing with tables, yet no luck! arg. Any help would be amazzzzing! <table width="82" border="0" cellpadding="0"> <tr> <td> <table border="0" cellspacing="0" cellpadding="2"> <tr> <?php echo '<td class="main" colspan="2">' . TEXT_PRODUCT_OPTIONS . '<br>'; ?> <?php if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<br>';?> <td valign="top" width="17"><?php /* $Id: options_images.php,v 1.0 2003/08/18 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ $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) { ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_images_enabled 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, pov.products_options_values_thumbnail, 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'], 'thumbnail' => $products_options['products_options_values_thumbnail']); 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" valign="top"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <?php if ($products_options_name['products_options_images_enabled'] == 'false'){ echo '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '</td></tr>'; } else { $count=0; echo '<td class="main"><table><tr>'; foreach ($products_options_array as $opti_array){ echo '<td><table cellspacing="1" cellpadding="0" border="0">'; if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<td align="center"><a href="java script:popupWindow(\'' . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, 'oID=' . $opti_array['id']) .'\')">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</a></td></tr><br>'; else echo '<tr><td align="center">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</td></tr>'; echo '<tr><td class="main" align="center">' . $opti_array['text'] . '</td></tr>'; echo '<tr><td align="center"><input type="checkbox" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" checked><br></td></tr></table></td>'; $count++; if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) { echo '</tr><tr>'; $count = 0; } } echo '</table>'; } ?> <td width="37" valign="top"><br></td> </tr> <tr> <td class="main" valign="top"><?php } ?></td> <td width="37" valign="top"></td> </tr> <?php } ?> </table> </td> </tr> </table> Link to comment Share on other sites More sharing options...
Guest Posted January 2, 2007 Share Posted January 2, 2007 Any thoughts, answers, comments, annnnnything? I am still trying to get it, but, not getting it. here is the way it looks now: Here is the way I want it to appear I have looked in my product_info.php files, and the options_images.php files, and fooled with everything I could think of to make it not centered. Here is the options_images.php file if you are feeling ambitious. My gut tells me the answer is there. As you can see i have been playing with tables, yet no luck! arg. Any help would be amazzzzing! <table width="82" border="0" cellpadding="0"> <tr> <td> <table border="0" cellspacing="0" cellpadding="2"> <tr> <?php echo '<td class="main" colspan="2">' . TEXT_PRODUCT_OPTIONS . '<br>'; ?> <?php if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<br>';?> <td valign="top" width="17"><?php /* $Id: options_images.php,v 1.0 2003/08/18 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ $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) { ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_images_enabled 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, pov.products_options_values_thumbnail, 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'], 'thumbnail' => $products_options['products_options_values_thumbnail']); 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" valign="top"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <?php if ($products_options_name['products_options_images_enabled'] == 'false'){ echo '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '</td></tr>'; } else { $count=0; echo '<td class="main"><table><tr>'; foreach ($products_options_array as $opti_array){ echo '<td><table cellspacing="1" cellpadding="0" border="0">'; if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<td align="center"><a href="java script:popupWindow(\'' . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, 'oID=' . $opti_array['id']) .'\')">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</a></td></tr><br>'; else echo '<tr><td align="center">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</td></tr>'; echo '<tr><td class="main" align="center">' . $opti_array['text'] . '</td></tr>'; echo '<tr><td align="center"><input type="checkbox" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" checked><br></td></tr></table></td>'; $count++; if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) { echo '</tr><tr>'; $count = 0; } } echo '</table>'; } ?> <td width="37" valign="top"><br></td> </tr> <tr> <td class="main" valign="top"><?php } ?></td> <td width="37" valign="top"></td> </tr> <?php } ?> </table> </td> </tr> </table> Link to comment Share on other sites More sharing options...
Guest Posted January 3, 2007 Share Posted January 3, 2007 I fixed it myself. Incase anyone searches this same problem. the answer is a table inside a php code, that doesnt show up inside of a php editor. I don't know if that makes sense. But here is an updated code, that aligns the images properly, instead of that centered confusion this is for the options_images.php file <?php /* $Id: options_images.php,v 1.0 2003/08/18 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ $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> <?php echo '<td class="main" colspan="2">' . TEXT_PRODUCT_OPTIONS . ''; ?> <?php if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<br>Click the images to enlarge';?> </td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_images_enabled 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, pov.products_options_values_thumbnail, 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'], 'thumbnail' => $products_options['products_options_values_thumbnail']); 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" valign="top"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <?php if ($products_options_name['products_options_images_enabled'] == 'false'){ echo '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '</td></tr>'; } else { $count=0; echo '<td class="main"><table><tr>'; foreach ($products_options_array as $opti_array){ echo '<td><table cellspacing="1" cellpadding="0" border="0">'; if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<tr><td width="971" height="27" align="center" valign="top"><a href="java script:popupWindow(\'' . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, 'oID=' . $opti_array['id']) .'\')">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</a></td> <td width="38" rowspan="2" align="center" valign="top"><img src="images/spacer.gif" width="1" height="30"></td> </tr>'; else echo '<tr><td height="22" align="center" valign="top">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</td> </tr>'; echo '<tr><td align="center" valign="top" class="main">' . $opti_array['text'] . '</td> <td align="center" valign="bottom" class="main"><img src="images/spacer.gif" alt="space" width="1" height="25"></td> </tr>'; echo '<tr><td height="22" align="center" valign="top"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" checked></td> <td align="center"><img src="images/spacer.gif" alt="space" width="1" height="15"></td> </tr></table></td>'; $count++; if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) { echo '</tr><tr>'; $count = 0; } } echo '</table>'; } ?> </td></tr> <?php } ?> </table> <?php } ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.