本文整理汇总了PHP中validate_msg函数 的典型用法代码示例。如果您正苦于以下问题:PHP validate_msg函数的具体用法?PHP validate_msg怎么用?PHP validate_msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validate_msg函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: message_get_meta_content
function message_get_meta_content($msg, &$meta_keywords, &$meta_description)
{
if (!validate_msg($msg)) {
return;
}
list($tid, $pid) = explode('.', $msg);
if (($thread_data = thread_get($tid)) && ($message_content = message_get_content($tid, $pid))) {
$meta_keywords_array = search_extract_keywords(strip_tags(htmlentities_decode_array($message_content)));
$meta_description = $thread_data['TITLE'];
$meta_keywords = htmlentities_array(implode(',', $meta_keywords_array['keywords_array']));
}
}
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:12, 代码来源:messages.inc.php
示例2: list
require_once BH_INCLUDE_PATH . 'html.inc.php';
require_once BH_INCLUDE_PATH . 'lang.inc.php';
require_once BH_INCLUDE_PATH . 'logon.inc.php';
require_once BH_INCLUDE_PATH . 'messages.inc.php';
require_once BH_INCLUDE_PATH . 'poll.inc.php';
require_once BH_INCLUDE_PATH . 'session.inc.php';
require_once BH_INCLUDE_PATH . 'thread.inc.php';
// User UID for fetching recent message
$uid = session::get_value('UID');
// Check that required variables are set
// default to display most recent discussion for user
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
$msg = $_GET['msg'];
list($tid, $pid) = explode('.', $msg);
} else {
if (isset($_GET['print_msg']) && validate_msg($_GET['print_msg'])) {
$msg = $_GET['print_msg'];
list($tid, $pid) = explode('.', $msg);
} else {
html_draw_error(gettext("Invalid Message ID or no Message ID specified."));
}
}
if (!($thread_data = thread_get($tid, session::check_perm(USER_PERM_ADMIN_TOOLS, 0)))) {
html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
if (!($folder_data = folder_get($thread_data['FID']))) {
html_draw_error(gettext("The requested folder could not be found or access was denied."));
}
if (!($message = messages_get($tid, $pid, 1))) {
html_draw_error(gettext("That post does not exist in this thread!"));
}
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:display.php
示例3: html_email_confirmation_error
if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) {
html_email_confirmation_error();
exit;
}
if (!session::check_perm(USER_PERM_POST_EDIT | USER_PERM_POST_READ, $t_fid)) {
html_draw_error(gettext("You cannot delete posts in this folder"));
}
if (!($thread_data = thread_get($tid))) {
html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
if (!thread_is_poll($tid) || $pid != 1) {
$uri = "discussion.php?webtag={$webtag}";
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
$uri .= "&msg=" . $_GET['msg'];
} else {
if (isset($_POST['msg']) && validate_msg($_POST['msg'])) {
$uri .= "&msg=" . $_POST['msg'];
}
}
header_redirect($uri);
}
if (!($edit_message = messages_get($tid, 1, 1))) {
html_draw_top(sprintf("title=%s", gettext("Error")));
html_display_error_msg(gettext("That post does not exist in this thread!"));
html_draw_bottom();
exit;
}
$post_edit_time = forum_get_setting('post_edit_time', null, 0);
$uid = session::get_value('UID');
if ((forum_get_setting('allow_post_editing', 'N') || $uid != $edit_message['FROM_UID'] && !(perm_get_user_permissions($edit_message['FROM_UID']) & USER_PERM_PILLORIED) || session::check_perm(USER_PERM_PILLORIED, 0) || $post_edit_time > 0 && time() - $edit_message['CREATED'] >= $post_edit_time * HOUR_IN_SECONDS) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
html_draw_error(gettext("You are not permitted to edit this message."), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $edit_message));
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:close_poll.php
示例4: html_draw_error
// Get folder FIDs and titles
if (!($folder_info = threads_get_folders())) {
html_draw_error(gettext("There are no folders available."));
}
// Get total number of messages for each folder
$folder_msgs = threads_get_folder_msgs();
// Check that the folder order is a valid array.
if (!is_array($folder_order)) {
$folder_order = array();
}
// Check the folder display order.
if (session::get_value('THREADS_BY_FOLDER') == 'Y') {
$folder_order = array_keys($folder_info);
}
// Check for a message to display and re-order the thread list.
if (isset($_REQUEST['msg']) && validate_msg($_REQUEST['msg'])) {
list($selected_tid) = explode('.', $_REQUEST['msg']);
if ($thread = thread_get($selected_tid)) {
if (!isset($thread['RELATIONSHIP'])) {
$thread['RELATIONSHIP'] = 0;
}
// Check the folder display order / user is a guest.
if (session::get_value('THREADS_BY_FOLDER') != 'Y' || !session::logged_in()) {
// Remove the folder from the list of folders.
if (in_array($thread['FID'], $folder_order)) {
array_splice($folder_order, array_search($thread['FID'], $folder_order), 1);
}
// Re-add it at the top of the list.
array_unshift($folder_order, $thread['FID']);
}
// Check $thread_info is an array.
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:thread_list.php
示例5: light_draw_thread_list
function light_draw_thread_list($mode = ALL_DISCUSSIONS, $folder = false, $page = 1)
{
$webtag = get_webtag();
forum_check_webtag_available($webtag);
$error_msg_array = array();
$available_views = thread_list_available_views();
$visible_threads_array = array();
if (!isset($_SESSION['UID']) || !is_numeric($_SESSION['UID'])) {
return;
}
light_thread_list_draw_top($mode, $folder);
switch ($mode) {
case UNREAD_DISCUSSIONS:
list($thread_info, $folder_order, $thread_count) = threads_get_unread($_SESSION['UID'], $folder, $page);
break;
case UNREAD_DISCUSSIONS_TO_ME:
list($thread_info, $folder_order, $thread_count) = threads_get_unread_to_me($_SESSION['UID'], $folder, $page);
break;
case TODAYS_DISCUSSIONS:
list($thread_info, $folder_order, $thread_count) = threads_get_by_days($_SESSION['UID'], $folder, $page, 1);
break;
case UNREAD_TODAY:
list($thread_info, $folder_order, $thread_count) = threads_get_unread_by_days($_SESSION['UID'], $folder, $page);
break;
case TWO_DAYS_BACK:
list($thread_info, $folder_order, $thread_count) = threads_get_by_days($_SESSION['UID'], $folder, $page, 2);
break;
case SEVEN_DAYS_BACK:
list($thread_info, $folder_order, $thread_count) = threads_get_by_days($_SESSION['UID'], $folder, $page, 7);
break;
case HIGH_INTEREST:
list($thread_info, $folder_order, $thread_count) = threads_get_by_interest($_SESSION['UID'], $folder, $page, THREAD_INTERESTED);
break;
case UNREAD_HIGH_INTEREST:
list($thread_info, $folder_order, $thread_count) = threads_get_unread_by_interest($_SESSION['UID'], $folder, $page, THREAD_INTERESTED);
break;
case RECENTLY_SEEN:
list($thread_info, $folder_order, $thread_count) = threads_get_recently_viewed($_SESSION['UID'], $folder, $page);
break;
case IGNORED_THREADS:
list($thread_info, $folder_order, $thread_count) = threads_get_by_interest($_SESSION['UID'], $folder, $page, THREAD_IGNORED);
break;
case BY_IGNORED_USERS:
list($thread_info, $folder_order, $thread_count) = threads_get_by_relationship($_SESSION['UID'], $folder, $page, USER_IGNORED_COMPLETELY);
break;
case SUBSCRIBED_TO:
list($thread_info, $folder_order, $thread_count) = threads_get_by_interest($_SESSION['UID'], $folder, $page, THREAD_SUBSCRIBED);
break;
case STARTED_BY_FRIEND:
list($thread_info, $folder_order, $thread_count) = threads_get_by_relationship($_SESSION['UID'], $folder, $page, USER_FRIEND);
break;
case UNREAD_STARTED_BY_FRIEND:
list($thread_info, $folder_order, $thread_count) = threads_get_unread_by_relationship($_SESSION['UID'], $folder, $page, USER_FRIEND);
break;
case STARTED_BY_ME:
list($thread_info, $folder_order, $thread_count) = threads_get_started_by_me($_SESSION['UID'], $folder, $page);
break;
case POLL_THREADS:
list($thread_info, $folder_order, $thread_count) = threads_get_polls($_SESSION['UID'], $folder, $page);
break;
case STICKY_THREADS:
list($thread_info, $folder_order, $thread_count) = threads_get_sticky($_SESSION['UID'], $folder, $page);
break;
case MOST_UNREAD_POSTS:
list($thread_info, $folder_order, $thread_count) = threads_get_longest_unread($_SESSION['UID'], $folder, $page);
break;
case DELETED_THREADS:
list($thread_info, $folder_order, $thread_count) = threads_get_deleted($_SESSION['UID'], $folder, $page);
break;
default:
list($thread_info, $folder_order, $thread_count) = threads_get_all($_SESSION['UID'], $folder, $page);
break;
}
// Now, the actual bit that displays the threads...
// Get folder FIDs and titles
if (!($folder_info = threads_get_folders())) {
light_html_display_error_msg(gettext("There are no folders available."));
return;
}
// Get total number of messages for each folder
$folder_msgs = threads_get_folder_msgs();
// Check that the folder order is a valid array.
if (!is_array($folder_order)) {
$folder_order = array();
}
// Check the folder display order.
if (isset($_SESSION['THREADS_BY_FOLDER']) && $_SESSION['THREADS_BY_FOLDER'] == 'Y') {
$folder_order = array_keys($folder_info);
}
// Check for a message to display and re-order the thread list.
if (isset($_REQUEST['msg']) && validate_msg($_REQUEST['msg'])) {
list($selected_tid) = explode('.', $_REQUEST['msg']);
if (($thread = thread_get($selected_tid)) !== false) {
if (!isset($thread['RELATIONSHIP'])) {
$thread['RELATIONSHIP'] = 0;
}
// Check the folder display order / user is a guest.
if (!isset($_SESSION['THREADS_BY_FOLDER']) || $_SESSION['THREADS_BY_FOLDER'] != 'Y' || !session::logged_in()) {
// Remove the folder from the list of folders.
if (in_array($thread['FID'], $folder_order)) {
//.........这里部分代码省略.........
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:101, 代码来源:light.inc.php
示例6: html_draw_error
// Check we have Admin / Moderator access
if (!session::check_perm(USER_PERM_ADMIN_TOOLS, 0)) {
html_draw_error(gettext("You do not have permission to use this section."));
}
// Perform additional admin login.
admin_check_credentials();
if (isset($_GET['uid']) && is_numeric($_GET['uid'])) {
$uid = $_GET['uid'];
} else {
if (isset($_POST['uid']) && is_numeric($_POST['uid'])) {
$uid = $_POST['uid'];
} else {
html_draw_error(gettext("No user specified."), 'admin_users.php', 'get', array('back' => gettext("Back")));
}
}
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
$ret = "messages.php?webtag={$webtag}&msg={$_GET['msg']}";
} else {
if (isset($_POST['ret']) && strlen(trim($_POST['ret'])) > 0) {
$ret = trim($_POST['ret']);
} else {
$ret = "admin_users.php?webtag={$webtag}";
}
}
// validate the return to page
if (isset($ret) && strlen(trim($ret)) > 0) {
$available_files_preg = implode("|^", array_map('preg_quote_callback', get_available_files()));
if (preg_match("/^{$available_files_preg}/u", basename($ret)) < 1) {
$ret = "admin_users.php?webtag={$webtag}";
}
}
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:admin_user.php
示例7: cache_check_messages
function cache_check_messages()
{
if (!($db = db::get())) {
return false;
}
if (!($table_prefix = get_table_prefix())) {
return false;
}
if (!cache_check_enabled()) {
return false;
}
if (browser_check(BROWSER_AOL)) {
return false;
}
if (headers_sent()) {
return false;
}
if (isset($_GET['post_success'])) {
return false;
}
if (isset($_GET['delete_success'])) {
return false;
}
if (isset($_GET['edit_success'])) {
return false;
}
if (isset($_GET['font_resize'])) {
return false;
}
if (isset($_GET['markasread'])) {
return false;
}
if (isset($_GET['post_approve_success'])) {
return false;
}
if (isset($_GET['relupdated'])) {
return false;
}
if (isset($_GET['setinterest'])) {
return false;
}
if (isset($_GET['setstats'])) {
return false;
}
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
cache_disable();
return false;
}
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
list($tid) = explode('.', $_GET['msg']);
$sql = "SELECT * FROM (SELECT UNIX_TIMESTAMP(MAX(POST.CREATED)) AS CREATED, ";
$sql .= "UNIX_TIMESTAMP(MAX(POST_RECIPIENT.VIEWED)) AS VIEWED, UNIX_TIMESTAMP(MAX(POST.APPROVED)) AS APPROVED, ";
$sql .= "UNIX_TIMESTAMP(MAX(POST.EDITED)) AS EDITED FROM `{$table_prefix}POST` POST ";
$sql .= "LEFT JOIN `{$table_prefix}POST_RECIPIENT` POST_RECIPIENT ";
$sql .= "ON (POST_RECIPIENT.TID = POST.TID AND POST_RECIPIENT.PID = POST.PID) ";
$sql .= "WHERE POST.TID = '{$tid}') AS POST_DATA, (SELECT UNIX_TIMESTAMP(MAX(USER_POLL_VOTES.VOTED)) ";
$sql .= "AS POLL_VOTE FROM `{$table_prefix}USER_POLL_VOTES` USER_POLL_VOTES ";
$sql .= "WHERE USER_POLL_VOTES.TID = '{$tid}') AS POLL_DATA";
} else {
$sql = "SELECT UNIX_TIMESTAMP(MAX(CREATED)) AS CREATED, ";
$sql .= "0 AS VIEWED, 0 AS APPROVED, 0 AS EDITED, 0 AS POLL_VOTE ";
$sql .= "FROM `{$table_prefix}POST`";
}
if (!($result = $db->query($sql))) {
return false;
}
if ($result->num_rows == 0) {
return true;
}
list($created, $viewed, $approved, $edited, $voted) = $result->fetch_row();
$last_modified = max($created, $viewed, $approved, $edited, $voted);
$etag = md5($_SESSION['UID'] . $_SESSION['LOGON']);
return cache_check_last_modified($last_modified, $etag);
}
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:74, 代码来源:cache.inc.php
示例8: list
} else {
if (isset($_GET['post_success']) && validate_msg($_GET['post_success'])) {
list($return_tid, $return_pid) = explode(".", $_GET['post_success']);
if ($return_tid != $tid || $return_pid > $pid + $posts_per_page) {
message_display_success_msg($return_tid, $return_pid, $pid, gettext("Successfully created post %s"), $posts_per_page);
}
} else {
if (isset($_GET['edit_success']) && validate_msg($_GET['edit_success'])) {
list($return_tid, $return_pid) = explode(".", $_GET['edit_success']);
message_display_success_msg($return_tid, $return_pid, $pid, gettext("Successfully edited post %s"), $posts_per_page);
} else {
if (isset($_GET['delete_success']) && validate_msg($_GET['delete_success'])) {
list($return_tid, $return_pid) = explode(".", $_GET['delete_success']);
message_display_success_msg($return_tid, $return_pid, $pid, gettext("Successfully deleted post %s"), $posts_per_page);
} else {
if (isset($_GET['post_approve_success']) && validate_msg($_GET['post_approve_success'])) {
list($return_tid, $return_pid) = explode(".", $_GET['post_approve_success']);
message_display_success_msg($return_tid, $return_pid, $pid, gettext("Successfully approved post %s"), $posts_per_page);
} else {
if (!isset($thread_data['APPROVED'])) {
html_display_warning_msg(gettext("Thread is pending approval by a moderator"), '96%', 'center');
}
}
}
}
}
}
}
if (isset($_GET['font_resize'])) {
echo "<div id=\"font_resize_success\">\n";
html_display_success_msg(sprintf(gettext("Font Size Changed. %s"), gettext("Frames must be reloaded manually to see changes.")), '96%', 'center');
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:31, 代码来源:messages.php
示例9: admin_add_log_entry
admin_add_log_entry(REMOVE_THREAD_STICKY, array($tid, $thread_data['TITLE']));
} else {
$error_msg_array[] = gettext("Failed to update thread sticky status");
$valid = false;
}
}
}
}
if (isset($_POST['thread_merge_split']) && is_numeric($_POST['thread_merge_split'])) {
if ($_POST['thread_merge_split'] == THREAD_TYPE_MERGE) {
if (isset($_POST['merge_thread']) && is_numeric($_POST['merge_thread'])) {
if (isset($_POST['merge_type']) && is_numeric($_POST['merge_type']) && isset($_POST['merge_thread_con']) && $_POST['merge_thread_con'] == "Y") {
$error_str = '';
$merge_thread = $_POST['merge_thread'];
$merge_type = $_POST['merge_type'];
if (validate_msg($merge_thread)) {
list($merge_thread) = explode('.', $merge_thread);
}
if ($merge_result = thread_merge($tid, $merge_thread, $merge_type, $error_str)) {
post_add_edit_text($tid, 1);
admin_add_log_entry(THREAD_MERGE, $merge_result);
} else {
$error_msg_array[] = $error_str;
$valid = false;
}
}
}
} else {
if ($_POST['thread_merge_split'] == THREAD_TYPE_SPLIT) {
if (isset($_POST['split_thread']) && is_numeric($_POST['split_thread']) && $_POST['split_thread'] > 1) {
if (isset($_POST['split_type']) && is_numeric($_POST['split_type']) && isset($_POST['split_thread_con']) && $_POST['split_thread_con'] == "Y") {
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:thread_options.php
示例10: light_draw_thread_list
function light_draw_thread_list($mode = ALL_DISCUSSIONS, $folder = false, $page = 1)
{
$webtag = get_webtag();
$error_msg_array = array();
$available_views = thread_list_available_views();
$visible_threads_array = array();
if (($uid = session::get_value('UID')) === false) {
return;
}
echo "<div id=\"thread_view\">\n";
echo "<form accept-charset=\"utf-8\" name=\"f_mode\" method=\"get\" action=\"lthread_list.php\">\n";
echo form_input_hidden("webtag", htmlentities_array($webtag));
if (is_numeric($folder) && in_array($folder, folder_get_available_array())) {
echo form_input_hidden('folder', htmlentities_array($folder)), "\n";
}
echo "<ul>\n";
echo "<li>", light_threads_draw_discussions_dropdown($mode), "</li>\n";
echo "<li class=\"right_col\">", light_form_submit("go", gettext("Go!")), "</li>\n";
echo "</ul>\n";
echo "</form>\n";
echo "</div>\n";
// Get the right threads for whichever mode is selected
switch ($mode) {
case UNREAD_DISCUSSIONS:
list($thread_info, $folder_order) = threads_get_unread($uid, $folder, $page);
break;
case UNREAD_DISCUSSIONS_TO_ME:
list($thread_info, $folder_order) = threads_get_unread_to_me($uid, $folder, $page);
break;
case TODAYS_DISCUSSIONS:
list($thread_info, $folder_order) = threads_get_by_days($uid, $folder, $page, 1);
break;
case UNREAD_TODAY:
list($thread_info, $folder_order) = threads_get_unread_by_days($uid, $folder, $page);
break;
case TWO_DAYS_BACK:
list($thread_info, $folder_order) = threads_get_by_days($uid, $folder, $page, 2);
break;
case SEVEN_DAYS_BACK:
list($thread_info, $folder_order) = threads_get_by_days($uid, $folder, $page, 7);
break;
case HIGH_INTEREST:
list($thread_info, $folder_order) = threads_get_by_interest($uid, $folder, $page, 1);
break;
case UNREAD_HIGH_INTEREST:
list($thread_info, $folder_order) = threads_get_unread_by_interest($uid, $folder, $page, 1);
break;
case RECENTLY_SEEN:
list($thread_info, $folder_order) = threads_get_recently_viewed($uid, $folder, $page);
break;
case IGNORED_THREADS:
list($thread_info, $folder_order) = threads_get_by_interest($uid, $folder, $page, -1);
break;
case BY_IGNORED_USERS:
list($thread_info, $folder_order) = threads_get_by_relationship($uid, $folder, $page, USER_IGNORED_COMPLETELY);
break;
case SUBSCRIBED_TO:
list($thread_info, $folder_order) = threads_get_by_interest($uid, $folder, $page, 2);
break;
case STARTED_BY_FRIEND:
list($thread_info, $folder_order) = threads_get_by_relationship($uid, $folder, $page, USER_FRIEND);
break;
case UNREAD_STARTED_BY_FRIEND:
list($thread_info, $folder_order) = threads_get_unread_by_relationship($uid, $folder, $page, USER_FRIEND);
break;
case STARTED_BY_ME:
list($thread_info, $folder_order) = threads_get_started_by_me($uid, $folder, $page);
break;
case POLL_THREADS:
list($thread_info, $folder_order) = threads_get_polls($uid, $folder, $page);
break;
case STICKY_THREADS:
list($thread_info, $folder_order) = threads_get_sticky($uid, $folder, $page);
break;
case MOST_UNREAD_POSTS:
list($thread_info, $folder_order) = threads_get_longest_unread($uid, $folder, $page);
break;
case DELETED_THREADS:
list($thread_info, $folder_order) = threads_get_deleted($uid, $folder, $page);
break;
default:
list($thread_info, $folder_order) = threads_get_all($uid, $folder, $page);
break;
}
// Now, the actual bit that displays the threads...
// Get folder FIDs and titles
if (!($folder_info = threads_get_folders())) {
light_html_display_error_msg(gettext("There are no folders available."));
return;
}
// Get total number of messages for each folder
$folder_msgs = threads_get_folder_msgs();
// Check that the folder order is a valid array.
// While we're here we can also check to see how the user
// has decided to display the thread list.
if (!is_array($folder_order) || session::get_value('THREADS_BY_FOLDER') == 'Y') {
$folder_order = array_keys($folder_info);
}
// Sort the folders and threads correctly as per the URL query for the TID
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
//.........这里部分代码省略.........
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:101, 代码来源:light.inc.php
示例11: html_draw_error
if (isset($_POST['msg'])) {
if (validate_msg($_POST['msg'])) {
$msg = $_POST['msg'];
} else {
html_draw_error(gettext("No message specified for editing"), 'admin_post_approve.php', 'post', array('cancel' => gettext("Cancel")), array('ret' => $ret), '_self', 'center');
}
} else {
if (isset($_GET['msg'])) {
if (validate_msg($_GET['msg'])) {
$msg = $_GET['msg'];
} else {
html_draw_error(gettext("No message specified for editing"), 'admin_post_approve.php', 'post', array('cancel' => gettext("Cancel")), array('ret' => $ret), '_self', 'center');
}
}
}
if (isset($msg) && validate_msg($msg)) {
$valid = true;
list($tid, $pid) = explode('.', $msg);
if (!($t_fid = thread_get_folder($tid, $pid))) {
html_draw_error(gettext("The requested thread could not be found or access was denied."), 'admin_post_approve.php', 'post', array('cancel' => gettext("Cancel")), array('ret' => $ret), '_self', 'center');
}
if (!session::check_perm(USER_PERM_POST_EDIT | USER_PERM_POST_READ, $t_fid)) {
html_draw_error(gettext("You cannot edit posts in this folder"), 'admin_post_approve.php', 'post', array('cancel' => gettext("Cancel")), array('ret' => $ret), '_self', 'center');
}
if (!session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
html_draw_error(gettext("You cannot edit posts in this folder"), 'admin_post_approve.php', 'post', array('cancel' => gettext("Cancel")), array('ret' => $ret), '_self', 'center');
}
if (!($thread_data = thread_get($tid))) {
html_draw_error(gettext("The requested thread could not be found or access was denied."), 'admin_post_approve.php', 'post', array('cancel' => gettext("Cancel")), array('ret' => $ret), '_self', 'center');
}
if ($preview_message = messages_get($tid, $pid, 1)) {
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:admin_post_approve.php
示例12: validate_msg
<?php
$secret = 'dupa231';
include 'commons.php';
$logbook_type = validate_msg(decrypt($_POST['secret'], $secret));
if (!$logbook_type) {
exit;
}
// Where the file is going to be placed
$target_path = "work/";
function file_begin($filename)
{
return begin(explode(".", $filename));
}
function replace_text_in_file($file, $search, $replace)
{
$f = fopen($file, 'r');
if (!$f) {
return;
}
while (!feof($f)) {
$text .= fread($f, 4096);
}
fclose($f);
$f = fopen($file, 'w');
if (!$f) {
return;
}
$text = str_replace($search, $replace, $text);
fwrite($f, $text, strlen($text));
fclose($f);
开发者ID:pawelzielak, 项目名称:opencaching-pl, 代码行数:31, 代码来源:remotelogbook.php
示例13: cache_check_messages
function cache_check_messages()
{
if (!($db = db::get())) {
return false;
}
if (!($table_prefix = get_table_prefix())) {
return false;
}
if (!cache_check_enabled()) {
return false;
}
if (browser_check(BROWSER_AOL)) {
return false;
}
if (headers_sent()) {
return false;
}
// Disable cache on these URL queries.
if (isset($_GET['delete_success'])) {
return false;
}
if (isset($_GET['edit_success'])) {
return false;
}
if (isset($_GET['font_resize'])) {
return false;
}
if (isset($_GET['markasread'])) {
return false;
}
if (isset($_GET['post_approve_success'])) {
return false;
}
if (isset($_GET['relupdated'])) {
return false;
}
if (isset($_GET['setinterest'])) {
return false;
}
if (isset($_GET['setstats'])) {
return false;
}
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
cache_disable();
return false;
}
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
list($tid) = explode('.', $_GET['msg']);
$sql = "SELECT * FROM (SELECT UNIX_TIMESTAMP(MAX(POST.CREATED)) AS CREATED, ";
$sql .= "UNIX_TIMESTAMP(MAX(POST.VIEWED)) AS VIEWED, UNIX_TIMESTAMP(MAX(POST.APPROVED)) AS APPROVED, ";
$sql .= "UNIX_TIMESTAMP(MAX(POST.EDITED)) AS EDITED FROM `{$table_prefix}POST` POST ";
$sql .= "WHERE POST.TID = '{$tid}') AS POST_DATA, (SELECT UNIX_TIMESTAMP(MAX(USER_POLL_VOTES.VOTED)) ";
$sql .= "AS POLL_VOTE FROM `{$table_prefix}USER_POLL_VOTES` USER_POLL_VOTES ";
$sql .= "WHERE USER_POLL_VOTES.TID = '{$tid}') AS POLL_DATA";
} else {
$sql = "SELECT UNIX_TIMESTAMP(MAX(CREATED)) AS CREATED, ";
$sql .= "0 AS VIEWED, 0 AS APPROVED, 0 AS EDITED, 0 AS POLL_VOTE ";
$sql .= "FROM `{$table_prefix}POST`";
}
if (!($result = $db->query($sql))) {
return false;
}
if ($result->num_rows == 0) {
return true;
}
// Get the two modified dates from the query
list($created, $viewed, $approved, $edited, $voted) = $result->fetch_row();
// Work out which one is newer (higher).
$local_cache_date = max($created, $viewed, $approved, $edited, $voted);
// Last Modified Header for cache control
$local_last_modified = gmdate("D, d M Y H:i:s", $local_cache_date) . " GMT";
$local_cache_expires = gmdate("D, d M Y H:i:s", $local_cache_date) . " GMT";
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strlen(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) > 0) {
$remote_last_modified = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
if (strtotime($remote_last_modified) >= $local_cache_date) {
header("Expires: {$local_cache_expires}", true);
header("Last-Modified: {$remote_last_modified}", true);
header('Cache-Control: private, must-revalidate', true);
header_status(304, 'Not Modified');
exit;
}
}
header("Expires: {$local_cache_expires}", true);
header("Last-Modified: {$local_last_modified}", true);
header('Cache-Control: private, must-revalidate', true);
return true;
}
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:87, 代码来源:cache.inc.php
示例14: html_draw_bottom
html_draw_bottom();
exit;
}
} else {
$error_msg_array[] = gettext("You must select some messages to delete");
$valid = false;
}
}
}
html_draw_top(array('title' => gettext('Admin - Post Approval Queue'), 'class' => 'window_title', 'main_css' => 'admin.css'));
$post_approval_array = admin_get_post_approval_queue($page);
echo "<h1>", gettext("Admin"), html_style_image('separator'), gettext("Post Approval Queue"), "</h1>\n";
if (isset($_GET['post_approve_success']) && validate_msg($_GET['post_approve_success'])) {
html_display_success_msg(sprintf(gettext("Successfully approved post %s"), $_GET['post_approve_success']), '86%', 'center');
} else {
if (isset($_GET['delete_success']) && validate_msg($_GET['delete_success'])) {
html_display_success_msg(sprintf(gettext("Successfully deleted post %s"), $_GET['delete_success']), '86%', 'center');
} else {
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
html_display_error_array($error_msg_array, '86%', 'center');
} else {
if (sizeof($post_approval_array['post_array']) < 1) {
html_display_warning_msg(gettext("No posts are awaiting approval"), '86%', 'center');
}
}
}
}
echo "<br />\n";
echo "<div align=\"center\">\n";
echo "<form accept-charset=\"utf-8\" name=\"f_delete\" action=\"admin_post_approve.php\" method=\"post\" target=\"_self\">\n";
echo " ", form_csrf_token_field(), "\n";
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:31, 代码来源:admin_post_approve.php
示例15: light_html_draw_error
}
if (!($fid = thread_get_folder_fid($tid))) {
light_html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) {
light_html_email_confirmation_error();
exit;
}
if (!session::check_perm(USER_PERM_POST_CREATE, $fid)) {
light_html_draw_error(gettext("You cannot reply to posts in this folder"));
}
$new_thread = false;
} else {
if (isset($_POST['reply_to']) && validate_msg($_POST['reply_to'])) {
list($tid, $reply_to_pid) = explode(".", $_POST['reply_to']);
if (isset($_POST['return_msg']) && validate_msg($_POST['return_msg'])) {
$return_msg = $_POST['return_msg'];
} else {
$return_msg = $_POST['reply_to'];
}
if (!($fid = thread_get_folder_fid($tid))) {
light_html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) {
light_html_email_confirmation_error();
exit;
}
if (!session::check_perm(USER_PERM_POST_CREATE, $fid)) {
light_html_draw_error(gettext("You cannot reply to posts in this folder"));
}
if (sizeof($attachments) > 0 && !session::check_perm(USER_PERM_POST_ATTACHMENTS | USER_PERM_POST_READ, $fid)) {
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:31, 代码来源:lpost.php
示例16: html_draw_top
function html_draw_top(array $options = array())
{
$title = null;
$class = null;
$base_target = null;
$robots = null;
$main_css = null;
$images_css = null;
$inline_css = null;
$emoticons = null;
$frame_set_html = false;
$pm_popup_disabled = false;
$js = array();
$css = array();
$webtag = get_webtag();
forum_check_webtag_available($webtag);
$forum_name = forum_get_setting('forum_name', null, 'A Beehive Forum');
foreach ($options as $key => $value) {
switch ($key) {
case 'title':
case 'class':
case 'base_target':
case 'robots':
case 'main_css':
case 'images_css':
case 'inline_css':
case 'emoticons':
${$key} = !isset(${$key}) && isset($value) ? $value : ${$key};
break;
case 'frame_set_html':
case 'pm_popup_disabled':
${$key} = is_bool($value) ? $value : ${$key};
break;
case 'js':
case 'css':
if (!is_array($value) || count(array_filter($value, 'is_string')) != count($value)) {
throw new InvalidArgumentException(sprintf('Expecting html_draw_top argument %s to be an array of strings', $key));
}
${$key} = $value;
break;
default:
throw new InvalidArgumentException(sprintf('Unknown html_draw_top argument "%s"', $key));
break;
}
}
if (!isset($main_css)) {
$main_css = 'style.css';
}
if (!isset($images_css)) {
$images_css = 'images.css';
}
if ($frame_set_html === false) {
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
} else {
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
}
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"", gettext('en-gb'), "\" lang=\"", gettext('en-gb'), "\" dir=\"", gettext('ltr'), "\">\n";
echo "<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
// Default Meta keywords and description.
$meta_keywords = html_get_forum_keywords();
$meta_description = html_get_forum_description();
if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
list($tid, $pid) = explode('.', $_GET['msg']);
message_get_meta_content($_GET['msg'], $meta_keywords, $meta_description);
if (isset($_SESSION['POSTS_PER_PAGE']) && is_numeric($_SESSION['POSTS_PER_PAGE'])) {
$posts_per_page = max(min($_SESSION['POSTS_PER_PAGE'], 30), 10);
} else {
$posts_per_page = 20;
}
if (($thread_data = thread_get($tid)) !== false) {
echo "<title>", word_filter_add_ob_tags($thread_data['TITLE'], true), " - ", word_filter_add_ob_tags($forum_name, true), "</title>\n";
echo "<link rel=\"canonical\" href=\"", html_get_forum_uri("index.php?webtag={$webtag}&msg={$tid}.1"), "\" />\n";
if ($thread_data['LENGTH'] > $posts_per_page) {
$prev_page = $pid - $posts_per_page > 0 ? $pid - $posts_per_page : 1;
$next_page = $pid + $posts_per_page < $thread_data['LENGTH'] ? $pid + $posts_per_page : $thread_data['LENGTH'];
$last_page = floor($thread_data['LENGTH'] / $posts_per_page) * $posts_per_page + 1;
echo "<link rel=\"first\" href=\"", html_get_forum_uri("index.php?webtag={$webtag}&msg={$tid}.1"), "\" />\n";
echo "<link rel=\"last\" href=\"", html_get_forum_uri("index.php?webtag={$webtag}&msg={$tid}.{$last_page}"), "\" />\n";
if ($pid + $posts_per_page < $thread_data['LENGTH']) {
echo "<link rel=\"next\" href=\"", html_get_forum_uri("index.php?webtag={$webtag}&msg={$tid}.{$next_page}"), "\" />\n";
}
if ($pid > 1) {
echo "<link rel=\"prev\" href=\"", html_get_forum_uri("index.php?webtag={$webtag}&msg={$tid}.{$prev_page}"), "\" />\n";
}
}
} else {
if (isset($title)) {
echo "<title>", word_filter_add_ob_tags($title, true), " - ", word_filter_add_ob_tags($forum_name, true), "</title>\n";
} else {
echo "<title>", word_filter_add_ob_tags($forum_name, true), "</title>\n";
}
}
} else {
if (isset($title)) {
echo "<title>", word_filter_add_ob_tags($title, true), " - ", htmlentities_array($forum_name), "</title>\n";
} else {
echo "<title>", htmlentities_array($forum_name), "</title>\n";
}
//.........这里部分代码省略.........
开发者ID:DeannaG65, 项目名称:BeehiveForum, 代码行数:101, 代码来源:html.inc.php
示例17: header_status
if ($user_prefs['FONT_SIZE'] > 15) {
$user_prefs['FONT_SIZE'] = 15;
}
if (!user_update_prefs($uid, $user_prefs)) {
header_status(500, 'Internal Server Error');
exit;
}
header('Content-Type: application/json');
$content = json_encode(array('success' => true, 'font_size' => $user_prefs['FONT_SIZE'], 'html' => messages_fontsize_form($tid, $pid, true, $user_prefs['FONT_SIZE'])));
break;
case 'post_options':
if (!session::logged_in()) {
break;
}
cache_disable();
if (!isset($_GET['msg']) || !validate_msg($_GET['msg'])) {
header_status(500, 'Internal Server Error');
exit;
}
list($tid, $pid) = explode('.', $_GET['msg']);
if (!($thread_data = thread_get($tid, session::check_perm(USER_PERM_ADMIN_TOOLS, 0)))) {
header_status(500, 'Internal Server Error');
exit;
}
if (!($content = message_get_post_options_html($tid, $pid, $thread_data['FID']))) {
header_status(500, 'Internal Server Error');
exit;
}
break;
case 'poll_add_question':
if (!session::logged_in()) {
开发者ID:richstokoe, 项目名称:BeehiveForum, 代码行数:31, 代码来源:ajax.php
GitbookIO/gitbook:
阅读:954| 2022-08-17
juleswhite/mobile-cloud-asgn1
阅读:1029| 2022-08-30
kyamagu/matlab-json: Use official API: https://mathworks.com/help/matlab/json-fo
阅读:924| 2022-08-17
书名:墙壁眼睛膝盖 作者:温柔一刀 类别:欲望丛林,饮食男女。 簡介:Wall(我)Eye(爱)Kn
阅读:655| 2022-11-06
前言 在编写MATLAB程序时,我们可以不指定变量的数据类型。这使得MATALB编程很接近演
阅读:1519| 2022-07-18
sevenjay/cpp-markdown: Cpp-Markdown is a freely-available Markdown text-to-HTML
阅读:578| 2022-08-18
Q1: 多线程中需避免多个线程同时向全局变量进行写入操作,导致访问冲突问题。A1:
阅读:1193| 2022-07-18
An issue in the isSVG() function of Known v1.2.2+2020061101 allows attackers to
阅读:967| 2022-07-29
mathjax/MathJax-i18n: MathJax localization
阅读:387| 2022-08-16
众所周知,我们的身份证号码里面包含的信息有很多,如出生日期、性别和识别码等,如果
阅读:251| 2022-11-06
请发表评论