예제 #1
0
<?php

require_once 'cls/clsAlbum.php';
require_once 'cls/clsPicture.php';
print "<span class='recentheader'>New Pictures</span>";
$arrPictures = clsPicture::getRecentPictures($objUser, 5);
foreach ($arrPictures as $objPicture) {
    $objPicture = new clsPicture($objPicture->get('id'));
    $objAlbum = new clsAlbum($objPicture->get('album_id'));
    print "<p>";
    print $objPicture->getHtmlThumbnail(100, 100) . "<br>";
    print "<a href='index.php?action=picture&" . $objPicture->getIDPair() . "' class='recentlink'>" . $objPicture->get('title') . "</a> <span class='recentdate'>in</span> <a href='index.php?action=albums&" . $objAlbum->getIDPair() . "' class='recentlink'>" . $objAlbum->get('name') . "</a><br>";
    print "<span class='recentdate'>" . $objPicture->getUsername() . "<br>";
    print time_to_text(strtotime($objPicture->get('date'))) . "</span>";
    print "</p>";
}
예제 #2
0
파일: picture.php 프로젝트: shifter/ospap2
 $objMiniMenu->add('Link to this', 'index.php?action=picture&subaction=link&' . $objPicture->getIDPair());
 /* Mark this picture as viewed. */
 $objPicture->setViewed($objUser);
 $objPictureTemplate = new clsTemplate('picture');
 if ($objPrevPicture) {
     $objPictureTemplate->setText('PREV', "<a href='index.php?action=picture&" . $objPrevPicture->getIDPair() . "'>Previous<br>" . $objPrevPicture->getHtmlThumbnail(64, 64) . "</a>");
 } else {
     $objPictureTemplate->setText('PREV', "<span class='disabled'>At the start</span>");
 }
 if ($objNextPicture) {
     $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) {