本文整理汇总了PHP中user_logged_in函数的典型用法代码示例。如果您正苦于以下问题:PHP user_logged_in函数的具体用法?PHP user_logged_in怎么用?PHP user_logged_in使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_logged_in函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor
*
* @return void
*/
public function __construct()
{
self::$instance =& $this;
// Assign all the class objects that were instantiated by the
// bootstrap file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
foreach (is_loaded() as $var => $class)
{
$this->$var =& load_class($class);
}
$this->load =& load_class('Loader', 'core');
$this->load->initialize();
log_message('info', 'Controller Class Initialized');
user_logged_in();
//echo $user_type = $this->session->userdata['department'];
$valid_method = get_restricted_department();
$user_type = strtolower($this->session->userdata['department']);
if(in_array($user_type, $valid_method)) {
user_authentication($user_type);
}
}
开发者ID:anujjaha,项目名称:ncybera,代码行数:30,代码来源:Controller.php
示例2: content
function content()
{
if (!user_logged_in()) {
return must_log_in();
}
$user = fetch_one_or_none('users', 'id', user_logged_in());
if (!array_key_exists('token', $_GET) || !$_GET['token'] || $_GET['token'] != sha1($user->new_email_address)) {
$errors[] = 'Invalid reset token';
}
# This can happen if two accounts try to change address at similar times.
if (count($errors) == 0 && count(fetch_all('users', 'email_address', $user->new_email_address))) {
$errors[] = "A user with this email address already exists";
}
if (count($errors) == 0) {
update_all('users', array('email_address' => $user->new_email_address, 'new_email_address' => null), 'id', user_logged_in());
?>
<h2>Address changed</h2>
<p>Your email address has been changed to
<tt><?php
esc($user->new_email_address);
?>
</tt>.</p>
<?php
return;
}
page_header('Address verification failed');
show_error_list($errors);
}
开发者ID:ras52,项目名称:geneopedia,代码行数:28,代码来源:verify-email.php
示例3: content
function content()
{
if (!user_logged_in()) {
return must_log_in();
}
$user = fetch_one_or_none('users', 'id', user_logged_in());
$errors = array();
if (array_key_exists('change', $_POST)) {
if (!isset($_POST['email']) || !$_POST['email']) {
$errors[] = "Please enter an email address";
} else {
$email = $_POST['email'];
if ($email && !validate_email_address($email)) {
$errors[] = "Invalid email address";
}
if (count($errors) == 0 && count(fetch_all('users', 'email_address', $email))) {
$errors[] = "A user with this email address already exists";
}
if (count($errors) == 0) {
update_all('users', array('new_email_address' => $email), 'id', user_logged_in());
send_email_change_email($email, $user->name);
?>
<p>We have sent an email to your new address requesting that you
confirm that change of address.</p>
<?php
return;
}
}
}
$fields = array();
page_header('Change email address');
show_error_list($errors);
?>
<form method="post" action="" accept-charset="UTF-8">
<div class="fieldrow">
<div class="field">
<label>Current address:</label>
<div><tt><?php
esc($user->email_address);
?>
</tt></div>
</div>
</div>
<div class="fieldrow">
<?php
text_field($fields, 'email', 'New address');
?>
</div>
<div class="fieldrow">
<input type="submit" name="change" value="Change"/>
</div>
</form>
<?php
}
开发者ID:ras52,项目名称:geneopedia,代码行数:57,代码来源:change-email.php
示例4: require_login
function require_login($target_page = 'login.php')
{
if (!user_logged_in()) {
$src = strtolower(basename($_SERVER['PHP_SELF']));
if (!in_array($src, array('login.php'))) {
header('Location:' . $target_page);
}
}
}
开发者ID:AndanTeknomedia,项目名称:Ganafus-SMS-Gateway,代码行数:9,代码来源:session.php
示例5: content
function content()
{
global $config;
if (!user_logged_in()) {
return must_log_in();
}
$errors = array();
if (!array_key_exists('id', $_GET)) {
$errors[] = 'No user ID';
}
if (count($errors) == 0) {
$user = fetch_one_or_none('users', 'id', $_GET['id']);
if (!$user) {
$errors[] = 'No such user';
}
if (!$user->date_verified) {
$errors[] = 'User has not yet been verified';
}
if ($user->date_approved) {
$errors[] = 'User has already been approved';
}
}
if (count($errors)) {
page_header("Error approving account");
show_error_list($errors);
return;
}
if (!$user->date_approved) {
update_all('users', array('date_approved' => date('Y-m-d H:i:s'), 'approved_by' => user_logged_in()), 'id', $user->id);
}
$root = 'http://' . $config['domain'] . $config['http_path'];
$msg = "Your " . $config['title'] . " account has been approved. " . "To log in, please follow \n" . "the following link:\n" . "\n" . " {$root}account/login\n" . "\n";
mail(sprintf('"%s" <%s>', $user->name, $user->email_address), $config['title'] . " account approved", $msg) or die('Unable to send email');
register_user_rdf($user);
page_header("Account approved");
?>
<p>Thank you for approving <?php
esc($user->name);
?>
's account.</p>
<?php
}
开发者ID:ras52,项目名称:geneopedia,代码行数:44,代码来源:approve.php
示例6: menu
function menu()
{
global $config;
$root = $config['http_path'];
?>
<ul>
<li><a href="<?php
esc($root);
?>
">Home</a></li>
<?php
if (user_logged_in()) {
?>
<li><a href="<?php
esc($root);
?>
files">Files</a></li>
<li><a href="<?php
esc($root);
?>
account">Account</a></li>
<li><a href="<?php
esc($root);
?>
account/logout">Log out</a></li>
<?php
} else {
?>
<li><a href="<?php
esc($root);
?>
account/register">Register</a></li>
<li><a href="<?php
esc($root);
?>
account/login">Log in</a></li>
<?php
}
?>
</ul>
<?php
}
开发者ID:ras52,项目名称:geneopedia,代码行数:42,代码来源:menu.php
示例7: content
function content()
{
if (!user_logged_in()) {
return must_log_in();
}
$errors = array();
if (array_key_exists('upload', $_POST)) {
if (!array_key_exists('file', $_FILES) || filesize($_FILES['file']['tmp_name']) == 0) {
$errors[] = 'Please supply a file';
}
if (count($errors) == 0) {
preg_match('/\\.([^\\/.]+)$/', $_FILES['file']['name'], $matches);
$file_id = do_upload($_FILES['file']['tmp_name'], $_FILES['file']['type'], $matches[1], $_FILES['file']['size']);
page_header('File uploaded');
?>
<?php
return;
}
}
page_header('Upload file');
show_error_list($errors);
?>
<form enctype="multipart/form-data" action="" method="post">
<div class="fieldrow">
<div>
<label for="file">Select an image
<span class="label-extra">(size limit: 8MB)</span></label>
<input id="file" name="file" type="file" />
</div>
</div>
<div class="fieldrow">
<input type="submit" name="upload" value="Upload" />
</div>
</form>
<?php
}
开发者ID:ras52,项目名称:geneopedia,代码行数:42,代码来源:upload.php
示例8: content
function content()
{
if (!user_logged_in()) {
return must_log_in();
}
$files = fetch_wol('*', 'files', sprintf("user_id=%d", user_logged_in()));
if (count($files) == 0) {
?>
<p>You have not <a href="upload">uploaded</a> any files.</p>
<?php
return;
}
?>
<table class="data">
<?php
foreach ($files as $f) {
?>
<tr><td class="file-id"><a href="<?php
esc($f->id . '.' . $f->extension);
?>
"><?php
esc(sprintf("%06d", $f->id));
?>
</a></td>
<td><?php
esc(date_format('Y-m-d H:i:s', $f->date_uploaded));
?>
</td>
<td><?php
esc(format_size($f->length));
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
开发者ID:ras52,项目名称:geneopedia,代码行数:40,代码来源:index.php
示例9: render_graph_new
/**
* Render the HTML on the page necessary for rendering a graph to the user.
*
* @param $graph = array(
* 'graph_type' => $id,
* 'width' => 8,
* 'height' => 4,
* 'page_order' => 0,
* 'days' => $days,
* 'id' => 0,
* 'arg0_resolved' => $name,
* 'delta' => $delta,
* 'public' => true,
* 'no_technicals' => true,
* );
* @param $include_user_hash if true, include user_id and user_hash in the graph data, necessary for
* graphs that require user authentication; default is false
*/
function render_graph_new($graph, $include_user_hash = false)
{
global $_rendered_graph_contents;
if (!$_rendered_graph_contents) {
// calculate the relevant text for outofdate indicators
$title = "";
if (user_logged_in()) {
$user = get_user(user_id());
$plural_hours = plural("hour", user_is_new($user) ? get_site_config('refresh_queue_hours_premium') : get_premium_value($user, "refresh_queue_hours"));
if ($user['is_first_report_sent']) {
$title = t("This graph will take up to :hours to be updated with recently added or removed accounts.", array(':hours' => $plural_hours));
} else {
if ($user['has_added_account']) {
$title = t("As a new user, it will take up to :hours for this graph to be populated with initial data.", array(':hours' => $plural_hours));
} else {
$title = t("You need to add some account data for this graph to display.");
}
}
}
?>
<div id="graph_contents_template" style="display:none;">
<div class="graph_headings">
<h1 class="h1"></h1>
<h2 class="h2"></h2>
<h2 class="graph_title">
<a href=""></a>
</h2>
<span class="outofdate" style="display:none;" title="<?php
echo htmlspecialchars($title);
?>
"></span>
<span class="subheading"></span>
<span class="last-updated"></span>
<ul class="graph_controls">
<li class="move_up"><a><?php
echo ht("Move up");
?>
</a></li>
<li class="move_down"><a><?php
echo ht("Move down");
?>
</a></li>
<li class="remove"><a><?php
echo ht("Remove");
?>
</a></li>
<li class="edit"><a><?php
echo ht("Edit");
?>
</a></li>
</ul>
<div class="edit_target" style="display:none;">
<ul class="graph_edit_controls">
<li class="close"><a><?php
echo ht("Close");
?>
</a></li>
</ul>
</div>
</div>
<div class="graph-target"><span class="status_loading"><?php
echo ht("Loading...");
?>
</span></div>
<div class="graph_extra extra" style="display:none;"><a href="#"></a></span></div>
<div class="admin-stats-wrapper hide-admin"><span class="admin-stats render_time"></span></div>
</div>
<div id="graph_table_template" class="overflow_wrapper extra-text-container" style="display:none;">
<table class="standard graph_table">
</table>
</div>
<?php
}
if (user_logged_in()) {
$user = get_user(user_id());
$graph['can_be_edited'] = !($user['graph_managed_type'] == 'auto' && isset($graph['is_managed']) && $graph['is_managed']);
}
if (isset($graph['page_id']) && isset($graph['id'])) {
$graph['move_up_link'] = url_for('profile', array('page' => $graph['page_id'], 'move_up' => $graph['id']));
$graph['move_down_link'] = url_for('profile', array('page' => $graph['page_id'], 'move_down' => $graph['id']));
$graph['remove_link'] = url_for('profile', array('page' => $graph['page_id'], 'remove' => $graph['id']));
}
//.........这里部分代码省略.........
开发者ID:phpsource,项目名称:openclerk,代码行数:101,代码来源:new.php
示例10: header
<?php
require_once 'config.php';
require_once 'auth.php';
require_once 'verify_lib.php';
header("Content-Type: application/json");
if ($https && !isset($_SERVER['HTTPS'])) {
// We're using mod_rewrite .htaccess for HTTPS redirect; this shouldn't happen
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
exit;
}
if (!user_logged_in()) {
exit(json_encode(array('error' => 'not_logged_in')));
}
if (!isset($_POST['email']) || !isset($_POST['new_password']) || !isset($_POST['old_password'])) {
exit(json_encode(array('error' => 'invalid_parameters')));
}
$user = get_viewer_id();
$old_password = $_POST['old_password'];
$new_password = $_POST['new_password'];
$email = $_POST['email'];
$result = $conn->query("SELECT username, email, hash FROM users WHERE id=\"{$user}\"");
$user_row = $result->fetch_assoc();
if (!$user_row) {
exit(json_encode(array('error' => 'internal_error')));
}
if (!password_verify($old_password, $user_row['hash'])) {
exit(json_encode(array('error' => 'invalid_credentials')));
}
$change_email = "";
if ($user_row['email'] !== $email) {
开发者ID:Ashoat,项目名称:squadcal,代码行数:31,代码来源:edit_account.php
示例11: array
<?php
/**
* This page displays historical data publically.
*/
require __DIR__ . "/../layout/graphs.php";
require __DIR__ . "/../layout/templates.php";
$messages = array();
$errors = array();
$historical_graphs = graph_types_public();
$permitted_days = get_permitted_days();
$permitted_deltas = get_permitted_deltas();
$days = isset($permitted_days[require_get('days', false)]) ? $permitted_days[require_get('days')]['days'] : 45;
$delta = isset($permitted_deltas[require_get('delta', false)]) ? require_get('delta') : '';
$user = user_logged_in() ? get_user(user_id()) : false;
$id = require_get("id", false);
if ($id && isset($historical_graphs[$id])) {
// we're displaying a specific graph
$name = require_get('name', false);
$title = $name;
// if we've got a name, then we want to get the title too
if (isset($historical_graphs[$id]['title_callback'])) {
$callback = $historical_graphs[$id]['title_callback'];
$title = $callback($id, $title);
}
$heading = $historical_graphs[$id]["heading"] . ($title ? ": " . $title : "");
page_header(t("Historical Data: :heading", array(':heading' => $heading)), "page_historical", array('jsapi' => true));
$graph = array('graph_type' => $id, 'width' => 8, 'height' => 4, 'page_order' => 0, 'days' => $days, 'id' => 0, 'arg0_resolved' => $name, 'delta' => $delta, 'public' => true, 'no_technicals' => true);
$extra_args = $name ? array("name" => $name) : array();
$extra_args['id'] = $id;
$extra_args['days'] = $days;
开发者ID:phpsource,项目名称:openclerk,代码行数:31,代码来源:historical.php
示例12: deleteMyCookie
if (isset($_POST['mode']) and $_POST['mode'] == 'login') {
require $pathToFiles . 'bb_func_login.php';
}
if ($loginError == 0) {
if (isset($_GET['mode']) and $_GET['mode'] == 'logout') {
deleteMyCookie();
if (isset($metaLocation)) {
$meta_relocate = "{$main_url}/{$indexphp}";
echo ParseTpl(makeUp($metaLocation));
exit;
} else {
header("Location: {$main_url}/{$startIndex}");
exit;
}
}
user_logged_in();
if ($user_id != 0 and isset($langu) and $langu = str_replace(array('.', '/', '\\'), '', $langu) and file_exists($pathToFiles . "lang/{$langu}.php")) {
$lang = $langu;
} elseif ($user_id == 0 and isset($_GET['setlang']) and $setlang = str_replace(array('.', '/', '\\'), '', $_GET['setlang']) and file_exists($pathToFiles . "lang/{$setlang}.php")) {
$lang = $setlang;
$indexphp .= 'setlang=' . $setlang . '&';
}
if ($user_id > 0 and !isset($_COOKIE[$cookiename . '_csrfchk'])) {
setCSRFCheckCookie();
}
include $pathToFiles . "lang/{$lang}.php";
$actEnable = isset($GLOBALS['user_activity']) ? $GLOBALS['user_activity'] : 1;
$actTrue = ($actEnable == -1 and ($action == 'prefs' or $action == 'editprefs' or $action == 'confirmpasswd'));
if ($actEnable == 0 or $actEnable != 1 and !$actTrue) {
$forb = 2;
} else {
开发者ID:amenski,项目名称:BookSharing,代码行数:31,代码来源:index.php
示例13: json_decode
if (isset($_COOKIE['nvsa_session'])) {
$kp_session = (array) json_decode(base64_decode($_COOKIE['nvsa_session']));
if (!isset($logged_in_user)) {
$logged_in_user = new NVSA_USER($session_db, $kp_session);
}
$qry = "INSERT INTO `wb-user-meta` (user_id,meta_key,meta_value) VALUES ('" . $logged_in_user->ID() . "','last_accessed', CURRENT_TIMESTAMP)" . "ON DUPLICATE KEY UPDATE meta_value=CURRENT_TIMESTAMP;";
$session_db->query($qry);
}
// note: tuck all echo statments away so they cannot accidentally fire
// when this file is included. Only available upon "Action" request
if (isset($_POST['action']) && $_POST['action'] !== '') {
// if attempting to login
if ($_POST['action'] == 'login') {
// if ( user_logged_in(true)==true )
// $_SESSION['session_id'] = $mySession->session_lock;
$json['logged_in'] = user_logged_in(true);
$json['login_html'] = get_login_link();
// there is no else because the login_error would be set in the function user_logged_in
echo json_encode($json);
} elseif ($_POST['action'] == 'logout') {
if (logged_out() == true) {
$json['login_html'] = get_login_link();
}
echo json_encode($json);
}
// end if login
}
// end if action set
} else {
ob_start();
echo "<p>";
开发者ID:mvbaxter,项目名称:gi-whiteboard,代码行数:31,代码来源:session_mgr.php
示例14: is_admin
/**
* Is the current user an administrator?
* Once called, may cached across the length of the script.
*
* @return true if admin, false if not. always returns false if NO_SESSION is defined
*/
function is_admin()
{
if (defined('NO_SESSION')) {
// a sessionless request can never be admin
return false;
}
if (!user_logged_in()) {
return false;
}
$q = db()->prepare("SELECT * FROM user_properties WHERE id=?");
$q->execute(array(user_id()));
$user = $q->fetch();
return $user['is_admin'];
}
开发者ID:phpsource,项目名称:openclerk,代码行数:20,代码来源:security.php
示例15: protect_page
function protect_page()
{
if (user_logged_in() === false) {
header('Location: protected.php');
exit;
}
}
开发者ID:peonso,项目名称:ZnoteAAC,代码行数:7,代码来源:general.php
示例16: die
if (!$curlcheck) {
die("php cURL is not enabled. It is required to for paypal and ZEOTSS services.<br>1. Find your php.ini file.<br>2. Uncomment extension=php_curl<br>Restart web server.<br><br><b>If you don't want this then disable zeotss and paypal in config.php.</b>");
}
}
require_once 'database/connect.php';
require_once 'function/general.php';
require_once 'function/users.php';
require_once 'function/cache.php';
require_once 'function/mail.php';
require_once 'function/token.php';
require_once 'function/itemparser/itemlistparser.php';
if (isset($_SESSION['token'])) {
$_SESSION['old_token'] = $_SESSION['token'];
}
Token::generate();
if (user_logged_in() === true) {
$session_user_id = getSession('user_id');
$user_data = user_data($session_user_id, 'id', 'name', 'password', 'email', 'premdays');
$user_znote_data = user_znote_account_data($session_user_id, 'ip', 'created', 'points', 'cooldown');
}
$errors = array();
// Log IP
if ($config['log_ip']) {
$visitor_config = $config['ip_security'];
$flush = $config['flush_ip_logs'];
if ($flush != false) {
$timef = $time - $flush;
if (getCache() < $timef) {
$timef = $time - $visitor_config['time_period'];
mysql_delete("DELETE FROM znote_visitors_details WHERE time <= '{$timef}'");
setCache($time);
开发者ID:peonso,项目名称:ZnoteAAC,代码行数:31,代码来源:init.php
示例17: performance_metrics_graph_complete
/**
* Called when a graph has been rendered by the job framework.
* {@link #performance_metrics_page_end()} can still be called for database metrics etc.
*/
function performance_metrics_graph_complete($graph)
{
if (!performance_metrics_enabled()) {
return;
}
global $_performance_metrics;
$graph_time = microtime(true) - $_performance_metrics['page_start'];
if (isset($_performance_metrics['graph_complete'])) {
throw new PerformanceMetricsException("graph_complete called twice");
}
$_performance_metrics['graph_complete'] = true;
// "What graph types take the longest to render?"
// "What are the most common graph types?"
// "How many ticker graphs are being requested?"
if ($graph) {
$query = "INSERT INTO performance_metrics_graphs SET graph_type=:graph_type, time_taken=:time_taken, is_logged_in=:is_logged_in,\n days=:days, has_technicals=:has_technicals";
$args = array('graph_type' => substr($graph['graph_type'], 0, 32), 'time_taken' => $graph_time * 1000, 'is_logged_in' => user_logged_in() ? 1 : 0, 'days' => $graph['days'] ? $graph['days'] : null, 'has_technicals' => isset($graph['technicals']) && $graph['technicals'] ? 1 : 0);
$q = db()->prepare($query);
$q->execute($args);
}
}
开发者ID:phpsource,项目名称:openclerk,代码行数:25,代码来源:performance.php
示例18: t
<h1><?php
echo t("Support :site_name with Premium Accounts");
?>
</h1>
<?php
if (user_logged_in() && ($user = get_user(user_id()))) {
if ($user['is_premium']) {
?>
<div class="success success_float">
<?php
echo t("Thank you for supporting :site_name with :premium!", array(':premium' => link_to(url_for('user#user_premium'), ht("your premium account"))));
?>
<br>
<?php
echo t("Your premium account expires in :time.", array(":time" => recent_format_html($user['premium_expires'], " ago", "")));
?>
</div>
<?php
}
}
?>
<p>
<?php
$result = array();
foreach (get_site_config('premium_currencies') as $currency) {
$result[] = get_currency_name($currency);
}
echo t("You can support :site_name by purchasing a\n\tpremium account with :currencies currencies. You will also get access to exclusive, premium-only functionality such as\n\tvastly increased limits on the number of addresses and accounts you may track at once,\n\tand advanced reporting and notification functionality. Your jobs and reports will also have higher priority over free users.", array(":currencies" => implode_english($result)));
开发者ID:phpsource,项目名称:openclerk,代码行数:30,代码来源:premium.php
示例19: make_comment_from_id
function make_comment_from_id($comment_id)
{
$comment = get_comment_by_id($comment_id);
$user = find_user_by_id($comment["user_id"]);
$votes = get_votes_by_comment_id($comment_id);
$formatted_votes = format_votes($votes);
$avatar = get_user_avatar($comment["user_id"])["file_path"];
// bug where time since doesn;'t show, figure it out later (edit, this fixes that)
$time = format_time_in_words(strtotime($comment["date"]));
if ($time == "") {
$time_text = "now";
} else {
$time_text = $time . " ago ";
}
$output = "<div class=\"row comment_output_panel\" data-comment-id=\"{$comment_id}\">";
$output .= "<div>";
$output .= "<img class=\"left\" src=\"" . $avatar . "\"/>";
$output .= "</div>";
$output .= "<div class=\"comment_output\">";
$output .= "<div ><span class=\"comment_output_info_label\">";
$output .= "<a href=\"user.php?user=" . $comment["user_id"] . "\">" . $user["username"] . "</a>";
$output .= "</span> ";
$output .= "<span> " . $time_text . " </span></div>";
$output .= "<div>";
$output .= $comment["text"];
$output .= "</div>";
$output .= "<div class=\"vote_panel\">";
$output .= "<span class=\"upvote_button ";
if (user_logged_in() && already_upvoted($_SESSION["user_id"], $comment_id)) {
$output .= "upvote_button_clicked";
}
$output .= "\">";
$output .= "<i class=\"fi-like\" ></i> Upvote <span class=\"vote_display_box ";
if ($votes != "null" && (int) $votes > 0) {
$output .= " positive_votes ";
} else {
if ($votes != "null" && (int) $votes < 0) {
$output .= " negative_votes ";
} else {
if ($votes != "null" && (int) $votes == 0) {
$output .= " zero_votes ";
}
}
}
$output .= "\" >" . $formatted_votes . "</span>";
$output .= "</span>";
$output .= "<span class=\"downvote_button ";
if (user_logged_in() && already_downvoted($_SESSION["user_id"], $comment_id)) {
$output .= "downvote_button_clicked";
}
$output .= "\">";
$output .= "<i class=\"fi-dislike\" > </i>";
$output .= "</span>";
$output .= "</div>";
$output .= "</div>";
$output .= "</div>";
return $output;
}
开发者ID:0xCA2,项目名称:Hotline-To-Hell-Girl,代码行数:58,代码来源:functions.php
示例20: user_logged_in
<?php
require_once 'engine/init.php';
include 'layout/overall/header.php';
$logged_in = user_logged_in();
if ($logged_in === true) {
if (!empty($_POST['new'])) {
?>
<h1>Create image article</h1>
<p>Only works with "Direct link" URLs from <a href="http://www.imgland.net/">imgland.net</a>
<br />Don't understand? Don't worry! Watch this <a href="http://youtu.be/r9pEc7T3cJg" target="_BLANK">video guide!</a></p>
<form action="" method="post">
Image URL:<br /><input type="text" name="image" size="70"><br />
Image Title:<br /><input type="text" name="title" size="70"><br />
Image Description:<br /><textarea name="desc" cols="55" rows="15"></textarea><br />
<input type="submit" name="Submit" value="Post Image Article">
</form>
<?php
}
if (!empty($_POST['image']) && !empty($_POST['title']) && !empty($_POST['desc'])) {
$image = sanitize($_POST['image']);
$image = str_replace("www", "", str_replace(":", "", str_replace("/", "", str_replace(".", "!", str_replace("1m.yt", "", str_replace("http", "", $image))))));
$title = sanitize($_POST['title']);
$desc = sanitize($_POST['desc']);
// Insert to database
insertImage((int) $session_user_id, $title, $desc, $image);
$pw = explode("!", $image);
?>
<h1>Image Posted</h1>
<p>However, your image will not be listed until a GM have verified it.<br />
Feel free to remind the GM in-game to login on website and approve the image post.</p>
开发者ID:l04d,项目名称:ZnoteAAC,代码行数:31,代码来源:gallery.php
注:本文中的user_logged_in函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论