Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 1788

phpBB Custom Coding • Usage of submit_post, with tags = wrong recording in database

$
0
0
Hi,

Related to a previous topic on this forum, I use a php script to create a new topic from an exe app.

Here is the part of code I use to post:

Code:

if ( $action ==  "create" ) {if ( $username == '' ) { $ForumID = 16; }$rawsubject = request_var('subject', '', true);$my_subject   = utf8_normalize_nfc($rawsubject, '', true);$message = request_var('message', '', true);$my_text   = utf8_normalize_nfc($message, '', true);// variables to hold the parameters for submit_post$poll = $uid = $bitfield = $options = '';generate_text_for_storage($my_text, $uid, $bitfield, $options, false, false, false);$data = array(       'forum_id'      => $ForumID,       'icon_id'      => false,       'enable_bbcode'      => true,       'enable_smilies'   => true,       'enable_urls'      => true,       'enable_sig'      => true,       'message'      => $my_text,       'message_md5'   => md5($my_text),                       'bbcode_bitfield'   => $bitfield,       'bbcode_uid'      => $uid,       'post_edit_locked'   => 0,       'force_approved_state'=> ITEM_APPROVED, // To remove approval needing       'topic_visibility'   => ITEM_APPROVED, // To mark post visibility as 1       'topic_title'      => $my_subject,       'notify_set'      => false,       'notify'         => true,       'enable_indexing'   => true,   );submit_post('post', $my_subject, $user->data['username'], POST_NORMAL, $poll, $data);$returnurl = request_var('pwebsite', '') ."/viewtopic.php?t=". $data['topic_id'];}
It's OK with normal text.
But I would add some text in tags and the displayed message on the forum is wrong.

For example, if I send as $message The [u]pocpoc[/u] of Couin, it is displayed like I send, instead of
The pocpoc of Couin
In the database, it is recorded as <t>The [u]pocpoc[/u] of Couin</t>

If I edit the message (on the forum, not in database), I see well The [u]pocpoc[/u] of Couin, and when I submit, the message is well displayed as wanted, so
The pocpoc of Couin
The recording in the database is now <r>The <U><s>[u]</s>pocpoc<e>[/u]</e></U> of Couin</r>.

I probably missing something , how can I make posting correctly?

thanks :D

Statistics: Posted by Couin — Thu Oct 17, 2024 4:30 pm



Viewing all articles
Browse latest Browse all 1788

Trending Articles