• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bbcode_nl2br函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bbcode_nl2br函数的典型用法代码示例。如果您正苦于以下问题:PHP bbcode_nl2br函数的具体用法?PHP bbcode_nl2br怎么用?PHP bbcode_nl2br使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bbcode_nl2br函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: main

    function main($id, $mode)
    {
        global $auth, $db, $user, $template, $cache;
        global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher;
        include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
        $forum_id = request_var('f', 0);
        $start = request_var('start', 0);
        $this->page_title = 'MCP_REPORTS';
        switch ($action) {
            case 'close':
            case 'delete':
                include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                $report_id_list = request_var('report_id_list', array(0));
                if (!sizeof($report_id_list)) {
                    trigger_error('NO_REPORT_SELECTED');
                }
                close_report($report_id_list, $mode, $action);
                break;
        }
        switch ($mode) {
            case 'report_details':
                $user->add_lang(array('posting', 'viewforum', 'viewtopic'));
                $post_id = request_var('p', 0);
                // closed reports are accessed by report id
                $report_id = request_var('r', 0);
                $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, r.reported_post_enable_magic_url, r.reported_post_enable_smilies, r.reported_post_enable_bbcode, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
					FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
					WHERE ' . ($report_id ? 'r.report_id = ' . $report_id : "r.post_id = {$post_id}") . '
						AND rr.reason_id = r.reason_id
						AND r.user_id = u.user_id
						AND r.pm_id = 0
					ORDER BY report_closed ASC';
                $result = $db->sql_query_limit($sql, 1);
                $report = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
                if (!$report) {
                    trigger_error('NO_REPORT');
                }
                $phpbb_notifications = $phpbb_container->get('notification_manager');
                $phpbb_notifications->mark_notifications_read('notification.type.report_post', $post_id, $user->data['user_id']);
                if (!$report_id && $report['report_closed']) {
                    trigger_error('REPORT_CLOSED');
                }
                $post_id = $report['post_id'];
                $report_id = $report['report_id'];
                $parse_post_flags = $report['reported_post_enable_bbcode'] ? OPTION_FLAG_BBCODE : 0;
                $parse_post_flags += $report['reported_post_enable_smilies'] ? OPTION_FLAG_SMILIES : 0;
                $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0;
                $post_info = phpbb_get_post_data(array($post_id), 'm_report', true);
                if (!sizeof($post_info)) {
                    trigger_error('NO_REPORT_SELECTED');
                }
                $post_info = $post_info[$post_id];
                $reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']);
                if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])])) {
                    $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])];
                    $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])];
                }
                if (topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false)) {
                    $template->assign_vars(array('S_TOPIC_REVIEW' => true, 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], 'TOPIC_TITLE' => $post_info['topic_title'], 'REPORTED_POST_ID' => $post_id));
                }
                $topic_tracking_info = $extensions = $attachments = array();
                // Get topic tracking info
                if ($config['load_db_lastread']) {
                    $tmp_topic_data = array($post_info['topic_id'] => $post_info);
                    $topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time']));
                    unset($tmp_topic_data);
                } else {
                    $topic_tracking_info = get_complete_topic_tracking($post_info['forum_id'], $post_info['topic_id']);
                }
                $post_unread = isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']] ? true : false;
                $message = generate_text_for_display($report['reported_post_text'], $report['reported_post_uid'], $report['reported_post_bitfield'], $parse_post_flags, false);
                $report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
                if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) {
                    $sql = 'SELECT *
						FROM ' . ATTACHMENTS_TABLE . '
						WHERE post_msg_id = ' . $post_id . '
							AND in_message = 0
							AND filetime <= ' . (int) $report['report_time'] . '
						ORDER BY filetime DESC';
                    $result = $db->sql_query($sql);
                    while ($row = $db->sql_fetchrow($result)) {
                        $attachments[] = $row;
                    }
                    $db->sql_freeresult($result);
                    if (sizeof($attachments)) {
                        $update_count = array();
                        parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);
                    }
                    // Display not already displayed Attachments for this post, we already parsed them. ;)
                    if (!empty($attachments)) {
                        $template->assign_var('S_HAS_ATTACHMENTS', true);
                        foreach ($attachments as $attachment) {
                            $template->assign_block_vars('attachment', array('DISPLAY_ATTACHMENT' => $attachment));
                        }
                    }
                }
                $template->assign_vars(array('S_MCP_REPORT' => true, 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE, 'S_POST_LOCKED' => $post_info['post_edit_locked'], 'S_REPORT_CLOSED' => $report['report_closed'], 'S_USER_NOTES' => true, 'U_EDIT' => $auth->acl_get('m_edit', $post_info['forum_id']) ? append_sid("{$phpbb_root_path}posting.{$phpEx}", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '', 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']), 'U_MCP_WARN_REPORTER' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '', 'U_MCP_WARN_USER' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '', 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $post_info['forum_id']), 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), 'MINI_POST_IMG' => $post_unread ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports' . ($post_info['post_reported'] ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'REPORT_DATE' => $user->format_date($report['report_time']), 'REPORT_ID' => $report_id, 'REPORT_REASON_TITLE' => $reason['title'], 'REPORT_REASON_DESCRIPTION' => $reason['description'], 'REPORT_TEXT' => $report['report_text'], 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']), 'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']), 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $post_info['post_subject'] ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => $auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '') ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], 'U_LOOKUP_IP' => $auth->acl_get('m_info', $post_info['forum_id']) ? $this->u_action . '&amp;r=' . $report_id . '&amp;p=' . $post_id . '&amp;f=' . $forum_id . '&amp;lookup=' . $post_info['poster_ip'] . '#ip' : ''));
                $this->tpl_name = 'mcp_post';
                break;
//.........这里部分代码省略.........
开发者ID:Voxel37,项目名称:phpbb,代码行数:101,代码来源:mcp_reports.php


示例2: get_profile_value

	/**
	* Get Profile Value for display
	*/
	function get_profile_value($ident_ary)
	{
		$value = $ident_ary['value'];
		$field_type = $ident_ary['data']['field_type'];

		switch ($this->profile_types[$field_type])
		{
			case 'int':
				if ($value === '' && !$ident_ary['data']['field_show_novalue'])
				{
					return NULL;
				}
				return (int) $value;
			break;

			case 'string':
			case 'text':
				if (!$value && !$ident_ary['data']['field_show_novalue'])
				{
					return NULL;
				}

				$value = make_clickable($value);
				$value = censor_text($value);
				$value = bbcode_nl2br($value);
				return $value;
			break;

			// case 'datetime':
			case 'date':
				$date = explode('-', $value);
				$day = (isset($date[0])) ? (int) $date[0] : 0;
				$month = (isset($date[1])) ? (int) $date[1] : 0;
				$year = (isset($date[2])) ? (int) $date[2] : 0;

				if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue'])
				{
					return NULL;
				}
				else if ($day && $month && $year)
				{
					global $user;
					// Date should display as the same date for every user regardless of timezone, so remove offset
					// to compensate for the offset added by user::format_date()
					return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) - ($user->timezone + $user->dst), $user->lang['DATE_FORMAT'], true);
				}

				return $value;
			break;

			case 'dropdown':
				$field_id = $ident_ary['data']['field_id'];
				$lang_id = $ident_ary['data']['lang_id'];
				if (!isset($this->options_lang[$field_id][$lang_id]))
				{
					$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
				}

				if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue'])
				{
					return NULL;
				}

				$value = (int) $value;

				// User not having a value assigned
				if (!isset($this->options_lang[$field_id][$lang_id][$value]))
				{
					if ($ident_ary['data']['field_show_novalue'])
					{
						$value = $ident_ary['data']['field_novalue'];
					}
					else
					{
						return NULL;
					}
				}

				return $this->options_lang[$field_id][$lang_id][$value];
			break;

			case 'bool':
				$field_id = $ident_ary['data']['field_id'];
				$lang_id = $ident_ary['data']['lang_id'];
				if (!isset($this->options_lang[$field_id][$lang_id]))
				{
					$this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);
				}

				if (!$value && $ident_ary['data']['field_show_novalue'])
				{
					$value = $ident_ary['data']['field_default_value'];
				}

				if ($ident_ary['data']['field_length'] == 1)
				{
					return (isset($this->options_lang[$field_id][$lang_id][(int) $value])) ? $this->options_lang[$field_id][$lang_id][(int) $value] : NULL;
//.........这里部分代码省略.........
开发者ID:gonzo1247,项目名称:hitman_roa,代码行数:101,代码来源:functions_profile_fields.php


示例3: message_history

/**
* Display Message History
*/
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
{
    global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
    // Get History Messages (could be newer)
    $sql = 'SELECT t.*, p.*, u.*
		FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . ' t, ' . USERS_TABLE . ' u
		WHERE t.msg_id = p.msg_id
			AND p.author_id = u.user_id
			AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ")\n\t\t\tAND t.user_id = {$user_id}";
    if (!$message_row['root_level']) {
        $sql .= " AND (p.root_level = {$msg_id} OR (p.root_level = 0 AND p.msg_id = {$msg_id}))";
    } else {
        $sql .= " AND (p.root_level = " . $message_row['root_level'] . ' OR p.msg_id = ' . $message_row['root_level'] . ')';
    }
    $sql .= ' ORDER BY p.message_time DESC';
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    if (!$row) {
        $db->sql_freeresult($result);
        return false;
    }
    $rowset = array();
    $bbcode_bitfield = '';
    $folder_url = append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=pm') . '&amp;folder=';
    do {
        $folder_id = (int) $row['folder_id'];
        $row['folder'][] = isset($folder[$folder_id]) ? '<a href="' . $folder_url . $folder_id . '">' . $folder[$folder_id]['folder_name'] . '</a>' : $user->lang['UNKNOWN_FOLDER'];
        if (isset($rowset[$row['msg_id']])) {
            $rowset[$row['msg_id']]['folder'][] = isset($folder[$folder_id]) ? '<a href="' . $folder_url . $folder_id . '">' . $folder[$folder_id]['folder_name'] . '</a>' : $user->lang['UNKNOWN_FOLDER'];
        } else {
            $rowset[$row['msg_id']] = $row;
            $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
        }
    } while ($row = $db->sql_fetchrow($result));
    $db->sql_freeresult($result);
    $title = $row['message_subject'];
    if (sizeof($rowset) == 1 && !$in_post_mode) {
        return false;
    }
    // Instantiate BBCode class
    if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '') {
        if (!class_exists('bbcode')) {
            include $phpbb_root_path . 'includes/bbcode.' . $phpEx;
        }
        $bbcode = new bbcode(base64_encode($bbcode_bitfield));
    }
    $title = censor_text($title);
    $url = append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=pm');
    $next_history_pm = $previous_history_pm = $prev_id = 0;
    foreach ($rowset as $id => $row) {
        $author_id = $row['author_id'];
        $folder_id = (int) $row['folder_id'];
        $subject = $row['message_subject'];
        $message = $row['message_text'];
        $message = censor_text($message);
        $decoded_message = false;
        if ($in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id']) {
            $decoded_message = $message;
            decode_message($decoded_message, $row['bbcode_uid']);
            $decoded_message = bbcode_nl2br($decoded_message);
        }
        if ($row['bbcode_bitfield']) {
            $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
        }
        $message = bbcode_nl2br($message);
        $message = smiley_text($message, !$row['enable_smilies']);
        $subject = censor_text($subject);
        if ($id == $msg_id) {
            $next_history_pm = next($rowset);
            $next_history_pm = sizeof($next_history_pm) ? (int) $next_history_pm['msg_id'] : 0;
            $previous_history_pm = $prev_id;
        }
        $template->assign_block_vars('history_row', array('MESSAGE_AUTHOR_QUOTE' => $decoded_message ? addslashes(get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username'])) : '', 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $row['username'], $row['user_colour'], $row['username']), 'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $row['username'], $row['user_colour'], $row['username']), 'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username']), 'U_MESSAGE_AUTHOR' => get_username_string('profile', $author_id, $row['username'], $row['user_colour'], $row['username']), 'SUBJECT' => $subject, 'SENT_DATE' => $user->format_date($row['message_time']), 'MESSAGE' => $message, 'FOLDER' => implode(', ', $row['folder']), 'DECODED_MESSAGE' => $decoded_message, 'S_CURRENT_MSG' => $row['msg_id'] == $msg_id, 'S_AUTHOR_DELETED' => $author_id == ANONYMOUS ? true : false, 'S_IN_POST_MODE' => $in_post_mode, 'MSG_ID' => $row['msg_id'], 'U_VIEW_MESSAGE' => "{$url}&amp;f={$folder_id}&amp;p=" . $row['msg_id'], 'U_QUOTE' => !$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id'] ? "{$url}&amp;mode=compose&amp;action=quote&amp;f=" . $folder_id . "&amp;p=" . $row['msg_id'] : '', 'U_POST_REPLY_PM' => $author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm') ? "{$url}&amp;mode=compose&amp;action=reply&amp;f={$folder_id}&amp;p=" . $row['msg_id'] : ''));
        unset($rowset[$id]);
        $prev_id = $id;
    }
    $template->assign_vars(array('QUOTE_IMG' => $user->img('icon_post_quote', $user->lang['REPLY_WITH_QUOTE']), 'HISTORY_TITLE' => $title, 'U_VIEW_NEXT_HISTORY' => $next_history_pm ? "{$url}&amp;p=" . $next_history_pm : '', 'U_VIEW_PREVIOUS_HISTORY' => $previous_history_pm ? "{$url}&amp;p=" . $previous_history_pm : ''));
    return true;
}
开发者ID:jvinhit,项目名称:php,代码行数:82,代码来源:functions_privmsgs.php


