示例#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
 public function getLastUpdated()
 {
     $arrPictures = clsDB::selectQueryObjects('picture', "SELECT * \n\t\t\t\t\t\t\tFROM `<<tbl><picture>>`\n\t\t\t\t\t\t\tWHERE `<<foreign><picture><album>>`='" . $this->get('id') . "'\n\t\t\t\t\t\t\t\tAND `<<isdel><picture>>`='0'\n\t\t\t\t\t\t\t\tAND `<<picture><confirmed>>`='1'\n\t\t\t\t\t\t\tORDER BY `<<picture><date>>` DESC\n\t\t\t\t\t\t\tLIMIT 0, 1");
     if (sizeof($arrPictures) == 0) {
         return 'Never';
     } else {
         return time_to_text(strtotime($arrPictures[0]->get('date')));
     }
 }
示例#3
0
    } else {
        if ($strSubAction == 'delete') {
            if (!$objComment->canDelete($objUser)) {
                throw new Exception('exception_accessdenied');
            }
            $objComment->delete();
            $objComment->save();
            header("Location: index.php?action=picture&" . $objPicture->getIDPair());
        } else {
            if ($strSubAction = 'viewnew') {
                if (!$objUser) {
                    throw new Exception('exception_accessdenied');
                }
                $arrComments = clsComment::getNewComments($objUser);
                foreach ($arrComments as $objComment) {
                    $objComment = new clsComment($objComment->get('id'));
                    $objPicture = new clsPicture($objComment->get('picture_id'));
                    $objCommentTemplate = new clsTemplate('newcomment');
                    $objCommentTemplate->setText('IMAGE', "<a href='index.php?action=picture&" . $objPicture->getIDPair() . "'>" . $objPicture->getHtmlThumbnail(128, 128) . "</a>");
                    $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')));
                    print $objCommentTemplate->get();
                    /* Mark the comment as viewed */
                    $objComment->setViewed($objUser);
                }
            }
        }
    }
}
示例#4
0
function run_sched($simseconds, $st_array, $pid_array, $et_array, $data, $simt)
{
    $endtime = $simseconds;
    for ($sid = 0; $sid < $data["nboards"] * 8; $sid++) {
        if ($pid_array[$sid]) {
            if ($data["seq"] == 1) {
                time_to_text($sid, $st_array[$sid], $pid_array[$sid], $et_array[$sid], $data, $simt);
                if ($data["mas"] > 0 && $data["mas"] != $sid + 1 && $data["masop"][$sid >> 3] & 1 << $sid % 8) {
                    echo "{'start': " . ($st_array[$sid] + $data["mton"]) . ",'end': " . ($et_array[$sid] + $data["mtoff"]) . ",'content':'','className':'master','shortname':'M','group':'" . _("Master") . "'},";
                }
                $endtime = $et_array[$sid];
            } else {
                time_to_text($sid, $simseconds, $pid_array[$sid], $et_array[$sid], $data, $simt);
                if ($data["mas"] > 0 && $data["mas"] != $sid + 1 && $data["masop"][$sid >> 3] & 1 << $sid % 8) {
                    $endtime = $endtime > $et_array[$sid] ? $endtime : $et_array[$sid];
                }
            }
        }
    }
    if ($data["seq"] == 0 && $data["mas"] > 0) {
        echo "{'start': " . $simseconds . ",'end': " . $endtime . ",'content':'','className':'master','shortname':'M','group':'" . _("Master") . "'},";
    }
    return $endtime;
}