Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hyperlinking images in index.php


Guest

Recommended Posts

Posted

I've got 4 images in index.php (code below) and I just need to know how to hyperlink them to my categories (I know the URL for my categories)

 

<?php

/*

$Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

define('TEXT_MAIN', '<table><b>Welcome to the Inkywinky.m Shop</b><br><br><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'hpclicker.gif') . '</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'epsonclicker.gif') . '</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'canonclicker.gif') . '</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'lexclicker.gif') . '</td></tr><td class="main" valign="center">' . tep_image(DIR_WS_IMAGES . 'shop_payment_types.gif') . '</td></tr><td class="main" valign="top"><b>Payment Methods</b><br>Inkywinky accepts payments via Paypal and Nochex, and we also accept cheques and postal orders<br><br>All payments are processed on our behalf by the two most trusted names in online payment, PayPal and Nochex, so you can shop safe in the knowledge all your details are safe and secure. <br><b>We have NO credit card surcharges</b><br><br></td><tr><td class="main" valign="top"><b>Postage & Delivery</b><br>With free 1st Class Postage on everything, no credit card surcharge, and VAT already included, all you pay is the price you see on the site, <b>NO HIDDEN EXTRAS</b><br></td></tr></table></font>.');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

define('HEADING_TITLE', 'Let\'s See What We Have Here');

define('TABLE_HEADING_IMAGE', '');

define('TABLE_HEADING_MODEL', 'Model');

define('TABLE_HEADING_PRODUCTS', 'Product Name');

define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');

define('TABLE_HEADING_QUANTITY', 'Quantity');

define('TABLE_HEADING_PRICE', 'Price');

define('TABLE_HEADING_WEIGHT', 'Weight');

define('TABLE_HEADING_BUY_NOW', 'Buy Now');

define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');

define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');

define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');

define('TEXT_SHOW', '<b>Show:</b>');

define('TEXT_BUY', 'Buy 1 \'');

define('TEXT_NOW', '\' now');

define('TEXT_ALL_CATEGORIES', 'All Categories');

define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

} elseif ($category_depth == 'top') {

define('HEADING_TITLE', 'Hello and Welcome to www.inkywinky.net');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

 

Other small problem is that no price is being passed between OSCommerce and Nochex which is really annoying.

 

Thanks in advance for any help

 

Nick

Posted
I've got 4 images in index.php (code below) and I just need to know how to hyperlink them to my categories (I know the URL for my categories)

 

<?php

/*

  $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright ? 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

define('TEXT_MAIN', '<table><b>Welcome to the Inkywinky.m Shop</b><br><br><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'hpclicker.gif') . '</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'epsonclicker.gif') . '</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'canonclicker.gif') . '</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'lexclicker.gif') . '</td></tr><td class="main" valign="center">' . tep_image(DIR_WS_IMAGES . 'shop_payment_types.gif') . '</td></tr><td class="main" valign="top"><b>Payment Methods</b><br>Inkywinky accepts payments via Paypal and Nochex, and we also accept cheques and postal orders<br><br>All payments are processed on our behalf by the two most trusted names in online payment, PayPal and Nochex, so you can shop safe in the knowledge all your details are safe and secure. <br><b>We have NO credit card surcharges</b><br><br></td><tr><td class="main" valign="top"><b>Postage & Delivery</b><br>With free 1st Class Postage on everything, no credit card surcharge, and VAT already included, all you pay is the price you see on the site, <b>NO HIDDEN EXTRAS</b><br></td></tr></table></font>.');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

  define('HEADING_TITLE', 'Let\'s See What We Have Here');

  define('TABLE_HEADING_IMAGE', '');

  define('TABLE_HEADING_MODEL', 'Model');

  define('TABLE_HEADING_PRODUCTS', 'Product Name');

  define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');

  define('TABLE_HEADING_QUANTITY', 'Quantity');

  define('TABLE_HEADING_PRICE', 'Price');

  define('TABLE_HEADING_WEIGHT', 'Weight');

  define('TABLE_HEADING_BUY_NOW', 'Buy Now');

  define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');

  define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');

  define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');

  define('TEXT_SHOW', '<b>Show:</b>');

  define('TEXT_BUY', 'Buy 1 \'');

  define('TEXT_NOW', '\' now');

  define('TEXT_ALL_CATEGORIES', 'All Categories');

  define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

} elseif ($category_depth == 'top') {

  define('HEADING_TITLE', 'Hello and Welcome to www.inkywinky.net');

} elseif ($category_depth == 'nested') {

  define('HEADING_TITLE', 'Categories');

}

?>

 

Other small problem is that no price is being passed between OSCommerce and Nochex which is really annoying.

 

Thanks in advance for any help

 

Nick

 

 

 

I would never do it this way but you can use the tep_href_link function as example :

 

'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=23') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'

Treasurer MFC

Posted

What others ways are there to do hyperlink an image ?

Posted
What others ways are there to do hyperlink an image ?

 

 

I was refering to putting code into your language files, bad idea.

 

The language files are for static text in different languages.

 

If you want to add code, put it in a module and include it at the relevant positions of index.php and/or product_info.php etc.

Treasurer MFC

Posted

Hi

 

I've tried using the code you posted above, but just can't figure out how to adapt it to work on my images.

 

Where do I need to put it, and what do I need to change ?

 

Sorry for being so totally thick on this one.

 

Nick

Posted
Hi

 

I've tried using the code you posted above, but just can't figure out how to adapt it to work on my images.

 

Where do I need to put it, and what do I need to change ?

 

Sorry for being so totally thick on this one.

 

Nick

 

I am not farmiliar with the term thick on this, this is Taiwan, we do not understand slang.

 

if you want an image link to go to category 23 then you use :

 

'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=23') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'

 

FILENAME_DEFAULT is translated into your index.php, cPath=23 is passed as the url parameter along with the session_id if required and the tep_image function you already know.

 

You can also do this :

 

'<a href="' . tep_href_link('index.php', 'cPath=23') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'

 

don't use http://........ in there because that is done by the function.

Treasurer MFC

Posted

Hi

 

Starting to understand, but your code has the image being called as follows

 

. tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '

 

whereas I am currently calling the image as follows

 

' . tep_image(DIR_WS_IMAGES . 'lexclicker.gif') . '

 

and when I change the code to

 

'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=23') . '">'' . tep_image(DIR_WS_IMAGES . 'lexclicker.gif') . ' </a> all I get is a Parse error

 

I presume I need to use the code as you supplied, but where do I put my images ?

 

Many Thanks for the help you've already given me.

 

Nick

Posted
Hi

 

Starting to understand, but your code has the image being called as follows

 

. tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '

 

whereas I am currently calling the image as follows

 

' . tep_image(DIR_WS_IMAGES . 'lexclicker.gif') . '

 

and when I change the code to

 

'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=23') . '">'' . tep_image(DIR_WS_IMAGES . 'lexclicker.gif') . ' </a> all I get is a Parse error

 

I presume I need to use the code as you supplied, but where do I put my images ?

 

Many Thanks for the help you've already given me.

 

Nick

 

because the defines in the language files are very sensitive to single quote placements, you are asking for trouble when you put code in there.

Treasurer MFC

Posted

So how would I create a module to display and hyperlink 4 or 5 images ?

 

The frustrating part of this it's the very last thing I need to do to my shop, everything else working fine.

 

Is there any modifications which would make things easier or does it all need to be done by hand, so to speak.

 

Nick

Archived

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

×
×
  • Create New...