\o/ Posted December 31, 2002 Posted December 31, 2002 Hello everyone... I am wanting to know how I move a box from say the right hand column, into the centre of the page? For instance I want to move the manufacturers_info.php this is the code: $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); if (tep_db_num_rows($manufacturer_query)) { $manufacturer = tep_db_fetch_array($manufacturer_query); $manufacturer_url_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . $manufacturer['manufacturers_id'] . "'"); $manufacturer_url_values = tep_db_fetch_array($manufacturer_url_query); $has_manufacturer_url = ($manufacturer_url_values['manufacturers_url']) ? 'true' : 'false'; ?> <!-- manufacturer_info //--> <tr> <td> <TABLE WIDTH=150 BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD COLSPAN=3> <IMG SRC="images/boxes/table_manufacturers_info.gif" WIDTH=150 HEIGHT=20></TD> </TR> <TR> <td> <?php $manufacturer_info_string = '<div align="center">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</div>' . '<table border="0" width="' . BOX_WIDTH . '" cellspacing="0" cellpadding="0">'; if ($has_manufacturer_url == 'true') $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">- </td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id'], 'NONSSL') . '" target="_blank"><b>' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</b></a></td></tr>'; $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">- </td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id'], 'NONSSL') . '"><b>' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</b></a></td></tr></table>'; $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => $manufacturer_info_string); new infoBox($info_box_contents); ?> I want that in the middle, so I put this at the top of the page: <?php $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); if (tep_db_num_rows($manufacturer_query)) { $manufacturer = tep_db_fetch_array($manufacturer_query); $manufacturer_url_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . $manufacturer['manufacturers_id'] . "'"); $manufacturer_url_values = tep_db_fetch_array($manufacturer_url_query); $has_manufacturer_url = ($manufacturer_url_values['manufacturers_url']) ? 'true' : 'false'; ?> Then put this where I wanted the manufacturer image on the products page: <?php echo '<div align="center">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</div>' . 'true') $manufacturer_info_string .= '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id'], 'NONSSL') . '" target="_blank"><b>' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</b></a>'; '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id'], 'NONSSL') . '"><b>' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</b></a>'; ?> I obviously did something wron, cos all I get is parse errors, and I can not see what I did wrong. I am not very good with PHP, so please if you can help I would very much appreciate it. I want to do this with most of my boxes, but I dont know how to take it out of an array... Thank you everyone, I hope you can help. P.S. Sorry for the long post also!
Guest Posted December 31, 2002 Posted December 31, 2002 Instead of attempting to hard code the boxes into the center of your page, take a look at the way the includes/column_left.php or column_right.php file "call the boxes" and use a statement like that to include the boxes wherever you want them.
\o/ Posted December 31, 2002 Author Posted December 31, 2002 This is what I did at first, which was great. But... This gives me the entire look of the box around it. eg. the infobox header etc... I dont want it to be in the infobox, I just want it on it's own, with a plain white background. Thanks for your reply. I hope you can help me achieve what I need to find...
Guest Posted December 31, 2002 Posted December 31, 2002 In the file of the box you are moving...remove the header if you want, you can change or remove the class to change the colors and fonts etc. Keep a back-up of your file and experiment with it.
\o/ Posted December 31, 2002 Author Posted December 31, 2002 Changing the class appears to be easier said than done I'm affraid. It is for me anyway. :oops: I have got it working up to a point. Problem is, when I add this: <?php $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); if (tep_db_num_rows($manufacturer_query)) { $manufacturer = tep_db_fetch_array($manufacturer_query); $manufacturer_url_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . $manufacturer['manufacturers_id'] . "'"); $manufacturer_url_values = tep_db_fetch_array($manufacturer_url_query); $has_manufacturer_url = ($manufacturer_url_values['manufacturers_url']) ? 'true' : 'false'; ?> All seems fine apart from when this goes in, it tells me there is a parse error on line 400. But this is the last line of the page. and nothing is wrong with that. What does this normally point to?
\o/ Posted December 31, 2002 Author Posted December 31, 2002 You are right doing it your way is much easier. But... How do I alter the class from the normal infobox class. I see it comes from the boxes.php file, but how can I seperate manufacturer_info.php from the class set in there? This is why I went down the route I did in the first place, becos I could not find another way.
Guest Posted December 31, 2002 Posted December 31, 2002 Are you putting the include call between a <td> and a </td>? You can add a new class to your stylesheet... It will look something like this: <td class="manufacturersBox"> <?php require(DIR_WS_BOXES . 'manufacturers_info.php'); ?> </td>
\o/ Posted December 31, 2002 Author Posted December 31, 2002 I am yes, but the infobox class set in boxes.php file takes precedence over the class set in the <td> above. So even tho I put this in, it makes no difference. I believe it has something to do with this set in manufacturers_info.php: new infoBox($info_box_contents); Please, someone must know how to change this... Thank you Kim, your answers are very much appreciated!
Guest Posted December 31, 2002 Posted December 31, 2002 Ron, Here's a thread that should give you the results you're looking for. Enjoy! http://www.oscommerce.com/forums/viewtopic.php...g+class+infobox
Guest Posted January 13, 2003 Posted January 13, 2003 Ok, most of ya'll are talking a foreign language to me. I would like to move a few boxes from the left to the right to balance out the look as I have commented out the currencies and languages so far, but will also be commenting out the shopping cart box as I am only using this for it's cataloging feature, not as a shopping cart. I am not sure what code to move where and I don't want to start experiementing because I am incredibly new to PHP and don't feel confident enough just to start toying. Heck, most of the time, I don't even know what I am reading. Could someone explain what moving a box, say "What's New" from the left side over to the right side? And finally, how can I reshape a box? Meaning, I would like them all to be boxy with no rounded edges (e.g. Manufacturers, Quick Find, etc.)... Thanks for all the help!!!
Guest Posted January 13, 2003 Posted January 13, 2003 Oh, I forgot to post my theory on what I am supposed to do...LOL Am I supposed to move this require(DIR_WS_BOXES . 'information.php'); from where it is in the column_left.php to where I would like it in the column_right.php...or is it a bit more involved than that? It just seemed TOO easy, that is why I questioned it...
Guest Posted January 13, 2003 Posted January 13, 2003 Ok, I'm touched. :oops: So I finally got some balls to just comment the dang thing out, copy it and do what I thought to be true. I guess I shouldn't rely so much on handouts, but I have this fear of just janking everything up beyond belief. However, my second question, about changing the shapes, now that, I still cannot figure out (nor can I find any help on the forums about it). So that question still stands.
Guest Posted January 13, 2003 Posted January 13, 2003 Ok, you can kill me now...somehow I stumbled upon a post that explained it to me. http://www.oscommerce.com/forums/viewtopic.php...p?p=30655#30655 It's just not my night. First my printer breaks, then I can't find anything until I've posted a question and clogged up the board. Well, hopefully someone will find my ranting helpful down the road. :?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.