$objPictureTemplate->setText('NEXT', "<a href='index.php?action=picture&" . $objNextPicture->getIDPair() . "'>Next<br>" . $objNextPicture->getHtmlThumbnail(64, 64) . "</a>"); } else { $objPictureTemplate->setText('NEXT', "<span class='disabled'>At the end</span>"); } $objPictureTemplate->setText('TITLE', $objPicture->get('title')); $objPictureTemplate->setText('USERNAME', $objPicture->getUsername()); $objPictureTemplate->setText('PICTURE', $objPicture->getHtml()); $objPictureTemplate->setText('CAPTION', "<span id='more' style='display: none;'>" . bbcode_format($objPicture->get('caption')) . "<br><a href='#' onClick='\$(\"more\").style.display=\"none\"; \$(\"less\").style.display=\"block\"'>Less</a></span>"); $objPictureTemplate->setText('CAPTION', "<span id='less' style='display: inline;'>" . cut_text(bbcode_format($objPicture->get('caption')), MAX_CAPTION, "<br><a href='#' onClick='\$(\"less\").style.display=\"none\"; \$(\"more\").style.display=\"block\"'>More</a></span>")); $strCaption = cut_text(bbcode_format($objPicture->get('caption')), MAX_CAPTION, " (<a href='index.php?action=picture&all=1&" . $objPicture->getIDPair() . "'>more</a>)"); /* Voting code. */ if (clsVote::canVote($objPicture, $objUser, $_SERVER['REMOTE_ADDR'])) { $objPictureTemplate->setText('RATING', clsVote::getVoteField($objPicture)); } else { if (clsVote::getVoteCount($objPicture)) { $objPictureTemplate->setText('RATING', "Ranked <span class='rating'>" . clsVote::getRating($objPicture) . "</span> / " . clsVote::getMaxRating() . " (" . clsVote::getVoteCount($objPicture) . " votes)"); } } /* Commenting code. */ $arrComments = $objPicture->getComments(); foreach ($arrComments as $objComment) { $objComment = new clsComment($objComment->get('id')); $objCommentTemplate = new clsTemplate('comment'); $objCommentTemplate->setText('TITLE', $objComment->get('title') . ' ' . $objComment->getNewIcon($objUser)); $objCommentTemplate->setText('USERNAME', $objComment->getUsername()); $objCommentTemplate->setText('DATE', time_to_text(strtotime($objComment->get('date')))); $objCommentTemplate->setText('TEXT', bbcode_format($objComment->get('text'))); if ($objComment->canEdit($objUser)) { $objCommentTemplate->setText('TITLE', "<span class='editdelete'> [<a href='index.php?action=comment&subaction=edit&" . $objPicture->getIDPair() . "&" . $objComment->getIDPair() . "'>edit</a>]</span>"); } if ($objComment->canDelete($objUser)) {