Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do you add image borders?


deathgod

Recommended Posts

i am also trying to find a contribution that lists all the categories as the main page

http://www.oscommerce.com/community/contributions,2513

http://www.oscommerce.com/community/contributions,2860

Link to comment
Share on other sites

Not sure what you mean about the image borders on that site? All of the images I can see on the pages I went to are completely border-less (tested in Firefox and IE7)

I don't know about Nick, but I would like to be able to put a 1 - 2 pixel border around ALL my pictures on all the pages.

 

Kelvin

Link to comment
Share on other sites

I mean the big fat border pic that goes around the whole site

 

@everyth5: that can probably done by modifiying the tep_image() function in html output (i think it is tep_image, might not be that exact name)

Menou and unome

Link to comment
Share on other sites

I mean the big fat border pic that goes around the whole site

 

@everyth5: that can probably done by modifiying the tep_image() function in html output (i think it is tep_image, might not be that exact name)

Thanks. This is part of the code in html_output.php. I have tried to adjust some of the width or border variables but it didn't make any changes. Would you be able to tell me which one(s) I need to change?

 

// The HTML href link wrapper function
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
if ($page == '') {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
if ($connection == 'NONSSL') {
  $link = HTTP_SERVER . DIR_WS_ADMIN;
} elseif ($connection == 'SSL') {
  if (ENABLE_SSL == 'true') {
	$link = HTTPS_SERVER . DIR_WS_ADMIN;
  } else {
	$link = HTTP_SERVER . DIR_WS_ADMIN;
  }
} else {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
if ($parameters == '') {
  $link = $link . $page . '?' . SID;
} else {
  $link = $link . $page . '?' . $parameters . '&' . SID;
}

while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

return $link;
 }

 function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
if ($connection == 'NONSSL') {
  $link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
} elseif ($connection == 'SSL') {
  if (ENABLE_SSL_CATALOG == 'true') {
	$link = HTTPS_CATALOG_SERVER . DIR_WS_CATALOG;
  } else {
	$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
  }
} else {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
if ($parameters == '') {
  $link .= $page;
} else {
  $link .= $page . '?' . $parameters;
}

while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

return $link;
 }

////
// The HTML image wrapper function
 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) {
  $image .= ' title=" ' . tep_output_string($alt) . ' "';
}

if (tep_not_null($width) && tep_not_null($height)) {
  $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

$image .= '>';

return $image;
 }

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
 function tep_image_submit($image, $alt = '', $parameters = '') {
global $language;

$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

$image_submit .= '>';

return $image_submit;
 }

////
// Draw a 1 pixel black line
 function tep_black_line() {
return tep_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '1');
 }

////
// Output a separator either through whitespace, or with an image
 function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
return tep_image(DIR_WS_IMAGES . $image, '', $width, $height);
 }

 

Thanks

 

Kelvin

Link to comment
Share on other sites

this should do it, but it will adjust every pic in your site i think

// The HTML image wrapper function

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

$image = '<img src="' . tep_output_string($src) . '" border="2" /*changed*/ alt="' . tep_output_string($alt) . '"';

 

if (tep_not_null($alt)) {

$image .= ' title=" ' . tep_output_string($alt) . ' "';

}

 

if (tep_not_null($width) && tep_not_null($height)) {

$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';

}

 

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

 

$image .= '>';

 

return $image;

}

Menou and unome

Link to comment
Share on other sites

this should do it, but it will adjust every pic in your site i think

// The HTML image wrapper function

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

$image = '<img src="' . tep_output_string($src) . '" border="2" /*changed*/ alt="' . tep_output_string($alt) . '"';

 

if (tep_not_null($alt)) {

$image .= ' title=" ' . tep_output_string($alt) . ' "';

}

 

if (tep_not_null($width) && tep_not_null($height)) {

$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';

}

 

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

 

$image .= '>';

 

return $image;

}

Thanks Nick, but that put borders ALL OVER THE PLACE on the site, even where there were only spaces. lol

 

I will keep looking. Thanks again for trying.

 

Kelvin

Link to comment
Share on other sites

it puts a border around every pic in the site, including the invisible spacer pics. If you want to change that then it will be quite a lot of work. cant go into detail now because i am on my phone. &Anyone know about my problem yet. Nick

Menou and unome

Link to comment
Share on other sites

How do you add image borders

eg. http://www.karasutopia.com/index.php

and many other sites

Thx in advance

I think you want this ... http://www.oscommerce.com/community/contri...all/search,rhea

 

that's what I use on most sites, you can have nested borders also.

 

My Design on Kara's site is different, as I have added a bunch of padding and 8 different images (sides/corners) to get the rainbow design.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Hey kelvin,

all images, the normal one and the spacers go through the tep_image() function, if you want to have your spacer images without borfers and the rest with borders then what you have to do is create a new function for the spacers only and set it to '0' border, then manually change the functions that the spacers refer to from tep_image() to tep_image_spacer().

 

#1/ Copy the following into your functions/html_output.php file.

// The HTML spacer image wrapper function
function tep_image_spacer($src, $alt = '', $width = '', $height = '', $parameters = '') {
$image = '<img src="' . tep_output_string($src) . '" border="2" /*changed*/ alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) {
$image .= ' title=" ' . tep_output_string($alt) . ' "';
}

if (tep_not_null($width) && tep_not_null($height)) {
$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

$image .= '>';

return $image;
}

 

#2/ Manually change all spacer images from tep_image() to tep_image_spacer(), this will be the big task and is what i would say wont make it worth the time you put in.

 

#3/ You are done.....to speed up on step 2, search for the text that spacers usually use, or the tep_image function (but be careful that they are actually spacers).

 

#4/ Hope you like that hack, but personally i dont think it would be worth the time and you should just abandon the whole border image thing.

 

Nick

Menou and unome

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...