本文整理汇总了PHP中user::getRank方法的典型用法代码示例。如果您正苦于以下问题:PHP user::getRank方法的具体用法?PHP user::getRank怎么用?PHP user::getRank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user
的用法示例。
在下文中一共展示了user::getRank方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: database
<?php
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
if ($rank < 4) {
$base->redirect('../index.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title><?php
echo $data['wb_title'];
?>
</title>
<link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all">
<link rel="shortcut icon" href="../img/favicon.ico" />
<?php
include '../includes/google_analytics.html';
示例2: database
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/user.php';
require '../structure/msgcenter.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$msgcenter = new msgcenter($database);
$user = new user($database);
if (!$user->isLoggedIn()) {
$base->redirect('../index.php');
}
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$id = $_GET['id'];
if (!$msgcenter->canCreate($username, $rank) || $user->checkMute($username)) {
$content = 'You can\'t create a new conversation. <input type="button" class="button" value="Back" onclick="goBack()" />';
} elseif (!isset($_POST['title']) || !isset($_POST['reply'])) {
$content = '
<form action="create.php" method="POST">
<table>
<tr><td>Title</td><td align="left"><input type="text" class="button" name="title" maxlength="50"></td></tr>';
if ($rank > 3) {
$content .= '<tr><td>Mass Message</td><td align="left"><input type="checkbox" name="mass_message" id="mass"></td></tr><tr><td>Receiver</td><td align="left"><input type="text" class="button" name="receiver" id="receiver" maxlength="12"></td></tr>';
}
$content .= '
<tr><td>Message</td><td><textarea name="reply" class="button" cols="45" rows="20" maxlength="2000"></textarea></td></tr>
<tr><td></td><td align="left"><input type="submit" class="button" value="Create"></td></tr>
</table>
示例3: database
require '../structure/forum.post.php';
require '../structure/database.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$forum = new forum($database);
$forum_index = new forum_index($database);
$thread = new thread($database);
$post = new post($database);
$user->updateLastActive();
//get config
$config = $base->loadConfig();
//set some variables that are used a lot throughout the page
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$f = $_GET['forum'];
$i = $_GET['id'];
//preform basic checks
if (!ctype_digit($f) || !ctype_digit($i) || !$thread->checkExistence($i) || !$thread->canView($i, $username, $rank)) {
$base->redirect('index.php');
}
//if the GOTO field is set, let's skip to the selected post
if (ctype_digit($_GET['goto'])) {
$getPageNum = $thread->getPageNum($_GET['goto'], $i);
if ($getPageNum) {
$base->redirect('viewthread.php?forum=' . $f . '&id=' . $i . '&page=' . $getPageNum . '&highlight=' . $_GET['goto'] . '#' . $_GET['goto']);
}
}
//extract thread details
$detail_query = $database->processQuery("SELECT `id`,`lock`,`sticky`,`title`,`username`,`status`,`content`,`date`,`lastedit`,`qfc`,`moved`,`hidden`,`autohiding` FROM `threads` WHERE `id` = ? LIMIT 1", array($i), true);
示例4: database
require '../structure/forum.thread.php';
require '../structure/base.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$forum = new forum($database);
$thread_obj = new thread($database);
$user->updateLastActive();
//make sure required data is in the correct format AND they're logged in
if (!$user->isLoggedIn() || !ctype_digit($_REQUEST['forum']) || !ctype_digit($_REQUEST['id']) || !ctype_digit($_REQUEST['type']) || !ctype_digit($_REQUEST['pid']) && $_REQUEST['type'] == 1) {
$base->redirect('index.php');
}
//set some variables that are used a lot throughout the page
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$f = $_REQUEST['forum'];
$thread = $_REQUEST['id'];
//instead of typing it a million times, we're going to set our redirect url
$redirect = 'viewthread.php?forum=' . $f . '&id=' . $thread;
//make sure they are posting in a forum where they have permission
if ($user->checkMute($username) || !$thread_obj->canView($thread, $username, $rank) || !$thread_obj->canReply($thread, $rank)) {
$base->redirect($redirect);
}
//extract content for the set type
$data = $_REQUEST['type'] == 1 ? $database->processQuery("SELECT `content`,`username`,`status` FROM `posts` WHERE `id` = ?", array($_REQUEST['pid']), true) : $database->processQuery("SELECT `username`,`content`,`status`,`title` FROM `threads` WHERE `id` = ?", array($thread), true);
//check if they have permission to edit the thread/post
if ($rank < 3 && ($data[0]['username'] != $username || $data[0]['status'] == 1)) {
$base->redirect($redirect);
}
$type = $_POST['type'];
示例5: database
<?php
require '../includes/config.php';
require '../structure/database.php';
require '../structure/forum.php';
require '../structure/forum.thread.php';
require '../structure/base.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$thread = new thread($database);
$base = new base($database);
$user = new user($database);
$user->updateLastActive();
//useful variables
$rank = $user->getRank($user->getUsername($_COOKIE['user'], 2));
if ($rank < 4) {
$base->redirect('../index.php');
}
//toggle the maintenance status of the site
$m = $database->processQuery("SELECT `maintenance` FROM `config`", array(), true);
$database->processQuery("UPDATE `config` SET `maintenance` = ?", array($m[0]['maintenance'] == 0 ? 1 : 0), false);
$redirect = 'http://www.Asgarniax.org/admin/index.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<!-- LeeStrong Runescape Website Source --!>
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"><!-- /Added by HTTrack -->
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
示例6: database
<?php
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
if ($rank < 4) {
$base->redirect('../index.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title><?php
echo $data['wb_title'];
?>
</title>
<link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all">
<link rel="shortcut icon" href="../img/favicon.ico" />
<?php
include '../includes/google_analytics.html';
?>
示例7: base
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/forum.php';
require '../structure/forum.thread.php';
require '../structure/user.php';
$base = new base();
$database = new database($db_host, $db_name, $db_user, $db_password);
$user = new user($database);
$forum = new forum($database);
$thread_obj = new thread($database);
$user->updateLastActive();
//get the user's rank and username, and set the forum variable (less typing)
$username = $user->getUsername($_COOKIE['user'], 0);
$rank = $user->getRank($username);
$f = $_GET['forum'];
//let's also make sure they have the right permissions to view the forum
if ($forum->canView($f, $rank) == false) {
$base->redirect('index.php');
}
//check if a moderator is taking action against threads
if (isset($_POST['action']) && isset($_POST['selection']) && $rank > 2) {
//get all the threads we're going to update
foreach ($_POST['selection'] as $object) {
$threads .= $object . '-';
}
//now send them off to action.php to update all the threads selected
$base->redirect('action.php?forum=' . $f . '&action=' . $_POST['action'] . '&threads=' . $threads);
}
$forum_details = $database->processQuery("SELECT `icon`,`title`,`type` FROM `forums` WHERE `id` = ? LIMIT 1", array($f), true);
示例8: database
<?php
require '../../includes/config.php';
require '../../structure/database.php';
require '../../structure/base.php';
require '../../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
if ($rank < 3) {
$base->redirect('../../index.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title><?php
echo $data['wb_title'];
?>
</title>
<link href="../../css/basic-3.css" rel="stylesheet" type="text/css" media="all">
<link rel="shortcut icon" href="../../img/favicon.ico" />
<?php
include '../../includes/google_analytics.html';
示例9: database
<?php
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/user.php';
require '../structure/msgcenter.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$msgcenter = new msgcenter($database);
$user = new user($database);
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$id = $_GET['id'];
if (!$user->isLoggedIn()) {
$base->redirect('../index.php');
}
if (!$msgcenter->canView($_GET['id'], $username, $rank)) {
$base->redirect('index.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title><?php
echo $data['wb_title'];
示例10: database
<?php
require '../includes/config.php';
require '../structure/database.php';
require '../structure/base.php';
require '../structure/user.php';
require '../structure/user.register.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$user->updateLastActive();
$register = new user_register($database);
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
if ($rank < 4) {
$base->redirect('../index.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title><?php
echo $data['wb_title'];
?>
</title>
<link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all">
<link rel="shortcut icon" href="../img/favicon.ico" />
示例11: database
require '../../includes/config.php';
require '../../structure/database.php';
require '../../structure/forum.php';
require '../../structure/forum.thread.php';
require '../../structure/base.php';
require '../../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$thread = new thread($database);
$base = new base($database);
$user = new user($database);
$user->updateLastActive();
$username = $user->getUsername($_COOKIE['user'], 2);
//get the user's last bump
$data = $database->processQuery("SELECT `lastbump` FROM `users` WHERE `username` = ?", array($username), true);
if (time() - $data[0]['lastbump'] > 3600 && $thread->canReply($_GET['id'], $user->getRank($username))) {
$thread->bumpThread($_GET['id'], $username);
} else {
$base->redirect('../viewthread.php?forum=' . $_GET['forum'] . '&id=' . $_GET['id'] . '&goto=start');
}
$redirect = 'http://' . $path . 'forums/viewthread.php?forum=' . $_GET['forum'] . '&id=' . $_GET['id'] . '&goto=start';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<!-- LeeStrong Runescape Website Source --!>
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"><!-- /Added by HTTrack -->
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">