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

PHP posting_gen_topic_icons函数代码示例

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

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



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

示例1: array

$moderators = array();
if ($config['load_moderators']) {
    get_moderators($moderators, $forum_id);
}
// Generate smiley listing
generate_smilies('inline', $forum_id);
// Generate inline attachment select box
posting_gen_inline_attachments($attachment_data);
// Do show topic type selection only in first post.
$topic_type_toggle = false;
if ($mode == 'post' || $mode == 'edit' && $post_id == $post_data['topic_first_post_id']) {
    $topic_type_toggle = posting_gen_topic_types($forum_id, $post_data['topic_type']);
}
$s_topic_icons = false;
if ($post_data['enable_icons'] && $auth->acl_get('f_icons', $forum_id)) {
    $s_topic_icons = posting_gen_topic_icons($mode, $post_data['icon_id']);
}
$bbcode_checked = isset($post_data['enable_bbcode']) ? !$post_data['enable_bbcode'] : ($config['allow_bbcode'] ? !$user->optionget('bbcode') : 1);
$smilies_checked = isset($post_data['enable_smilies']) ? !$post_data['enable_smilies'] : ($config['allow_smilies'] ? !$user->optionget('smilies') : 1);
$urls_checked = isset($post_data['enable_urls']) ? !$post_data['enable_urls'] : 0;
$sig_checked = $post_data['enable_sig'];
$lock_topic_checked = isset($topic_lock) && $topic_lock ? $topic_lock : ($post_data['topic_status'] == ITEM_LOCKED ? 1 : 0);
$lock_post_checked = isset($post_lock) ? $post_lock : $post_data['post_edit_locked'];
// If the user is replying or posting and not already watching this topic but set to always being notified we need to overwrite this setting
$notify_set = $mode != 'edit' && $config['allow_topic_notify'] && $user->data['is_registered'] && !$post_data['notify_set'] ? $user->data['user_notify'] : $post_data['notify_set'];
$notify_checked = isset($notify) ? $notify : ($mode == 'post' ? $user->data['user_notify'] : $notify_set);
// Page title & action URL
$s_action = append_sid("{$phpbb_root_path}posting.{$phpEx}", "mode={$mode}&f={$forum_id}");
$s_action .= $topic_id ? "&t={$topic_id}" : '';
$s_action .= $post_id ? "&p={$post_id}" : '';
switch ($mode) {
开发者ID:PetsFundation,项目名称:Pets,代码行数:31,代码来源:posting.php


示例2: compose_pm


//.........这里部分代码省略.........
        } else {
            $message_link = '';
        }
        $message_parser->message = $message_link . '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
    }
    if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) {
        $message_subject = (!preg_match('/^Re:/', $message_subject) ? 'Re: ' : '') . censor_text($message_subject);
    }
    if ($action == 'forward' && !$preview && !$refresh && !$submit) {
        $fwd_to_field = write_pm_addresses(array('to' => $post['to_address']), 0, true);
        if ($config['allow_post_links']) {
            $quote_username_text = '[url=' . generate_board_url() . "/memberlist.{$phpEx}?mode=viewprofile&u={$post['author_id']}]{$quote_username}[/url]";
        } else {
            $quote_username_text = $quote_username . ' (' . generate_board_url() . "/memberlist.{$phpEx}?mode=viewprofile&u={$post['author_id']})";
        }
        $forward_text = array();
        $forward_text[] = $user->lang['FWD_ORIGINAL_MESSAGE'];
        $forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject));
        $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true));
        $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
        $forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to']));
        $message_parser->message = implode("\n", $forward_text) . "\n\n[quote="{$quote_username}"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
        $message_subject = (!preg_match('/^Fwd:/', $message_subject) ? 'Fwd: ' : '') . censor_text($message_subject);
    }
    $attachment_data = $message_parser->attachment_data;
    $filename_data = $message_parser->filename_data;
    $message_text = $message_parser->message;
    // MAIN PM PAGE BEGINS HERE
    // Generate smiley listing
    generate_smilies('inline', 0);
    // Generate PM Icons
    $s_pm_icons = false;
    if ($config['enable_pm_icons']) {
        $s_pm_icons = posting_gen_topic_icons($action, $icon_id);
    }
    // Generate inline attachment select box
    posting_gen_inline_attachments($attachment_data);
    // Build address list for display
    // array('u' => array($author_id => 'to'));
    if (sizeof($address_list)) {
        // Get Usernames and Group Names
        $result = array();
        if (!empty($address_list['u'])) {
            $sql = 'SELECT user_id as id, username as name, user_colour as colour
				FROM ' . USERS_TABLE . '
				WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($address_list['u']))) . '
				ORDER BY username_clean ASC';
            $result['u'] = $db->sql_query($sql);
        }
        if (!empty($address_list['g'])) {
            $sql = 'SELECT g.group_id AS id, g.group_name AS name, g.group_colour AS colour, g.group_type
				FROM ' . GROUPS_TABLE . ' g';
            if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) {
                $sql .= ' LEFT JOIN ' . USER_GROUP_TABLE . ' ug
					ON (
						g.group_id = ug.group_id
						AND ug.user_id = ' . $user->data['user_id'] . '
						AND ug.user_pending = 0
					)
					WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')';
            }
            $sql .= $auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') ? ' WHERE ' : ' AND ';
            $sql .= 'g.group_receive_pm = 1
				AND ' . $db->sql_in_set('g.group_id', array_map('intval', array_keys($address_list['g']))) . '
				ORDER BY g.group_name ASC';
            $result['g'] = $db->sql_query($sql);
