Topic: Just wondering...

...if you can use HTML and/or BB-code in ban messages?

Thanks, Ed.

Re: Just wondering...

Anybody know?

Re: Just wondering...

I believe you can't smile

Re: Just wondering...

Not without a modification I guess.

5 (edited by CodeXP 2007-05-16 21:15)

Re: Just wondering...

Just played around with the functions file and here's what you can do to be able to use BBCode in the ban messages.

1. Open ./include/functions.php and find on line 191

    $bans_altered = false;

2. Add after:

    require PUN_ROOT.'include/parser.php';

3. Find on line 206

            message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);

4. Replace with

            message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'</p>'.parse_message($cur_ban['message'], false).'<p>' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);

5. Find on line 220

                    message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);

6. Replace with

                    message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'</p>'.parse_message($cur_ban['message'], false).'<p>' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);

7. Save & upload


Hope this helps smile

EDIT: Almost forgot, if you want to use HTML instead of BBCode, just replace pun_htmlspecialchars($cur_ban['message']) with $cur_ban['message'] on line 206 & 220 instead of following the steps listed above.

Re: Just wondering...

Thanks. smile