Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

image call in PHP.. Running out of hair to pull.


Guest

Recommended Posts

Can some hard coder please help me with this statement.

 

For the life of me I can't get an image to show up . I need it to show up where the spacer.gif is.

 

Driving me nuts, so I reverted it to a working copy and you can find the page here.

http://www.vampiredust.net/wwhic/OnlineCatalog/index.php

 

Code Below

 

It is the image placeholer (spacer.gif) on the column_left.php and is in my customers in includes/boxes/all_specials.php

 

I am lost here...

 

Thanks guys and gals.

 

TJ

 

 

<?php
   $info_box_contents = array();
//   $info_box_contents[] = array('text' => BOX_HEADING_SPECIALS);

   new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
$box_text = '';
$rown = tep_db_num_rows($specials_query);
   $row = 0;
while ($specials = tep_db_fetch_array($specials_query)) {
  $row++; 
     $box_text .= '<table border=0 cellpadding=1 cellspacing=0 width="190"  align="center" background="images/blur50.gif"><tr><td width="100%" align="right" height=50>  <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '"><font face=Arial size=1 color=#FF8000><B>' . $specials['products_name'] . '</B></font></a>  <img src="images/spacer.gif" border="1" width="50" height="50" align="middle">      <font color=white>- <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '"><img src=images/right.gif border=0></a>  </font></td></tr></table>';
  if ($rown == $row) {
    $box_text .= "\n";
  } else {
    $box_text .= '' . "\n";
  }  
}
   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text' => $box_text);
new infoBox($info_box_contents);
?>

Link to comment
Share on other sites

This is how I finally got it to work, although a bandaid...

 

the image is called by teh productname.gif as follows:

<img src="images/' . $specials['products_name'] . '.jpg" width="45" height="45" align="middle" border="1">

 

 

Just postiing this for future reference, and possible helping others later.

 

Thanks Guys...

 

TJ

Link to comment
Share on other sites

This is how I finally got it to work, although a bandaid...

 

the image is called by teh productname.gif as follows:

<img src="images/' . $specials['products_name'] . '.jpg" width="45" height="45" align="middle" border="1">

Just postiing this for future reference, and possible helping others later.

 

Thanks Guys...

 

TJ

 

 

why not simply use the tep_image function ?

Treasurer MFC

Link to comment
Share on other sites

Thanks Boxtel...

 

I haven't reached that capacity , hehe.

 

resorted to old stuff I leaerned in asp :)

 

Can you show me where to learn more about tep tep function ( for beginners ), so I won't get bombarded by information like in the knowlegebase?

 

te_functions 101 etc...

 

Thanks for teh post, I though really need to learn that stuff, and it is VERy inteeresting to me

 

.

TJ

 

 

 

why not simply use the tep_image function ?

Link to comment
Share on other sites

Thanks Boxtel...

 

I haven't reached that capacity , hehe.

 

resorted to old stuff I leaerned in asp  :)

 

Can you show me where to learn more about tep tep function ( for beginners ), so I won't get bombarded by information like in the knowlegebase?

 

te_functions 101 etc...

 

Thanks for teh post, I though really need to learn that stuff, and it  is VERy inteeresting to me

 

.

TJ

 

 

well, I do not know all tep_functions but when you look at the code enough and checkout the function declarations themselves, you get a reasonable picture of how it is done the way it is done and more importantly why it is done the way it is done.

The examples of tep_image() are numerous.

<img src="images/' . $specials['products_name'] . '.jpg" width="45" height="45" align="middle" border="1">

 

tep_image(DIR_WS_IMAGES . $specials['products_name'] . '.jpg', $specials['products_name'], 45, 45, ' align="middle" ', 1)

 

as defined :

 

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '', $border = '0') {

 

the big advantage is that you only have to remember this construct and all the images will have the same look and feel and ofcourse if you want to change that, you only have to do it in 1 place, the function itself, instead of going to all you individual pages.

Treasurer MFC

Link to comment
Share on other sites

Heya Boxtel,

 

I think you just gave me some GREAT insight :)

 

So you can call an image ( or any variable ) just by using this function?

 

So, the tep gets all of these variables, stores them for use and tracks them, allowing you to simply call them up anytime, on any page?

 

Am I on the right track? If so that is too cool.

 

I will start using it more and more.

 

Thank you very much for tep 101 :)

 

I may have to ask you something again, after I break my code though hehe...

 

How long you been active in PHP ?

 

 

 

 

 

 

well, I do not know all tep_functions but when you look at the code enough and checkout the function declarations themselves, you get a reasonable picture of how it is done the way it is done and more importantly why it is done the way it is done.

The examples of tep_image() are numerous.

<img src="images/' . $specials['products_name'] . '.jpg" width="45" height="45" align="middle" border="1">

 

tep_image(DIR_WS_IMAGES . $specials['products_name'] . '.jpg', $specials['products_name'], 45, 45, ' align="middle" ', 1)

 

as defined :

 

  function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '', $border = '0') {

 

the big advantage is that you only have to remember this construct and all the images will have the same look and feel and ofcourse if you want to change that, you only have to do it in 1 place, the function itself, instead of going to all you individual pages.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...