当前位置: 首页>>代码示例>>PHP>>正文


PHP WCF::getAuthorInfo方法代码示例

本文整理汇总了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
开发者ID:Jougito,项目名称:DynWeb,代码行数:31,代码来源:edit_reply.php

示例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">';
开发者ID:Jougito,项目名称:DynWeb,代码行数:31,代码来源:topic.php


注:本文中的WCF::getAuthorInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。