function parse_signature($text) { global $pun_config, $lang_common, $pun_user; if ($pun_config['o_censoring'] == '1') { $text = censor_words($text); } $text = pun_htmlspecialchars($text); if ($pun_config['o_make_links'] == '1') { $text = do_clickable($text); } if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0') { $text = do_smilies($text); } if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false) { $text = do_bbcode($text); if ($pun_config['p_sig_img_tag'] == '1') { // $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text); $text = preg_replace('#\\[img\\]((ht|f)tps?://)([^\\s<"]*?)\\[/img\\]#e', 'handle_img_tag(\'$1$3\', true)', $text); } } // Deal with newlines, tabs and multiple spaces $pattern = array("\n", "\t", ' ', ' '); $replace = array('<br />', ' ', ' ', ' '); $text = str_replace($pattern, $replace, $text); return $text; }
function parse_signature($text) { global $forum_config, $lang_common, $forum_user; $return = ($hook = get_hook('ps_parse_signature_start')) ? eval($hook) : null; if ($return != null) { return $return; } if ($forum_config['o_censoring'] == '1') { $text = censor_words($text); } $return = ($hook = get_hook('ps_parse_signature_post_censor')) ? eval($hook) : null; if ($return != null) { return $return; } // Convert applicable characters to HTML entities $text = forum_htmlencode($text); $return = ($hook = get_hook('ps_parse_signature_pre_bbcode')) ? eval($hook) : null; if ($return != null) { return $return; } if ($forum_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false) { $text = do_bbcode($text, true); } if ($forum_config['o_smilies_sig'] == '1' && $forum_user['show_smilies'] == '1') { $text = do_smilies($text); } $return = ($hook = get_hook('ps_parse_signature_post_bbcode')) ? eval($hook) : null; if ($return != null) { return $return; } // Deal with newlines, tabs and multiple spaces $pattern = array("\n", "\t", ' ', ' '); $replace = array('<br />', ' ', ' ', ' '); $text = str_replace($pattern, $replace, $text); $return = ($hook = get_hook('ps_parse_signature_end')) ? eval($hook) : null; if ($return != null) { return $return; } return $text; }
function parse_signature($text) { global $luna_config, $luna_user; if ($luna_config['o_censoring'] == '1') { $text = censor_words($text); } // Convert applicable characters to HTML entities $text = luna_htmlspecialchars($text); if (strpos($text, '[') !== false && strpos($text, ']') !== false) { $text = do_bbcode($text, true); } if ($luna_config['o_smilies_sig'] == '1' && $luna_user['show_smilies'] == '1') { $text = do_smilies($text); } // Deal with newlines, tabs and multiple spaces $pattern = array("\n", "\t", ' ', ' '); $replace = array('<br />', '    ', '  ', '  '); $text = str_replace($pattern, $replace, $text); return clean_paragraphs($text); }
function parse_signature($text) { global $pun_config, $pun_user, $lang_common, $lang_topic; if ($pun_config['o_censoring'] == '1') { $text = censor_words($text); } if ($pun_config['o_make_links'] == '1') { $text = do_clickable($text); } $text = pun_htmlspecialchars($text); if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0') { $text = do_smilies($text); } if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false) { $text = do_bbcode($text, true); } // Deal with newlines, tabs and multiple spaces $pattern = array("\n", "\t", ' ', ' ', '<p><br />'); $replace = array('<br />', ' ', ' ', ' ', '<p>'); $text = str_replace($pattern, $replace, $text); return $text; }
function parse_signature($text) { global $pun_config, $lang_common, $pun_user; if ($pun_config['o_censoring'] == '1') { $text = censor_words($text); } // Convert applicable characters to HTML entities $text = pun_htmlspecialchars($text); if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false) { $text = do_bbcode($text, true); } if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] == '1') { $text = do_smilies($text); } // Deal with newlines, tabs and multiple spaces $pattern = array("\n", "\t", ' ', ' '); $replace = array('<br />', '    ', '  ', '  '); $text = str_replace($pattern, $replace, $text); // Add paragraph tag around post, but make sure there are no empty paragraphs $text = preg_replace('#<br />\\s*?<br />((\\s*<br />)*)#i', "</p>\$1<p>", $text); $text = str_replace('<p><br />', '<p>', $text); $text = str_replace('<p></p>', '', '<p>' . $text . '</p>'); return $text; }
function parse_signature($text) { global $pun_config, $lang_common, $pun_user; if ($pun_config['o_censoring'] == 1) { $text = censor_words($text); } $text = pun_htmlspecialchars($text); if ($pun_config['o_make_links'] == 1) { $text = do_clickable($text); } if ($pun_config['o_smilies_sig'] == 1 && $pun_user['show_smilies']) { $text = do_smilies($text); } if ($pun_config['p_sig_bbcode'] && strpos($text, '[') !== false && strpos($text, ']') !== false) { $text = do_bbcode($text); if ($pun_config['p_sig_img_tag']) { $text = preg_replace_callback('#\\[img\\]((ht|f)tps?://)([^\\s<"]*?)\\[/img\\]#', '_replace_signature_img', $text); } } // Deal with newlines, tabs and multiple spaces return str_replace(array("\n", "\t", ' ', ' '), array('<br />', '    ', '  ', '  '), $text); }
function parse_message($text, $hide_smilies) { // Convert applicable characters to HTML entities $text = htmlspecialchars($text); $text = do_clickable($text); //buat link $text = do_smilies($text); //alwais show smilies // Deal with newlines, tabs and multiple spaces $pattern = array("\n", "\t", ' ', ' '); $replace = array('<br />', ' ', ' ', ' '); $text = str_replace($pattern, $replace, $text); // Add paragraph tag around post, but make sure there are no empty paragraphs $text = str_replace('<p></p>', '', '<p>' . $text . '</p>'); $text = content_parser($text); return $text; }
require FORUM_ROOT . 'include/parser.php'; } $time_before = time() - $forum_config['o_om_shoutbox_msg_time'] * 60; // do not load the messages, that if ($_GET['list'] > $time_before) { $time_before = $_GET['list']; } $query = array('SELECT' => 'date, poster, message, color', 'FROM' => 'om_shoutbox', 'ORDER BY' => 'date DESC', 'WHERE' => 'date > ' . $time_before, 'LIMIT' => '0,' . $forum_config['o_om_shoutbox_msg_count']); $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $messages = array(); while ($msg = $forum_db->fetch_assoc($result)) { $text = $msg['message']; if (!empty($text) && $text[0] == '@' && strpos($text, '@' . $forum_user['username'] . ' ') !== 0 && $msg['poster'] != $forum_user['username']) { $msg_json = array('date' => $msg['date'], 'message' => null); $messages[] = $msg_json; continue; } $text = preg_replace('/(https?:\\/\\/[^\\s^\\[^\\]]+)/', '<a class="exthelp" href="$1" rel="nofollow">$1</a>', $text); $text = preg_replace('/\\[b\\](.+?)\\[\\/b\\]/', '<strong>$1</strong>', $text); if ($forum_config['o_om_shoutbox_show_smilies'] == '1') { $text = do_smilies($text); } $msg_json = array('date' => $msg['date'], 'poster' => $msg['poster'], 'message' => $text, 'color' => $msg['color']); $messages[] = $msg_json; } $messages = array_reverse($messages); echo json_encode(array('messages' => $messages)); // Close the db connection (and free up any result data) $forum_db->end_transaction(); $forum_db->close(); }