guess you're right
1 2005-12-15 22:04
Re: Smileys and site integration bug (8 replies, posted in PunBB 1.2 bug reports)
2 2005-12-15 16:17
Re: Smileys and site integration bug (8 replies, posted in PunBB 1.2 bug reports)
You could also set PUN_ROOT in the site integration file, like I do. Like this:
define('PUN_ROOT', '/home/account/forums/');
require_once '/home/account/forums/' . 'include/common.php';
require_once '/home/account/forums/' . 'include/parser.php';
Well, as it is now, it screws up the smileys when I use the parse_message() function on the site. So I modified it, and it works. I thought it would be useful if this fix was also done in the official version.
3 2005-12-14 21:28
Re: Smileys and site integration bug (8 replies, posted in PunBB 1.2 bug reports)
It would still work I suppose, because PUN_ROOT would point to the correct subdomain, and it would parse the smiley links to be from that subdomain... Or do I not understand this correctly?
4 2005-12-14 13:33
Topic: Smileys and site integration bug (8 replies, posted in PunBB 1.2 bug reports)
This bug causes the parse_message function to write the scr= path to any smiley incorrectly, when the function is used on a website that has the forums integrated.
This should fix it:
include/parser.php line 366:
$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
should be:
$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="' . PUN_ROOT . 'img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);