日本語:Function.generate text for display

generate_text_for_display -- パースされたテキストを表示する.

説明
string generate_text_for_display ( string $text, string $uid , string $bitfield , int $flags )

例 #1 bbcode_options
$sql = 'SELECT text, bbcode_uid, bbcode_bitfield, bbcode_options FROM '. YOUR_TABLE. '   WHERE some_id = '. (int) $example_id; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result);

$text = generate_text_for_display($row['text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']);

$template->assign_vars(array( 'TEXT' => $text, ));

例 #2 独自の bbcode_options
$sql = 'SELECT text, bbcode_uid, bbcode_bitfield, enable_bbcode, enable_smilies, enable_magic_url FROM '. YOUR_TABLE. '   WHERE some_id = '. (int) $example_id; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result);

// Add up the flag options... $bbcode_options = (($row['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0) + (($row['enable_smilies']) ? OPTION_FLAG_SMILIES : 0) + (($row['enable_magic_url']) ? OPTION_FLAG_LINKS : 0);

$template->assign_vars(array( 'TEXT' => generate_text_for_display($row['text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $bbcode_options), ));

例 #3 Forum テーブルの場合
$sql = 'SELECT forum_name, forum_desc, forum_desc_uid, forum_desc_bitfield, forum_desc_options FROM '. FORUMS_TABLE. '   WHERE forum_id = '. (int) $forum_id; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result);

$template->assign_vars(array( 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), ));

参照

 * Parsing text
 * generate_text_for_storage
 * generate_text_for_edit

generate_text_for_display