本文整理汇总了PHP中get_webtag函数的典型用法代码示例。如果您正苦于以下问题:PHP get_webtag函数的具体用法?PHP get_webtag怎么用?PHP get_webtag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_webtag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sprintf
if ($start_page == START_PAGE_THREAD_LIST) {
$final_uri = "start.php?webtag={$webtag}&left=threadlist";
} else {
$final_uri = "start.php?webtag={$webtag}";
}
}
}
} else {
$final_uri = "start.php?webtag={$webtag}";
}
}
}
}
}
} else {
if (get_webtag()) {
if (isset($final_uri) && strlen(trim($final_uri)) > 0) {
$final_uri = sprintf("forums.php?webtag={$webtag}&webtag_error=true&final_uri=%s", rawurlencode($final_uri));
} else {
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
$final_uri = "forums.php?webtag={$webtag}&webtag_error=true&final_uri=discussion.php%3Fmsg%3D{$_GET['msg']}";
} else {
if (isset($_GET['folder']) && is_numeric($_GET['folder'])) {
$final_uri = "forums.php?webtag={$webtag}&webtag_error=true&final_uri=discussion.php%3Ffolder%3D{$_GET['folder']}";
} else {
if (isset($_GET['pmid']) && is_numeric($_GET['pmid'])) {
$final_uri = "forums.php?webtag={$webtag}&webtag_error=true&final_uri=pm.php%3Fmid%3D{$_GET['pmid']}";
} else {
$final_uri = "forums.php?webtag={$webtag}&webtag_error=true";
}
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:index.php
示例2: stats_get_html
function stats_get_html()
{
// Get webtag
$webtag = get_webtag();
// Current active user UID
$uid = session::get_value('UID');
// Number of active users
$session_count = stats_get_active_session_count();
// Number of recent posts.
$recent_post_count = stats_get_recent_post_count();
// Update the stats records.
stats_update($session_count, $recent_post_count);
// User Profile link
$user_profile_link = '%s<a href="user_profile.php?webtag=%s&uid=%s" target="_blank" class="popup 650x500"><span class="%s" title="%s">%s</span></a>';
// Newest ser Profile link
$new_user_profile_link = '<a href="user_profile.php?webtag=%s&uid=%s" target="_blank" class="popup 650x500">%s</a>';
// Search Engine Bot link
$search_engine_bot_link = '<a href="%s" target="_blank"><span class="user_stats_normal">%s</span></a>';
// Output the HTML.
if ($user_stats = stats_get_active_user_list()) {
$active_user_list_array = array();
$html = "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"posthead\">\n";
$html .= " <tr>\n";
$html .= " <td width=\"35\"> </td>\n";
$html .= " <td> </td>\n";
$html .= " <td width=\"35\"> </td>\n";
$html .= " </tr>\n";
$html .= " <tr>\n";
$html .= " <td> </td>\n";
$html .= " <td>";
if (forum_get_setting('guest_show_recent', 'Y') && user_guest_enabled()) {
if ($user_stats['GUESTS'] != 1) {
$active_user_list_array[] = sprintf(gettext("<b>%s</b> guests"), $user_stats['GUESTS']);
} else {
$active_user_list_array[] = gettext("<b>1</b> guest");
}
}
if ($user_stats['USER_COUNT'] != 1) {
$active_user_list_array[] = sprintf(gettext("<b>%s</b> members"), $user_stats['USER_COUNT']);
} else {
$active_user_list_array[] = gettext("<b>1</b> member");
}
if ($user_stats['ANON_USERS'] != 1) {
$active_user_list_array[] = sprintf(gettext("<b>%s</b> anonymous members"), $user_stats['ANON_USERS']);
} else {
$active_user_list_array[] = gettext("<b>1</b> anonymous member");
}
$active_user_list = implode(", ", $active_user_list_array);
$active_user_time = format_time_display(ini_get('session.gc_maxlifetime'), false);
$html .= sprintf(gettext("%s active in the past %s."), $active_user_list, $active_user_time);
$html .= " [ <a href=\"start.php?webtag={$webtag}&show=visitors\" target=\"" . html_get_frame_name('main') . "\">" . gettext("View Complete List") . "</a> ]\n";
$html .= " </td>\n";
$html .= " <td width=\"35\"> </td>\n";
$html .= " </tr>\n";
if (sizeof($user_stats['USERS']) > 0) {
$active_users_array = array();
foreach ($user_stats['USERS'] as $user) {
$active_user_title = '';
$active_user_class = '';
$active_user_avatar = '';
if (isset($user['BOT_NAME']) && isset($user['BOT_URL'])) {
$active_user_display = word_filter_add_ob_tags($user['BOT_NAME'], true);
$active_user_display = sprintf($search_engine_bot_link, $user['BOT_URL'], $active_user_display);
$active_users_array[] = $active_user_display;
} else {
$active_user_logon = format_user_name($user['LOGON'], $user['NICKNAME']);
$active_user_display = str_replace(" ", " ", word_filter_add_ob_tags($active_user_logon, true));
if ($user['UID'] == $uid) {
if (isset($user['ANON_LOGON']) && $user['ANON_LOGON'] > USER_ANON_DISABLED) {
$active_user_title = gettext("You (Invisible)");
$active_user_class = 'user_stats_curuser';
} else {
$active_user_title = gettext("You");
$active_user_class = 'user_stats_curuser';
}
} else {
if (($user['RELATIONSHIP'] & USER_FRIEND) > 0) {
$active_user_title = gettext("Friend");
$active_user_class = 'user_stats_friend';
} else {
$active_user_class = 'user_stats_normal';
}
}
if (isset($user['AVATAR_URL']) && strlen($user['AVATAR_URL']) > 0) {
$active_user_avatar = sprintf('<a href="user_profile.php?webtag=%s&uid=%s" target="_blank" class="popup 650x500">
<img src="%s" title="%s" alt="" border="0" width="16" height="16" />
</a>', $webtag, $user['UID'], $user['AVATAR_URL'], htmlentities_array($active_user_title));
} else {
if (isset($user['AVATAR_AID']) && is_md5($user['AVATAR_AID'])) {
$attachment = attachments_get_by_hash($user['AVATAR_AID']);
if (!($user_avatar_picture = attachments_make_link($attachment, false, false, false, false))) {
$active_user_avatar = sprintf('<a href="user_profile.php?webtag=%s&uid=%s" target="_blank" class="popup 650x500">
<img src="%s&avatar_picture" title="%s" alt="" border="0" width="16" height="16" />
</a>', $webtag, $user['UID'], $user_avatar_picture, htmlentities_array($active_user_title));
}
}
}
$active_users_array[] = sprintf($user_profile_link, $active_user_avatar, $webtag, $user['UID'], $active_user_class, $active_user_title, $active_user_display);
}
}
//.........这里部分代码省略.........
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:101,代码来源:stats.inc.php
示例3: get_request_uri
function get_request_uri($include_webtag = true, $encode_uri_query = true)
{
if (!is_bool($include_webtag)) {
$include_webtag = true;
}
if (!is_bool($encode_uri_query)) {
$encode_uri_query = true;
}
$webtag = get_webtag();
$request_uri = basename($_SERVER['PHP_SELF']);
$query_string_array = array();
unset($_GET['webtag']);
if ($include_webtag) {
$query_string_array['webtag'] = $webtag;
}
$query_string_array += array_diff($_GET, $query_string_array);
$query_string = http_build_query($query_string_array, null, $encode_uri_query ? '&' : '&');
return sprintf('%s?%s', $request_uri, $query_string);
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:19,代码来源:format.inc.php
示例4: set_server_protocol
// Correctly set server protocol
set_server_protocol();
// Disable caching if on AOL
cache_disable_aol();
// Disable caching if proxy server detected.
cache_disable_proxy();
// Check that Beehive is installed correctly
check_install();
// Multiple forum support
require_once BH_INCLUDE_PATH . 'forum.inc.php';
// Initialise the session
session::init();
// Perform ban check
ban_check($_SESSION);
// Check to see if user account has been banned.
if (session::user_banned()) {
light_html_user_banned();
exit;
}
// Check to see if the user has been approved.
if (!session::user_approved()) {
light_html_user_require_approval();
exit;
}
// Get the webtag for the current forum
$webtag = get_webtag();
// Check we have a webtag and have access to the specified forum
if (!forum_check_webtag_available($webtag) || !forum_check_access_level()) {
$request_uri = rawurlencode(get_request_uri(false));
header_redirect("lforums.php?webtag_error");
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:lboot.php
示例5: form_quick_button
function form_quick_button($href, $label, $var_array = false, $target = "_self")
{
$webtag = get_webtag();
$html = "<form accept-charset=\"utf-8\" method=\"get\" action=\"{$href}\" target=\"{$target}\">";
$html .= form_input_hidden("webtag", htmlentities_array($webtag));
if (is_array($var_array)) {
foreach ($var_array as $var_name => $var_value) {
if (!is_array($var_value)) {
$html .= form_input_hidden($var_name, htmlentities_array($var_value));
}
}
}
$html .= form_submit(form_unique_id('submit'), $label);
$html .= "</form>";
return $html;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:16,代码来源:form.inc.php
示例6: sphinx_search_execute
function sphinx_search_execute($search_arguments, &$error)
{
if (!isset($_SESSION['UID']) || !is_numeric($_SESSION['UID'])) {
return false;
}
if (!($table_prefix = get_table_prefix())) {
return false;
}
if (!($forum_fid = get_forum_fid())) {
return false;
}
/** @var mysqli $sphinx */
if (!($sphinx = sphinx_search_connect())) {
$error = SEARCH_SPHINX_UNAVAILABLE;
return false;
}
// Sphinx Search index name is the forum's webtag.
if (!($sphinx_search_index = get_webtag())) {
$error = SEARCH_SPHINX_UNAVAILABLE;
return false;
}
// Validate the webtag
if (!forum_check_webtag_available($sphinx_search_index)) {
$error = SEARCH_SPHINX_UNAVAILABLE;
return false;
}
// Regular Database connection.
if (!($db = db::get())) {
return false;
}
// If the user has specified a folder within their viewable scope limit them
// to that folder, otherwise limit them to their available folders.
$where_sql = "WHERE forum = {$forum_fid} AND fid IN ({$search_arguments['fid']}) ";
// Where query needs to limit the search results to the user specified date range.
$where_sql .= sphinx_search_date_range($search_arguments['date_from'], $search_arguments['date_to']);
// Username based search.
if (isset($search_arguments['user_uid_array']) && sizeof($search_arguments['user_uid_array']) > 0) {
// Save the sort by and sort dir.
search_save_arguments($search_arguments);
// Combine the user UIDs into a comma-seperated list.
$user_uids = implode(',', array_filter($search_arguments['user_uid_array'], 'is_numeric'));
// Check if we're searching for threads or posts started by these users.
if (isset($search_arguments['user_include']) && is_numeric($search_arguments['user_include'])) {
if ($search_arguments['user_include'] == SEARCH_FILTER_USER_THREADS) {
$where_sql .= "AND by_uid IN ({$user_uids}) AND pid = 1 ";
} else {
if ($search_arguments['user_include'] == SEARCH_FILTER_USER_POSTS) {
$where_sql .= "AND from_uid IN ({$user_uids}) ";
}
}
}
}
/// Keyword based search.
if (isset($search_arguments['search_string']) && strlen(trim($search_arguments['search_string'])) > 0) {
// Sphinx doesn't like -- in MATCH. Don't know if it's because it
// thinks it is a MySQL-style comment or a bug. We have no choice
// but to strip it out.
$search_string = $sphinx->real_escape_string(str_replace('--', '', $search_arguments['search_string']));
search_save_arguments($search_arguments);
$where_sql .= "AND MATCH('{$search_string}')";
} else {
if (!isset($search_arguments['user_uid_array']) || sizeof($search_arguments['user_uid_array']) < 1) {
$error = SEARCH_NO_MATCHES;
return false;
}
}
// If the user wants results grouped by thread (TID) then do so.
if (isset($search_arguments['group_by_thread']) && $search_arguments['group_by_thread'] == SEARCH_GROUP_THREADS) {
$group_sql = "GROUP BY tid";
} else {
$group_sql = "";
}
// Get the correct sort dir
$sort_dir = $search_arguments['sort_dir'] == SEARCH_SORT_DESC ? 'DESC' : 'ASC';
// Construct the order by clause.
switch ($search_arguments['sort_by']) {
case SEARCH_SORT_NUM_REPLIES:
$order_sql = "ORDER BY length {$sort_dir}";
break;
case SEARCH_SORT_FOLDER_NAME:
$order_sql = "ORDER BY fid {$sort_dir}";
break;
case SEARCH_SORT_AUTHOR_NAME:
$order_sql = "ORDER BY from_uid {$sort_dir}";
break;
default:
$order_sql = "ORDER BY created {$sort_dir}";
break;
}
// Prepend _DELTA to the end of the index name.
$sphinx_search_index_delta = sprintf('%s_DELTA', $sphinx_search_index);
// Build query including main and delta indexes.
$sql = "SELECT *, WEIGHT() FROM {$sphinx_search_index}, {$sphinx_search_index_delta} ";
$sql .= "{$where_sql} {$group_sql} {$order_sql} LIMIT 1000";
// Execute the query
if (!($result = $sphinx->query($sql))) {
return false;
}
// Check if we have any results
if ($result->num_rows == 0) {
//.........这里部分代码省略.........
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:101,代码来源:sphinx.inc.php
示例7: light_pm_check_messages
function light_pm_check_messages()
{
// Check if this function has be called multiple times in one request.
static $light_pm_check_messages_done = false;
// Check if we've already displayed the notification once.
if ($light_pm_check_messages_done === true) {
return;
}
// Get the webtag
$webtag = get_webtag();
forum_check_webtag_available($webtag);
// Default the variables to return 0 even on error.
$new_count = 0;
$outbox_count = 0;
$unread_count = 0;
// Get the number of messages.
pm_get_message_count($new_count, $outbox_count, $unread_count);
// Format the message sent to the client.
if ($new_count == 1 && $outbox_count == 0) {
$notification = gettext("You have 1 new message. Would you like to go to your Inbox now?");
} else {
if ($new_count == 1 && $outbox_count == 1) {
$notification = gettext("You have 1 new message.\n\nYou also have 1 message awaiting delivery. To receive this message please clear some space in your Inbox.\n\nWould you like to go to your Inbox now?");
} else {
if ($new_count == 0 && $outbox_count == 1) {
$notification = gettext("You have 1 message awaiting delivery. To receive this message please clear some space in your Inbox.\n\nWould you like to go to your Inbox now?");
} else {
if ($new_count > 1 && $outbox_count == 0) {
$notification = sprintf(gettext("You have %d new messages. Would you like to go to your Inbox now?"), $new_count);
} else {
if ($new_count > 1 && $outbox_count == 1) {
$notification = sprintf(gettext("You have %d new messages.\n\nYou also have 1 message awaiting delivery. To receive this message please clear some space in your Inbox.\n\nWould you like to go to your Inbox now?"), $new_count);
} else {
if ($new_count > 1 && $outbox_count > 1) {
$notification = sprintf(gettext("You have %d new messages.\n\nYou also have %d messages awaiting delivery. To receive these message please clear some space in your Inbox.\n\nWould you like to go to your Inbox now?"), $new_count, $outbox_count);
} else {
if ($new_count == 1 && $outbox_count > 1) {
$notification = sprintf(gettext("You have 1 new message.\n\nYou also have %d messages awaiting delivery. To receive these messages please clear some space in your Inbox.\n\nWould you like to go to your Inbox now?"), $outbox_count);
} else {
if ($new_count == 0 && $outbox_count > 1) {
$notification = sprintf(gettext("You have %d messages awaiting delivery. To receive these messages please clear some space in your Inbox.\n\nWould you like to go to your Inbox now?"), $outbox_count);
}
}
}
}
}
}
}
}
if (isset($notification) && strlen(trim($notification)) > 0) {
// Wrap the notification in a hyperlink.
$notification = sprintf("<a href=\"lpm.php?webtag={$webtag}\">%s</a>\n", $notification);
// Display the notification
light_html_display_success_msg($notification);
}
// Prevent checking again.
$light_pm_check_messages_done = true;
}
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:58,代码来源:light.inc.php
示例8: form_quick_button
function form_quick_button($href, $button_label, $var_array = null, $target = '_self', $button_custom_html = null, $button_class = 'button', $button_id = null)
{
$webtag = get_webtag();
forum_check_webtag_available($webtag);
$html = "<form accept-charset=\"utf-8\" method=\"get\" action=\"{$href}\" target=\"{$target}\">";
$html .= form_input_hidden("webtag", htmlentities_array($webtag));
if (is_array($var_array)) {
foreach ($var_array as $var_name => $var_value) {
if (!is_array($var_value)) {
$html .= form_input_hidden($var_name, htmlentities_array($var_value));
}
}
}
$html .= form_submit(form_unique_id('submit'), $button_label, $button_custom_html, $button_class, $button_id);
return $html . "</form>";
}
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:16,代码来源:form.inc.php
示例9: get_request_uri
function get_request_uri($include_webtag = true, $encode_uri_query = true)
{
if (!is_bool($include_webtag)) {
$include_webtag = true;
}
if (!is_bool($encode_uri_query)) {
$encode_uri_query = true;
}
$webtag = get_webtag();
forum_check_webtag_available($webtag);
$request_uri = basename($_SERVER['PHP_SELF']);
$query_string_array = $_GET;
unset($query_string_array['webtag']);
if ($include_webtag && $webtag) {
$query_string_array['webtag'] = $webtag;
}
$query_string = http_build_query($query_string_array, null, $encode_uri_query ? '&' : '&');
return strlen($query_string) > 0 ? sprintf('%s?%s', $request_uri, $query_string) : $request_uri;
}
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:19,代码来源:format.inc.php
示例10: attachments_make_link
function attachments_make_link($attachment, $show_thumbs = true, $limit_filename = false, $local_path = false, $img_tag = true)
{
if (!is_array($attachment)) {
return false;
}
if (!is_bool($show_thumbs)) {
$show_thumbs = true;
}
if (!is_bool($limit_filename)) {
$limit_filename = false;
}
if (!is_bool($local_path)) {
$local_path = false;
}
if (!is_bool($img_tag)) {
$img_tag = true;
}
if (!($attachment_dir = forum_get_setting('attachment_dir'))) {
return false;
}
if (!isset($attachment['aid'])) {
return false;
}
if (!isset($attachment['hash'])) {
return false;
}
if (!isset($attachment['filename'])) {
return false;
}
if (!isset($attachment['downloads'])) {
return false;
}
if (!is_md5($attachment['aid'])) {
return false;
}
if (!is_md5($attachment['hash'])) {
return false;
}
$webtag = get_webtag();
if (forum_get_setting('attachment_thumbnails', 'Y') && (($user_show_thumbs = session::get_value('SHOW_THUMBS')) > 0 || !session::logged_in())) {
$thumbnail_size = array(1 => 50, 2 => 100, 3 => 150);
$thumbnail_max_size = isset($thumbnail_size[$user_show_thumbs]) ? $thumbnail_size[$user_show_thumbs] : 100;
} else {
$thumbnail_max_size = 100;
$show_thumbs = false;
}
if ($local_path) {
$attachment_href = "attachments/{$attachment['filename']}";
} else {
$attachment_href = "get_attachment.php?webtag={$webtag}&hash={$attachment['hash']}";
$attachment_href .= "&filename={$attachment['filename']}";
}
if ($img_tag === true) {
$title_array = array();
if (mb_strlen($attachment['filename']) > 16 && $limit_filename) {
$title_array[] = gettext("Filename") . ": {$attachment['filename']}";
$attachment['filename'] = mb_substr($attachment['filename'], 0, 16);
$attachment['filename'] .= "…";
}
if (isset($attachment['filesize']) && is_numeric($attachment['filesize'])) {
$title_array[] = gettext("Size") . ": " . format_file_size($attachment['filesize']);
}
if ($attachment['downloads'] == 1) {
$title_array[] = gettext("Downloaded: 1 time");
} else {
$title_array[] = sprintf(gettext("Downloaded: %d times"), $attachment['downloads']);
}
if (@file_exists("{$attachment_dir}/{$attachment['hash']}.thumb") && $show_thumbs) {
if (@($image_info = getimagesize("{$attachment_dir}/{$attachment['hash']}"))) {
$title_array[] = gettext("Dimensions") . ": {$image_info[0]}x{$image_info[1]}px";
$thumbnail_width = $image_info[0];
$thumbnail_height = $image_info[1];
while ($thumbnail_width > $thumbnail_max_size || $thumbnail_height > $thumbnail_max_size) {
$thumbnail_width--;
$thumbnail_height = floor($thumbnail_width * ($image_info[1] / $image_info[0]));
}
$title = implode(", ", $title_array);
$attachment_link = "<span class=\"attachment_thumb\"><a href=\"{$attachment_href}\" title=\"{$title}\" ";
$attachment_link .= "target=\"_blank\"><img src=\"{$attachment_href}&thumb=1\"";
$attachment_link .= "border=\"0\" width=\"{$thumbnail_width}\" height=\"{$thumbnail_height}\"";
$attachment_link .= "alt=\"{$title}\" title=\"{$title}\" /></a></span>";
return $attachment_link;
}
}
$title = implode(", ", $title_array);
$attachment_link = "<img src=\"";
$attachment_link .= html_style_image('attach.png');
$attachment_link .= "\" width=\"14\" height=\"14\" border=\"0\" ";
$attachment_link .= "alt=\"" . gettext("Attachment") . "\" ";
$attachment_link .= "title=\"" . gettext("Attachment") . "\" />";
$attachment_link .= "<a href=\"{$attachment_href}\" title=\"{$title}\" ";
$attachment_link .= "target=\"_blank\">{$attachment['filename']}</a>\n";
return $attachment_link;
}
return $attachment_href;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:96,代码来源:attachments.inc.php
示例11: pm_display
function pm_display($message_data, $preview = false, $export_html = false)
{
$webtag = get_webtag();
forum_check_webtag_available($webtag);
echo "<div align=\"center\">\n";
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table class=\"box\" width=\"100%\" cellpadding=\"0\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table width=\"100%\" class=\"posthead\" cellspacing=\"1\" cellpadding=\"0\">\n";
echo " <tr>\n";
if ($export_html === true) {
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("From"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">", word_filter_add_ob_tags(format_user_name($message_data['FROM_LOGON'], $message_data['FROM_NICKNAME']), true), "</span></td>\n";
} else {
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("From"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\"><a href=\"user_profile.php?webtag={$webtag}&uid={$message_data['FROM_UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($message_data['FROM_LOGON'], $message_data['FROM_NICKNAME']), true), "</a></span></td>\n";
}
if (isset($message_data['TYPE']) && $message_data['TYPE'] & PM_SAVED_DRAFT) {
echo " <td align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\"><i>", gettext("Not Sent"), "</i> </span></td>\n";
} else {
echo " <td align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\">", format_date_time($message_data['CREATED']), " </span></td>\n";
}
echo " </tr>\n";
echo " <tr>\n";
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("Subject"), ": </span></td>\n";
if (strlen(trim($message_data['SUBJECT'])) > 0) {
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">", word_filter_add_ob_tags($message_data['SUBJECT'], true), "</span></td>\n";
} else {
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\"><i>", gettext("No Subject"), "</i></span></td>\n";
}
echo " </tr>\n";
echo " <tr>\n";
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("To"), ": </span></td>\n";
if (isset($message_data['RECIPIENTS']) && sizeof($message_data['RECIPIENTS']) > 0) {
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">";
foreach ($message_data['RECIPIENTS'] as $recipient) {
echo " <a href=\"user_profile.php?webtag={$webtag}&uid={$recipient['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($recipient['LOGON'], $recipient['NICKNAME']), true), "</a>";
}
echo " </td>\n";
} else {
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">", gettext('Unknown User'), "</td>\n";
}
$message_data['CONTENT'] = message_apply_formatting($message_data['CONTENT']);
$message_data['CONTENT'] = word_filter_add_ob_tags($message_data['CONTENT']);
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table width=\"100%\">\n";
echo " <tr>\n";
echo " <td colspan=\"3\" align=\"left\"> </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class=\"postbody overflow_content\" align=\"left\">{$message_data['CONTENT']}</td>\n";
echo " </tr>\n";
if (isset($message_data['ATTACHMENTS']) && sizeof($message_data['ATTACHMENTS']) > 0) {
if (($attachments_array = attachments_get($message_data['FROM_UID'], $message_data['ATTACHMENTS'])) !== false) {
echo " <tr>\n";
echo " <td class=\"postbody\" align=\"left\">\n";
echo " <p><b>", gettext("Attachments"), ":</b><br />\n";
foreach ($attachments_array as $attachment) {
echo attachments_make_link($attachment), $attachment['thumbnail'] == 'N' ? "<br />\n" : "\n";
}
echo " </p>\n";
echo " </td>\n";
echo " </tr>\n";
}
}
echo " </table>\n";
echo " <table width=\"100%\" class=\"postresponse\" cellspacing=\"1\" cellpadding=\"0\">\n";
echo " <tr>\n";
echo " <td align=\"center\">\n";
if ($preview === false) {
if ($message_data['TYPE'] & PM_INBOX_ITEMS) {
echo "", html_style_image('post', "Reply"), " <a href=\"pm_write.php?webtag={$webtag}&reply_to={$message_data['MID']}\" target=\"", html_get_frame_name('main'), "\">", gettext("Reply"), "</a> \n";
if (isset($message_data['RECIPIENTS']) && sizeof($message_data['RECIPIENTS']) > 1) {
echo "", html_style_image('reply_all', "Reply All"), " <a href=\"pm_write.php?webtag={$webtag}&replyall={$message_data['MID']}\" target=\"", html_get_frame_name('main'), "\">", gettext("Reply All"), "</a> \n";
}
echo "", html_style_image('forward', "Forward"), " <a href=\"pm_write.php?webtag={$webtag}&fwdmsg={$message_data['MID']}\" target=\"", html_get_frame_name('main'), "\">", gettext("Forward"), "</a> \n";
} else {
if ($message_data['TYPE'] & PM_DRAFT_ITEMS) {
echo "", html_style_image('edit', "Edit"), " <a href=\"pm_write.php?webtag={$webtag}&editmsg={$message_data['MID']}\" target=\"", html_get_frame_name('main'), "\">", gettext("Edit"), "</a> \n";
} else {
if ($message_data['EDITABLE'] == 1) {
echo "", html_style_image('post', "Edit"), " <a href=\"pm_edit.php?webtag={$webtag}&mid={$message_data['MID']}\" target=\"", html_get_frame_name('main'), "\">", gettext("Edit"), "</a> \n";
}
echo "", html_style_image('forward', "Forward"), " <a href=\"pm_write.php?webtag={$webtag}&fwdmsg={$message_data['MID']}\" target=\"", html_get_frame_name('main'), "\">", gettext("Forward"), "</a> \n";
}
}
}
echo " </td>\n";
echo " </tr>\n";
//.........这里部分代码省略.........
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:101,代码来源:pm.inc.php
示例12: pm_display
function pm_display($pm_message_array, $folder, $preview = false, $export_html = false)
{
$webtag = get_webtag();
echo "<div align=\"center\">\n";
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table class=\"box\" width=\"100%\" cellpadding=\"0\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table width=\"100%\" class=\"posthead\" cellspacing=\"1\" cellpadding=\"0\">\n";
echo " <tr>\n";
if ($folder == PM_FOLDER_INBOX) {
if ($export_html === true) {
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("From"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">", word_filter_add_ob_tags(format_user_name($pm_message_array['FLOGON'], $pm_message_array['FNICK']), true), "</span></td>\n";
} else {
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("From"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\"><a href=\"user_profile.php?webtag={$webtag}&uid={$pm_message_array['FROM_UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($pm_message_array['FLOGON'], $pm_message_array['FNICK']), true), "</a></span></td>\n";
}
} else {
if (isset($pm_message_array['RECIPIENTS']) && strlen(trim($pm_message_array['RECIPIENTS'])) > 0) {
$recipient_array = preg_split("/[;|,]/u", trim($pm_message_array['RECIPIENTS']));
if ($pm_message_array['TO_UID'] > 0) {
$recipient_array = array_unique(array_merge($recipient_array, array($pm_message_array['TLOGON'])));
}
if ($export_html === false) {
$recipient_array = array_map('user_profile_popup_callback', $recipient_array);
}
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("To"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">", word_filter_add_ob_tags(implode('; ', $recipient_array)), "</span></td>\n";
} else {
if (is_array($pm_message_array['TLOGON'])) {
$recipient_array = array_unique($pm_message_array['TLOGON']);
if ($export_html === false) {
$recipient_array = array_map('user_profile_popup_callback', $recipient_array);
}
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("To"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">", word_filter_add_ob_tags(implode('; ', $recipient_array)), "</span></td>\n";
} else {
if (isset($pm_message_array['TO_UID']) && is_numeric($pm_message_array['TO_UID'])) {
if ($export_html === true) {
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("To"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofromlabel\">", word_filter_add_ob_tags(format_user_name($pm_message_array['TLOGON'], $pm_message_array['TNICK']), true), "</span></td>\n";
} else {
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("To"), ": </span></td>\n";
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofromlabel\"><a href=\"user_profile.php?webtag={$webtag}&uid={$pm_message_array['TO_UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($pm_message_array['TLOGON'], $pm_message_array['TNICK']), true), "</a></span></td>\n";
}
} else {
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("To"), ": </span></td>\n";
echo " <td align=\"left\" class=\"postbody\"><i>", gettext("No Recipients"), "</i></td>\n";
}
}
}
}
// Add emoticons/wikilinks and word filter tags
$pm_message_array['CONTENT'] = message_apply_formatting($pm_message_array['CONTENT']);
$pm_message_array['CONTENT'] = word_filter_add_ob_tags($pm_message_array['CONTENT']);
echo " </tr>\n";
echo " <tr>\n";
echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("Subject"), ": </span></td>\n";
if (strlen(trim($pm_message_array['SUBJECT'])) > 0) {
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">", word_filter_add_ob_tags($pm_message_array['SUBJECT'], true), "</span></td>\n";
} else {
echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\"><i>", gettext("No Subject"), "</i></span></td>\n";
}
if (isset($pm_message_array['TYPE']) && ($pm_message_array['TYPE'] & PM_SAVED_DRAFT) > 0) {
echo " <td align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\"><i>", gettext("Not Sent"), "</i> </span></td>\n";
} else {
echo " <td align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\">", format_time($pm_message_array['CREATED']), " </span></td>\n";
}
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table width=\"100%\">\n";
echo " <tr>\n";
echo " <td colspan=\"3\" align=\"left\"> </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class=\"postbody\" align=\"left\">{$pm_message_array['CONTENT']}</td>\n";
echo " </tr>\n";
if (isset($pm_message_array['AID'])) {
$aid = $pm_message_array['AID'];
$attachments_array = array();
$image_attachments_array = array();
if (attachments_get($pm_message_array['FROM_UID'], $aid, $attachments_array, $image_attachments_array)) {
// Draw the attachment header at the bottom
|
请发表评论