1 (edited by ataylor 2004-01-09 22:32)

Topic: Announcement feature - bbcode and smilies

Any chance of enabling bbcode and/or smilies instead of HTML in the new Announcement feature? Or options to enable any of the three in the admin panel?

Re: Announcement feature - bbcode and smilies

Well, I guess it's possible. I don't perticularily like the idea of allowing both HTML and BBCode though. If you want the field to be HTML, then a regular line break \n should not be converted into <br />. However, if the field can contain BBCode, it feels more like a regular post and then the forum should convert line breaks into <br />.

But, if you want to do it yourself, it's quite easy. If you want to, I can describe how.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Announcement feature - bbcode and smilies

Yes please smile

Re: Announcement feature - bbcode and smilies

I'm at school now, but give me a minute.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Announcement feature - bbcode and smilies

OK no problem... take as much time as you like smile

Re: Announcement feature - bbcode and smilies

Open up header.php, goto line 185 (after "ob_start();"). Insert:

include_once $pun_root.'include/parser.php';

Then a few line down, replace

<?php echo $pun_config['o_announcement_message'] ?><br><br>

with

<?php echo parse_message($pun_config['o_announcement_message'], 1) ?><br><br>

Then, you have to search all files for the string:

require $pun_root.'include/parser.php';

and replace it with

require_once $pun_root.'include/parser.php';

The files you need to search in are delete.php, edit.php, help.php, moderate.php, post.php (2 places), profile.php (2 places) and viewtopic.php.

It was a bit more tedious than I had first expected, but I'm sure you can handle it :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7

Re: Announcement feature - bbcode and smilies

Thankyou very much smile I've had more tedious code editing than this wink