本文整理汇总了PHP中WCF::getAuthorInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP WCF::getAuthorInfo方法的具体用法?PHP WCF::getAuthorInfo怎么用?PHP WCF::getAuthorInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCF
的用法示例。
在下文中一共展示了WCF::getAuthorInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
//Free mem
unset($res);
//Verify that we have permissions to edit
//Start by checking if we own that post
if ($CURUSER->get('id') != $Post['author']) {
//Since we dont own the post
//Check if we have the minimum required rank
if ($CURUSER->getRank()->int() < $config['FORUM']['Min_Rank_Post_Edit']) {
WCF::SetupNotification('You do not meet the requirements to edit this post.');
header("Location: " . $config['BaseURL'] . "/forums.php");
die;
} else {
//We have the minimum required rank
//now check if the authoer is lower rank
//If the author is not resolved we assume he is lower rank
if ($userInfo = WCF::getAuthorInfo($Post['author'])) {
//Get the poster rank
$userRank = new UserRank($userInfo['rank']);
//The author has equal or geater rank, we cant delete his post
if ($CURUSER->getRank()->int() <= $userRank->int()) {
WCF::SetupNotification('You do not meet the requirements to edit this post.');
header("Location: " . $config['BaseURL'] . "/forums.php");
die;
}
}
}
}
//Set the title
$TPL->SetTitle('Edit Reply');
$TPL->SetParameter('topbar', true);
//Print the header
示例2: UserRank
$userRank = new UserRank(0);
$arr['author_str'] = 'Unknown';
$arr['author_rank'] = 'Unknown';
$gallery = new AvatarGallery();
$Avatar = $gallery->get(0);
unset($gallery);
}
//format the time
$arr['added'] = date('D M j, Y, h:i A', strtotime($arr['added']));
//Is staff post
$staffPost = $CORE->hasFlag((int) $arr['flags'], WCF_FLAGS_STAFF_POST);
//Is deleted
$deletedPost = (int) $arr['deleted_by'] > 0 ? true : false;
//Resolve the deletion author
if ($deletedPost) {
$userInfo = WCF::getAuthorInfo($arr['deleted_by']);
$arr['deleted_by_str'] = $userInfo['displayName'];
unset($userInfo);
$arr['deleted_time'] = date('D M j, Y, h:i A', strtotime($arr['deleted_time']));
}
echo '
<!-- Topic Post -->
<div class="topic_post', $staffPost ? ' admin_post' : '', $deletedPost ? ' deleted_post' : '', '" id="post-', $arr['id'], '">';
if ($staffPost) {
echo '<!-- Admin Warcry WoW post -->
<div class="admin_post_logo_wc"></div>';
}
echo '
<div class="left_side">
<div class="user_avatar">';