Topic: [help] Secondary Message

Okay, so I want a post to be able to have an optional secondary message, I manually added a column to pun_posts structure called "post_extra". It's nullable so I can check that with an if-statement an ignore it if it's null.

But how would I retrieve that data and add it on the end of (or after) the $forum_page['message']['message']?

I'm fairly new to PunBB modding so I'm not awfully familiar with how each component works with each other.

One I understand how to add it to the end I can do the rest (like editing the message etc) on my own.

Note: I'm creating this directly in the PHP files themselves rather than as a hook, just because I'm more comfortable doing it this way, I convert it to a hook after I finish it though.

Re: [help] Secondary Message

Do the following:
1) On the line 277 add the "p.post_extra" field in the SELECT expression;
2) After the line 497 add something like this:

 $forum_page['message']['post_extra'] = $cur_post['post_extra'];  

3 (edited by Zuriki 2010-06-05 21:21)

Re: [help] Secondary Message

Okay, I finally got round to properly implementing this into my forum. In edit.php I have the lines:

$message = preparse_bbcode($message, $errors);
$warning = preparse_bbcode($warning, $errors);

Yet, when the warning is submitted, it doesn't seem to parse the bbcode at all... it shows up as plain text...

My query is as follows:

$query = array(
            'UPDATE'    => 'posts',
            'SET'        => 'message=\''.$forum_db->escape($message).'\', hide_smilies=\''.$hide_smilies.'\', post_warn=\''.$warning.'\'',
            'WHERE'        => 'id='.$id
        );

Am I missing something?

(Warning is optional and only displays when not-null)