本文整理汇总了PHP中Feed::user_priv方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::user_priv方法的具体用法?PHP Feed::user_priv怎么用?PHP Feed::user_priv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::user_priv方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
function indexAction()
{
$sql = "SELECT feed_content.feed_id as feed_id, COUNT(content.id) as cnt\n FROM feed_content\n LEFT JOIN content ON feed_content.content_id = content.id\n WHERE feed_content.moderation_flag IS NULL\n GROUP BY feed_content.feed_id;";
$res = sql_query($sql);
for ($i = 0; $row = sql_row_keyed($res, $i); ++$i) {
$this->count[$row['feed_id']] = $row['cnt'];
$new_feed = new Feed($row['feed_id']);
if ($new_feed->user_priv($_SESSION['user'], 'moderate')) {
$this->feeds[] = $new_feed;
}
}
$this->setTitle('Moderation');
$this->setSubject('Moderate');
}
示例2: COUNT
</div>
<?php
if(isLoggedIn()) {
$sql = 'SELECT feed_content.feed_id as feed_id, COUNT(content.id) as cnt '.
'FROM feed_content '.
'LEFT JOIN content ON feed_content.content_id = content.id '.
'WHERE feed_content.moderation_flag IS NULL '.
'GROUP BY feed_content.feed_id;';
$res = sql_query($sql);
$more_waiting = 0;
for($i = 0;$row = sql_row_keyed($res,$i);++$i){
$count = $row['cnt'];
$feed = new Feed($row['feed_id']);
if($feed->user_priv($_SESSION['user'], 'moderate',true)) {
$mod_feeds[]="<p><a href=\"".ADMIN_URL."/moderate/feed/{$feed->id}\">" . htmlspecialchars($feed->name) . " ({$row['cnt']})</a></p>";
} else {
$more_waiting += $row['cnt'];
}
}
}
if(isset($mod_feeds) || ($more_waiting && isAdmin())) {
?>
<div class="alert_box">
<div class="alert_box_inset">
<div class="alert_box_padding">
<h1><a href="<?=ADMIN_URL?>/moderate">Awaiting Moderation</a></h1>
<?= isset($mod_feeds) ? join("\n", $mod_feeds) : "Nothing in your feeds." ?>
<? if ($more_waiting > 0 && isAdmin()) {?>
<p><a href="<?=ADMIN_URL?>/moderate"><?=$more_waiting?> items in other feeds...</a></p>