示例4: mcp_topic_view


//.........这里部分代码省略.........
    if (!empty($sort_days_old) && $sort_days_old != $sort_days || $total <= $posts_per_page) {
        $start = 0;
    }
    // Make sure $start is set to the last page if it exceeds the amount
    if ($start < 0 || $start >= $total) {
        $start = $start < 0 ? 0 : floor(($total - 1) / $posts_per_page) * $posts_per_page;
    }
    $sql = 'SELECT u.username, u.username_clean, u.user_colour, p.*
		FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
		WHERE ' . ($action == 'reports' ? 'p.post_reported = 1 AND ' : '') . '
			p.topic_id = ' . $topic_id . ' ' . (!$auth->acl_get('m_approve', $topic_info['forum_id']) ? ' AND p.post_approved = 1 ' : '') . '
			AND p.poster_id = u.user_id ' . $limit_time_sql . '
		ORDER BY ' . $sort_order_sql;
    $result = $db->sql_query_limit($sql, $posts_per_page, $start);
    $rowset = $post_id_list = array();
    $bbcode_bitfield = '';
    while ($row = $db->sql_fetchrow($result)) {
        $rowset[] = $row;
        $post_id_list[] = $row['post_id'];
        $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
    }
    $db->sql_freeresult($result);
    if ($bbcode_bitfield !== '') {
        include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
        $bbcode = new bbcode(base64_encode($bbcode_bitfield));
    }
    $topic_tracking_info = array();
    // Get topic tracking info
    if ($config['load_db_lastread']) {
        $tmp_topic_data = array($topic_id => $topic_info);
        $topic_tracking_info = get_topic_tracking($topic_info['forum_id'], $topic_id, $tmp_topic_data, array($topic_info['forum_id'] => $topic_info['forum_mark_time']));
        unset($tmp_topic_data);
    } else {
        $topic_tracking_info = get_complete_topic_tracking($topic_info['forum_id'], $topic_id);
    }
    $has_unapproved_posts = false;
    // Grab extensions
    $extensions = $attachments = array();
    if ($topic_info['topic_attachment'] && sizeof($post_id_list)) {
        $extensions = $cache->obtain_attach_extensions($topic_info['forum_id']);
        // Get attachments...
        if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_info['forum_id'])) {
            $sql = 'SELECT *
				FROM ' . ATTACHMENTS_TABLE . '
				WHERE ' . $db->sql_in_set('post_msg_id', $post_id_list) . '
					AND in_message = 0
				ORDER BY filetime DESC, post_msg_id ASC';
            $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result)) {
                $attachments[$row['post_msg_id']][] = $row;
            }
            $db->sql_freeresult($result);
        }
    }
    foreach ($rowset as $i => $row) {
        $message = $row['post_text'];
        $post_subject = $row['post_subject'] != '' ? $row['post_subject'] : $topic_info['topic_title'];
        if ($row['bbcode_bitfield']) {
            $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
        }
        $message = bbcode_nl2br($message);
        $message = smiley_text($message);
        if (!empty($attachments[$row['post_id']])) {
            $update_count = array();
            parse_attachments($topic_info['forum_id'], $message, $attachments[$row['post_id']], $update_count);
        }
        if (!$row['post_approved']) {
            $has_unapproved_posts = true;
        }
        $post_unread = isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id] ? true : false;
        $template->assign_block_vars('postrow', array('POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_DATE' => $user->format_date($row['post_time']), 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'POST_ID' => $row['post_id'], 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 't=' . $topic_id) . '">', '</a>'), 'MINI_POST_IMG' => $post_unread ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), 'S_POST_REPORTED' => $row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id']), 'S_POST_UNAPPROVED' => !$row['post_approved'] && $auth->acl_get('m_approve', $topic_info['forum_id']), 'S_CHECKED' => $submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list) || in_array(intval($row['post_id']), $checked_ids) ? true : false, 'S_HAS_ATTACHMENTS' => !empty($attachments[$row['post_id']]) ? true : false, 'U_POST_DETAILS' => "{$url}&amp;i={$id}&amp;p={$row['post_id']}&amp;mode=post_details" . ($forum_id ? "&amp;f={$forum_id}" : ''), 'U_MCP_APPROVE' => $auth->acl_get('m_approve', $topic_info['forum_id']) ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '', 'U_MCP_REPORT' => $auth->acl_get('m_report', $topic_info['forum_id']) ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : ''));
        // Display not already displayed Attachments for this post, we already parsed them. ;)
        if (!empty($attachments[$row['post_id']])) {
            foreach ($attachments[$row['post_id']] as $attachment) {
                $template->assign_block_vars('postrow.attachment', array('DISPLAY_ATTACHMENT' => $attachment));
            }
        }
        unset($rowset[$i]);
    }
    // Display topic icons for split topic
    $s_topic_icons = false;
    if ($auth->acl_gets('m_split', 'm_merge', (int) $topic_info['forum_id'])) {
        include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
        $s_topic_icons = posting_gen_topic_icons('', $icon_id);
        // Has the user selected a topic for merge?
        if ($to_topic_id) {
            $to_topic_info = get_topic_data(array($to_topic_id), 'm_merge');
            if (!sizeof($to_topic_info)) {
                $to_topic_id = 0;
            } else {
                $to_topic_info = $to_topic_info[$to_topic_id];
                if (!$to_topic_info['enable_icons'] || $auth->acl_get('!f_icons', $topic_info['forum_id'])) {
                    $s_topic_icons = false;
                }
            }
        }
    }
    $s_hidden_fields = build_hidden_fields(array('st_old' => $sort_days, 'post_ids' => $post_id_list));
    $template->assign_vars(array('TOPIC_TITLE' => $topic_info['topic_title'], 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']), 'TO_TOPIC_ID' => $to_topic_id, 'TO_TOPIC_INFO' => $to_topic_id ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '', 'SPLIT_SUBJECT' => $subject, 'POSTS_PER_PAGE' => $posts_per_page, 'ACTION' => $action, 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'), 'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'), 'S_MCP_ACTION' => "{$url}&amp;i={$id}&amp;mode={$mode}&amp;action={$action}&amp;start={$start}", 'S_FORUM_SELECT' => $to_forum_id ? make_forum_select($to_forum_id, false, false, true, true, true) : make_forum_select($topic_info['forum_id'], false, false, true, true, true), 'S_CAN_SPLIT' => $auth->acl_get('m_split', $topic_info['forum_id']) ? true : false, 'S_CAN_MERGE' => $auth->acl_get('m_merge', $topic_info['forum_id']) ? true : false, 'S_CAN_DELETE' => $auth->acl_get('m_delete', $topic_info['forum_id']) ? true : false, 'S_CAN_APPROVE' => $has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id']) ? true : false, 'S_CAN_LOCK' => $auth->acl_get('m_lock', $topic_info['forum_id']) ? true : false, 'S_CAN_REPORT' => $auth->acl_get('m_report', $topic_info['forum_id']) ? true : false, 'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']), 'S_REPORT_VIEW' => $action == 'reports' ? true : false, 'S_MERGE_VIEW' => $action == 'merge' ? true : false, 'S_SPLIT_VIEW' => $action == 'split' ? true : false, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, 'S_TOPIC_ICON' => $icon_id, 'U_SELECT_TOPIC' => "{$url}&amp;i={$id}&amp;mode=forum_view&amp;action=merge_select" . ($forum_id ? "&amp;f={$forum_id}" : ''), 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start={$start}") . '">', '</a>'), 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.{$phpEx}", "f={$topic_info['forum_id']}&amp;start={$start}") . '">', '</a>'), 'PAGE_NUMBER' => on_page($total, $posts_per_page, $start), 'PAGINATION' => !$posts_per_page ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i={$id}&amp;t={$topic_info['topic_id']}&amp;mode={$mode}&amp;action={$action}&amp;to_topic_id={$to_topic_id}&amp;posts_per_page={$posts_per_page}&amp;st={$sort_days}&amp;sk={$sort_key}&amp;sd={$sort_dir}"), $total, $posts_per_page, $start), 'TOTAL_POSTS' => $total == 1 ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total)));
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:101,代码来源:mcp_topic.php


