Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

more banners at the same time


glambrecht

Recommended Posts

Posted

finally managed to make my banner function.

just corrected 468x60 to 135x60 (my new banners) in footer.php in catalog/includes.

would like to have 4 banners side by side (4 in a row) - is that possible?

thanks :'(

Posted
finally managed to make my banner function.

just corrected 468x60 to 135x60 (my new banners) in footer.php in catalog/includes.

would like to have 4 banners side by side (4 in a row) - is that possible?

thanks :'(

Sure, but you'll have to modify the code in footers.php that queries for the banners, and have it select 4 of it, and then loop through the results and lay them all out in neighboring <td> elements within the same <tr> row...

 

*Quick Edit*

 

I just looked through the footer code and saw that it grabs 1 banner due to its function calls, which route through tep_random_select, which only returns 1 random result... You'll probably want to forego the call to that, and rewrite the query yourself to return a limit 4 on those results, ordered by rand(), so it randomly selects them, and doesn't duplicate them... Then push all of the results into an array, and return the array to $banner in footer.php... Then loop through $banner with a foreach, and lay them all out in neighboring <td> elements as suggested above...

 

Richard.

Richard Lindsey

  • 6 months later...
Posted
Sure, but you'll have to modify the code in footers.php that queries for the banners, and have it select 4 of it, and then loop through the results and lay them all out in neighboring <td> elements within the same <tr> row...

 

*Quick Edit*

 

I just looked through the footer code and saw that it grabs 1 banner due to its function calls, which route through tep_random_select, which only returns 1 random result... You'll probably want to forego the call to that, and rewrite the query yourself to return a limit 4 on those results, ordered by rand(), so it randomly selects them, and doesn't duplicate them... Then push all of the results into an array, and return the array to $banner in footer.php... Then loop through $banner with a foreach, and lay them all out in neighboring <td> elements as suggested above...

 

Richard.

 

Hi,

 

that is a great idea since i have the same problem.

 

do you know what you can replace with "tep_random_select" so it doesnt pick randomly. Or have you already done what you wrote above, because im killing myself to find out how to do that.

 

thank you

Archived

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

×
×
  • Create New...