本文整理汇总了PHP中post::numComments方法的典型用法代码示例。如果您正苦于以下问题:PHP post::numComments方法的具体用法?PHP post::numComments怎么用?PHP post::numComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类post
的用法示例。
在下文中一共展示了post::numComments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
$D->idpostShared = $D->idpost;
$D->isShare = 0;
if ($D->typepost == 'share') {
$infop = explode(':', $D->valueattach);
$D->idpostShared = $infop[0];
$D->isShare = 1;
}
// see if the favorite is for the observer
$D->liketoUser = 0;
if ($D->is_logged == 1) {
if ($onePost->likeOfUser($this->user->id) > 0) {
$D->liketoUser = 1;
}
}
$D->htmlcommentspost = '';
$D->totalcomments = $onePost->numComments();
$allcommentspost = $onePost->getComments(0, $C->NUM_COMMENTS_PER_POST);
$D->numcomments = count($allcommentspost);
$allcommentspost = array_reverse($allcommentspost);
foreach ($allcommentspost as $onecomment) {
$D->o_comment = stripslashes($onecomment->comment);
$D->o_username = stripslashes($onecomment->username);
$D->o_firstname = stripslashes($onecomment->firstname);
$D->o_lastname = stripslashes($onecomment->lastname);
$D->o_ucode = $onecomment->ucode;
$D->o_nameUser = empty($D->o_firstname) || empty($D->o_lastname) ? stripslashes($D->o_username) : stripslashes($D->o_firstname) . ' ' . stripslashes($D->o_lastname);
$D->o_whendate = $onecomment->whendate;
$D->o_avatar = empty($onecomment->avatar) ? $C->AVATAR_DEFAULT : $onecomment->avatar;
$D->o_idcomment = $onecomment->idcomment;
$D->o_idUser = $onecomment->iduser;
$D->o_idpost = $D->idpost;
示例2: post
$numitems = $this->db1->e($_POST["ni"]);
}
if (empty($codepost)) {
$errored = 1;
$txterror .= 'Error. ';
}
if (!is_numeric($numitems) || $numitems <= 0) {
$errored = 1;
$txterror .= 'Error. ';
}
if ($errored == 1) {
echo '0: ' . $txterror;
} else {
$onePost = new post($codepost);
$htmlResults = '';
$totalitems = $onePost->numComments();
$allcommentspost = $onePost->getComments($numitems, $C->NUM_COMMENTS_PER_POST);
$numitemsnow = count($allcommentspost);
$allcommentspost = array_reverse($allcommentspost);
foreach ($allcommentspost as $onecomment) {
ob_start();
$D->o_comment = stripslashes($onecomment->comment);
$D->o_username = stripslashes($onecomment->username);
$D->o_firstname = stripslashes($onecomment->firstname);
$D->o_lastname = stripslashes($onecomment->lastname);
$D->o_ucode = $onecomment->ucode;
$D->o_nameUser = empty($D->o_firstname) || empty($D->o_lastname) ? stripslashes($D->o_username) : stripslashes($D->o_firstname) . ' ' . stripslashes($D->o_lastname);
$D->o_whendate = $onecomment->whendate;
$D->o_avatar = empty($onecomment->avatar) ? $C->AVATAR_DEFAULT : $onecomment->avatar;
$D->o_idcomment = $onecomment->idcomment;
$D->o_idUser = $onecomment->iduser;