WebsiteBaker Support (2.8.x) > Bakery Shop
Bakery Lightbox Caption with Email Link and Custom Subject
YoJoe:
skywriter: try to clean the $img_title variable from any non letter/digital chars using string replace function.
The easiest way:
--- Code: ---$specialCharacters = array(
‘#’ => ”,
‘$’ => ”,
‘%’ => ”,
‘&’ => ”,
‘@’ => ”,
‘.’ => ”,
‘€’ => ”,
‘+’ => ”,
‘=’ => ”,
‘§’ => ”,
‘\\’ => ”,
‘/’ => ”,
);
while (list($character, $replacement) = each($specialCharacters)) {
$string = str_replace($character, '-' . $replacement . '-', $string);
}
--- End code ---
There's also a more advanced preg_replace() function, but only you know what exact chars appear in image titles.
sky writer:
--- Quote from: Bug on June 17, 2011, 07:28:09 AM ---I am curious about the fancybox in stead of lightbox, is this taken from a post on the forum?
--- End quote ---
Yes: https://forum.WebsiteBaker.org/index.php/topic,21322.msg143994.html#msg143994
sky writer:
YoJoe - I ended up using htmlentities, as suggested by Ruud, and it worked perfectly.
Thanks for the alternate suggestion.
Navigation
[0] Message Index
[*] Previous page
Go to full version