1 (edited by Jannejt 2006-12-08 12:23)

Topic: News Generator and smilies

Hi! I tested Richards news generator and noticed that when i write news and watch the generated html page, smilies wont work "The requested URL /PunBB/plugins/AP_News_Generator/img/smilies/smile.png was not found on this server." So it looks like PunBB links smileys wrong. Is this already fixed on 1.3 dev release ? smile

Janne Tanskanen

EDIT: Looks like there's also "Bug reports" area, so if mods want, just move this thread smile

2 (edited by Jarkko 2006-12-09 00:55)

Re: News Generator and smilies

Yep, you can fix it by changing two lines of code in include/parser.php (in function do_smilies to be more specific):

FIND (Line: 360):

    global $smiley_text, $smiley_img;


    global $pun_config, $smiley_text, $smiley_img;

FIND (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);


        $text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="'.$pun_config['o_base_url'].'/img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);

Won't have any effect on the smilies on the board itself, other than they use the full URL instead of the relative one.

And yes, it seems to be fixed in SVN. smile