本文整理汇总了PHP中AUTH::admin_logged_in方法的典型用法代码示例。如果您正苦于以下问题:PHP AUTH::admin_logged_in方法的具体用法?PHP AUTH::admin_logged_in怎么用?PHP AUTH::admin_logged_in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AUTH
的用法示例。
在下文中一共展示了AUTH::admin_logged_in方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_suggestion
function display_suggestion($suggestion_row)
{
$database = DB::getInstance();
$db = $database->getConnection();
//lets determine, if this user has already voted on this:
$mysql['user_id'] = $db->real_escape_string($_SESSION['user_id']);
$mysql['suggestion_id'] = $db->real_escape_string($suggestion_row['suggestion_id']);
$votes_sql = "SELECT * FROM suggestion_votes WHERE user_id='" . $mysql['user_id'] . "' AND suggestion_id='" . $mysql['suggestion_id'] . "'";
$votes_result = _mysqli_query($votes_sql);
//($votes_sql);
$already_voted = '';
if ($votes_result->num_rows > 0) {
$already_voted = '1';
}
if ($suggestion_row['votes'] > 0) {
$suggestion_row['votes'] = '+' . $suggestion_row['votes'];
}
$mysql['user_id'] = $db->real_escape_string($suggestion_row['user_id']);
$user_sql = "SELECT user_username FROM users WHERE user_id='" . $mysql['user_id'] . "'";
$user_result = _mysqli_query($user_sql);
//($user_sql);
$user_row = $user_result->fetch_assoc();
$html['suggestion_id'] = htmlentities($suggestion_row['suggestion_id'], ENT_QUOTES, 'UTF-8');
$html['user_username'] = htmlentities($user_row['user_username'], ENT_QUOTES, 'UTF-8');
$html['suggestion_time'] = date('M d, Y', $suggestion_row['suggestion_time']);
$html['suggestion_votes'] = htmlentities($suggestion_row['suggestion_votes'], ENT_QUOTES, 'UTF-8');
$html['suggestion_text'] = htmlentities($suggestion_row['suggestion_text'], ENT_QUOTES, 'UTF-8');
?>
<li id="c-comment<?php
echo $html['suggestion_id'];
?>
">
<table class="c-table" cellspacing="0" cellpadding="0">
<tr class="c-head">
<td class="c-info"><strong><?php
echo $html['user_username'];
?>
</strong> <span class="c-time"><?php
echo $html['suggestion_time'];
?>
</span></td>
<td class="c-votes" id="c-votes<?php
echo $html['suggestion_id'];
?>
"><?php
echo $html['suggestion_votes'];
?>
rating</td>
<td class="c-vote-no">
<img id="c-vote-no<?php
echo $html['suggestion_id'];
?>
" src="/202-img/icons/18x18/vote-no<?php
if ($already_voted == '1') {
echo '-off';
}
?>
.png" alt="Vote No" title="Vote No" <?php
if ($already_voted != '1') {
?>
onclick="vote('<?php
echo $html['suggestion_id'];
?>
','','1');" <?php
}
?>
/>
</td>
<td class="c-vote-yes">
<img id="c-vote-yes<?php
echo $html['suggestion_id'];
?>
" src="/202-img/icons/18x18/vote-yes<?php
if ($already_voted == '1') {
echo '-off';
}
?>
.png" alt="Vote Yes" title="Vote Yes" <?php
if ($already_voted != '1') {
?>
onclick="vote('<?php
echo $html['suggestion_id'];
?>
','1','');" <?php
}
?>
/>
</td>
<?php
if (AUTH::admin_logged_in() == true) {
?>
<td class="c-delete">
<img id="c-delete<?php
echo $html['suggestion_id'];
?>
" src="/202-img/icons/16x16/cancel.png" title="Delete" onclick="deleteComment('<?php
echo $html['suggestion_id'];
?>
//.........这里部分代码省略.........