示例5: build_language_options

    /**
     * Build all Language specific options
     */
    function build_language_options(&$cp, $field_type, $action = 'create')
    {
        global $user, $config, $db;
        $default_lang_id = !empty($this->edit_lang_id) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']];
        $sql = 'SELECT lang_id, lang_iso
			FROM ' . LANG_TABLE . '
			WHERE lang_id <> ' . (int) $default_lang_id . '
			ORDER BY lang_english_name';
        $result = $db->sql_query($sql);
        $languages = array();
        while ($row = $db->sql_fetchrow($result)) {
            $languages[$row['lang_id']] = $row['lang_iso'];
        }
        $db->sql_freeresult($result);
        $options = array();
        $options['lang_name'] = 'string';
        if ($cp->vars['lang_explain']) {
            $options['lang_explain'] = 'text';
        }
        switch ($field_type) {
            case FIELD_BOOL:
                $options['lang_options'] = 'two_options';
                break;
            case FIELD_DROPDOWN:
                $options['lang_options'] = 'optionfield';
                break;
            case FIELD_TEXT:
            case FIELD_STRING:
                if (strlen($cp->vars['lang_default_value'])) {
                    $options['lang_default_value'] = $field_type == FIELD_STRING ? 'string' : 'text';
                }
                break;
        }
        $lang_options = array();
        foreach ($options as $field => $field_type) {
            $lang_options[1]['lang_iso'] = $this->lang_defs['id'][$default_lang_id];
            $lang_options[1]['fields'][$field] = array('TITLE' => $user->lang['CP_' . strtoupper($field)], 'FIELD' => '<dd>' . (is_array($cp->vars[$field]) ? implode('<br />', $cp->vars[$field]) : bbcode_nl2br($cp->vars[$field])) . '</dd>');
            if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) {
                $lang_options[1]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN'];
            }
        }
        foreach ($languages as $lang_id => $lang_iso) {
            $lang_options[$lang_id]['lang_iso'] = $lang_iso;
            foreach ($options as $field => $field_type) {
                $value = $action == 'create' ? utf8_normalize_nfc(request_var('l_' . $field, array(0 => ''), true)) : $cp->vars['l_' . $field];
                if ($field == 'lang_options') {
                    $var = !isset($cp->vars['l_lang_options'][$lang_id]) || !is_array($cp->vars['l_lang_options'][$lang_id]) ? $cp->vars['lang_options'] : $cp->vars['l_lang_options'][$lang_id];
                    switch ($field_type) {
                        case 'two_options':
                            $lang_options[$lang_id]['fields'][$field] = array('TITLE' => $user->lang['CP_' . strtoupper($field)], 'FIELD' => '
											<dd><input class="medium" name="l_' . $field . '[' . $lang_id . '][]" value="' . (isset($value[$lang_id][0]) ? $value[$lang_id][0] : $var[0]) . '" /> ' . $user->lang['FIRST_OPTION'] . '</dd>
											<dd><input class="medium" name="l_' . $field . '[' . $lang_id . '][]" value="' . (isset($value[$lang_id][1]) ? $value[$lang_id][1] : $var[1]) . '" /> ' . $user->lang['SECOND_OPTION'] . '</dd>');
                            break;
                        case 'optionfield':
                            $value = isset($value[$lang_id]) ? is_array($value[$lang_id]) ? implode("\n", $value[$lang_id]) : $value[$lang_id] : implode("\n", $var);
                            $lang_options[$lang_id]['fields'][$field] = array('TITLE' => $user->lang['CP_' . strtoupper($field)], 'FIELD' => '<dd><textarea name="l_' . $field . '[' . $lang_id . ']" rows="7" cols="80">' . $value . '</textarea></dd>');
                            break;
                    }
                    if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) {
                        $lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN'];
                    }
                } else {
                    $var = $action == 'create' || !is_array($cp->vars[$field]) ? $cp->vars[$field] : $cp->vars[$field][$lang_id];
                    $lang_options[$lang_id]['fields'][$field] = array('TITLE' => $user->lang['CP_' . strtoupper($field)], 'FIELD' => $field_type == 'string' ? '<dd><input class="medium" type="text" name="l_' . $field . '[' . $lang_id . ']" value="' . (isset($value[$lang_id]) ? $value[$lang_id] : $var) . '" /></dd>' : '<dd><textarea name="l_' . $field . '[' . $lang_id . ']" rows="3" cols="80">' . (isset($value[$lang_id]) ? $value[$lang_id] : $var) . '</textarea></dd>');
                    if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) {
                        $lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN'];
                    }
                }
            }
        }
        return $lang_options;
    }
