Guest Posted July 3, 2010 Posted July 3, 2010 I've got OCS to CSS and Sam's Anti Hacker Mod add-ons installed. They are both great, but I've got the problem that as Sam's script includes table layout for some of the pages, the CSS script won't work properly on those pages as the CSS scipts for the same pages has been altered to strip out the tables. SO I either have the OCS to css contact form without the security scripting, or I have Sam's add on without the css styling I want. :blink: Having no experience in php scripting, and only some in css I can't work out how to change the table script so that it follows the ocs to css style. I have tried to follow the scripts and work it out, but it's not working. Does anyone have any tips on which bits to change so Sam's script for the layout follows the css stylesheet? I thought I might add Divs and then style them in the css, but it didn't work. Quote
npn2531 Posted July 3, 2010 Posted July 3, 2010 (edited) Take the contact_us.php page you downloaded from Sam's Antihacker Mod. Upload it to where you have the OSC to CSS contribution installed, overwriting your existing contact_us.php. Then open up Sam's contact_us.php you know have in the OSC to CSS mod and 1) at the top Replace: <!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"> </head> <body> With this: <?php echo $doctype; ?> <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; ?>"> <?php echo $stylesheet; ?> <?php require(DIR_WS_INCLUDES . 'template-top.php'); ?> 2)at the bottom replace : <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" summary="" 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'); ?> with: <?php require(DIR_WS_INCLUDES . 'template-bottom.php'); ?> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> 3) Now go through and delete every <table><tr> and <td>, making sure you don't delete anything else, no php, ?> or <?php tags. 4) From my examination of that page the programming should still work, and work in the OSC to CSS contribution, but nothing will be formatted, just stacked up down the page. However, it will look at whole lot more like the OSC to CSS contact_us.php page in an editor, and it should be easier to compare the two files and see where to cut and paste the div's and span's from the OSC-CSS page to the contact_us.php page from Sam' Hacker mod you just butchered. Edited July 3, 2010 by npn2531 Quote Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
Guest Posted July 3, 2010 Posted July 3, 2010 Take the contact_us.php page you downloaded from Sam's Antihacker Mod. Upload it to where you have the OSC to CSS contribution installed, overwriting your existing contact_us.php. Then open up Sam's contact_us.php you know have in the OSC to CSS mod and 1) at the top Replace: <!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"> </head> <body> With this: <?php echo $doctype; ?> <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; ?>"> <?php echo $stylesheet; ?> <?php require(DIR_WS_INCLUDES . 'template-top.php'); ?> 2)at the bottom replace : <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" summary="" 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'); ?> with: <?php require(DIR_WS_INCLUDES . 'template-bottom.php'); ?> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> 3) Now go through and delete every <table><tr> and <td>, making sure you don't delete anything else, no php, ?> or <?php tags. 4) From my examination of that page the programming should still work, and work in the OSC to CSS contribution, but nothing will be formatted, just stacked up down the page. However, it will look at whole lot more like the OSC to CSS contact_us.php page in an editor, and it should be easier to compare the two files and see where to cut and paste the div's and span's from the OSC-CSS page to the contact_us.php page from Sam' Hacker mod you just butchered. Thanks a million for your help npn! I'll certainly give that a go :) Quote
Guest Posted July 16, 2010 Posted July 16, 2010 Just a quick post to say thanks npn for your help - it looked a little daunting at first but I managed to go through the scripts and compare them and make the changes. In the end it wasn't as tricky as I thought it would be. Fantastic! I can no go ahead and make changes to the other pages. :) Quote
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.
Note: Your post will require moderator approval before it will be visible.