开发者ID:Voxel37,项目名称:phpbb,代码行数:67,代码来源:ucp_pm_compose.php


示例3: 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


示例4: unset

unset($message_parser);
// MAIN POSTING PAGE BEGINS HERE
// Forum moderators?
$moderators = get_moderators($forum_id);
// Generate smiley listing
generate_smilies('inline', $forum_id);
// Generate inline attachment select box
posting_gen_inline_attachments($attachment_data);
// Do show topic type selection only in first post.
$topic_type_toggle = false;
if ($mode == 'post' || $mode == 'edit' && $post_id == $topic_first_post_id) {
    $topic_type_toggle = posting_gen_topic_types($forum_id, $posting_data['topic_type']);
}
$s_topic_icons = false;
if ($enable_icons) {
    $s_topic_icons = posting_gen_topic_icons($mode, $icon_id);
}
$html_checked = isset($enable_html) ? !$enable_html : ($config['allow_html'] ? !$_CLASS['core_user']->user_data_get('html') : 1);
$bbcode_checked = isset($enable_bbcode) ? !$enable_bbcode : ($config['allow_bbcode'] ? !$_CLASS['core_user']->user_data_get('bbcode') : 1);
$smilies_checked = isset($enable_smilies) ? !$enable_smilies : ($config['allow_smilies'] ? !$_CLASS['core_user']->user_data_get('smilies') : 1);
$urls_checked = isset($enable_urls) ? !$enable_urls : 0;
$sig_checked = $enable_sig;
$notify_checked = isset($notify) ? $notify : (!$notify_set ? $_CLASS['core_user']->is_user ? $_CLASS['core_user']->data['user_notify'] : 0 : 1);
$lock_topic_checked = isset($topic_lock) ? $topic_lock : ($posting_data['topic_status'] == ITEM_LOCKED ? 1 : 0);
$lock_post_checked = isset($post_lock) ? $post_lock : $posting_data['post_edit_locked'];
// Page title & action URL, include session_id for security purpose
$s_action = "Forums&amp;file=posting&amp;mode={$mode}&amp;f={$forum_id}";
$s_action .= $topic_id ? "&amp;t={$topic_id}" : '';
$s_action .= $post_id ? "&amp;p={$post_id}" : '';
$s_action = generate_link($s_action);
switch ($mode) {
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:posting.php


示例5: parse_message

			$karma_power = $max_karma_power;
		}

		// Include posting functions
		include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
		include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
		include($phpbb_root_path . 'includes/message_parser.' . $phpEx);

		$message_parser = new parse_message();
		$error = array();

		$s_icons = false;
		// Icons enabled for this forum?
		if ($karmamod->config['icons'])
		{
			$s_icons = posting_gen_topic_icons('', $icon_id);
		}

		// HTML, BBCode, Smilies, Images and Flash status
		$bbcode_status	= ($config['allow_bbcode']) ? true : false;
		$smilies_status	= ($bbcode_status && $config['allow_smilies']) ? true : false;
		$img_status		= ($bbcode_status) ? true : false;
		$url_status		= ($config['allow_post_links']) ? true : false;
		$flash_status	= ($bbcode_status && $config['allow_post_flash']) ? true : false;

		if ($submit || confirm_box(true) || $preview)
		{
			$enable_bbcode	= (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true;
			$enable_smilies	= (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true;
			$enable_urls	= (isset($_POST['disable_magic_url'])) ? false : true;
		}
开发者ID:esacinc,项目名称:forum-sitplatform-org-website,代码行数:31,代码来源:karma.php


示例6: mcp_topic_view

/**
* View topic in MCP
*/
function mcp_topic_view($id, $mode, $action)
{
    global $phpEx, $phpbb_root_path, $config;
    global $template, $db, $user, $auth;
    $url = append_sid("{$phpbb_root_path}mcp.{$phpEx}?" . extra_url());
    $user->add_lang('viewtopic');
    $topic_id = request_var('t', 0);
    $topic_info = get_topic_data(array($topic_id));
    if (!sizeof($topic_info)) {
        trigger_error($user->lang['TOPIC_NOT_EXIST']);
    }
    $topic_info = $topic_info[$topic_id];
    // Set up some vars
    $icon_id = request_var('icon', 0);
    $subject = request_var('subject', '', true);
    $start = request_var('start', 0);
    $to_topic_id = request_var('to_topic_id', 0);
    $to_forum_id = request_var('to_forum_id', 0);
    $post_id_list = request_var('post_id_list', array(0));
    // Split Topic?
    if ($action == 'split_all' || $action == 'split_beyond') {
        split_topic($action, $topic_id, $to_forum_id, $subject);
        $action = 'split';
    }
    // Merge Posts?
    if ($action == 'merge_posts') {
        merge_posts($topic_id, $to_topic_id);
        $action = 'merge';
    }
    if ($action == 'split' && !$subject) {
        $subject = $topic_info['topic_title'];
    }
    // Jumpbox, sort selects and that kind of things
    make_jumpbox($url . "&amp;i={$id}&amp;mode=forum_view", $topic_info['forum_id'], false, 'm_');
    $where_sql = $action == 'reports' ? 'WHERE post_reported = 1 AND ' : 'WHERE';
    $sort_days = $total = 0;
    $sort_key = $sort_dir = '';
    $sort_by_sql = $sort_order_sql = array();
    mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql);
    $limit_time_sql = $sort_days ? 'AND t.topic_last_post_time >= ' . (time() - $sort_days * 86400) : '';
    if ($total == -1) {
        $total = $topic_info['topic_replies'] + 1;
    }
    $posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page'])));
    if ($posts_per_page == 0) {
        $posts_per_page = $total;
    }
    $sql = 'SELECT u.username, u.user_colour, p.*
		FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
		WHERE ' . ($action == 'reports' ? 'p.post_reported = 1 AND ' : '') . "\n\t\t\tp.topic_id = {$topic_id}\n\t\t\tAND p.poster_id = u.user_id\n\t\tORDER BY {$sort_order_sql}";
    $result = $db->sql_query_limit($sql, $posts_per_page, $start);
    $rowset = array();
    $bbcode_bitfield = 0;
    while ($row = $db->sql_fetchrow($result)) {
        $rowset[] = $row;
        $bbcode_bitfield |= $row['bbcode_bitfield'];
    }
    $db->sql_freeresult($result);
    if ($bbcode_bitfield) {
        include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
        $bbcode = new bbcode($bbcode_bitfield);
    }
    foreach ($rowset as $i => $row) {
        $has_unapproved_posts = false;
        $poster = $row['poster_id'] != ANONYMOUS ? $row['username'] : (!$row['post_username'] ? $user->lang['GUEST'] : $row['post_username']);
        $poster = $row['user_colour'] ? '<span style="color:#' . $row['user_colour'] . '">' . $poster . '</span>' : $poster;
        $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 = smiley_text($message);
        $message = str_replace("\n", '<br />', $message);
        if (!$row['post_approved']) {
            $has_unapproved_posts = true;
        }
        $template->assign_block_vars('postrow', array('POSTER_NAME' => $poster, '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' => $row['post_time'] > $user->data['user_lastvisit'] && $user->data['is_registered'] ? $user->img('icon_post_new', $user->lang['NEW_POST']) : $user->img('icon_post', $user->lang['POST']), 'S_POST_REPORTED' => $row['post_reported'] ? true : false, 'S_POST_UNAPPROVED' => $row['post_approved'] ? false : true, 'S_CHECKED' => $post_id_list && in_array(intval($row['post_id']), $post_id_list) ? true : false, 'U_POST_DETAILS' => "{$url}&amp;i={$id}&amp;p={$row['post_id']}&amp;mode=post_details", 'U_MCP_APPROVE' => 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' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id'])));
        unset($rowset[$i]);
    }
    // Display topic icons for split topic
    $s_topic_icons = false;
    if ($auth->acl_get('m_split', $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']) {
                $s_topic_icons = false;
            }
        }
    }