开发者ID:eyumay,项目名称:ju.ejhs,代码行数:75,代码来源:acp_profile.php


示例6: mcp_warn_post_view

	/**
	* Handles warning the user when the warning is for a specific post
	*/
	function mcp_warn_post_view($action)
	{
		global $phpEx, $phpbb_root_path, $config;
		global $template, $db, $user, $auth;

		$post_id = request_var('p', 0);
		$forum_id = request_var('f', 0);
		$notify = (isset($_REQUEST['notify_user'])) ? true : false;
		$warning = utf8_normalize_nfc(request_var('warning', '', true));

		$sql = 'SELECT u.*, p.*
			FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
			WHERE post_id = $post_id
				AND u.user_id = p.poster_id";
		$result = $db->sql_query($sql);
		$user_row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (!$user_row)
		{
			trigger_error('NO_POST');
		}

		// There is no point issuing a warning to ignored users (ie anonymous and bots)
		if ($user_row['user_type'] == USER_IGNORE)
		{
			trigger_error('CANNOT_WARN_ANONYMOUS');
		}

		// Prevent someone from warning themselves
		if ($user_row['user_id'] == $user->data['user_id'])
		{
			trigger_error('CANNOT_WARN_SELF');
		}

		// Check if there is already a warning for this post to prevent multiple
		// warnings for the same offence
		$sql = 'SELECT post_id
			FROM ' . WARNINGS_TABLE . "
			WHERE post_id = $post_id";
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if ($row)
		{
			trigger_error('ALREADY_WARNED');
		}

		$user_id = $user_row['user_id'];

		if (strpos($this->u_action, "&amp;f=$forum_id&amp;p=$post_id") === false)
		{
			$this->p_master->adjust_url("&amp;f=$forum_id&amp;p=$post_id");
			$this->u_action .= "&amp;f=$forum_id&amp;p=$post_id";
		}

		if ($warning && $action == 'add_warning')
		{
			if (check_form_key('mcp_warn'))
			{
				add_warning($user_row, $warning, $notify, $post_id);
				$msg = $user->lang['USER_WARNING_ADDED'];
			}
			else
			{
				$msg = $user->lang['FORM_INVALID'];
			}
			$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
			meta_refresh(2, $redirect);
			trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
		}

		// OK, they didn't submit a warning so lets build the page for them to do so
		
		// We want to make the message available here as a reminder
		// Parse the message and subject
		$message = censor_text($user_row['post_text']);

		// Second parse bbcode here
		if ($user_row['bbcode_bitfield'])
		{
			include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);

			$bbcode = new bbcode($user_row['bbcode_bitfield']);
			$bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']);
		}

		$message = bbcode_nl2br($message);
		$message = smiley_text($message);

		// Generate the appropriate user information for the user we are looking at
		if (!function_exists('get_user_avatar'))
		{
			include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
		}

