本文整理汇总了PHP中get_remote_address函数的典型用法代码示例。如果您正苦于以下问题:PHP get_remote_address函数的具体用法?PHP get_remote_address怎么用?PHP get_remote_address使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_remote_address函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
public function logout($id, $token)
{
global $lang_login;
if ($this->user->is_guest || !isset($id) || $id != $this->user->id || !isset($token) || $token != feather_hash($this->user->id . feather_hash(get_remote_address()))) {
header('Location: ' . get_base_url());
exit;
}
// Remove user from "users online" list
DB::for_table('online')->where('user_id', $this->user->id)->delete_many();
// Update last_visit (make sure there's something to update it with)
if (isset($this->user->logged)) {
DB::for_table('users')->where('id', $this->user->id)->find_one()->set('last_visit', $this->user->logged)->save();
}
feather_setcookie(1, feather_hash(uniqid(rand(), true)), time() + 31536000);
redirect(get_base_url(), $lang_login['Logout redirect']);
}
示例2: escrow_publish_topic_problem
function escrow_publish_topic_problem($post_info)
{
global $forum_db, $db_type, $forum_config, $lang_common;
if ($return != null) {
return;
}
// Add the topic
$query = array('INSERT' => 'poster, subject, posted, last_post, last_poster, forum_id, visibility', 'INTO' => 'topics', 'VALUES' => '\'' . $forum_db->escape($post_info['poster']) . '\', \'' . $forum_db->escape($post_info['subject']) . '\', ' . $post_info['posted'] . ', ' . $post_info['posted'] . ', \'' . $forum_db->escape($post_info['poster']) . '\', ' . $post_info['forum_id'] . ', ' . $post_info['visibility']);
$forum_db->query_build($query) or error(__FILE__, __LINE__);
$new_tid = $forum_db->insert_id();
// Create the post ("topic post")
$query = array('INSERT' => 'poster, poster_id, poster_ip, message, posted, topic_id', 'INTO' => 'posts', 'VALUES' => '\'' . $forum_db->escape($post_info['poster']) . '\', ' . $post_info['poster_id'] . ', \'' . $forum_db->escape(get_remote_address()) . '\', \'' . $forum_db->escape($post_info['message']) . '\', ' . $post_info['posted'] . ', ' . $new_tid);
$forum_db->query_build($query) or error(__FILE__, __LINE__);
$new_pid = $forum_db->insert_id();
// Update the topic with last_post_id and first_post_id
$query = array('UPDATE' => 'topics', 'SET' => 'last_post_id=' . $new_pid . ', first_post_id=' . $new_pid, 'WHERE' => 'id=' . $new_tid);
$forum_db->query_build($query) or error(__FILE__, __LINE__);
return $new_tid;
}
示例3: get_user_nav_menu_items
function get_user_nav_menu_items()
{
global $db, $luna_config, $luna_user;
$items = array();
if ($luna_user['is_guest']) {
$items['guest'] = array('register' => array('url' => 'register.php', 'title' => __('Register', 'luna')), 'login' => array('url' => '#', 'title' => __('Login', 'luna')));
} else {
if ($luna_user['is_admmod']) {
$items['backstage'] = array('url' => 'backstage/', 'title' => __('Backstage', 'luna'));
}
// Check for new notifications
$result = $db->query('SELECT COUNT(id) FROM ' . $db->prefix . 'notifications WHERE viewed = 0 AND user_id = ' . $luna_user['id']) or error('Unable to load notifications', __FILE__, __LINE__, $db->error());
$num_notifications = intval($db->result($result));
$items['notifications'] = array('url' => $luna_config['o_notification_flyout'] ? '#' : 'notifications.php', 'title' => $num_notifications > 0 ? __('Notifications', 'luna') : __('No new notifications', 'luna'), 'num' => $num_notifications, 'flyout' => 1 == $luna_config['o_notification_flyout']);
if ($luna_config['o_pms_enabled'] == '1' && $luna_user['g_pm'] == '1' && $luna_user['use_pm'] == '1') {
// Check for new messages
$result = $db->query('SELECT COUNT(id) FROM ' . $db->prefix . 'messages WHERE showed=0 AND show_message=1 AND owner=' . $luna_user['id']) or error('Unable to check the availibility of new messages', __FILE__, __LINE__, $db->error());
$num_new_pm = intval($db->result($result));
$items['inbox'] = array('url' => 'inbox.php', 'title' => 'Inbox', 'num' => $num_new_pm);
}
$items['user'] = array('profile' => array('url' => 'profile.php?id=' . $luna_user['id'], 'title' => __('Profile', 'luna')), 'settings' => array('url' => 'settings.php', 'title' => __('Settings', 'luna')), 'help' => array('url' => 'help.php', 'title' => __('Help', 'luna')), 'logout' => array('url' => 'login.php?action=out&id=' . $luna_user['id'] . '&csrf_token=' . luna_hash($luna_user['id'] . luna_hash(get_remote_address())), 'title' => __('Logout', 'luna')));
}
return $items;
}
示例4: generate_cached_search_query
function generate_cached_search_query($search_id, &$show_as)
{
global $forum_db, $db_type, $forum_user, $forum_config;
$return = ($hook = get_hook('sf_fn_generate_cached_search_query_start')) ? eval($hook) : null;
if ($return != null) {
return $return;
}
$ident = $forum_user['is_guest'] ? get_remote_address() : $forum_user['username'];
$query = array('SELECT' => 'sc.search_data', 'FROM' => 'search_cache AS sc', 'WHERE' => 'sc.id=' . $search_id . ' AND sc.ident=\'' . $forum_db->escape($ident) . '\'');
($hook = get_hook('sf_fn_generate_cached_search_query_qr_get_cached_search_data')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if ($row = $forum_db->fetch_assoc($result)) {
$search_data = unserialize($row['search_data']);
$search_results = $search_data['search_results'];
$sort_by = $search_data['sort_by'];
$sort_dir = $search_data['sort_dir'];
$show_as = $search_data['show_as'];
unset($search_data);
} else {
return false;
}
// If there are no posts, we don't need to execute the query
if (empty($search_results)) {
return false;
}
switch ($sort_by) {
case 1:
$sort_by_sql = $show_as == 'topics' ? 't.poster' : 'p.poster';
break;
case 2:
$sort_by_sql = 't.subject';
break;
case 3:
$sort_by_sql = 't.forum_id';
break;
default:
$sort_by_sql = $show_as == 'topics' ? 't.posted' : 'p.posted';
($hook = get_hook('sf_fn_generate_cached_search_query_qr_cached_sort_by')) ? eval($hook) : null;
break;
}
if ($show_as == 'posts') {
$query = array('SELECT' => 'p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, p.message, p.hide_smilies, t.id AS tid, t.poster, t.subject, t.first_post_id, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id, f.forum_name', 'FROM' => 'posts AS p', 'JOINS' => array(array('INNER JOIN' => 'topics AS t', 'ON' => 't.id=p.topic_id'), array('INNER JOIN' => 'forums AS f', 'ON' => 'f.id=t.forum_id')), 'WHERE' => 'p.id IN(' . $search_results . ')', 'ORDER BY' => $sort_by_sql . ' ' . $sort_dir);
($hook = get_hook('sf_fn_generate_cached_search_query_qr_get_cached_hits_as_posts')) ? eval($hook) : null;
} else {
$query = array('SELECT' => 't.id AS tid, t.poster, t.subject, t.first_post_id, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.sticky, t.forum_id, f.forum_name', 'FROM' => 'topics AS t', 'JOINS' => array(array('INNER JOIN' => 'forums AS f', 'ON' => 'f.id=t.forum_id')), 'WHERE' => 't.id IN(' . $search_results . ')', 'ORDER BY' => $sort_by_sql . ' ' . $sort_dir);
// With "has posted" indication
if (!$forum_user['is_guest'] && $forum_config['o_show_dot'] == '1') {
$query['SELECT'] .= ', p.poster_id AS has_posted';
$query['JOINS'][] = array('LEFT JOIN' => 'posts AS p', 'ON' => '(p.poster_id=' . $forum_user['id'] . ' AND p.topic_id=t.id)');
// Must have same columns as in prev SELECT
$query['GROUP BY'] = 't.id, t.poster, t.subject, t.first_post_id, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.sticky, t.forum_id, f.forum_name, p.poster_id';
($hook = get_hook('sf_fn_generate_cached_search_query_qr_get_has_posted')) ? eval($hook) : null;
}
($hook = get_hook('sf_fn_generate_cached_search_query_qr_get_cached_hits_as_topics')) ? eval($hook) : null;
}
($hook = get_hook('sf_fn_generate_cached_search_query_end')) ? eval($hook) : null;
return $query;
}
示例5: array
if ($_SESSION['GPG_MESSAGE'] == $_POST['req_CLEARTEXT'] || $_SESSION['GPG_CIPHERTEXT'] == 'SORRY, YOUR PUBKEY IS FAULTY') {
// Remove this user's guest entry from the online list
$query = array('DELETE' => 'online', 'WHERE' => 'ident=\'' . $forum_db->escape(get_remote_address()) . '\'');
($hook = get_hook('li_login_qr_delete_online_user')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
$expire = $save_pass ? time() + 1209600 : time() + $forum_config['o_timeout_visit'];
forum_setcookie($cookie_name, base64_encode($user_id . '|' . $form_password_hash . '|' . $expire . '|' . sha1($salt . $form_password_hash . forum_hash($expire, $salt))), $expire);
($hook = get_hook('li_login_pre_redirect')) ? eval($hook) : null;
$_SESSION = array();
$_SESSION['NOT_BOT'] = 1;
redirect(FORUM_ROOT . "search.php?action=show_new");
}
} else {
$_SESSION['GPG_VERIFICATION_REQUIRED'] = 0;
// Remove this user's guest entry from the online list
$query = array('DELETE' => 'online', 'WHERE' => 'ident=\'' . $forum_db->escape(get_remote_address()) . '\'');
($hook = get_hook('li_login_qr_delete_online_user')) ? eval($hook) : null;
$forum_db->query_build($query) or error(__FILE__, __LINE__);
$expire = $save_pass ? time() + 1209600 : time() + $forum_config['o_timeout_visit'];
forum_setcookie($cookie_name, base64_encode($user_id . '|' . $form_password_hash . '|' . $expire . '|' . sha1($salt . $form_password_hash . forum_hash($expire, $salt))), $expire);
($hook = get_hook('li_login_pre_redirect')) ? eval($hook) : null;
$_SESSION = array();
$_SESSION['NOT_BOT'] = 1;
redirect(FORUM_ROOT . "search.php?action=show_new");
}
}
}
} else {
if ($action == 'out') {
if ($forum_user['is_guest'] || !isset($_GET['id']) || $_GET['id'] != $forum_user['id']) {
header('Location: ' . forum_link($forum_url['index']));
示例6: array
}
}
if ($panther_config['p_allow_dupe_email'] == '0') {
$data = array(':email' => $email);
$ps = $db->select('users', 1, $data, 'email=:email');
if ($ps->rowCount()) {
$errors[] = $lang_prof_reg['Dupe email'];
}
}
if (empty($errors)) {
// Insert the new user into the database. We do this now to get the last inserted ID for later use
$now = time();
$initial_group_id = $random_pass == 0 ? $panther_config['o_default_user_group'] : PANTHER_UNVERIFIED;
$password_hash = panther_hash($password1 . $password_salt);
// Add the user
$insert = array('username' => $username, 'group_id' => $initial_group_id, 'password' => $password_hash, 'salt' => $password_salt, 'email' => $email, 'email_setting' => $panther_config['o_default_email_setting'], 'timezone' => $panther_config['o_default_timezone'], 'dst' => $panther_config['o_default_dst'], 'language' => $panther_config['o_default_lang'], 'style' => $panther_config['o_default_style'], 'registered' => $now, 'registration_ip' => get_remote_address(), 'last_visit' => $now);
$db->insert('users', $insert);
$new_uid = $db->lastInsertId($db->prefix . 'users');
if ($random_pass == '1') {
$info = array('subject' => array('<board_title>' => $panther_config['o_board_title']), 'message' => array('<base_url>' => get_base_url(), '<username>' => $username, '<password>' => $password1, '<login_url>' => panther_link($panther_url['login'])));
$mail_tpl = $mailer->parse(PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/mail_templates/welcome.tpl', $info);
$mailer->send($email, $mail_tpl['subject'], $mail_tpl['message']);
}
// Regenerate the users info cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require PANTHER_ROOT . 'include/cache.php';
}
generate_users_info_cache();
redirect(panther_link($panther_url['admin_maintenance']), $lang_admin_maintenance['User created message']);
}
}
示例7: error
$db->query('UPDATE ' . $db->prefix . 'topics SET has_poll=' . $poll_id . ' WHERE id=' . $new_tid) or error('Unable to update topic for poll', __FILE__, __LINE__, $db->error());
}
}
}
// hcs AJAX POLL MOD END
if (!$pun_user['is_guest']) {
// To subscribe or not to subscribe, that ...
if ($pun_config['o_subscriptions'] == 1 && $_POST['subscribe'] == 1) {
$db->query('INSERT INTO ' . $db->prefix . 'subscriptions (user_id, topic_id) VALUES(' . $pun_user['id'] . ' ,' . $new_tid . ')') or error('Unable to add subscription', __FILE__, __LINE__, $db->error());
}
// Create the post ("topic post")
$db->query('INSERT INTO ' . $db->prefix . 'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\'' . $db->escape($username) . '\', ' . $pun_user['id'] . ', \'' . get_remote_address() . '\', \'' . $db->escape($message) . '\', \'' . $hide_smilies . '\', ' . $_SERVER['REQUEST_TIME'] . ', ' . $new_tid . ')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
} else {
// Create the post ("topic post")
$email_sql = $pun_config['p_force_guest_email'] == 1 || $email ? '\'' . $db->escape($email) . '\'' : 'NULL';
$db->query('INSERT INTO ' . $db->prefix . 'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\'' . $db->escape($username) . '\', \'' . get_remote_address() . '\', ' . $email_sql . ', \'' . $db->escape($message) . '\', \'' . $hide_smilies . '\', ' . $_SERVER['REQUEST_TIME'] . ', ' . $new_tid . ')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
}
$new_pid = $db->insert_id();
// Update the topic with last_post_id
$db->query('UPDATE ' . $db->prefix . 'topics SET last_post_id=' . $new_pid . ' WHERE id=' . $new_tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
update_search_index('post', $new_pid, $message, $subject);
update_forum($fid);
}
}
generate_rss();
$uploaded = 0;
$upload_result = process_uploaded_files($fid ? $new_tid : $tid, $new_pid, $uploaded);
// If the posting user is logged in, increment his/her post count
// MERGE POSTS BEGIN
if (!$pun_user['is_guest']) {
if ($uploaded) {
示例8: get_remote_address
\'' . get_remote_address() . '\',
\'' . $smilies . '\',
\'0\',
\'0\',
\'' . $_SERVER['REQUEST_TIME'] . '\',
\'0\'
)') or error('Unable to send message', __FILE__, __LINE__, $db->error());
// Save an own copy of the message
if (isset($_POST['savemessage'])) {
$db->query('INSERT INTO ' . $db->prefix . 'messages (owner, subject, message, sender, sender_id, sender_ip, smileys, showed, status, posted, popup) VALUES(
\'' . $pun_user['id'] . '\',
\'' . $db->escape($subject) . '\',
\'' . $db->escape($message) . '\',
\'' . $db->escape($user) . '\',
\'' . $id . '\',
\'' . get_remote_address() . '\',
\'' . $smilies . '\',
\'1\',
\'1\',
\'' . $_SERVER['REQUEST_TIME'] . '\',
\'1\'
)') or error('Unable to send message', __FILE__, __LINE__, $db->error());
}
} else {
wap_message($lang_pms['No user']);
}
$topic_redirect = intval($_POST['topic_redirect']);
$from_profile = intval(@$_POST['from_profile']);
if ($from_profile) {
wap_redirect('profile.php?id=' . $from_profile);
} else {
示例9: trim
// Load the "new_pm" template
$mail_tpl = trim(file_get_contents(PUN_ROOT . 'lang/' . $pun_user['language'] . '/mail_templates/new_pm.tpl'));
// The first row contains the subject
$first_crlf = strpos($mail_tpl, "\n");
$mail_subject = trim(substr($mail_tpl, 8, $first_crlf - 8));
$mail_message = trim(substr($mail_tpl, $first_crlf));
$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
$mail_message = str_replace('<sender>', $pun_user['username'], $mail_message);
$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'] . ' ' . $lang_common['Mailer'], $mail_message);
}
foreach ($destinataires as $dest) {
$db->query('INSERT INTO ' . $db->prefix . 'messages (owner, subject, message, sender, sender_id, sender_ip, smileys, showed, status, posted) VALUES(\'' . $dest['id'] . '\', \'' . $db->escape($p_subject) . '\', \'' . $db->escape($p_message) . '\', \'' . $db->escape($pun_user['username']) . '\', \'' . $pun_user['id'] . '\', \'' . get_remote_address() . '\', \'' . $smilies . '\', \'0\', \'0\', \'' . time() . '\' )') or error('Impossible d\'envoyer le message.', __FILE__, __LINE__, $db->error());
$new_mp = $db->insert_id();
// Save an own copy of the message
if ($save == 1) {
$db->query('INSERT INTO ' . $db->prefix . 'messages (owner, subject, message, sender, sender_id, sender_ip, smileys, showed, status, posted) VALUES(\'' . $pun_user['id'] . '\', \'' . $db->escape($p_subject) . '\', \'' . $db->escape($p_message) . '\', \'' . $db->escape($dest['username']) . '\', \'' . $dest['id'] . '\', \'' . get_remote_address() . '\', \'' . $smilies . '\', \'1\', \'1\', \'' . time() . '\' )') or error('Impossible de sauvegarder le message dans le dossier des messages envoyés', __FILE__, __LINE__, $db->error());
}
// E-mail notification
if ($pun_config['o_pms_notification'] == '1' && $dest['notify_mp'] == 1) {
$mail_message = str_replace('<pm_url>', $pun_config['o_base_url'] . '/pms_list.php?mid=' . $new_mp, $mail_message);
pun_mail($dest['email'], $mail_subject, $mail_message);
}
}
if ($from_profile != '') {
redirect('profile.php?id=' . $from_profile, $lang_pms['Sent redirect']);
} elseif ($tid != '') {
redirect('viewtopic.php?id=' . $tid, $lang_pms['Sent redirect']);
} else {
redirect('pms_list.php', $lang_pms['Sent redirect']);
}
}
示例10: write
/**
* @see parent::write()
*/
function write($session_id, $data)
{
$client = self::$client;
$address = get_remote_address();
$user_id = CAppUI::$instance->user_id;
$user_ip = $address["remote"] ? inet_pton($address["remote"]) : null;
$new_hash = md5($data);
$key = $this->getKey($session_id);
// If session is to be updated
if ($this->data_hash || $this->data_hash !== $new_hash) {
$session = array("user_id" => $user_id, "user_ip" => $user_ip, "data" => $data);
$client->set($key, serialize($session), $this->lifetime);
} else {
$client->expire($key, $this->lifetime);
}
return true;
}
示例11: get_extensions
// Check note_pm
$note_pm = 'Subject: ' . $pm_subject . "\n\n" . 'Message:' . "\n\n" . $pm_message;
} else {
$note_pm = '';
}
($hook = get_extensions('warn_after_validation')) ? eval($hook) : null;
if (empty($errors)) {
$expiration = $expiration != '0' ? $now + $expiration : 0;
$insert = array('user_id' => $user_id, 'type_id' => $warning_type, 'post_id' => $post_id, 'title' => $warning_type == 0 ? $warning_title : '', 'points' => $warning_points, 'date_issued' => $now, 'date_expire' => $expiration, 'issued_by' => $panther_user['id'], 'note_admin' => $admin_note, 'note_post' => isset($message) ? $message : '', 'note_pm' => $note_pm);
$db->insert('warnings', $insert);
// If private messaging system is enabled
if ($panther_config['o_private_messaging'] == '1') {
$insert = array('subject' => $pm_subject, 'poster' => $panther_user['username'], 'poster_id' => $panther_user['id'], 'num_replies' => 0, 'last_post' => $now, 'last_poster' => $panther_user['username']);
$db->insert('conversations', $insert);
$new_tid = $db->lastInsertId($db->prefix . 'conversations');
$insert = array('poster' => $panther_user['username'], 'poster_id' => $panther_user['id'], 'poster_ip' => get_remote_address(), 'message' => $pm_message, 'hide_smilies' => 0, 'posted' => $now, 'topic_id' => $new_tid);
$db->insert('messages', $insert);
$new_pid = $db->lastInsertId($db->prefix . 'messages');
$update = array('first_post_id' => $new_pid, 'last_post_id' => $new_pid);
$data = array(':tid' => $new_tid);
$db->update('conversations', $update, 'id=:tid', $data);
$insert = array('topic_id' => $new_tid, 'user_id' => $user_id);
$db->insert('pms_data', $insert);
$insert = array('topic_id' => $new_tid, 'user_id' => $panther_user['id'], 'viewed' => 1, 'deleted' => 1);
$db->insert('pms_data', $insert);
$data = array(':id' => $user_id);
$db->run('UPDATE ' . $db->prefix . 'users SET num_pms=num_pms+1 WHERE id=:id', $data);
if ($pm_notify == '1') {
$info = array('message' => array('<username>' => $username, '<sender>' => $panther_user['username'], '<message>' => $pm_message, '<pm_title>' => $subject, '<message_url>' => panther_link($panther_url['pms_topic'], array($new_pid))));
$mail_tpl = $mailer->parse(PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/mail_templates/new_pm.tpl', $info);
$mailer->send($email, $mail_tpl['subject'], $mail_tpl['message']);
示例12: pun_csrf_token
function pun_csrf_token()
{
global $pun_user;
static $token;
if (!isset($token)) {
$token = pun_hash($pun_user['id'] . $pun_user['password'] . pun_hash(get_remote_address()));
}
return $token;
}
示例13: message
} else {
message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna'), false, '404 Not Found');
}
// Prune "old" search results
$old_searches = array();
$result = $db->query('SELECT ident FROM ' . $db->prefix . 'online') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
while ($row = $db->fetch_row($result)) {
$old_searches[] = '\'' . $db->escape($row[0]) . '\'';
}
$db->query('DELETE FROM ' . $db->prefix . 'search_cache WHERE ident NOT IN(' . implode(',', $old_searches) . ')') or error('Unable to delete search results', __FILE__, __LINE__, $db->error());
}
// Fill an array with our results and search properties
$temp = serialize(array('search_ids' => serialize($search_ids), 'num_hits' => $num_hits, 'sort_by' => $sort_by, 'sort_dir' => $sort_dir, 'show_as' => $show_as, 'search_type' => $search_type));
$search_id = mt_rand(1, 2147483647);
$ident = $luna_user['is_guest'] ? get_remote_address() : $luna_user['username'];
$db->query('INSERT INTO ' . $db->prefix . 'search_cache (id, ident, search_data) VALUES(' . $search_id . ', \'' . $db->escape($ident) . '\', \'' . $db->escape($temp) . '\')') or error('Unable to insert search results', __FILE__, __LINE__, $db->error());
if ($search_type[0] != 'action') {
$db->end_transaction();
$db->close();
// Redirect the user to the cached result page
header('Location: search.php?search_id=' . $search_id);
exit;
}
}
$forum_actions = array();
// If we're on the new posts search, display a "mark all as read" link
if (!$luna_user['is_guest'] && $search_type[0] == 'action' && $search_type[1] == 'show_new') {
$forum_actions[] = '<a href="misc.php?action=markread">' . __('Mark as read', 'luna') . '</a>';
}
// Fetch results to display
示例14: luna_csrf_token
function luna_csrf_token()
{
global $luna_user;
return luna_hash($luna_user['id'] . luna_hash(get_remote_address()));
}
示例15: luna_csrf_token
function luna_csrf_token()
{
global $luna_user;
static $token;
if (!isset($token)) {
return luna_hash($luna_user['id'] . $luna_user['password'] . luna_hash(get_remote_address()));
}
}