本文整理汇总了PHP中rights函数的典型用法代码示例。如果您正苦于以下问题:PHP rights函数的具体用法?PHP rights怎么用?PHP rights使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rights函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rights
<?php
require_once '../frame.php';
rights($_SESSION["hoaurights"], '3');
//var_dump($_POST);
$id = $_POST['id'];
$price = new table_class('hoau_drd_price');
if ($id != '') {
$price->find($id);
}
$pid = province_update('hoau_drd_price', '0', $_POST['drd']['startprovince']);
province_update('hoau_drd_price', '1', $_POST['drd']['startcity'], $pid);
$pid = province_update('hoau_drd_price', '0', $_POST['drd']['endprovince']);
province_update('hoau_drd_price', '1', $_POST['drd']['endcity'], $pid);
$price->update_attributes($_POST['drd']);
redirect($_POST['url']);
示例2: hot
hot($con, $token);
} else {
if ($ask == "news") {
news($con, $token);
} else {
if ($ask == "tidinfo") {
tidinfo($con, $bid, $tid);
} else {
if ($ask == "recentpost") {
recentpost($con, $view);
} else {
if ($ask == "recentreply") {
recentreply($con, $view);
} else {
if ($ask == "rights") {
rights($con, $bid, $token);
} else {
if ($ask == "attach") {
attach($con, $token, $path, $filename, $price, $auth);
} else {
if ($ask == "attachdl") {
attachdl($con, $token, $id);
} else {
if ($ask == "attachinfo") {
attachinfo($con, $id, $token);
} else {
if ($ask == "unusedattachinfo") {
unusedattachinfo($con, $token);
} else {
if ($ask == "delattach") {
delattach($con, $token, $id);
示例3: session_start
<?php
session_start();
include "functions.php";
if (rights($_SESSION['user']) != 'admin') {
header("Location: index.php");
exit;
}
phpinfo();
示例4: elseif
} else {
echo '24';
}
echo '"> <a href="#"><img src="images/check.gif" border="0" onclick="document.edit.submit();"></a></div>';
} else {
echo '</td></tr></table></div>';
}
echo '</h1><h2><a href="analyze.php?u=' . $author . '"';
if (rights($author) == 'admin') {
echo ' style="color: #CC0000;" title="' . $author . ' is an administrator."';
} elseif (rights($author) == 'moderator') {
echo ' style="color: #00CC00;" title="' . $author . ' is a moderator."';
}
echo '>' . $author . '</a></h2>';
echo '<br /><div id="description" class="shown">' . $description;
if ($_SESSION['user'] == $author || rights($_SESSION['user']) == 'admin' || rights($_SESSION['user']) == 'moderator') {
echo ' <a href="#"><img src="images/edit.gif" border="0" onclick="editDescription()"></a></div>';
echo '<div id="editDescription" class="hidden"><textarea name="newDescription" class="editDescription" cols="64" rows="10">' . $editdescription . '</textarea> <a href="#"><img src="images/check.gif" border="0" onclick="document.edit.submit();"></a></div>';
}
echo '<br /> <br /> <br />';
if (isset($_SESSION['user'])) {
if (checkUserInfo("viewed", $_REQUEST['id']) === false) {
setInfo($_REQUEST['id'], "views", strval(intval(getInfo($_REQUEST['id'], "views")) + 1));
setUserInfo("viewed", $_REQUEST['id']);
}
}
$rating = getInfo($_REQUEST['id'], "rating");
if (empty($rating)) {
echo '<table align="center" cellpadding="0" cellspacing="0"><tr><td style="font-weight: bold;">Track Rating:</td><td width="8"></td><td style="background: url(\'nostars.png\'); color: #FFFFFF;" width="86">Not Yet Rated</td></tr>';
if ($_SESSION['user'] != $author && isset($_SESSION['user'])) {
echo '<tr class="trshown" id="ratebutton"><td colspan="4" align="center"><input type="button" value="Rate It!" class="rateit" onclick="rateIt();"></td></tr>';
示例5: shadow
shadow();
echo '<input type="image" src="images/cancel.gif" onclick="document.getElementById(\'addMessage\').className = \'shown\';document.getElementById(\'messageBox\').className = \'hidden\';">';
endShadow();
echo '</td></tr></table>';
echo '<br />';
echo '</div>';
echo '</form>';
for ($i = count($shout) - $cInfo - 1; $i >= 0; $i -= $cInfo) {
$max--;
if ($max < 0) {
break;
}
echo '<b><a href="analyze.php?u=' . $shout[$i] . '"';
if (rights($shout[$i]) == 'admin') {
echo ' style="color: #CC0000;" title="' . $shout[$i] . ' is an administrator."';
} elseif (rights($shout[$i]) == 'moderator') {
echo ' style="color: #00CC00;" title="' . $shout[$i] . ' is a moderator."';
}
echo '>' . $shout[$i] . '</a></b>';
echo '<br />' . $shout[$i + 2];
if ($i > 0 && $max > 0) {
$tmp = $i / 3 % 3;
if ($tmp == 0) {
echo '<hr size="1" color="#CCCCFF">';
} elseif ($tmp == 1) {
echo '<hr size="1" color="#FFCCCC">';
} elseif ($tmp == 2) {
echo '<hr size="1" color="#CCFFCC">';
}
}
}
示例6: mysql_query
if (empty($_GET['sort'])) {
$_GET['sort'] = 'id';
}
if (empty($_GET['order'])) {
$_GET['order'] = 'ASC';
}
//$result = mysql_query("SELECT * FROM users WHERE id BETWEEN " . $_GET['from'] . " AND " . $_GET['to'] ." ORDER BY " . $_GET['sort']);
$result = mysql_query("SELECT * FROM users ORDER BY " . $_GET['sort'] . " " . $_GET['order'] . " LIMIT " . $_GET['from'] . ", " . ($_GET['to'] - $_GET['from']));
groupHead("<center>Users</center>", "", "", 400);
echo '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
echo '<tr><td width="4%" align="right" style="font-weight: bold;">#</td><td width="1%"></td><td width="50%" style="font-weight: bold;">Username</td><td width="45%" style="font-weight: bold;">Joined</td></tr>';
while ($row = mysql_fetch_array($result)) {
echo '<tr><td align="right">' . $row['id'] . '.</td><td></td><td><a href="analyze.php?u=' . $row['name'] . '"';
if (rights($row['name']) == 'admin') {
echo ' style="color: #CC0000;" title="' . $row['name'] . ' is an administrator."';
} elseif (rights($row['name']) == 'moderator') {
echo ' style="color: #00CC00;" title="' . $row['name'] . ' is a moderator."';
}
echo '>' . $row['name'] . '</a></td><td>' . date("n/d/y (g:i:s A)", $row['joined'] + 10800) . '</td></tr>';
}
echo '<tr><form name="options" action="moderator.php" method="GET"><td colspan="5" align="center">
<input type="button" value="<< BACK 100 <<" onclick="document.options.from.value = ' . ($_GET['from'] - 100) . '; document.options.to.value = ' . $_GET['from'] . '; document.options.submit();" ' . ($_GET['from'] < 100 ? 'disabled="true"' : '') . '>
<input type="button" value=">> NEXT 100 >>" onclick="document.options.from.value = ' . ($_GET['from'] + 100) . '; document.options.to.value = ' . ($_GET['from'] + 200) . '; document.options.submit();">
<select name="sort" onchange="document.options.submit();">
<option value="id" ' . ($_GET['sort'] == 'id' ? 'selected="true"' : '') . '>ID</option>
<option value="name" ' . ($_GET['sort'] == 'name' ? 'selected="true"' : '') . '>Username</option>
<option value="joined" ' . ($_GET['sort'] == 'joined' ? 'selected="true"' : '') . '>Join Date</option>
</select>
<select name="order" onchange="document.options.submit();">
示例7: date
echo '<b>' . date('F jS, Y') . '</b>';
?>
</td><td class="homebar" align="center" width="50%">
<?php
echo '| ';
echo '<a href="index.php" class="homelink">Home</a>';
if (isset($_SESSION['user'])) {
echo ' | <a href="manager.php" class="homelink">Manager</a>';
echo ' | <a href="analyze.php" class="homelink">Analyze</a>';
}
echo ' | <a href="faq.php" class="homelink">FAQ</a>';
echo ' | <a href="tracks.php" class="homelink">All Tracks</a>';
if (rights($_SESSION['user']) == 'admin') {
echo ' | <a href="admin.php" style="color: #CC0000; font-weight: bold;">Admin</a>';
}
if (rights($_SESSION['user']) == 'admin' || rights($_SESSION['user']) == 'moderator') {
echo ' | <a href="moderator.php" style="color: #00CC00; font-weight: bold;">Mod</a>';
}
echo ' |';
?>
<!--| <a target="_parent" href="http://www.linerider.org" class="homelink">Home</a> | <a target="_parent" href="http://www.linerider.org/forum/index.php" class="homelink">Forum</a> | <a target="_parent" href="http://www.linerider.org/downloads.php" class="homelink">Downloads</a> | <a target="_parent" href="http://www.linerider.org/movies/" class="homelink">Movies</a> | <a target="_parent" href="http://share.linerider.org/" class="homelink">Share</a> |-->
</td><td class="homebar" align="right" width="25%">
<?php
if (isset($_SESSION['user'])) {
echo 'Logged in as <b>' . $_SESSION['user'] . '</b>. <a href="login.php?logout=true">Logout</a>';
} else {
echo '<a href="login.php">Login</a> | <a href="login.php?r=true">Register</a>';
}
echo '<br />';
echo '<form name="searchForm" action="search.php" method="post">';
echo '<script>sclicked = false;</script>';
示例8: explode
echo '<tr><td>There are no tracks in this users manager.</td></tr>';
} else {
if (!file_exists("tracks/managers/" . $_SESSION['user'] . ".manager")) {
echo '<tr><td>There are no tracks in this users manager.</td></tr>';
} else {
if (filesize("tracks/managers/" . $_SESSION['user'] . ".manager") == 0) {
echo '<tr><td>There are no tracks in this users manager.</td></tr>';
} else {
$manager = explode("\r\n", file_get_contents("tracks/managers/" . $u . ".manager"));
echo '<tr><td width="5%"><i>#</i></td><td align="right" width="8%"><b>ID</b></td><td width="2%"></td><td width="50%">Name</td><td width="35%">Author</td></tr>';
for ($i = 0; $i < count($manager) - 1; $i++) {
$author = getInfo($manager[$i], "author");
echo '<tr><td><i>' . ($i + 1) . '.</i></td><td align="right"><a href="track.php?id=' . $manager[$i] . '">' . $manager[$i] . '.</a></td><td></td><td><a href="track.php?id=' . $manager[$i] . '" style="font-weight: bold;">' . getInfo($manager[$i], "label") . '</a></td><td><a href="analyze.php?u=' . $author . '"';
if (rights($author) == 'admin') {
echo ' style="color: #CC0000;" title="' . $author . ' is an administrator."';
} elseif (rights($author) == 'moderator') {
echo ' style="color: #00CC00;" title="' . $author . ' is a moderator."';
}
echo '>' . $author . '</a></td></tr>';
}
}
}
}
echo '<tr><td></td></tr>';
echo '</table>';
groupFoot($userColor);
echo '</td></tr><tr><td align="center" align="center">';
groupHead("<center>" . $u . "'s Tracks</center>", $userColor);
$trackCount = 0;
// # of track in the manager
$trackSize = array();
示例9: elseif
if ($sstart == "yes") { echo ' checked="checked";'; }
echo '> Show start position';
echo '</td></tr></table>'; // X7
echo '</td></tr></table>'; // X4
echo '<br /> ';
echo '<br /><center><input type="submit" value=" Save Changes "></center>';
echo '<br /> ';
echo '</form>' . $nl;
echo '</div>' . $nl; Advanced editing part throws everything out of wack */
echo '</td>' . $nl;
echo '<td width="25%" align="center" valign="middle" style="cursor:hand" class="offauthor" onMouseOver="this.className=\'author\'" onMouseOut="this.className=\'offauthor\'"><b><a href="analyze.php?u=' . $info[2] . '"';
if (rights($info[2]) == 'admin') {
echo ' style="color: #CC0000;" title="' . $info[2] . ' is an administrator."';
} elseif (rights($info[2]) == 'moderator') {
echo ' style="color: #00CC00;" title="' . $info[2] . ' is a moderator."';
}
echo '>' . $info[2] . '</a></b></td>' . $nl;
echo '<td width="15%" align="center" valign="middle" class="offother" onMouseOver="this.className=\'other\'" onMouseOut="this.className=\'offother\'"><table cellpadding="0" cellspacing="0" border="0"><tr><td><a href="#"><img src="images/remove.gif" alt="Remove ' . $info[1] . '" border="0" onclick="removeTrack(' . $info[0] . ', \'' . $info[1] . '\')"></a></td>' . $nl;
echo '<td width="4"></td>' . $nl;
if ($info[2] == $_SESSION['user']) {
echo '<td><a href="#"><img src="images/delete.gif" alt="Delete ' . $info[1] . '" border="0" onclick="deleteTrack(' . $info[0] . ', \'' . $info[1] . '\')"></a></td>' . $nl;
echo '<td width="4"></td>' . $nl;
} else {
echo '<td><img src="images/nodelete.gif" alt="Can\'t Delete ' . $info[1] . '" border="0"></td>' . $nl;
echo '<td width="4"></td>' . $nl;
}
echo '</tr></table>' . $nl;
// X3
echo $nl . $nl . $nl;
示例10: while
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 800;
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
';
/*********** GOOGLE ANALYTICS SEARCH RESULTS ************/
echo '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
echo '<tr><td width="6%" class="header" align="right">ID <a href="tracks.php?a=id&o=asc"><img src="images/asc.png" border="0"></a><a href="tracks.php?a=id&o=desc"><img src="images/desc.png" border="0"></a></td><td width="1%"></td><td width="28%" class="header">Name <a href="tracks.php?a=name&o=asc"><img src="images/asc.png" border="0"></a><a href="tracks.php?a=name&o=desc"><img src="images/desc.png" border="0"></a></td><td width="14%" class="header">Author <a href="tracks.php?a=author&o=asc"><img src="images/asc.png" border="0"></a><a href="tracks.php?a=author&o=desc"><img src="images/desc.png" border="0"></a></td><td width="16%" class="header">Creation Date <a href="tracks.php?a=created&o=asc"><img src="images/asc.png" border="0"></a><a href="tracks.php?a=created&o=desc"><img src="images/desc.png" border="0"></a></td><td width="9%" class="header">Views <a href="tracks.php?a=views&o=asc"><img src="images/asc.png" border="0"></a><a href="tracks.php?a=views&o=desc"><img src="images/desc.png" border="0"></a></td><td width="13%" class="header">Downloads <a href="tracks.php?a=downloads&o=asc"><img src="images/asc.png" border="0"></a><a href="tracks.php?a=downloads&o=desc"><img src="images/desc.png" border="0"></a></td></tr>';
while ($row = mysql_fetch_array($result)) {
$row['avg'] = avgRating($row['rating']) * 16 + 2;
echo '<tr height="16" class="dull" onMouseOver="this.className=\'bright\';" onMouseOut="this.className=\'dull\';"><td align="right"><a href="track.php?id=' . $row['id'] . '" title="Track #' . $row['id'] . '">' . $row['id'] . '.</a></td><td></td><td><b><a href="track.php?id=' . $row['id'] . '">' . $row['label'] . '</a></b></td><td><a href="analyze.php?u=' . $row['author'] . '"';
if (rights($row['author']) == 'admin') {
echo ' style="color: #CC0000;" title="' . $row['author'] . ' is an administrator."';
} elseif (rights($row['author']) == 'moderator') {
echo ' style="color: #00CC00;" title="' . $row['author'] . ' is a moderator."';
}
echo '>' . $row['author'] . '</a></td><td>' . date("n/d/y (g:i A)", $row['created']) . '</td>';
echo '<td>' . $row['views'] . '</td><td>' . $row['downloads'] . '</td></tr>';
}
echo '<tr><td colspan="7"><hr size="1" color="#666699" /></td></tr>';
echo '<tr><td colspan="7"><form name="options" action="tracks.php" method="GET">
<input type="button" value="< Back" onclick="document.options.from.value = ' . ($_REQUEST['from'] - 100) . '; document.options.to.value = ' . $_REQUEST['from'] . '; document.options.submit();" ' . ($_REQUEST['from'] < 100 ? 'disabled="true"' : '') . '>
<input type="button" value="Next >" onclick="document.options.from.value = ' . ($_REQUEST['from'] + 100) . '; document.options.to.value = ' . ($_REQUEST['from'] + 200) . '; document.options.submit();" ' . ($_REQUEST['to'] > $last - 100 ? 'disabled="true"' : '') . '>
<select name="a" onchange="document.options.submit();">
<option value="id" ' . ($_REQUEST['a'] == 'id' ? 'selected="true"' : '') . '>ID</option>
<option value="name" ' . ($_REQUEST['a'] == 'name' ? 'selected="true"' : '') . '>Username</option>
<option value="author" ' . ($_REQUEST['a'] == 'author' ? 'selected="true"' : '') . '>Author</option>