//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:101,代码来源:mcp_warn.php


示例7: display_posts


//.........这里部分代码省略.........
                $update_time = $config['load_online_time'] * 60;
                while ($row = $db->sql_fetchrow($result)) {
                    $user_cache[$row['session_user_id']]['online'] = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? true : false;
                }
                $db->sql_freeresult($result);
            }
            unset($id_cache);
            // Instantiate BBCode
            if (empty($bbcode)) {
                $bbcode = new bbcode(base64_encode($bbcode_bitfield));
            } else {
                $bbcode->bbcode(base64_encode($bbcode_bitfield));
            }
            $prev_post_id = '';
            // Parse messages
            foreach ($forum_ids as $topic_id => $forum_id) {
                if (!isset($post_datas[$forum_id][$topic_id])) {
                    continue;
                }
                $row =& $post_datas[$forum_id][$topic_id];
                $topic_data =& $topic_datas[$forum_id][$topic_id];
                $poster_id = (int) $row['user_id'];
                $l_edited_by = $l_bumped_by = '';
                $s_first_unread = false;
                // End signature parsing, only if needed
                if (@$user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed'])) {
                    $user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
                    if ($user_cache[$poster_id]['sig_bbcode_bitfield']) {
                        if ($bbcode_filter) {
                            $user_cache[$poster_id]['sig'] = preg_replace($patterns, $replaces, $user_cache[$poster_id]['sig']);
                        }
                        $bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
                    }
                    $user_cache[$poster_id]['sig'] = bbcode_nl2br($user_cache[$poster_id]['sig']);
                    $user_cache[$poster_id]['sig'] = $master->gym_master->smiley_text($user_cache[$poster_id]['sig'], !$master->module_config['html_allow_smilies']);
                    $user_cache[$poster_id]['sig_parsed'] = true;
                } else {
                    // Remove sig
                    $user_cache[$poster_id]['sig'] = '';
                }
                // Parse the message and subject
                $message =& $row['post_text'];
                if ($bbcode_filter) {
                    $message = preg_replace($patterns, $replaces, $message);
                }
                if ($display_sumarize > 0) {
                    $message = $master->gym_master->summarize($message, $display_sumarize, $master->call['display_sumarize_method']);
                    // Clean broken tag at the end of the message
                    $message = preg_replace('`\\<[^\\<\\>]*$`i', ' ...', $message);
                    // Close broken bbcode tags requiring it, only quotes for now
                    $master->gym_master->close_bbcode_tags($message, $row['bbcode_uid']);
                }
                // Parse the message and subject
                $message = censor_text($message);
                // Second parse bbcode here
                if ($row['bbcode_bitfield']) {
                    $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
                }
                $message = bbcode_nl2br($message);
                $message = $master->gym_master->smiley_text($message, !$master->module_config['html_allow_smilies']);
                if ($display_sumarize > 0) {
                    // Clean up
                    static $find = array('`\\<\\!--[^\\<\\>]+--\\>`Ui', '`\\[\\/?[^\\]\\[]*\\]`Ui');
                    $message = preg_replace($find, '', $message);
                }
                // Replace naughty words such as farty pants
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:67,代码来源:display_posts.php


示例8: main

    function main($id, $mode)
    {
        global $auth, $db, $user, $template, $cache;
        global $config, $phpbb_root_path, $phpEx, $action;
        include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
        include_once $phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx;
        $start = request_var('start', 0);
        $this->page_title = 'MCP_PM_REPORTS';
        switch ($action) {
            case 'close':
            case 'delete':
                include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                $report_id_list = request_var('report_id_list', array(0));
                if (!sizeof($report_id_list)) {
                    trigger_error('NO_REPORT_SELECTED');
                }
                if (!function_exists('close_report')) {
                    include $phpbb_root_path . 'includes/mcp/mcp_reports.' . $phpEx;
                }
                close_report($report_id_list, $mode, $action, true);
                break;
        }
        switch ($mode) {
            case 'pm_report_details':
                $user->add_lang(array('posting', 'viewforum', 'viewtopic', 'ucp'));
                $report_id = request_var('r', 0);
                $sql = 'SELECT r.pm_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
					FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
					WHERE r.report_id = ' . $report_id . '
						AND rr.reason_id = r.reason_id
						AND r.user_id = u.user_id
						AND r.post_id = 0
					ORDER BY report_closed ASC';
                $result = $db->sql_query_limit($sql, 1);
                $report = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
                if (!$report_id || !$report) {
                    trigger_error('NO_REPORT');
                }
                $pm_id = $report['pm_id'];
                $report_id = $report['report_id'];
                $pm_info = get_pm_data(array($pm_id));
                if (!sizeof($pm_info)) {
                    trigger_error('NO_REPORT_SELECTED');
                }
                $pm_info = $pm_info[$pm_id];
                write_pm_addresses(array('to' => $pm_info['to_address'], 'bcc' => $pm_info['bcc_address']), (int) $pm_info['author_id']);
                $reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']);
                if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])])) {
                    $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])];
                    $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])];
                }
                // Process message, leave it uncensored
                $message = $pm_info['message_text'];
                if ($pm_info['bbcode_bitfield']) {
                    include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
                    $bbcode = new bbcode($pm_info['bbcode_bitfield']);
                    $bbcode->bbcode_second_pass($message, $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield']);
                }
                $message = bbcode_nl2br($message);
                $message = smiley_text($message);
                if ($pm_info['message_attachment'] && $auth->acl_get('u_pm_download')) {
                    $sql = 'SELECT *
						FROM ' . ATTACHMENTS_TABLE . '
						WHERE post_msg_id = ' . $pm_id . '
							AND in_message = 1
						ORDER BY filetime DESC';
                    $result = $db->sql_query($sql);
                    while ($row = $db->sql_fetchrow($result)) {
                        $attachments[] = $row;
                    }
                    $db->sql_freeresult($result);
                    if (sizeof($attachments)) {
                        $update_count = array();
                        parse_attachments(0, $message, $attachments, $update_count);
                    }
                    // Display not already displayed Attachments for this post, we already parsed them. ;)
                    if (!empty($attachments)) {
                        $template->assign_var('S_HAS_ATTACHMENTS', true);
                        foreach ($attachments as $attachment) {
                            $template->assign_block_vars('attachment', array('DISPLAY_ATTACHMENT' => $attachment));
                        }
                    }
                }
                $template->assign_vars(array('S_MCP_REPORT' => true, 'S_PM' => true, 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=pm_reports&amp;mode=pm_report_details&amp;r=' . $report_id), 'S_CAN_VIEWIP' => $auth->acl_getf_global('m_info'), 'S_POST_REPORTED' => $pm_info['message_reported'], 'S_USER_NOTES' => true, 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=pm_reports&amp;mode=pm_report_details&amp;r=' . $report_id), 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $pm_info['author_id']), 'U_MCP_WARN_REPORTER' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '', 'U_MCP_WARN_USER' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $pm_info['author_id']) : '', 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), 'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'), 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=pm_reports' . ($pm_info['message_reported'] ? '&amp;mode=pm_reports' : '&amp;mode=pm_reports_closed') . '&amp;start=' . $start) . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'REPORT_DATE' => $user->format_date($report['report_time']), 'REPORT_ID' => $report_id, 'REPORT_REASON_TITLE' => $reason['title'], 'REPORT_REASON_DESCRIPTION' => $reason['description'], 'REPORT_TEXT' => $report['report_text'], 'POST_AUTHOR_FULL' => get_username_string('full', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), 'POST_AUTHOR' => get_username_string('username', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), 'U_POST_AUTHOR' => get_username_string('profile', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), 'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']), 'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']), 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $pm_info['message_subject'] ? $pm_info['message_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($pm_info['message_time']), 'POST_IP' => $pm_info['author_ip'], 'POST_IPADDR' => $auth->acl_getf_global('m_info') && request_var('lookup', '') ? @gethostbyaddr($pm_info['author_ip']) : '', 'POST_ID' => $pm_info['msg_id'], 'U_LOOKUP_IP' => $auth->acl_getf_global('m_info') ? $this->u_action . '&amp;r=' . $report_id . '&amp;pm=' . $pm_id . '&amp;lookup=' . $pm_info['author_ip'] . '#ip' : ''));
                $this->tpl_name = 'mcp_post';
                break;
            case 'pm_reports':
            case 'pm_reports_closed':
                $user->add_lang(array('ucp'));
                $sort_days = $total = 0;
                $sort_key = $sort_dir = '';
                $sort_by_sql = $sort_order_sql = array();
                mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $to 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bbcodeurl函数代码示例发布时间:2022-05-24
下一篇:
PHP bbcode函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap