本文整理汇总了PHP中fix_html函数 的典型用法代码示例。如果您正苦于以下问题:PHP fix_html函数的具体用法?PHP fix_html怎么用?PHP fix_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fix_html函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: light_message_display
function light_message_display($tid, $message, $msg_count, $first_msg, $folder_fid, $in_list = true, $closed = false, $limit_text = true, $is_poll = false, $is_preview = false)
{
$perm_is_moderator = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_fid);
$post_edit_time = forum_get_setting('post_edit_time', null, 0);
$post_edit_grace_period = forum_get_setting('post_edit_grace_period', null, 0);
$webtag = get_webtag();
forum_check_webtag_available($webtag);
if (!isset($_SESSION['UID']) || !is_numeric($_SESSION['UID'])) {
return;
}
if ((!isset($message['CONTENT']) || $message['CONTENT'] == "") && !$is_preview) {
light_message_display_deleted($tid, isset($message['PID']) ? $message['PID'] : 0);
return;
}
$from_user_permissions = perm_get_user_permissions($message['FROM_UID']);
if ($_SESSION['UID'] != $message['FROM_UID']) {
if ($from_user_permissions & USER_PERM_WORMED && !$perm_is_moderator) {
light_message_display_deleted($tid, $message['PID']);
return;
}
}
if (!$is_preview && !isset($message['APPROVED'])) {
light_message_display_approval_req($tid, $message['PID']);
return;
}
if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) {
light_message_display_deleted($tid, $message['PID']);
return;
}
if (isset($message['RECIPIENTS']) && sizeof($message['RECIPIENTS']) == 1) {
$recipient = array_slice(array_values($message['RECIPIENTS']), 0, 1);
if (isset($recipient['RELATIONSHIP']) && $recipient['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) {
light_message_display_deleted($tid, $message['PID']);
return;
}
}
if (!$is_preview && isset($message['MOVED_TID']) && isset($message['MOVED_PID'])) {
light_message_display_moved($message);
return;
}
if (isset($_SESSION['IMAGES_TO_LINKS']) && $_SESSION['IMAGES_TO_LINKS'] == 'Y') {
$message['CONTENT'] = message_images_to_links($message['CONTENT']);
}
if (mb_strlen(strip_tags($message['CONTENT'])) > intval(forum_get_setting('maximum_post_length', null, 6226)) && $limit_text) {
$cut_msg = mb_substr($message['CONTENT'], 0, intval(forum_get_setting('maximum_post_length', null, 6226)));
$cut_msg = preg_replace("/(<[^>]+)?\$/Du", "", $cut_msg);
$message['CONTENT'] = fix_html($cut_msg);
$message['CONTENT'] .= "…[" . gettext("Message Truncated") . "]\n";
$message['CONTENT'] .= "<a href=\"ldisplay.php?webtag={$webtag}&msg={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" class=\"message_full_view\">" . gettext("View full message") . ".</a>";
}
if ($in_list && isset($message['PID'])) {
echo "<a name=\"a{$tid}_{$message['PID']}\"></a>";
}
if ($in_list && isset($message['PID'])) {
echo "<div class=\"message\" id=\"message_{$tid}_{$message['PID']}\">\n";
} else {
echo "<div class=\"message\">\n";
}
echo "<div class=\"message_header\">\n";
echo "<div class=\"message_from\">\n";
echo gettext("From"), ": ", word_filter_add_ob_tags(format_user_name($message['FROM_LOGON'], $message['FROM_NICKNAME']), true);
if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_FRIEND) {
echo html_style_image('friend', gettext("Friend"));
} else {
if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED) {
echo html_style_image('enemy', gettext("Ignored user"));
}
}
// If the user posting a poll is ignored, remove ignored status for this message only so the poll can be seen
if ($is_poll && $message['PID'] == 1 && isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED) {
$message['RELATIONSHIP'] -= USER_IGNORED;
}
if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED && $limit_text && $_SESSION['UID'] > 0) {
echo "<span class=\"message_ignored\">", gettext("Ignored message"), "</span>\n";
} else {
if ($in_list) {
if ($from_user_permissions & USER_PERM_WORMED) {
echo gettext("Wormed user");
}
echo "<span class=\"message_time\">", format_date_time($message['CREATED']), "</span>\n";
}
}
echo "<div class=\"clearer\"></div>\n";
echo "</div>";
echo "<div class=\"message_to\">", gettext("To"), ": ";
if (isset($message['RECIPIENTS']) && sizeof($message['RECIPIENTS']) > 0) {
foreach ($message['RECIPIENTS'] as $recipient) {
if (isset($recipient['RELATIONSHIP']) && $recipient['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) {
continue;
}
echo word_filter_add_ob_tags(format_user_name($recipient['LOGON'], $recipient['NICKNAME']), true), "\n";
if (isset($recipient['VIEWED']) && $recipient['VIEWED'] > 0) {
echo "<span>", html_style_image('post_read', sprintf(gettext("Read: %s"), format_date_time($recipient['VIEWED']))), "</span>\n";
} else {
if ($is_preview == false) {
echo "<span>", html_style_image('post_unread', gettext("Unread Message")), "</span>\n";
}
}
}
} else {
//.........这里部分代码省略.........
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:101, 代码来源:light.inc.php
示例2: html_display_error_array
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
html_display_error_array($error_msg_array, '600', 'left');
} else {
if ($peer_perms & USER_PERM_FOLDER_MODERATE && !session::check_perm(USER_PERM_CAN_IGNORE_ADMIN, 0)) {
html_display_warning_msg(gettext("You cannot ignore this user, as they are a moderator."), '600', 'left');
}
}
if (isset($_POST['preview_signature'])) {
if (($t_sig_content = user_get_sig($peer_uid)) !== false) {
$preview_message['RECIPIENTS'] = array();
$preview_from_user = user_get($peer_uid);
$preview_message['FROM_LOGON'] = $preview_from_user['LOGON'];
$preview_message['FROM_NICKNAME'] = $preview_from_user['NICKNAME'];
$preview_message['FROM_UID'] = $preview_from_user['UID'];
$preview_message['CONTENT'] = gettext("Signature Preview");
$preview_message['CONTENT'] .= "<div class=\"sig\">" . fix_html($t_sig_content) . "</div>";
$preview_message['CREATED'] = time();
echo " <br />\n";
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table class=\"box\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" class=\"posthead\">\n";
echo " <table class=\"posthead\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" class=\"subhead\">", gettext("Preview"), "</td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " <table class=\"posthead\" width=\"100%\">\n";
echo " <tr>\n";
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:31, 代码来源:user_rel.php
示例3: custom_new_ticket_ext1_check
custom_new_ticket_ext1_check($ext1);
}
if (!$isoper && defined("IRC_MODE")) {
/* Don't let users open another ticket if they already have a pending one on the same team but let opers bypass it! */
$query = squery("SELECT id,unick,open_time,rep_g FROM karnaf_tickets WHERE status!=0 AND rep_g='%s' AND ((unick='%s' AND unick!='Guest') OR uemail='%s' OR (opened_by='%s' AND opened_by!='Guest'))", $rep_g, $unick, $uemail, $unick);
if ($result = sql_fetch_array($query)) {
$error = "You already have an open ticket (#" . $result['id'] . ") for " . $rep_g . ".<br>";
$error .= "Please do not open more than one ticket about the same issue.<br>";
$error .= "If you need to send a reply or give more information please view your current ticket stauts and post a reply there.";
}
sql_free_result($query);
}
if (isset($error)) {
echo "Error!<br><br>" . $error;
} else {
squery("INSERT INTO karnaf_tickets(randcode,status,title,description,cat3_id,unick,ufullname,uemail,uphone,uip,upriority,priority,open_time,opened_by,rep_u,rep_g,is_real,is_private,email_upd,memo_upd) VALUES('%s',%d,'%s','%s','%d','%s','%s','%s','%s','%s',%d,%d,%d,'%s','%s','%s',%d,%d,%d,%d)", $randstr, 1, $title, $description, $cat3_id, $unick, fix_html($_POST['uname']), $uemail, $uphone, $uip, $upriority, $priority, time(), $nick, $rep_u, $rep_g, $is_real, $is_private, $email_upd, $memo_upd);
$id = sql_insert_id();
if (isset($ext1)) {
squery("UPDATE karnaf_tickets SET ext1='%s' WHERE id=%d", $ext1, $id);
}
if (isset($_POST['ext2']) && !empty($_POST['ext2'])) {
squery("UPDATE karnaf_tickets SET ext2='%s' WHERE id=%d", $_POST['ext2'], $id);
}
if (isset($_POST['ext3']) && !empty($_POST['ext3'])) {
squery("UPDATE karnaf_tickets SET ext3='%s' WHERE id=%d", $_POST['ext3'], $id);
}
?>
Your ticket has been opened.
<br>
Ticket ID: <?php
echo $id;
开发者ID:vik0803, 项目名称:karnaf, 代码行数:31, 代码来源:new.php
示例4: html_guest_error
if (!session::logged_in()) {
html_guest_error();
}
// Check we have Admin / Moderator access
if (!session::check_perm(USER_PERM_ADMIN_TOOLS, 0)) {
html_draw_error(gettext("You do not have permission to use this section."));
}
// Perform additional admin login.
admin_check_credentials();
// Get the user's post page preferences.
$page_prefs = session::get_post_page_prefs();
// Array to hold error messages
$error_msg_array = array();
// Check to see if we're submitting new page or retrieving the old one.
if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) {
$t_content = fix_html(emoticons_strip($_POST['t_content']), true);
} else {
$t_content = forum_get_setting('start_page', 'strlen', '');
}
// Submit code.
if (isset($_POST['save'])) {
// New array of forum settings.
$new_forum_settings = array('start_page' => $t_content);
// Save the settings.
if (forum_save_settings($new_forum_settings)) {
// Update the admin log.
admin_add_log_entry(EDITED_START_PAGE);
// Redirect back to self.
header_redirect("admin_startpage.php?webtag={$webtag}&updated=true");
exit;
}
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:31, 代码来源:admin_startpage.php
示例5: html_draw_error
}
if (!session::check_perm(USER_PERM_POST_CREATE, $t_fid)) {
html_draw_error(gettext("You cannot reply to posts in this folder"));
}
if (isset($_GET['quote_list']) && strlen(trim($_GET['quote_list'])) > 0) {
$quote_list = array_filter(explode(',', $_GET['quote_list']), 'is_numeric');
sort($quote_list);
$t_content_array = array();
foreach ($quote_list as $quote_pid) {
if ($message_array = messages_get($reply_to_tid, $quote_pid)) {
$message_author = htmlentities_array(format_user_name($message_array['FLOGON'], $message_array['FNICK']));
$message_content = message_get_content($reply_to_tid, $quote_pid);
$message_content = message_apply_formatting($message_content, true);
$message_link = "messages.php?webtag={$webtag}&msg={$reply_to_tid}.{$quote_pid}";
$t_content_array[] = sprintf('<div class="quotetext"><b>%s:</b> <a href="%s">%s</a></div>
<div class="quote">%s</div>', gettext('quote'), $message_link, $message_author, fix_html($message_content));
}
}
if (sizeof($t_content_array) > 0) {
$t_content = implode('', $t_content_array);
}
}
$new_thread = false;
} else {
if (isset($_POST['t_tid']) && isset($_POST['t_rpid'])) {
$reply_to_tid = is_numeric($_POST['t_tid']) ? $_POST['t_tid'] : 0;
$reply_to_pid = is_numeric($_POST['t_rpid']) ? $_POST['t_rpid'] : 0;
if (!($t_fid = thread_get_folder($reply_to_tid, $reply_to_pid))) {
html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) {
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:post.php
示例6: fix_html
$new_forum_settings['require_unique_email'] = "Y";
} else {
$new_forum_settings['require_unique_email'] = "N";
}
if (isset($_POST['require_email_confirmation']) && $_POST['require_email_confirmation'] == "Y") {
$new_forum_settings['require_email_confirmation'] = "Y";
} else {
$new_forum_settings['require_email_confirmation'] = "N";
}
if (isset($_POST['forum_rules_enabled']) && $_POST['forum_rules_enabled'] == "Y") {
$new_forum_settings['forum_rules_enabled'] = "Y";
} else {
$new_forum_settings['forum_rules_enabled'] = "N";
}
if (isset($_POST['forum_rules_message']) && strlen(trim($_POST['forum_rules_message'])) > 0) {
$new_forum_settings['forum_rules_message'] = fix_html(emoticons_strip($_POST['forum_rules_message']));
} else {
$new_forum_settings['forum_rules_message'] = "";
}
if (isset($_POST['enable_google_analytics']) && $_POST['enable_google_analytics'] == "Y") {
$new_forum_settings['enable_google_analytics'] = "Y";
} else {
$new_forum_settings['enable_google_analytics'] = "N";
}
if (isset($_POST['allow_forum_google_analytics']) && $_POST['allow_forum_google_analytics'] == "Y") {
$new_forum_settings['allow_forum_google_analytics'] = "Y";
} else {
$new_forum_settings['allow_forum_google_analytics'] = "N";
}
if (isset($_POST['google_analytics_code']) && strlen(trim($_POST['google_analytics_code'])) > 0) {
$new_forum_settings['google_analytics_code'] = trim($_POST['google_analytics_code']);
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:admin_default_forum_settings.php
示例7: html_draw_bottom
function html_draw_bottom($frame_set_html = false)
{
if (!is_bool($frame_set_html)) {
$frame_set_html = false;
}
if ($frame_set_html === false) {
if ($page_footer = html_get_page_footer()) {
echo fix_html($page_footer);
}
if (adsense_publisher_id() && adsense_check_user() && adsense_check_page_bottom()) {
echo '<br>';
adsense_output_html();
}
if ($google_analytics_code = html_get_google_analytics_code()) {
echo "<script type=\"text/javascript\">\n\n";
echo " var _gaq = _gaq || [];\n";
echo " _gaq.push(['_setAccount', '{$google_analytics_code}']);\n";
echo " _gaq.push(['_trackPageview']);\n\n";
echo " (function() {\n";
echo " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
echo " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
echo " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
echo " })();\n\n";
echo "</script>\n";
}
echo "</body>\n";
}
echo "</html>\n";
}
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:29, 代码来源:html.inc.php
示例8: __construct
public function __construct($message)
{
$this->original = $message;
$message_parts = preg_split('/(<[^<>]+>)/u', $message, -1, PREG_SPLIT_DELIM_CAPTURE);
$signature_parts = array();
if (($signature_offset = array_search("<div class=\"sig\">", $message_parts)) !== false) {
while (sizeof($message_parts) > 0) {
$signature_parts = array_merge($signature_parts, array_splice($message_parts, $signature_offset, 1));
if (count(explode('<div', implode('', $signature_parts))) == count(explode('</div>', implode('', $signature_parts)))) {
break;
}
}
}
$signature = preg_replace('/^<div class="sig">(.*)<\\/div>$/Dsu', '$1', implode('', $signature_parts));
$message = implode('', $message_parts);
$this->message = fix_html($message);
$this->sig = fix_html($signature);
}
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:18, 代码来源:post.inc.php
示例9: trim
if (($message = messages_get($search_result['TID'], $search_result['PID'], 1)) !== false) {
if (($thread_data = thread_get($search_result['TID'])) !== false) {
$message['TITLE'] = trim($thread_data['TITLE']);
// Fetch the messaage content, strip the signature and remove HTML.
$message['CONTENT'] = message_get_content($search_result['TID'], $search_result['PID']);
$message['CONTENT'] = message_apply_formatting($message['CONTENT'], true);
$message['CONTENT'] = trim(strip_tags($message['CONTENT']));
// Limit thread title to 20 characters.
if (mb_strlen($message['TITLE']) > 20) {
$message['TITLE'] = word_filter_add_ob_tags(mb_substr($message['TITLE'], 0, 20), true) . "…";
} else {
$message['TITLE'] = word_filter_add_ob_tags($message['TITLE'], true);
}
// Limit displayed post content to 35 characters
if (mb_strlen($message['CONTENT']) > 70) {
$message['CONTENT'] = word_filter_add_ob_tags(fix_html(mb_substr($message['CONTENT'], 0, 70)), true) . "…";
} else {
$message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT'], true);
}
if (thread_is_poll($search_result['TID']) && $search_result['PID'] == 1 || strlen($message['CONTENT']) < 1) {
echo " <li><p><a href=\"messages.php?webtag={$webtag}&msg={$search_result['TID']}.{$search_result['PID']}&hightlight=yes\" target=\"", html_get_frame_name('right'), "\"><b>{$message['TITLE']}</b></a><br />";
echo "<span><b>", gettext("From"), ":</b> ", word_filter_add_ob_tags(format_user_name($search_result['FROM_LOGON'], $search_result['FROM_NICKNAME']), true), ", ", format_date_time($search_result['CREATED']), "</span></p></li>\n";
} else {
echo " <li><p><a href=\"messages.php?webtag={$webtag}&msg={$search_result['TID']}.{$search_result['PID']}&highlight=yes\" target=\"", html_get_frame_name('right'), "\"><b>{$message['TITLE']}</b></a><br />";
echo "{$message['CONTENT']}<br /><span><b>", gettext("From"), ":</b> ", word_filter_add_ob_tags(format_user_name($search_result['FROM_LOGON'], $search_result['FROM_NICKNAME']), true), ", ", format_date_time($search_result['CREATED']), "</span></p></li>\n";
}
}
}
}
echo "</ol>\n";
if (ceil($search_results_array['result_count'] / 20) > $page) {
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:31, 代码来源:search.php
示例10: api_create_ticket
function api_create_ticket($unick, $uname, $uemail, $title, $description, $uip, $rep_g, $cat3_id = 71, $ext1 = "")
{
$randstr = RandomNumber(10);
$email_upd = 1;
$memo_upd = 1;
$uphone = "";
$rep_u = "";
$is_real = 0;
$is_private = 0;
$upriority = 0;
$priority = 0;
squery("INSERT INTO karnaf_tickets(randcode,status,title,description,cat3_id,unick,ufullname,uemail,uphone,uip,upriority,priority,open_time,opened_by,rep_u,rep_g,is_real,is_private,email_upd,memo_upd) VALUES('%s',%d,'%s','%s','%d','%s','%s','%s','%s','%s',%d,%d,%d,'%s','%s','%s',%d,%d,%d,%d)", $randstr, 1, $title, $description, $cat3_id, $unick, fix_html($uname), $uemail, $uphone, $uip, $upriority, $priority, time(), "(API)", $rep_u, $rep_g, $is_real, $is_private, $email_upd, $memo_upd);
$id = sql_insert_id();
if (!empty($ext1)) {
squery("UPDATE karnaf_tickets SET ext1='%s' WHERE id=%d", $ext1, $id);
}
return $id;
}
开发者ID:nirn, 项目名称:karnaf, 代码行数:18, 代码来源:ktools.php
示例11: squery
/* Don't let users open another ticket if they already have a pending one on the same team but let opers bypass it! */
$query = squery("SELECT id,unick,open_time,rep_g FROM karnaf_tickets WHERE status!=0 AND rep_g='%s' AND ((unick='%s' AND unick!='Guest') OR uemail='%s' OR (opened_by='%s' AND opened_by!='Guest'))",
$rep_g, $unick, $uemail, $unick);
if($result = sql_fetch_array($query)) {
$error = "You already have an open ticket (#".$result['id'].") for ".$rep_g.".<br>";
$error .= "Please do not open more than one ticket about the same issue.<br>";
$error .= "If you need to send a reply or give more information please view your current ticket stauts and post a reply there.";
}
sql_free_result($query);
}
if(isset($error)) {
echo "Error!<br><br>".$error;
}
else {
squery("INSERT INTO karnaf_tickets(randcode,status,title,description,cat3_id,unick,ufullname,uemail,uphone,uip,upriority,priority,open_time,opened_by,rep_u,rep_g,is_real,is_private,email_upd,memo_upd) VALUES('%s',%d,'%s','%s','%d','%s','%s','%s','%s','%s',%d,%d,%d,'%s','%s','%s',%d,%d,%d,%d)",
$randstr,1,$title,$description,$cat3_id,$unick,fix_html($_POST['uname']),$uemail,$uphone,$uip,$upriority,$priority,time(),$nick,$rep_u,
$rep_g,$is_real,$is_private,$email_upd,$memo_upd);
$id = sql_insert_id();
if(isset($ext1)) squery("UPDATE karnaf_tickets SET ext1='%s' WHERE id=%d", $ext1, $id);
if(isset($_POST['ext2']) && !empty($_POST['ext2'])) squery("UPDATE karnaf_tickets SET ext2='%s' WHERE id=%d", $_POST['ext2'], $id);
if(isset($_POST['ext3']) && !empty($_POST['ext3'])) squery("UPDATE karnaf_tickets SET ext3='%s' WHERE id=%d", $_POST['ext3'], $id);
?>
Your ticket has been opened.
<br>
Ticket ID: <?=$id?>
<br>
Verification Number: <?=$randstr?>
<br>
Assigned to: <?=$rep_g?>
<br>
Ticket status: <a href="<?=KARNAF_URL?>/view.php?id=<?=$id?>&code=<?=$randstr?>"><?=KARNAF_URL?>/view.php?id=<?=$id?>&code=<?=$randstr?></a><br>
开发者ID:kbuley, 项目名称:karnaf, 代码行数:31, 代码来源:new.php
示例12: rss_feed_check_feeds
function rss_feed_check_feeds()
{
if (($rss_feed = rss_feed_fetch()) !== false) {
if (($rss_data = rss_feed_read_database($rss_feed['URL'])) !== false) {
$max_item_count = min(10, $rss_feed['MAX_ITEM_COUNT']);
foreach ($rss_data as $item_index => $rss_feed_item) {
if ($item_index + 1 > $max_item_count) {
return;
}
if (!rss_feed_thread_exist($rss_feed['RSSID'], $rss_feed_item->link)) {
$rss_title = htmlentities_decode_array($rss_feed_item->title);
$rss_title = htmlentities_array(strip_tags($rss_title));
$rss_feed_name = htmlentities_array($rss_feed['NAME']);
$rss_quote_source = "{$rss_feed_name} {$rss_title}";
if (isset($rss_feed['PREFIX']) && strlen(trim($rss_feed['PREFIX'])) > 0) {
$rss_feed_prefix = htmlentities_array($rss_feed['PREFIX']);
$rss_title = "{$rss_feed_prefix} {$rss_title}";
}
if (mb_strlen($rss_title) > 64) {
$rss_title = mb_substr($rss_title, 0, 60);
if (($pos = mb_strrpos($rss_title, ' ')) !== false) {
$rss_title = trim(mb_substr($rss_title, 0, $pos));
}
$rss_title .= "...";
}
if (strlen($rss_feed_item->description) > 1) {
$rss_feed_item_description = htmlentities_decode_array($rss_feed_item->description);
$rss_content = fix_html(sprintf('<div class="quotetext"><b>%s:</b> <a href="%s">%s</a></div>
<div class="quote">%s</div>', gettext('quote'), $rss_feed_item->link, $rss_quote_source, $rss_feed_item_description));
} else {
$rss_content = fix_html(sprintf('<p>%s</p><a href=\\"%s\\" target=\\"_blank\\">%s</a>', $rss_quote_source, $rss_feed_item->link, gettext("Click here to read this article")));
}
$tid = post_create_thread($rss_feed['FID'], $rss_feed['UID'], $rss_title);
post_create($rss_feed['FID'], $tid, 0, $rss_feed['UID'], array(), $rss_content);
rss_feed_create_history($rss_feed['RSSID'], $rss_feed_item->link);
}
}
}
}
}
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:40, 代码来源:rss_feed.inc.php
示例13: light_message_display
function light_message_display($tid, $message, $msg_count, $first_msg, $folder_fid, $in_list = true, $closed = false, $limit_text = true, $is_poll = false, $is_preview = false)
{
$perm_is_moderator = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_fid);
$post_edit_time = forum_get_setting('post_edit_time', null, 0);
$post_edit_grace_period = forum_get_setting('post_edit_grace_period', null, 0);
$webtag = get_webtag();
$attachments_array = array();
$image_attachments_array = array();
if (($uid = session::get_value('UID')) === false) {
return;
}
if ((!isset($message['CONTENT']) || $message['CONTENT'] == "") && !$is_preview) {
light_message_display_deleted($tid, isset($message['PID']) ? $message['PID'] : 0);
return;
}
$from_user_permissions = perm_get_user_permissions($message['FROM_UID']);
if ($uid != $message['FROM_UID']) {
if ($from_user_permissions & USER_PERM_WORMED && !$perm_is_moderator) {
light_message_display_deleted($tid, $message['PID']);
return;
}
}
if (!isset($message['FROM_RELATIONSHIP'])) {
$message['FROM_RELATIONSHIP'] = 0;
}
if (!isset($message['TO_RELATIONSHIP'])) {
$message['TO_RELATIONSHIP'] = 0;
}
if ($message['TO_RELATIONSHIP'] & USER_IGNORED_COMPLETELY || $message['FROM_RELATIONSHIP'] & USER_IGNORED_COMPLETELY) {
light_message_display_deleted($tid, $message['PID']);
return;
}
if (forum_get_setting('require_post_approval', 'Y') && $message['FROM_UID'] != $uid) {
if (isset($message['APPROVED']) && $message['APPROVED'] == 0 && !$perm_is_moderator) {
light_message_display_approval_req($tid, $message['PID']);
return;
}
}
// OUTPUT MESSAGE ----------------------------------------------------------
if (!$is_preview && $message['MOVED_TID'] > 0 && $message['MOVED_PID'] > 0) {
$post_link = "<a href=\"messages.php?webtag={$webtag}&msg=%s.%s\" target=\"_self\">%s</a>";
$post_link = sprintf($post_link, $message['MOVED_TID'], $message['MOVED_PID'], gettext("here"));
light_html_display_warning_msg(gettext("<b>Thread Split:</b> This post has been moved %s"), $post_link);
return;
}
if ($in_list) {
echo "<a name=\"a{$tid}_{$message['PID']}\"></a>";
}
echo "<div class=\"message\">\n";
if (session::get_value('IMAGES_TO_LINKS') == 'Y') {
$message['CONTENT'] = preg_replace('/<a([^>]*)href="([^"]*)"([^\\>]*)><img[^>]*src="([^"]*)"[^>]*><\\/a>/iu', '[img: <a\\1href="\\2"\\3>\\4</a>]', $message['CONTENT']);
$message['CONTENT'] = preg_replace('/<img[^>]*src="([^"]*)"[^>]*>/iu', '[img: <a href="\\1">\\1</a>]', $message['CONTENT']);
$message['CONTENT'] = preg_replace('/<embed[^>]*src="([^"]*)"[^>]*>/iu', '[object: <a href="\\1">\\1</a>]', $message['CONTENT']);
}
if (mb_strlen(strip_tags($message['CONTENT'])) > intval(forum_get_setting('maximum_post_length', null, 6226)) && $limit_text) {
$cut_msg = mb_substr($message['CONTENT'], 0, intval(forum_get_setting('maximum_post_length', null, 6226)));
$cut_msg = preg_replace("/(<[^>]+)?\$/Du", "", $cut_msg);
$message['CONTENT'] = fix_html($cut_msg);
$message['CONTENT'] .= "…[" . gettext("Message Truncated") . "]\n";
$message['CONTENT'] .= "<a href=\"ldisplay.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" class=\"message_full_view\">" . gettext("View full message") . ".</a>";
}
echo "<div class=\"message_header\">\n";
echo "<div class=\"message_from\">\n";
echo "", gettext("From"), ": ", word_filter_add_ob_tags(format_user_name($message['FLOGON'], $message['FNICK']), true);
if ($message['FROM_RELATIONSHIP'] & USER_FRIEND) {
echo "<span class=\"user_friend\" title=\"", gettext("Friend"), "\">[F]</span>";
} else {
if ($message['FROM_RELATIONSHIP'] & USER_IGNORED) {
echo "<span class=\"user_enemy\" title=\"", gettext("Ignored user"), "\">[E]</span>";
}
}
// If the user posting a poll is ignored, remove ignored status for this message only so the poll can be seen
if ($is_poll && $message['PID'] == 1 && $message['FROM_RELATIONSHIP'] & USER_IGNORED) {
$message['FROM_RELATIONSHIP'] -= USER_IGNORED;
}
if ($message['FROM_RELATIONSHIP'] & USER_IGNORED && $limit_text) {
echo gettext("Ignored message");
} else {
if ($in_list) {
if ($from_user_permissions & USER_PERM_WORMED) {
echo gettext("Wormed user");
}
echo "<span class=\"message_time\">", format_time($message['CREATED']), "</span>\n";
}
}
echo "<div class=\"clearer\"></div>\n";
echo "</div>";
echo "<div class=\"message_to\">\n";
if ($message['TLOGON'] != gettext("ALL") && $message['TO_UID'] != 0) {
echo "", gettext("To"), ": ", word_filter_add_ob_tags(format_user_name($message['TLOGON'], $message['TNICK']), true);
if ($message['TO_RELATIONSHIP'] & USER_FRIEND) {
echo "<span class=\"user_friend\" title=\"", gettext("Friend"), "\">[F]</span>";
} else {
if ($message['TO_RELATIONSHIP'] & USER_IGNORED) {
echo "<span class=\"user_enemy\" title=\"", gettext("Ignored user"), "\">[E]</span>";
}
}
if (!$is_preview) {
if (isset($message['VIEWED']) && $message['VIEWED'] > 0) {
echo "<span class=\"message_read\">", format_time($message['VIEWED']), "</span>";
//.........这里部分代码省略.........
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:101, 代码来源:light.inc.php
示例14: message_display
function message_display($tid, $message, $msg_count, $first_msg, $folder_fid, $in_list = true, $closed = false, $limit_text = true, $is_poll = false, $show_sigs = true, $is_preview = false, $highlight_array = array())
{
$perm_is_moderator = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_fid);
$post_edit_time = forum_get_setting('post_edit_time', null, 0);
$post_edit_grace_period = forum_get_setting('post_edit_grace_period', null, 0);
$webtag = get_webtag();
if (($uid = session::get_value('UID')) === false) {
return;
}
if ($posts_per_page = session::get_value('POSTS_PER_PAGE')) {
if ($posts_per_page < 10) {
$posts_per_page = 10;
}
if ($posts_per_page > 30) {
$posts_per_page = 30;
}
} else {
$posts_per_page = 20;
}
if (($quick_reply = session::get_value('REPLY_QUICK')) === false) {
$quick_reply = 'N';
}
if ((!isset($message['CONTENT']) || $message['CONTENT'] == "") && !$is_preview) {
message_display_deleted($tid, isset($message['PID']) ? $message['PID'] : 0, $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page);
return;
}
$from_user_permissions = perm_get_user_permissions($message['FROM_UID']);
if ($uid != $message['FROM_UID']) {
if ($from_user_permissions & USER_PERM_WORMED && !$perm_is_moderator) {
message_display_deleted($tid, $message['PID'], $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page);
return;
}
}
if (!isset($message['FROM_RELATIONSHIP'])) {
$message['FROM_RELATIONSHIP'] = 0;
}
if (!isset($message['TO_RELATIONSHIP'])) {
$message['TO_RELATIONSHIP'] = 0;
}
if ($message['TO_RELATIONSHIP'] & USER_IGNORED_COMPLETELY || $message['FROM_RELATIONSHIP'] & USER_IGNORED_COMPLETELY) {
message_display_deleted($tid, $message['PID'], $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page);
return;
}
// Add emoticons/WikiLinks and ignore signature ----------------------------
if (session::get_value('IMAGES_TO_LINKS') == 'Y') {
$message['CONTENT'] = preg_replace('/<a([^>]*)href="([^"]*)"([^\\>]*)><img[^>]*src="([^"]*)"[^>]*><\\/a>/iu', '[href: <a\\1href="\\2"\\3>\\2</a>][img: <a\\1href="\\4"\\3>\\4</a>]', $message['CONTENT']);
$message['CONTENT'] = preg_replace('/<img[^>]*src="([^"]*)"[^>]*>/iu', '[img: <a href="\\1">\\1</a>]', $message['CONTENT']);
$message['CONTENT'] = preg_replace('/<embed[^>]*src="([^"]*)"[^>]*>/iu', '[object: <a href="\\1">\\1</a>]', $message['CONTENT']);
}
if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) {
$message['CONTENT'] = message_apply_formatting($message['CONTENT'], $message['FROM_RELATIONSHIP'] & USER_IGNORED_SIG || !$show_sigs);
}
// Check length of post to see if we should truncate it for display --------
if (mb_strlen(strip_tags($message['CONTENT'])) > intval(forum_get_setting('maximum_post_length', null, 6226)) && $limit_text) {
$cut_msg = mb_substr($message['CONTENT'], 0, intval(forum_get_setting('maximum_post_length', null, 6226)));
$cut_msg = preg_replace("/(<[^>]+)?\$/Du", "", $cut_msg);
$message['CONTENT'] = fix_html($cut_msg);
$message['CONTENT'] .= "…[" . gettext("Message Truncated") . "]\n<p align=\"center\"><a href=\"display.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" target=\"_self\">" . gettext("View full message") . "</a>";
}
// Check for words that should be filtered ---------------------------------
if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) {
$message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT'], false);
}
if ($in_list && isset($message['PID'])) {
echo "<a name=\"a{$tid}_{$message['PID']}\"></a>\n";
}
// Check for search words to highlight -------------------------------------
if (is_array($highlight_array) && sizeof($highlight_array) > 0) {
$highlight_pattern = array();
$highlight_replace = array();
foreach ($highlight_array as $key => $word) {
$highlight_word = preg_quote($word, "/");
$highlight_pattern[$key] = "/({$highlight_word})/iu";
$highlight_replace[$key] = "<span class=\"highlight\">\\1</span>";
}
$message_parts = preg_split('/([<|>])/u', $message['CONTENT'], -1, PREG_SPLIT_DELIM_CAPTURE);
for ($i = 0; $i < sizeof($message_parts); $i++) {
if (!($i % 4)) {
$message_parts[$i] = preg_replace($highlight_pattern, $highlight_replace, $message_parts[$i], 1);
}
}
$message['CONTENT'] = implode("", $message_parts);
}
// Little up/down arrows to the left of each message -----------------------
if (forum_get_setting('require_post_approval', 'Y') && $message['FROM_UID'] != $uid) {
if (isset($message['APPROVED']) && $message['APPROVED'] == 0 && !$perm_is_moderator) {
message_display_approval_req($tid, $message['PID'], $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page);
return;
}
}
// OUTPUT MESSAGE ----------------------------------------------------------
if (!$is_preview && $message['MOVED_TID'] > 0 && $message['MOVED_PID'] > 0) {
$post_link = "<a href=\"messages.php?webtag={$webtag}&msg=%s.%s\" target=\"_self\">%s</a>";
$post_link = sprintf($post_link, $message['MOVED_TID'], $message['MOVED_PID'], gettext("here"));
echo "<div align=\"center\">\n";
echo "<table class=\"thread_track_notice\" width=\"96%\">\n";
echo " <tr>\n";
echo " <td align=\"left\">", sprintf(gettext("<b>Thread Split:</b> This post has been moved %s"), $post_link), "</td>\n";
echo " </tr>\n";
echo "</table>\n";
//.........这里部分代码省略.........
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:101, 代码来源:messages.inc.php
示例15: forum_update_access
}
if (isset($_POST['access_level']) && is_numeric($_POST['access_level'])) {
forum_update_access($forum_settings['fid'], $_POST['access_level']);
}
if (isset($_POST['closed_message']) && strlen(trim($_POST['closed_message'])) > 0) {
$new_forum_settings['closed_message'] = fix_html(emoticons_strip($_POST['closed_message']), true);
} else {
$new_forum_settings['closed_message'] = "";
}
if (isset($_POST['restricted_message']) && strlen(trim($_POST['restricted_message'])) > 0) {
$new_forum_settings['restricted_message'] = fix_html(emoticons_strip($_POST['restricted_message']), true);
} else {
$new_forum_settings['restricted_message'] = "";
}
if (isset($_POST['password_protected_message']) && strlen(trim($_POST['password_protected_message'])) > 0) {
$new_forum_settings['password_protected_message'] = fix_html(emoticons_strip($_POST['password_protected_message']), true);
} else {
$new_forum_settings['password_protected_message'] = "";
}
if (isset($_POST['allow_post_editing']) && $_POST['allow_post_editing'] == "Y") {
$new_forum_settings['allow_post_editing'] = "Y";
} else {
$new_forum_settings['allow_post_editing'] = "N";
}
if (isset($_POST['post_edit_time']) && is_numeric($_POST['post_edit_time'])) {
$new_forum_settings['post_edit_time'] = $_POST['post_edit_time'];
} else {
$new_forum_settings['post_edit_time'] = 0;
}
if (isset($_POST['post_edit_grace_period']) && is_numeric($_POST['post_edit_grace_period'])) {
$new_forum_settings['post_edit_grace_period'] = $_POST['post_edit_grace_period'];
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:31, 代码来源:admin_forum_settings.php
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1291| 2022-08-30
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1205| 2022-08-17
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:1002| 2022-11-06
Vesta v1.0.0-5 was discovered to contain a cross-site scripting (XSS) vulnerabil
阅读:533| 2022-07-29
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1401| 2022-08-18
sslcommerz/SSLCommerz-Laravel: SSLCOMMERZ is a bangladeshi payment gateway provi
阅读:917| 2022-08-13
qiangxi/CheckUpdateLibrary: Android检查更新库
阅读:881| 2022-08-15
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:518| 2022-08-16
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:669| 2022-11-06
这个文章不会说具体0到1的代码流程,我会着重讲几个问题的解决 准备以下依赖 amp;quot
阅读:643| 2022-07-18
请发表评论