本文整理汇总了PHP中showEmailAddress函数的典型用法代码示例。如果您正苦于以下问题:PHP showEmailAddress函数的具体用法?PHP showEmailAddress怎么用?PHP showEmailAddress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showEmailAddress函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: MembergroupMembers
//.........这里部分代码省略.........
$member_query[] = 'id_member IN ({array_int:member_ids})';
$member_parameters['member_ids'] = $member_ids;
}
if (!empty($member_names)) {
$member_query[] = 'LOWER(member_name) IN ({array_string:member_names})';
$member_query[] = 'LOWER(real_name) IN ({array_string:member_names})';
$member_parameters['member_names'] = $member_names;
}
$members = array();
if (!empty($member_query)) {
$request = $smcFunc['db_query']('', '
SELECT id_member
FROM {db_prefix}members
WHERE (' . implode(' OR ', $member_query) . ')
AND id_group != {int:id_group}
AND FIND_IN_SET({int:id_group}, additional_groups) = 0', array_merge($member_parameters, array('id_group' => $_REQUEST['group'])));
while ($row = $smcFunc['db_fetch_assoc']($request)) {
$members[] = $row['id_member'];
}
$smcFunc['db_free_result']($request);
}
// !!! Add $_POST['additional'] to templates!
// Do the updates...
if (!empty($members)) {
require_once $sourcedir . '/Subs-Membergroups.php';
addMembersToGroup($members, $_REQUEST['group'], isset($_POST['additional']) || $context['group']['hidden'] ? 'only_additional' : 'auto', true);
}
}
// Sort out the sorting!
$sort_methods = array('name' => 'real_name', 'email' => allowedTo('moderate_forum') ? 'email_address' : 'hide_email ' . (isset($_REQUEST['desc']) ? 'DESC' : 'ASC') . ', email_address', 'active' => 'last_login', 'registered' => 'date_registered', 'posts' => 'posts');
// They didn't pick one, default to by name..
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']])) {
$context['sort_by'] = 'name';
$querySort = 'real_name';
} else {
$context['sort_by'] = $_REQUEST['sort'];
$querySort = $sort_methods[$_REQUEST['sort']];
}
$context['sort_direction'] = isset($_REQUEST['desc']) ? 'down' : 'up';
// The where on the query is interesting. Non-moderators should only see people who are in this group as primary.
if ($context['group']['can_moderate']) {
$where = $context['group']['is_post_group'] ? 'id_post_group = {int:group}' : 'id_group = {int:group} OR FIND_IN_SET({int:group}, additional_groups) != 0';
} else {
$where = $context['group']['is_post_group'] ? 'id_post_group = {int:group}' : 'id_group = {int:group}';
}
// Count members of the group.
$request = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}members
WHERE ' . $where, array('group' => $_REQUEST['group']));
list($context['total_members']) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
$context['total_members'] = comma_format($context['total_members']);
// Create the page index.
$context['page_index'] = constructPageIndex($scripturl . '?action=' . ($context['group']['can_moderate'] ? 'moderate;area=viewgroups' : 'groups') . ';sa=members;group=' . $_REQUEST['group'] . ';sort=' . $context['sort_by'] . (isset($_REQUEST['desc']) ? ';desc' : ''), $_REQUEST['start'], $context['total_members'], $modSettings['defaultMaxMembers']);
$context['start'] = $_REQUEST['start'];
$context['can_moderate_forum'] = allowedTo('moderate_forum');
// Load up all members of this group.
$request = $smcFunc['db_query']('', '
SELECT id_member, member_name, real_name, email_address, member_ip, date_registered, last_login,
hide_email, posts, is_activated, real_name
FROM {db_prefix}members
WHERE ' . $where . '
ORDER BY ' . $querySort . ' ' . ($context['sort_direction'] == 'down' ? 'DESC' : 'ASC') . '
LIMIT ' . $context['start'] . ', ' . $modSettings['defaultMaxMembers'], array('group' => $_REQUEST['group']));
$context['members'] = array();
while ($row = $smcFunc['db_fetch_assoc']($request)) {
$last_online = empty($row['last_login']) ? $txt['never'] : timeformat($row['last_login']);
// Italicize the online note if they aren't activated.
if ($row['is_activated'] % 10 != 1) {
$last_online = '<em title="' . $txt['not_activated'] . '">' . $last_online . '</em>';
}
if (!empty($row['id_member'])) {
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
}
$context['members'][] = array('id' => $row['id_member'], 'name' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>', 'email' => $row['email_address'], 'show_email' => showEmailAddress(!empty($row['hide_email']), $row['id_member']), 'ip' => '<a href="' . $scripturl . '?action=trackip;searchip=' . $row['member_ip'] . '">' . $row['member_ip'] . '</a>', 'registered' => timeformat($row['date_registered']), 'last_online' => $last_online, 'posts' => comma_format($row['posts']), 'is_activated' => $row['is_activated'] % 10 == 1);
}
$smcFunc['db_free_result']($request);
//Color the Groups List ;D
if (!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
if (!empty($context['group']['moderators'])) {
foreach ($context['group']['moderators'] as $key => $item) {
if (!empty($colorDatas[$item['id']]['colored_link'])) {
$context['group']['moderators'][$key]['name'] = $colorDatas[$item['id']]['colored_name'];
}
}
}
if (!empty($context['members'])) {
foreach ($context['members'] as $key => $item) {
if (!empty($colorDatas[$item['id']]['colored_link'])) {
$context['members'][$key]['name'] = $colorDatas[$item['id']]['colored_link'];
}
}
}
}
// Select the template.
$context['sub_template'] = 'group_members';
$context['page_title'] = $txt['membergroups_members_title'] . ': ' . $context['group']['name'];
}
开发者ID:Kheros,项目名称:MMOver,代码行数:101,代码来源:Groups.php
示例2: loadMemberContext
function loadMemberContext($user, $display_custom_fields = false)
{
global $memberContext, $user_profile, $txt, $scripturl, $user_info;
global $context, $modSettings, $settings;
static $dataLoaded = array();
// If this person's data is already loaded, skip it.
if (isset($dataLoaded[$user])) {
return true;
}
// We can't load guests or members not loaded by loadMemberData()!
if ($user == 0) {
return false;
}
if (!isset($user_profile[$user])) {
trigger_error('loadMemberContext(): member id ' . $user . ' not previously loaded by loadMemberData()', E_USER_WARNING);
return false;
}
// Well, it's loaded now anyhow.
$dataLoaded[$user] = true;
$profile = $user_profile[$user];
// Censor everything.
censorText($profile['signature']);
censorText($profile['personal_text']);
censorText($profile['location']);
// Set things up to be used before hand.
$gendertxt = $profile['gender'] == 2 ? $txt['female'] : ($profile['gender'] == 1 ? $txt['male'] : '');
$profile['signature'] = str_replace(array("\n", "\r"), array('<br />', ''), $profile['signature']);
$profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);
$profile['is_online'] = (!empty($profile['show_online']) || allowedTo('moderate_forum')) && $profile['is_online'] > 0;
$profile['stars'] = empty($profile['stars']) ? array('', '') : explode('#', $profile['stars']);
// Setup the buddy status here (One whole in_array call saved :P)
$profile['buddy'] = in_array($profile['id_member'], $user_info['buddies']);
$buddy_list = !empty($profile['buddy_list']) ? explode(',', $profile['buddy_list']) : array();
// If we're always html resizing, assume it's too large.
if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize') {
$avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
$avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
} else {
$avatar_width = '';
$avatar_height = '';
}
$m_href = URL::user($profile['id_member'], $profile['real_name']);
// What a monstrous array...
$memberContext[$user] = array('username' => $profile['member_name'], 'name' => $profile['real_name'], 'id' => $profile['id_member'], 'is_buddy' => $profile['buddy'], 'is_reverse_buddy' => in_array($user_info['id'], $buddy_list), 'buddies' => $buddy_list, 'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '', 'href' => $m_href, 'link' => '<a class="member group_' . (empty($profile['id_group']) ? $profile['id_post_group'] : $profile['id_group']) . '" onclick="getMcard(' . $profile['id_member'] . ');return(false);" href="' . $m_href . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>', 'email' => $profile['email_address'], 'show_email' => showEmailAddress(!empty($profile['hide_email']), $profile['id_member']), 'registered' => empty($profile['date_registered']) ? $txt['not_applicable'] : timeformat($profile['date_registered']), 'blurb' => $profile['personal_text'], 'gender' => array('name' => $gendertxt, 'image' => !empty($profile['gender']) ? '<img class="gender" src="' . $settings['images_url'] . '/' . ($profile['gender'] == 1 ? 'Male' : 'Female') . '.gif" alt="' . $gendertxt . '" />' : ''), 'birth_date' => empty($profile['birthdate']) || $profile['birthdate'] === '0001-01-01' ? '0000-00-00' : (substr($profile['birthdate'], 0, 4) === '0004' ? '0000' . substr($profile['birthdate'], 4) : $profile['birthdate']), 'signature' => $profile['signature'], 'location' => $profile['location'], 'real_posts' => $profile['posts'], 'posts' => comma_format($profile['posts']), 'avatar' => array('name' => $profile['avatar'], 'image' => $profile['avatar'] == '' ? $profile['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) . '" alt="" />' : '' : (stristr($profile['avatar'], 'http://') ? '<img class="avatar" src="' . $profile['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($profile['avatar']) . '" alt="" />'), 'href' => $profile['avatar'] == '' ? $profile['id_attach'] > 0 ? empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename'] : '' : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']), 'url' => $profile['avatar'] == '' ? '' : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar'])), 'last_login' => empty($profile['last_login']) ? $txt['never'] : !empty($profile['show_online']) || allowedTo('moderate_forum') ? timeformat($profile['last_login']) : $txt['hidden'], 'ip' => htmlspecialchars($profile['member_ip']), 'ip2' => htmlspecialchars($profile['member_ip2']), 'online' => array('is_online' => $profile['is_online'], 'text' => $txt[$profile['is_online'] ? 'online' : 'offline'], 'href' => $scripturl . '?action=pm;sa=send;u=' . $profile['id_member'], 'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $profile['id_member'] . '">' . $txt[$profile['is_online'] ? 'online' : 'offline'] . '</a>', 'image_href' => $settings['images_url'] . '/' . ($profile['buddy'] ? 'buddy_' : '') . ($profile['is_online'] ? 'useron' : 'useroff') . '.gif', 'label' => $txt[$profile['is_online'] ? 'online' : 'offline']), 'language' => commonAPI::ucwords(strtr($profile['lngfile'], array('_' => ' ', '-utf8' => ''))), 'is_activated' => isset($profile['is_activated']) ? $profile['is_activated'] : 1, 'is_banned' => isset($profile['is_activated']) ? $profile['is_activated'] >= 10 : 0, 'options' => $profile['options'], 'is_guest' => false, 'group' => $profile['member_group'], 'group_id' => $profile['id_group'], 'post_group_id' => $profile['id_post_group'], 'post_group' => $profile['post_group'], 'group_stars' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($profile['stars'][1]) ? $settings['images_url'] . '/' . $profile['stars'][1] : '') . '" alt="*" />', empty($profile['stars'][0]) || empty($profile['stars'][1]) ? 0 : $profile['stars'][0]), 'warning' => $profile['warning'], 'warning_status' => !empty($modSettings['warning_mute']) && $modSettings['warning_mute'] <= $profile['warning'] ? 'mute' : (!empty($modSettings['warning_moderate']) && $modSettings['warning_moderate'] <= $profile['warning'] ? 'moderate' : (!empty($modSettings['warning_watch']) && $modSettings['warning_watch'] <= $profile['warning'] ? 'watch' : '')), 'local_time' => timeformat_static(time() + ($profile['time_offset'] - $user_info['time_offset']) * 3600, false), 'liked' => isset($profile['liked']) ? $profile['liked'] : 0, 'likesgiven' => isset($profile['likesgiven']) ? $profile['likesgiven'] : 0, 'notify_optout' => isset($profile['notify_optout']) ? $profile['notify_optout'] : '');
if ($memberContext[$user]['avatar']['name'] == 'gravatar') {
$hash = md5(strtolower(trim($memberContext[$user]['email'])));
$memberContext[$user]['avatar']['image'] = '<img class="avatar" alt="avatar" src="http://www.gravatar.com/avatar/' . $hash . '" />';
$memberContext[$user]['avatar']['href'] = 'http://www.gravatar.com/avatar/' . $hash;
$memberContext[$user]['avatar']['url'] = $memberContext[$user]['avatar']['href'];
}
// First do a quick run through to make sure there is something to be shown.
$memberContext[$user]['has_messenger'] = false;
// Are we also loading the members custom fields into context?
if ($display_custom_fields && !empty($modSettings['displayFields'])) {
$memberContext[$user]['custom_fields'] = array();
if (!isset($context['display_fields'])) {
$context['display_fields'] = unserialize($modSettings['displayFields']);
}
foreach ($context['display_fields'] as $custom) {
if (empty($custom['title']) || empty($profile['options'][$custom['colname']])) {
continue;
}
$value = $profile['options'][$custom['colname']];
// BBC?
if ($custom['bbc']) {
$value = parse_bbc($value);
} elseif (isset($custom['type']) && $custom['type'] == 'check') {
$value = $value ? $txt['yes'] : $txt['no'];
}
// Enclosing the user input within some other text?
if (!empty($custom['enclose'])) {
$value = strtr($custom['enclose'], array('{SCRIPTURL}' => $scripturl, '{IMAGES_URL}' => $settings['images_url'], '{DEFAULT_IMAGES_URL}' => $settings['default_images_url'], '{INPUT}' => $value));
}
$memberContext[$user]['custom_fields'][] = array('title' => $custom['title'], 'colname' => $custom['colname'], 'value' => $value, 'placement' => !empty($custom['placement']) ? $custom['placement'] : 0);
}
}
HookAPI::callHook('integrate_loadmembercontext', array(&$memberContext[$user], &$profile));
return true;
}
开发者ID:norv,项目名称:EosAlpha,代码行数:79,代码来源:Load.php
示例3: findMembers
/**
* Finds members by email address, username, or real name.
* - searches for members whose username, display name, or e-mail address match the given pattern of array names.
* - searches only buddies if buddies_only is set.
*
* @param array $names,
* @param bool $use_wildcards = false, accepts wildcards ? and * in the patern if true
* @param bool $buddies_only = false,
* @param int $max = 500 retrieves a maximum of max members, if passed
* @return array containing information about the matching members
*/
function findMembers($names, $use_wildcards = false, $buddies_only = false, $max = 500)
{
global $scripturl, $user_info, $modSettings, $smcFunc;
// If it's not already an array, make it one.
if (!is_array($names)) {
$names = explode(',', $names);
}
$maybe_email = false;
foreach ($names as $i => $name) {
// Trim, and fix wildcards for each name.
$names[$i] = trim($smcFunc['strtolower']($name));
$maybe_email |= strpos($name, '@') !== false;
// Make it so standard wildcards will work. (* and ?)
if ($use_wildcards) {
$names[$i] = strtr($names[$i], array('%' => '\\%', '_' => '\\_', '*' => '%', '?' => '_', '\'' => '''));
} else {
$names[$i] = strtr($names[$i], array('\'' => '''));
}
}
// What are we using to compare?
$comparison = $use_wildcards ? 'LIKE' : '=';
// Nothing found yet.
$results = array();
// This ensures you can't search someones email address if you can't see it.
$email_condition = allowedTo('moderate_forum') ? '' : 'hide_email = 0 AND ';
if ($use_wildcards || $maybe_email) {
$email_condition = '
OR (' . $email_condition . 'email_address ' . $comparison . ' \'' . implode('\') OR (' . $email_condition . ' email_address ' . $comparison . ' \'', $names) . '\')';
} else {
$email_condition = '';
}
// Get the case of the columns right - but only if we need to as things like MySQL will go slow needlessly otherwise.
$member_name = $smcFunc['db_case_sensitive'] ? 'LOWER(member_name)' : 'member_name';
$real_name = $smcFunc['db_case_sensitive'] ? 'LOWER(real_name)' : 'real_name';
// Search by username, display name, and email address.
$request = $smcFunc['db_query']('', '
SELECT id_member, member_name, real_name, email_address, hide_email
FROM {db_prefix}members
WHERE ({raw:member_name_search}
OR {raw:real_name_search} {raw:email_condition})
' . ($buddies_only ? 'AND id_member IN ({array_int:buddy_list})' : '') . '
AND is_activated IN (1, 11)
LIMIT {int:limit}', array('buddy_list' => $user_info['buddies'], 'member_name_search' => $member_name . ' ' . $comparison . ' \'' . implode('\' OR ' . $member_name . ' ' . $comparison . ' \'', $names) . '\'', 'real_name_search' => $real_name . ' ' . $comparison . ' \'' . implode('\' OR ' . $real_name . ' ' . $comparison . ' \'', $names) . '\'', 'email_condition' => $email_condition, 'limit' => $max));
while ($row = $smcFunc['db_fetch_assoc']($request)) {
$results[$row['id_member']] = array('id' => $row['id_member'], 'name' => $row['real_name'], 'username' => $row['member_name'], 'email' => in_array(showEmailAddress(!empty($row['hide_email']), $row['id_member']), array('yes', 'yes_permission_override')) ? $row['email_address'] : '', 'href' => $scripturl . '?action=profile;u=' . $row['id_member'], 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>');
}
$smcFunc['db_free_result']($request);
// Return all the results.
return $results;
}
开发者ID:albertlast,项目名称:SMF2.1,代码行数:61,代码来源:Subs-Auth.php
示例4: CustomEmail
function CustomEmail()
{
global $context, $modSettings, $user_info, $smcFunc, $txt, $scripturl, $sourcedir;
// Can the user even see this information?
if ($user_info['is_guest'] && !empty($modSettings['guest_hideContacts'])) {
fatal_lang_error('no_access', false);
}
// Are we sending to a user?
$context['form_hidden_vars'] = array();
if (isset($_REQUEST['uid'])) {
$request = $smcFunc['db_query']('', '
SELECT email_address AS email, real_name AS name, id_member, hide_email
FROM {db_prefix}members
WHERE id_member = {int:id_member}', array('id_member' => (int) $_REQUEST['uid']));
$context['form_hidden_vars']['uid'] = (int) $_REQUEST['uid'];
} elseif (isset($_REQUEST['msg'])) {
$request = $smcFunc['db_query']('', '
SELECT IFNULL(mem.email_address, m.poster_email) AS email, IFNULL(mem.real_name, m.poster_name) AS name, IFNULL(mem.id_member, 0) AS id_member, hide_email
FROM {db_prefix}messages AS m
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE m.id_msg = {int:id_msg}', array('id_msg' => (int) $_REQUEST['msg']));
$context['form_hidden_vars']['msg'] = (int) $_REQUEST['msg'];
}
if (empty($request) || $smcFunc['db_num_rows']($request) == 0) {
fatal_lang_error('cant_find_user_email');
}
$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);
// Are you sure you got the address?
if (empty($row['email'])) {
fatal_lang_error('cant_find_user_email');
}
// Can they actually do this?
$context['show_email_address'] = showEmailAddress(!empty($row['hide_email']), $row['id_member']);
if ($context['show_email_address'] === 'no') {
fatal_lang_error('no_access', false);
}
// Setup the context!
$context['recipient'] = array('id' => $row['id_member'], 'name' => $row['name'], 'email' => $row['email'], 'email_link' => ($context['show_email_address'] == 'yes_permission_override' ? '<em>' : '') . '<a href="mailto:' . $row['email'] . '">' . $row['email'] . '</a>' . ($context['show_email_address'] == 'yes_permission_override' ? '</em>' : ''), 'link' => $row['id_member'] ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['name'] . '</a>' : $row['name']);
// Can we see this person's email address?
$context['can_view_receipient_email'] = $context['show_email_address'] == 'yes' || $context['show_email_address'] == 'yes_permission_override';
// Are we actually sending it?
if (isset($_POST['send']) && isset($_POST['email_body'])) {
require_once $sourcedir . '/Subs-Post.php';
checkSession();
// If it's a guest sort out their names.
if ($user_info['is_guest']) {
if (empty($_POST['y_name']) || $_POST['y_name'] == '_' || trim($_POST['y_name']) == '') {
fatal_lang_error('no_name', false);
}
if (empty($_POST['y_email'])) {
fatal_lang_error('no_email', false);
}
if (preg_match('~^[0-9A-Za-z=_+\\-/][0-9A-Za-z=_\'+\\-/\\.]*@[\\w\\-]+(\\.[\\w\\-]+)*(\\.[\\w]{2,6})$~', $_POST['y_email']) == 0) {
fatal_lang_error('email_invalid_character', false);
}
$from_name = trim($_POST['y_name']);
$from_email = trim($_POST['y_email']);
} else {
$from_name = $user_info['name'];
$from_email = $user_info['email'];
}
// Check we have a body (etc).
if (trim($_POST['email_body']) == '' || trim($_POST['email_subject']) == '') {
fatal_lang_error('email_missing_data');
}
// We use a template in case they want to customise!
$replacements = array('EMAILSUBJECT' => $_POST['email_subject'], 'EMAILBODY' => $_POST['email_body'], 'SENDERNAME' => $from_name, 'RECPNAME' => $context['recipient']['name']);
// Don't let them send too many!
spamProtection('sendmail');
// Get the template and get out!
$emaildata = loadEmailTemplate('send_email', $replacements);
sendmail($context['recipient']['email'], $emaildata['subject'], $emaildata['body'], $from_email, null, false, 1, null, true);
// Now work out where to go!
if (isset($_REQUEST['uid'])) {
redirectexit('action=profile;u=' . (int) $_REQUEST['uid']);
} elseif (isset($_REQUEST['msg'])) {
redirectexit('msg=' . (int) $_REQUEST['msg']);
} else {
redirectexit();
}
}
$context['sub_template'] = 'custom_email';
$context['page_title'] = $txt['send_email'];
}
开发者ID:valek0972,项目名称:hackits,代码行数:85,代码来源:SendTopic.php
示例5: prepareDisplayContext_callback
/**
* Callback for the message display.
* It actually gets and prepares the message context.
* This method will start over from the beginning if reset is set to true, which is
* useful for showing an index before or after the posts.
*
* @param bool $reset default false.
*/
public function prepareDisplayContext_callback($reset = false)
{
global $settings, $txt, $modSettings, $scripturl, $options, $user_info;
global $memberContext, $context, $messages_request, $topic;
static $counter = null;
// If the query returned false, bail.
if ($messages_request == false) {
return false;
}
// Remember which message this is. (ie. reply #83)
if ($counter === null || $reset) {
$counter = $context['start'];
}
// Start from the beginning...
if ($reset) {
return currentContext($messages_request, $reset);
}
// Attempt to get the next message.
$message = currentContext($messages_request);
if (!$message) {
return false;
}
// $context['icon_sources'] says where each icon should come from - here we set up the ones which will always exist!
if (empty($context['icon_sources'])) {
require_once SUBSDIR . '/MessageIndex.subs.php';
$context['icon_sources'] = MessageTopicIcons();
}
// Message Icon Management... check the images exist.
if (empty($modSettings['messageIconChecks_disable'])) {
// If the current icon isn't known, then we need to do something...
if (!isset($context['icon_sources'][$message['icon']])) {
$context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.png') ? 'images_url' : 'default_images_url';
}
} elseif (!isset($context['icon_sources'][$message['icon']])) {
$context['icon_sources'][$message['icon']] = 'images_url';
}
// If you're a lazy bum, you probably didn't give a subject...
$message['subject'] = $message['subject'] != '' ? $message['subject'] : $txt['no_subject'];
// Are you allowed to remove at least a single reply?
$context['can_remove_post'] |= allowedTo('delete_own') && (empty($modSettings['edit_disable_time']) || $message['poster_time'] + $modSettings['edit_disable_time'] * 60 >= time()) && $message['id_member'] == $user_info['id'];
// Have you liked this post, can you?
$message['you_liked'] = !empty($context['likes'][$message['id_msg']]['member']) && isset($context['likes'][$message['id_msg']]['member'][$user_info['id']]);
$message['use_likes'] = allowedTo('like_posts') && ($message['id_member'] != $user_info['id'] || !empty($modSettings['likeAllowSelf'])) && (empty($modSettings['likeMinPosts']) ? true : $modSettings['likeMinPosts'] <= $user_info['posts']);
$message['like_count'] = !empty($context['likes'][$message['id_msg']]['count']) ? $context['likes'][$message['id_msg']]['count'] : 0;
// If it couldn't load, or the user was a guest.... someday may be done with a guest table.
if (!loadMemberContext($message['id_member'], true)) {
// Notice this information isn't used anywhere else....
$memberContext[$message['id_member']]['name'] = $message['poster_name'];
$memberContext[$message['id_member']]['id'] = 0;
$memberContext[$message['id_member']]['group'] = $txt['guest_title'];
$memberContext[$message['id_member']]['link'] = $message['poster_name'];
$memberContext[$message['id_member']]['email'] = $message['poster_email'];
$memberContext[$message['id_member']]['show_email'] = showEmailAddress(true, 0);
$memberContext[$message['id_member']]['is_guest'] = true;
} else {
$memberContext[$message['id_member']]['can_view_profile'] = allowedTo('profile_view_any') || $message['id_member'] == $user_info['id'] && allowedTo('profile_view_own');
$memberContext[$message['id_member']]['is_topic_starter'] = $message['id_member'] == $context['topic_starter_id'];
$memberContext[$message['id_member']]['can_see_warning'] = !isset($context['disabled_fields']['warning_status']) && $memberContext[$message['id_member']]['warning_status'] && ($context['user']['can_mod'] || !$user_info['is_guest'] && !empty($modSettings['warning_show']) && ($modSettings['warning_show'] > 1 || $message['id_member'] == $user_info['id']));
}
$memberContext[$message['id_member']]['ip'] = $message['poster_ip'];
$memberContext[$message['id_member']]['show_profile_buttons'] = $settings['show_profile_buttons'] && (!empty($memberContext[$message['id_member']]['can_view_profile']) || !empty($memberContext[$message['id_member']]['website']['url']) && !isset($context['disabled_fields']['website']) || in_array($memberContext[$message['id_member']]['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) || $context['can_send_pm']);
// Do the censor thang.
censorText($message['body']);
censorText($message['subject']);
// Run BBC interpreter on the message.
$message['body'] = parse_bbc($message['body'], $message['smileys_enabled'], $message['id_msg']);
// Compose the memory eat- I mean message array.
require_once SUBSDIR . '/Attachments.subs.php';
$output = array('attachment' => loadAttachmentContext($message['id_msg']), 'alternate' => $counter % 2, 'id' => $message['id_msg'], 'href' => $scripturl . '?topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg'], 'link' => '<a href="' . $scripturl . '?topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg'] . '" rel="nofollow">' . $message['subject'] . '</a>', 'member' => &$memberContext[$message['id_member']], 'icon' => $message['icon'], 'icon_url' => $settings[$context['icon_sources'][$message['icon']]] . '/post/' . $message['icon'] . '.png', 'subject' => $message['subject'], 'time' => standardTime($message['poster_time']), 'html_time' => htmlTime($message['poster_time']), 'timestamp' => forum_time(true, $message['poster_time']), 'counter' => $counter, 'modified' => array('time' => standardTime($message['modified_time']), 'html_time' => htmlTime($message['modified_time']), 'timestamp' => forum_time(true, $message['modified_time']), 'name' => $message['modified_name']), 'body' => $message['body'], 'new' => empty($message['is_read']), 'approved' => $message['approved'], 'first_new' => isset($context['start_from']) && $context['start_from'] == $counter, 'is_ignored' => !empty($modSettings['enable_buddylist']) && in_array($message['id_member'], $context['user']['ignoreusers']), 'is_message_author' => $message['id_member'] == $user_info['id'], 'can_approve' => !$message['approved'] && $context['can_approve'], 'can_unapprove' => !empty($modSettings['postmod_active']) && $context['can_approve'] && $message['approved'], 'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || allowedTo('modify_replies') && $context['user']['started'] || allowedTo('modify_own') && $message['id_member'] == $user_info['id'] && (empty($modSettings['edit_disable_time']) || !$message['approved'] || $message['poster_time'] + $modSettings['edit_disable_time'] * 60 > time())), 'can_remove' => allowedTo('delete_any') || allowedTo('delete_replies') && $context['user']['started'] || allowedTo('delete_own') && $message['id_member'] == $user_info['id'] && (empty($modSettings['edit_disable_time']) || $message['poster_time'] + $modSettings['edit_disable_time'] * 60 > time()), 'can_see_ip' => allowedTo('moderate_forum') || $message['id_member'] == $user_info['id'] && !empty($user_info['id']), 'can_like' => $message['use_likes'] && !$message['you_liked'], 'can_unlike' => $message['use_likes'] && $message['you_liked'], 'like_counter' => $message['like_count'], 'likes_enabled' => !empty($modSettings['likes_enabled']) && ($message['use_likes'] || $message['like_count'] != 0));
if (!empty($output['modified']['name'])) {
$output['modified']['last_edit_text'] = sprintf($txt['last_edit_by'], $output['modified']['time'], $output['modified']['name'], standardTime($output['modified']['timestamp']));
}
if (!empty($output['member']['karma']['allow'])) {
$output['member']['karma'] += array('applaud_url' => $scripturl . '?action=karma;sa=applaud;uid=' . $output['member']['id'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';m=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], 'smite_url' => $scripturl . '?action=karma;sa=smite;uid=' . $output['member']['id'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';m=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id']);
}
call_integration_hook('integrate_prepare_display_context', array(&$output, &$message));
$counter++;
return $output;
}
开发者ID:scripple,项目名称:Elkarte,代码行数:87,代码来源:Display.controller.php
示例6: loadMemberContext
function loadMemberContext($user, $display_custom_fields = false)
{
global $memberContext, $user_profile, $txt, $scripturl, $user_info;
global $context, $modSettings, $board_info, $settings;
global $smcFunc;
static $dataLoaded = array();
// If this person's data is already loaded, skip it.
if (isset($dataLoaded[$user])) {
return true;
}
// We can't load guests or members not loaded by loadMemberData()!
if ($user == 0) {
return false;
}
if (!isset($user_profile[$user])) {
trigger_error('loadMemberContext(): member id ' . $user . ' not previously loaded by loadMemberData()', E_USER_WARNING);
return false;
}
// Well, it's loaded now anyhow.
$dataLoaded[$user] = true;
$profile = $user_profile[$user];
// Censor everything.
censorText($profile['signature']);
censorText($profile['personal_text']);
censorText($profile['location']);
// Set things up to be used before hand.
$gendertxt = $profile['gender'] == 2 ? $txt['female'] : ($profile['gender'] == 1 ? $txt['male'] : '');
$profile['signature'] = str_replace(array("\n", "\r"), array('<br />', ''), $profile['signature']);
$profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);
$profile['is_online'] = (!empty($profile['show_online']) || allowedTo('moderate_forum')) && $profile['is_online'] > 0;
$profile['stars'] = empty($profile['stars']) ? array('', '') : explode('#', $profile['stars']);
// Setup the buddy status here (One whole in_array call saved :P)
$profile['buddy'] = in_array($profile['id_member'], $user_info['buddies']);
$buddy_list = !empty($profile['buddy_list']) ? explode(',', $profile['buddy_list']) : array();
// If we're always html resizing, assume it's too large.
if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize') {
$avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
$avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
} else {
$avatar_width = '';
$avatar_height = '';
}
// What a monstrous array...
$memberContext[$user] = array('username' => $profile['member_name'], 'name' => $profile['real_name'], 'id' => $profile['id_member'], 'is_buddy' => $profile['buddy'], 'is_reverse_buddy' => in_array($user_info['id'], $buddy_list), 'buddies' => $buddy_list, 'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '', 'href' => $scripturl . '?action=profile;u=' . $profile['id_member'], 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>', 'email' => $profile['email_address'], 'show_email' => showEmailAddress(!empty($profile['hide_email']), $profile['id_member']), 'registered' => empty($profile['date_registered']) ? $txt['not_applicable'] : timeformat($profile['date_registered']), 'registered_timestamp' => empty($profile['date_registered']) ? 0 : forum_time(true, $profile['date_registered']), 'blurb' => $profile['personal_text'], 'gender' => array('name' => $gendertxt, 'image' => !empty($profile['gender']) ? '<img class="gender" src="' . $settings['images_url'] . '/' . ($profile['gender'] == 1 ? 'Male' : 'Female') . '.gif" alt="' . $gendertxt . '" />' : ''), 'website' => array('title' => $profile['website_title'], 'url' => $profile['website_url']), 'birth_date' => empty($profile['birthdate']) || $profile['birthdate'] === '0001-01-01' ? '0000-00-00' : (substr($profile['birthdate'], 0, 4) === '0004' ? '0000' . substr($profile['birthdate'], 4) : $profile['birthdate']), 'signature' => $profile['signature'], 'location' => $profile['location'], 'icq' => $profile['icq'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array('name' => $profile['icq'], 'href' => 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'], 'link' => '<a class="icq new_win" href="http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'] . '" target="_blank" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '"><img src="http://status.icq.com/online.gif?img=5&icq=' . $profile['icq'] . '" alt="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '" width="18" height="18" /></a>', 'link_text' => '<a class="icq extern" href="http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'] . '" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '">' . $profile['icq'] . '</a>') : array('name' => '', 'add' => '', 'href' => '', 'link' => '', 'link_text' => ''), 'aim' => $profile['aim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array('name' => $profile['aim'], 'href' => 'aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&message=' . $txt['aim_default_message'], 'link' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '"><img src="' . $settings['images_url'] . '/aim.gif" alt="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '" /></a>', 'link_text' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '">' . $profile['aim'] . '</a>') : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''), 'yim' => $profile['yim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array('name' => $profile['yim'], 'href' => 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']), 'link' => '<a class="yim" href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($profile['yim']) . '&m=g&t=0" alt="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '" /></a>', 'link_text' => '<a class="yim" href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '">' . $profile['yim'] . '</a>') : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''), 'msn' => $profile['msn'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array('name' => $profile['msn'], 'href' => 'http://members.msn.com/' . $profile['msn'], 'link' => '<a class="msn new_win" href="http://members.msn.com/' . $profile['msn'] . '" title="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '" /></a>', 'link_text' => '<a class="msn new_win" href="http://members.msn.com/' . $profile['msn'] . '" title="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '">' . $profile['msn'] . '</a>') : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''), 'real_posts' => $profile['posts'], 'posts' => $profile['posts'] > 500000 ? $txt['geek'] : comma_format($profile['posts']), 'avatar' => array('name' => $profile['avatar'], 'image' => $profile['avatar'] == '' ? $profile['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) . '" alt="" />' : '' : (stristr($profile['avatar'], 'http://') ? '<img class="avatar" src="' . $profile['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($profile['avatar']) . '" alt="" />'), 'href' => $profile['avatar'] == '' ? $profile['id_attach'] > 0 ? empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename'] : '' : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']), 'url' => $profile['avatar'] == '' ? '' : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar'])), 'last_login' => empty($profile['last_login']) ? $txt['never'] : timeformat($profile['last_login']), 'last_login_timestamp' => empty($profile['last_login']) ? 0 : forum_time(0, $profile['last_login']), 'karma' => array('good' => $profile['karma_good'], 'bad' => $profile['karma_bad'], 'allow' => !$user_info['is_guest'] && !empty($modSettings['karmaMode']) && $user_info['id'] != $user && allowedTo('karma_edit') && ($user_info['posts'] >= $modSettings['karmaMinPosts'] || $user_info['is_admin'])), 'ip' => htmlspecialchars($profile['member_ip']), 'ip2' => htmlspecialchars($profile['member_ip2']), 'online' => array('is_online' => $profile['is_online'], 'text' => $txt[$profile['is_online'] ? 'online' : 'offline'], 'href' => $scripturl . '?action=pm;sa=send;u=' . $profile['id_member'], 'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $profile['id_member'] . '">' . $txt[$profile['is_online'] ? 'online' : 'offline'] . '</a>', 'image_href' => $settings['images_url'] . '/' . ($profile['buddy'] ? 'buddy_' : '') . ($profile['is_online'] ? 'useron' : 'useroff') . '.gif', 'label' => $txt[$profile['is_online'] ? 'online' : 'offline']), 'language' => $smcFunc['ucwords'](strtr($profile['lngfile'], array('_' => ' ', '-utf8' => ''))), 'is_activated' => isset($profile['is_activated']) ? $profile['is_activated'] : 1, 'is_banned' => isset($profile['is_activated']) ? $profile['is_activated'] >= 10 : 0, 'options' => $profile['options'], 'is_guest' => false, 'group' => $profile['member_group'], 'group_color' => $profile['member_group_color'], 'group_id' => $profile['id_group'], 'post_group' => $profile['post_group'], 'post_group_color' => $profile['post_group_color'], 'group_stars' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($profile['stars'][1]) ? $settings['images_url'] . '/' . $profile['stars'][1] : '') . '" alt="*" />', empty($profile['stars'][0]) || empty($profile['stars'][1]) ? 0 : $profile['stars'][0]), 'warning' => $profile['warning'], 'warning_status' => !empty($modSettings['warning_mute']) && $modSettings['warning_mute'] <= $profile['warning'] ? 'mute' : (!empty($modSettings['warning_moderate']) && $modSettings['warning_moderate'] <= $profile['warning'] ? 'moderate' : (!empty($modSettings['warning_watch']) && $modSettings['warning_watch'] <= $profile['warning'] ? 'watch' : '')), 'local_time' => timeformat(time() + ($profile['time_offset'] - $user_info['time_offset']) * 3600, false));
// First do a quick run through to make sure there is something to be shown.
$memberContext[$user]['has_messenger'] = false;
foreach (array('icq', 'msn', 'aim', 'yim') as $messenger) {
if (!isset($context['disabled_fields'][$messenger]) && !empty($memberContext[$user][$messenger]['link'])) {
$memberContext[$user]['has_messenger'] = true;
break;
}
}
// Are we also loading the members custom fields into context?
if ($display_custom_fields && !empty($modSettings['displayFields'])) {
$memberContext[$user]['custom_fields'] = array();
if (!isset($context['display_fields'])) {
$context['display_fields'] = unserialize($modSettings['displayFields']);
}
foreach ($context['display_fields'] as $custom) {
if (empty($custom['title']) || empty($profile['options'][$custom['colname']])) {
continue;
}
$value = $profile['options'][$custom['colname']];
// BBC?
if ($custom['bbc']) {
$value = parse_bbc($value);
} elseif (isset($custom['type']) && $custom['type'] == 'check') {
$value = $value ? $txt['yes'] : $txt['no'];
}
// Enclosing the user input within some other text?
if (!empty($custom['enclose'])) {
$value = strtr($custom['enclose'], array('{SCRIPTURL}' => $scripturl, '{IMAGES_URL}' => $settings['images_url'], '{DEFAULT_IMAGES_URL}' => $settings['default_images_url'], '{INPUT}' => $value));
}
$memberContext[$user]['custom_fields'][] = array('title' => $custom['title'], 'colname' => $custom['colname'], 'value' => $value, 'placement' => !empty($custom['placement']) ? $custom['placement'] : 0);
}
}
return true;
}
开发者ID:valek0972,项目名称:hackits,代码行数:78,代码来源:Load.php
示例7: shd_prepare_reply_context
function shd_prepare_reply_context()
{
global $settings, $txt, $modSettings, $scripturl, $options, $user_info, $smcFunc;
global $memberContext, $context, $reply_request;
if (empty($reply_request)) {
return false;
}
$message = $smcFunc['db_fetch_assoc']($reply_request);
if (!$message) {
$smcFunc['db_free_result']($reply_request);
return false;
}
if (!loadMemberContext($message['id_member'], true)) {
// Notice this information isn't used anywhere else....
$memberContext[$message['id_member']]['name'] = $message['poster_name'];
$memberContext[$message['id_member']]['id'] = 0;
$memberContext[$message['id_member']]['group'] = $txt['guest_title'];
$memberContext[$message['id_member']]['link'] = $message['poster_name'];
$memberContext[$message['id_member']]['email'] = $message['poster_email'];
$memberContext[$message['id_member']]['show_email'] = showEmailAddress(true, 0);
$memberContext[$message['id_member']]['is_guest'] = true;
$memberContext[$message['id_member']]['group_stars'] = '';
}
$memberContext[$message['id_member']]['ip'] = $message['poster_ip'];
censorText($message['body']);
$message['body'] = shd_format_text($message['body'], $message['smileys_enabled'], 'shd_reply_' . $message['id_msg']);
$output = array('id' => $message['id_msg'], 'member' => &$memberContext[$message['id_member']], 'time' => timeformat($message['poster_time']), 'timestamp' => forum_time(true, $message['poster_time']), 'body' => $message['body'], 'is_staff' => !empty($context['shd_is_staff'][$message['id_member']]), 'can_edit' => shd_allowed_to('shd_edit_reply_any', $context['ticket_form']['dept']) || $message['id_member'] == $user_info['id'] && shd_allowed_to('shd_edit_reply_own', $context['ticket_form']['dept']), 'ip_address' => $message['poster_ip']);
if (!empty($message['modified_time'])) {
$output['modified'] = array('time' => timeformat($message['modified_time']), 'timestamp' => forum_time(true, $message['modified_time']), 'id' => !empty($user_profile[$message['modified_member']]) ? $message['modified_member'] : 0, 'name' => !empty($user_profile[$message['modified_member']]) ? $user_profile[$message['modified_member']]['real_name'] : $message['modified_name']);
$output['modified']['link'] = shd_profile_link($output['modified']['name'], $output['modified']['id']);
}
return $output;
}
开发者ID:wintstar,项目名称:Testing,代码行数:33,代码来源:SimpleDesk-Post.php
示例8: shd_prepare_ticket_context
/**
* Callback function for the template to load messages.
*
* The process set up by shd_view_ticket() and invoked within template_view_replies() is reasonably complex.
* {@link shd_view_ticket()} identifies what messages should be displayed on the current page of the ticket, and performs a query
* to load the ticket data. Instead, however, of retrieving every row directly into memory before passing to the template,
* it passes the query result, and the name of a handler function into $context, so the template can call to get an
* individual row at a time, which saves memory amongst other things.
*
* With respect to {@link shd_view_ticket()}, the relevant items are $reply_request being defined and $context['get_replies']
* being defined as the name of this function, and in {@link template_view_replies()}, the reference is $reply = $context['get_replies']()
*
* @return mixed The function returns the "next" message reply's details, or simply false if no replies were available, or no further replies are available. Assuming a reply can be returned, it will be a hash array in the following format:
* <ul>
* <li>id: numeric message id</li>
* <li>member: hash array containing details of the poster; normally the return value from SMF's loadMemberContext() function. A minimal set of details is prepared if the poster holds no current SMF account. Common values:
* <ul>
* <li>name: User's name (falls back to the poster name specified in the replies table)</li>
* <li>id: User's id</li>
* <li>group: Name of the assigned group/post count group of the user</li
|
请发表评论