Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using Image Map in Header


mosquitohawk

Recommended Posts

Posted

I want to replace the top-most part of the header with my own custom work, and am curious how I would code the image map with php to achieve the same links as are there now.

 

Here's what I have:

 

<map name="header_right89f457">

<area shape="rect" coords="129,128,227,143" href="createaccount_link" alt="">

<area shape="rect" coords="189,82,230,119" href="checkout_link" alt="">

<area shape="rect" coords="142,81,186,118" href="mycart_link" alt="">

<area shape="rect" coords="99,82,139,118" href="account_link" alt="">

</map>

 

What would I need to put in the href statements for the create account link, checkout link, account link and the my cart link?

 

Thanks for any assistance!

Affordable Web Hosting .:. http://www.croakingtoad.com/

Posted

Open up includes/header.php

 

Head to around line 51 and you see ?>

 

Under that you will see some HTML code that goes down till you see another <?

 

Simply edit the HTML code as you see fit..

 

As for the links: just link to create_account.php login.php checkout.pph and so on..

 

Regards,

 

Ryan

Posted

Well, I tried this and it didn't work.... here's the section of code I have now, can anyone look at it and tell me what I'm doing wrong?

 

You can view the results at-- http://www.williesimmons.com/shop/

 

<?php

/*

 $Id: header.php,v 1.31 2001/12/19 15:32:55 hpdl Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2001 osCommerce



 Released under the GNU General Public License

*/

?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 <tr class="header">

   <td valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce'); ?></td>

   <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>

 </tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

 <tr class="headerNavigation">

   <td class="headerNavigation">

<?php

 echo '  <a href="' . HTTP_SERVER . '" class="headerNavigation">' . HEADER_TITLE_TOP . '</a> » <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerNavigation">' . HEADER_TITLE_CATALOG . '</a>';



 if ($cPath) {

   if (!ereg('_', $cPath)) {

     $cPath_array = array($cPath);

   }

   $cPath_new = '';

   for($i=0; $i<sizeof($cPath_array); $i++) {

     if ($cPath_new == '') {

       $cPath_new .= $cPath_array[$i];

     } else {

       $cPath_new .= '_' . $cPath_array[$i];

     }

     $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $cPath_array[$i] . "' and language_id='" . $languages_id . "'");

     $categories = tep_db_fetch_array($categories_query);

     echo ' » <a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath_new, 'NONSSL') . '" class="headerNavigation">' . $categories['categories_name'] . '</a>';

   }

 } elseif ($HTTP_GET_VARS['manufacturers_id']) {

   $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'");

   $manufacturers = tep_db_fetch_array($manufacturers_query);

   echo ' » <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'], 'NONSSL') . '" class="headerNavigation">' . $manufacturers['manufacturers_name'] . '</a>';

 }

 if ($HTTP_GET_VARS['products_id']) {

   $model = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

   $model_values = tep_db_fetch_array($model);

   echo ' » <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL') . '" class="headerNavigation">' . $model_values['products_model'] . '</a>';

 }

 if ($location) {

   echo $location;

 }

?>

   </td>

   <td align="right" class="headerNavigation"><table width="100%" border="0" cellspacing="0" cellpadding="0">

 <tr>

 <td align="left" style="background: #FFFFFF url(images/header_middle.jpg) repeat-x;"><img src="header_left.jpg"></td>

 <td style="background: #FFFFFF url(images/header_middle.jpg) repeat-x;" align="center" valign="middle"><img src="images/willie_logo.jpg" style="border: 1px solid black;"></td>

 <td align="right" style="background: #FFFFFF url(images/header_middle.jpg) repeat-x;"><img src="images/header_right.jpg" usemap="#header_right89f457" style="border: 0px;"></td>

 </tr>

 </table>

 <map name="header_right89f457">

 <area shape="rect" coords="129,128,227,143" href="create_account.php" alt="Create an Account">

 <area shape="rect" coords="189,82,230,119" href="checkout_payment.php" alt="Checkout">

 <area shape="rect" coords="142,81,186,118" href="shopping_cart.php" alt="View your Cart">

 <area shape="rect" coords="99,82,139,118" href="account.php" alt="Go to your Account"></map>

   </td>

 </tr>

</table>

<?php

 if ($HTTP_GET_VARS['error_message'] != '') {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

 <tr class="headerError">

   <td class="headerError"><?php echo urldecode($HTTP_GET_VARS['error_message']); ?></td>

 </tr>

</table>

<?php

 }



 if ($HTTP_GET_VARS['info_message'] != '') {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

 <tr class="headerInfo">

   <td class="headerInfo"><?php echo $HTTP_GET_VARS['info_message']; ?></td>

 </tr>

</table>

<?php

 }

?>

Affordable Web Hosting .:. http://www.croakingtoad.com/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...