//.........这里部分代码省略.........
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:mcp_topic.php


示例7: compose_pm


//.........这里部分代码省略.........
        }
        unset($message_text);
    }
    // Decode text for message display
    $bbcode_uid = ($action == 'quote' || $action == 'forward') && !$preview && !$refresh && empty($error) ? $bbcode_uid : $message_parser->bbcode_uid;
    $message_parser->decode_message($bbcode_uid);
    if ($action == 'quote' && !$preview && !$refresh) {
        $message_parser->message = '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
    }
    if (($action == 'reply' || $action == 'quote') && !$preview && !$refresh) {
        $message_subject = (!preg_match('/^Re:/', $message_subject) ? 'Re: ' : '') . censor_text($message_subject);
    }
    if ($action == 'forward' && !$preview && !$refresh) {
        $fwd_to_field = write_pm_addresses(array('to' => $to_address), 0, true);
        $forward_text = array();
        $forward_text[] = $_CLASS['core_user']->lang['FWD_ORIGINAL_MESSAGE'];
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_SUBJECT'], censor_text($message_subject));
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_DATE'], $_CLASS['core_user']->format_date($message_time));
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_FROM'], $quote_username);
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));
        $message_parser->message = implode("\n", $forward_text) . "\n\n[quote=\"[url=" . generate_link("Members_List&mode=viewprofile&u={$author_id}]{$quote_username}") . "[/url]\"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
        $message_subject = (!preg_match('/^Fwd:/', $message_subject) ? 'Fwd: ' : '') . censor_text($message_subject);
    }
    $attachment_data = $message_parser->attachment_data;
    $filename_data = $message_parser->filename_data;
    $message_text = $message_parser->message;
    unset($message_parser);
    // MAIN PM PAGE BEGINS HERE
    // Generate smiley listing
    generate_smilies('inline', 0);
    // Generate PM Icons
    $s_pm_icons = false;
    if ($config['enable_pm_icons']) {
        $s_pm_icons = posting_gen_topic_icons($action, $icon_id);
    }
    // Generate inline attachment select box
    posting_gen_inline_attachments($attachment_data);
    // Build address list for display
    // array('u' => array($author_id => 'to'));
    if (!empty($address_list)) {
        // Get Usernames and Group Names
        $result = array();
        if (isset($address_list['u']) && !empty($address_list['u'])) {
            $result['u'] = $_CLASS['core_db']->query('SELECT user_id as id, username as name, user_colour as colour 
				FROM ' . USERS_TABLE . ' 
				WHERE user_id IN (' . implode(', ', array_map('intval', array_keys($address_list['u']))) . ')');
        }
        if (isset($address_list['g']) && !empty($address_list['g'])) {
            $result['g'] = $_CLASS['core_db']->query('SELECT group_id as id, group_name as name, group_colour as colour 
				FROM ' . GROUPS_TABLE . ' 
				WHERE group_receive_pm = 1 AND group_id IN (' . implode(', ', array_map('intval', array_keys($address_list['g']))) . ')');
        }
        $u = $g = array();
        foreach (array('u', 'g') as $type) {
            if (isset($result[$type]) && $result[$type]) {
                while ($row = $_CLASS['core_db']->fetch_row_assoc($result[$type])) {
                    ${$type}[$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
                }
                $_CLASS['core_db']->free_result($result[$type]);
            }
        }
        // Now Build the address list
        $plain_address_field = '';
        foreach ($address_list as $type => $adr_ary) {
            foreach ($adr_ary as $id => $field) {
                if (!isset(${$type}[$id])) {
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:67,代码来源:ucp_pm_compose.php


示例8: compose_pm


//.........这里部分代码省略.........
		{
			$quote_username_text = '[url=' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&amp;u={$post['author_id']}]{$quote_username}[/url]";
		}
		else
		{
			$quote_username_text = $quote_username . ' (' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&amp;u={$post['author_id']})";
		}

		$forward_text = array();
		$forward_text[] = $user->lang['FWD_ORIGINAL_MESSAGE'];
		$forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject));
		$forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time));
		$forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
		$forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));

		$message_parser->message = implode("\n", $forward_text) . "\n\n[quote=\"{$quote_username}\"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
		$message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject);
	}

	$attachment_data = $message_parser->attachment_data;
	$filename_data = $message_parser->filename_data;
	$message_text = $message_parser->message;
	unset($message_parser);

	// MAIN PM PAGE BEGINS HERE

	// Generate smiley listing
	generate_smilies('inline', 0);

	// Generate PM Icons
	$s_pm_icons = false;
	if ($config['enable_pm_icons'])
	{
		$s_pm_icons = posting_gen_topic_icons($action, $icon_id);
	}

	// Generate inline attachment select box
	posting_gen_inline_attachments($attachment_data);

	// Build address list for display
	// array('u' => array($author_id => 'to'));
	if (sizeof($address_list))
	{
		// Get Usernames and Group Names
		$result = array();
		if (!empty($address_list['u']))
		{
			$sql = 'SELECT user_id as id, username as name, user_colour as colour
				FROM ' . USERS_TABLE . '
				WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($address_list['u']))) . '
				ORDER BY username_clean ASC';
			$result['u'] = $db->sql_query($sql);
		}

		if (!empty($address_list['g']))
		{
			$sql = 'SELECT g.group_id AS id, g.group_name AS name, g.group_colour AS colour, g.group_type
				FROM ' . GROUPS_TABLE . ' g';

			if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
			{
				$sql .= ' LEFT JOIN ' . USER_GROUP_TABLE . ' ug
					ON (
						g.group_id = ug.group_id
						AND ug.user_id = ' . $user->data['user_id'] . '
						AND ug.user_pending = 0
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:67,代码来源:ucp_pm_compose.php


示例9: post


//.........这里部分代码省略.........
        // Preview
        if (!sizeof($error) && $preview) {
            $post_data['post_time'] = $mode == 'edit' ? $post_data['post_time'] : $current_time;
            $preview_message = $message_parser->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies'], false);
            $preview_signature = $mode == 'edit' ? $post_data['user_sig'] : $user->data['user_sig'];
            $preview_signature_uid = $mode == 'edit' ? $post_data['user_sig_bbcode_uid'] : $user->data['user_sig_bbcode_uid'];
            $preview_signature_bitfield = $mode == 'edit' ? $post_data['user_sig_bbcode_bitfield'] : $user->data['user_sig_bbcode_bitfield'];
            // Signature
            if ($post_data['enable_sig'] && $config['allow_sig'] && $preview_signature && $auth->acl_get('u_gb_sig')) {
                $parse_sig = new parse_message($preview_signature);
                $parse_sig->bbcode_uid = $preview_signature_uid;
                $parse_sig->bbcode_bitfield = $preview_signature_bitfield;
                // Not sure about parameters for bbcode/smilies/urls... in signatures
                $parse_sig->format_display($config['allow_sig_bbcode'], true, $config['allow_sig_smilies']);
                $preview_signature = $parse_sig->message;
                unset($parse_sig);
            } else {
                $preview_signature = '';
            }
            $preview_subject = censor_text($post_data['post_subject']);
            if (!sizeof($error)) {
                $template->assign_vars(array('PREVIEW_SUBJECT' => $preview_subject, 'PREVIEW_MESSAGE' => $preview_message, 'PREVIEW_SIGNATURE' => $preview_signature, 'S_DISPLAY_PREVIEW' => true));
            }
        }
        // Decode text for message display
        $post_data['bbcode_uid'] = $mode == 'quote' && !$preview && !$refresh && !sizeof($error) ? $post_data['bbcode_uid'] : $message_parser->bbcode_uid;
        $message_parser->decode_message($post_data['bbcode_uid']);
        if ($mode == 'quote' && !$submit && !$preview && !$refresh) {
            if ($config['allow_bbcode']) {
                $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
            } else {
                $offset = 0;
                $quote_string = "&gt; ";
                $message = censor_text(trim($message_parser->message));
                // see if we are nesting. It's easily tricked but should work for one level of nesting
                if (strpos($message, "&gt;") !== false) {
                    $offset = 10;
                }
                $message = utf8_wordwrap($message, 75 + $offset, "\n");
                $message = $quote_string . $message;
                $message = str_replace("\n", "\n" . $quote_string, $message);
                $message_parser->message = $post_data['quote_username'] . " " . $user->lang['WROTE'] . " :\n" . $message . "\n";
            }
        }
        if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh) {
            $post_data['post_subject'] = (strpos($post_data['post_subject'], 'Re: ') !== 0 ? 'Re: ' : '') . censor_text($post_data['post_subject']);
        }
        $post_data['post_text'] = $message_parser->message;
        // MAIN POSTING PAGE BEGINS HERE
        // Generate smiley listing
        generate_smilies('inline', 0);
        // Do show topic type selection only in first post.
        $topic_type_toggle = false;
        $s_topic_icons = false;
        if ($post_data['enable_icons'] && $auth->acl_get('u_gb_icons')) {
            $s_topic_icons = posting_gen_topic_icons($mode, $post_data['icon_id']);
        }
        $bbcode_checked = isset($post_data['enable_bbcode']) ? !$post_data['enable_bbcode'] : ($config['allow_bbcode'] ? !$user->optionget('bbcode') : 1);
        $smilies_checked = isset($post_data['enable_smilies']) ? !$post_data['enable_smilies'] : ($config['allow_smilies'] ? !$user->optionget('smilies') : 1);
        $urls_checked = isset($post_data['enable_urls']) ? !$post_data['enable_urls'] : 0;
        $sig_checked = $post_data['enable_sig'];
        // If the user is replying or posting and not already watching this topic but set to always being notified we need to overwrite this setting
        $notify_set = $mode != 'edit' && $config['allow_topic_notify'] && $user->data['is_registered'] && !$post_data['notify_set'] ? $user->data['user_notify'] : $post_data['notify_set'];
        $notify_checked = isset($notify) ? $notify : ($mode == 'post' ? $user->data['user_notify'] : $notify_set);
        // Page title & action URL, include session_id for security purpose
        $s_action = append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=viewprofile&amp;u={$this->user_id}&amp;gbmode={$mode}", true, $user->session_id);
        $s_action .= $post_id ? "&amp;p={$post_id}" : '';
        switch ($mode) {
            case 'post':
                $page_title = $user->lang['POST_GUESTBOOK'];
                break;
            case 'quote':
            case 'reply':
                $page_title = $user->lang['POST_GUESTBOOK'];
                break;
            case 'delete':
            case 'edit':
                $page_title = $user->lang['EDIT_POST'];
                break;
        }
        // Posting uses is_solved for legacy reasons. Plugins have to use is_solved to force themselves to be displayed.
        if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === false) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote')) {
            $template->assign_vars(array('S_CONFIRM_CODE' => true, 'CAPTCHA_TEMPLATE' => $captcha->get_template()));
        }
        $s_hidden_fields = '<input type="hidden" name="lastclick" value="' . $current_time . '" />';
        if ($mode == 'edit') {
            $s_hidden_fields .= build_hidden_fields(array('edit_post_message_checksum' => $post_data['post_checksum'], 'edit_post_subject_checksum' => $post_data['post_subject_md5']));
        }
        // Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview
        if (isset($captcha) && $captcha->is_solved() !== false) {
            $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields());
        }
        add_form_key('posting');
        // Start assigning vars for main posting page ...
        $template->assign_vars(array('L_POST_A' => $page_title, 'L_ICON' => $user->lang['POST_ICON'], 'L_MESSAGE_BODY_EXPLAIN' => intval($config['max_post_chars']) ? sprintf($user->lang['MESSAGE_BODY_EXPLAIN'], intval($config['max_post_chars'])) : '', 'TOPIC_TITLE' => censor_text($post_data['topic_title']), 'USERNAME' => !$preview && $mode != 'quote' || $preview ? $post_data['username'] : '', 'SUBJECT' => $post_data['post_subject'], 'MESSAGE' => $post_data['post_text'], 'BBCODE_STATUS' => $bbcode_status ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.{$phpEx}", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.{$phpEx}", 'mode=bbcode') . '">', '</a>'), 'IMG_STATUS' => $img_status ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => $flash_status ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => $smilies_status ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'URL_STATUS' => $bbcode_status && $url_status ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 'MAX_FONT_SIZE' => (int) $config['max_post_font_size'], 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), 'POST_DATE' => $post_data['post_time'] ? $user->format_date($post_data['post_time']) : '', 'ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'], 'EDIT_REASON' => $post_data['post_edit_reason'], 'S_PRIVMSGS' => false, 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']) ? true : false, 'S_EDIT_POST' => $mode == 'edit' ? true : false, 'S_EDIT_REASON' => false, 'S_DISPLAY_USERNAME' => !$user->data['is_registered'] || $mode == 'edit' && $post_data['poster_id'] == ANONYMOUS ? true : false, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, 'S_BBCODE_ALLOWED' => $bbcode_status, 'S_BBCODE_CHECKED' => $bbcode_checked ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, 'S_SMILIES_CHECKED' => $smilies_checked ? ' checked="checked"' : '', 'S_SIG_ALLOWED' => $auth->acl_get('u_gb_sig') && $config['allow_sig'] && $user->data['is_registered'] ? true : false, 'S_SIGNATURE_CHECKED' => $sig_checked ? ' checked="checked"' : '', 'S_NOTIFY_ALLOWED' => !$user->data['is_registered'] || $mode == 'edit' && $user->data['user_id'] != $post_data['poster_id'] || !$config['allow_topic_notify'] || !$config['email_enable'] ? false : true, 'S_NOTIFY_CHECKED' => $notify_checked ? ' checked="checked"' : '', 'S_LINKS_ALLOWED' => $url_status, 'S_MAGIC_URL_CHECKED' => $urls_checked ? ' checked="checked"' : '', 'S_TYPE_TOGGLE' => '', 'S_SAVE_ALLOWED' => false, 'S_HAS_DRAFTS' => false, 'S_BBCODE_IMG' => $img_status, 'S_BBCODE_URL' => $url_status, 'S_BBCODE_FLASH' => $flash_status, 'S_BBCODE_QUOTE' => $quote_status, 'SIGNATURE' => '', 'S_POST_ACTION' => $s_action, 'S_HIDDEN_FIELDS' => $s_hidden_fields));
        // Build custom bbcodes array
        display_custom_bbcodes();
        $template->set_filenames(array('body' => 'posting_body.html'));
        make_jumpbox(append_sid("{$phpbb_root_path}viewforum.{$phpEx}"));
    }
开发者ID:paul999,项目名称:profile-guestbook,代码行数:101,代码来源:class_guestbook.php



注:本文中的posting_gen_topic_icons函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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