$D->numlikes = $onePost->numlikes; $D->numcommentstotal = $onePost->numcomments; $D->post = stripslashes($onePost->post); $D->typepost = $onePost->typepost; $D->valueattach = $onePost->valueattach; $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);