Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Some code help


Guest

Recommended Posts

Posted

Just need a little help needed.....

 

I will add a page into a new box no problem, what i want to do though is have a banner on the

homepage and possibly more pages

 

Now i can just image source the picture onto the pages, but how do i code the picture to be clickable

and the click will take it to the page i have added.

 

any help appreciated, if you know what i am talking about!

Posted

any help appreciated..

 

also if i say add a site in the text say www.domain.com how do i get it so a mouse over highlights it and it goes to that site

 

cheers

Posted

An example from the stock osC header.php

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?>

Let's pick it apart so you can modify it to your own needs:

 

In that code:

 

FILENAME_DEFAULT is the page (on your site) to link to. That particular item is defined in your filenames.php file. To make it link to your page you can substitute something like this: 'mynewpage.php'

 

oscommerce.gif is the name of the image to be displayed. Replace that with your image name, and put your image in the images folder with all the other images on your site.

 

osCommerce is the text to be displayed on a "mouseover".

 

If you want to link to a page NOT on your site, you'll need to do it differently.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

good stuff i will have a bash at that, can i determine the size of the banner or will it show relative to the size it is designed at

 

cheers

Posted

It would show the image full size.

 

To make the image any other size, change this code:

 

tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce')

to:

 

tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce','IMAGE_WIDTH','IMAGE_HEIGHT')

Replace the text IMAGE_WIDTH and IMAGE_HEIGHT with the image dimensions (numbers) you wish to use.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

sorry one more q, to centre it do i stick a <center> somewhere

Posted

<center>
<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?>
</center>

Is one way to do it.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

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

×
×
  • Create New...