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


PHP Comments::getUserComments方法代码示例

本文整理汇总了PHP中Comments::getUserComments方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::getUserComments方法的具体用法?PHP Comments::getUserComments怎么用?PHP Comments::getUserComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comments的用法示例。


在下文中一共展示了Comments::getUserComments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayComment

            break;
        case 6:
            return MARKSMAN_LEVEL_6;
            break;
        case 7:
            return MARKSMAN_LEVEL_7;
            break;
        case 8:
            return MARKSMAN_LEVEL_8;
            break;
    }
}
/*
 * Getting all arrrays to show in bottom notifications
 */
$myComments = Comments::getUserComments($user->getID());
$battleHistory = User::getBattleHistory($_SESSION['userID']);
$broadcastmsg = $user->getBroadcastMessages();
// this function needs to be change
function displayComment($index)
{
    global $myComments;
    $sender = User::getUser($myComments[$index]->getSenderID());
    $senderName = $sender->getName();
    $commentID = $myComments[$index]->getCommentID();
    $content = $myComments[$index]->getContent();
    $html = '<div class="newsinfo">
                <p class="infonews"><strong><a href="#">' . $senderName . '</a> commented</strong><br />
                    "' . $content . '"
                </p>	
            </div>';
开发者ID:ng2k12,项目名称:MercInc,代码行数:31,代码来源:charhome.php

示例2: validateRoute

 case validateRoute('PATCH', 'users/\\d+'):
     $response = $user->update((int) $params[1], $postdata);
     httpResponse();
     break;
 case validateRoute('GET', 'users/\\d+/torrents'):
     $arr = $user->getUserTorrents((int) $params[1], (int) $_GET["requests"]);
     httpResponse($arr);
     break;
 case validateRoute('GET', 'users/\\d+/torrent-comments'):
     $comments = new Comments($db, $user);
     list($result, $totalCount) = $comments->getCommentsForUserTorrents((int) $params[1], (int) $_GET["limit"] ?: 10, (int) $_GET["index"] ?: 0);
     httpResponse($result, $totalCount);
     break;
 case validateRoute('GET', 'users/\\d+/comments'):
     $comments = new Comments($db, $user);
     list($result, $totalCount) = $comments->getUserComments((int) $params[1], (int) $_GET["limit"] ?: 10, (int) $_GET["index"] ?: 0);
     httpResponse($result, $totalCount);
     break;
 case validateRoute('GET', 'users/\\d+/peers'):
     list($seeding, $leeching) = $user->getPeers($params[1] ?: 0);
     httpResponse(array("seeding" => $seeding, "leeching" => $leeching));
     break;
 case validateRoute('GET', 'users/\\d+/invitees'):
     $invitees = $user->getInvitees($params[1] ?: 0);
     httpResponse($invitees);
     break;
 case validateRoute('GET', 'users/\\d+/bonuslog'):
     $bonuslog = $user->getBonusLog($params[1] ?: 0, (int) $_GET["limit"] ?: 10);
     httpResponse($bonuslog);
     break;
 case validateRoute('GET', 'users/\\d+/iplog'):
开发者ID:lordgabber,项目名称:rartracker,代码行数:31,代码来源:api-v1.php

示例3: validateComment

    <div id="two">
        <a class="inlinecontent abshide" href="#inline1"> </a>
        <form method="POST" action="backend/commentactions.php?action=post&screen=externalProfile"  onsubmit="return validateComment();"  >
            <textarea id ="coment" class="comment" name="content" maxlength = "250"></textarea>
            <input type="submit" class="commentbutton" value="Post Comment" />
            <input type="hidden" value="<?php 
echo $_SESSION['userID'];
?>
" name="sender_id" >
            <input type="hidden" value="<?php 
echo $userID;
?>
" name="receiver_id" >
        </form>
<?php 
$myComments = Comments::getUserComments($userID);
foreach ($myComments as $comment) {
    $sender = User::getUser($comment->getSenderID());
    ?>
            <div class="commentpost">
                <a href="profile.php"><?php 
    echo $sender->getName();
    ?>
</a>

            <?php 
    if ($comment->getSenderID() == $_SESSION['userID']) {
        ?>
                    <a class="commentdelete" href="backend/commentactions.php?action=delete&receiver_id=<?php 
        echo $userID;
        ?>
开发者ID:ng2k12,项目名称:MercInc,代码行数:31,代码来源:externalplayerprofile.php


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