katman1971 Posted June 14, 2010 Posted June 14, 2010 Hi I have created a header (with a Nav Bar) in photoshop and I have sliced it up. I imported the html file into dreamweaver and I clicked on the slices and created the links. Now I have the code created by dreamweaver. Do I simply copy and paste all of the code into my header.php? Or do I paste a part of the code into my header.php? Where abouts in header.php do I paste the code? Below is the code created in Dreamweaver. <html> <head> <title>taxisupplies_main_header</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- Save for Web Slices (taxisupplies_main_header.psd) --> <table id="Table_01" width="900" height="240" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="9"> <img src="images/taxisupplies_main_header_01.png" width="900" height="193" alt=""></td> </tr> <tr> <td> <img src="images/taxisupplies_main_header_02.png" width="187" height="47" alt=""></td> <td><a href="http://taxisupplies.ie/catalog/"><img src="images/home_button.gif" width="106" height="47" alt="Home"></a></td> <td> <img src="images/taxisupplies_main_header_04.png" width="1" height="47" alt=""></td> <td><a href="http://www.taxisupplies.ie/catalog/about_us.php"><img src="images/about_us_button.gif" width="157" height="47" alt="About Us"></a></td> <td> <img src="images/taxisupplies_main_header_06.png" width="2" height="47" alt=""></td> <td><a href="http://www.taxisupplies.ie/catalog/contact_us.php"><img src="images/contact_us_button.gif" width="152" height="47" alt="Contact Us"></a></td> <td> <img src="images/taxisupplies_main_header_08.png" width="2" height="47" alt=""></td> <td> <img src="images/testimonials_button.png" width="163" height="47" alt="Testimonials"></td> <td> <img src="images/taxisupplies_main_header_10.png" width="130" height="47" alt=""></td> </tr> </table> <!-- End Save for Web Slices --> </body> </html> Once I paste the code properly into header.php I will upload the flat image to the images folder. Then, is there anything I need to do in the stylesheet? Thanks.
Guest Posted June 15, 2010 Posted June 15, 2010 Jim, You could try that, but the header.php also contains PHP code needed for the functionality of the site. You will need to include this BEFORE your code: <?php /* $Id: header.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> and this AFTER your code: <?php if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerError"> <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td> </tr> </table> <?php } if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerInfo"> <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td> </tr> </table> <?php } ?> Then, I am not even sure your site will function correctly, but hey it's worth a try. Chris
katman1971 Posted June 15, 2010 Author Posted June 15, 2010 Jim, You could try that, but the header.php also contains PHP code needed for the functionality of the site. You will need to include this BEFORE your code: <?php /* $Id: header.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> and this AFTER your code: <?php if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerError"> <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td> </tr> </table> <?php } if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerInfo"> <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td> </tr> </table> <?php } ?> Then, I am not even sure your site will function correctly, but hey it's worth a try. Chris Chris If you had a header created in ps and it was sliced up, how would you go about inserting iit into your site, so that your customers could click on the Home / About Us / etc. bbuttons? Is there a proper way of doing it?
jhande Posted June 16, 2010 Posted June 16, 2010 Hey Jim, It's not too difficult of a project. Not knowing exactly how you want it too look (are you replacing the entire header or only partial?) compare the table structures. Look at the structure of your includes/header.php. You need to keep what Chris pointed out, but can change the layout and content of the table(s). Compare the links you created in Dreamweaver with the ones from (example) includes/boxes/information.php. Notice they are similar to = '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>' And yours are similar to = <a href="http://www.taxisupplies.ie/catalog/contact_us.php"> Change yours to similar syntax as the first above, that way you won't lose sessions. Then it's pretty much a matter of replacing a section of the original header.php table with yours as created between this code = <!-- Save for Web Slices (taxisupplies_main_header.psd) --> <!-- End Save for Web Slices --> - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -
Recommended Posts
Archived
This topic is now archived and is closed to further replies.