Exemple #1
0
 public function getImageRaw($objUser)
 {
     $objPicture = new clsPicture($this->get('picture_id'));
     if ($objPicture->hasViewed($objUser)) {
         return base64_decode($this->getFrom('imagedata', 'data'));
     }
     $mime_type = $objPicture->getFrom('album', 'mime');
     if (!$mime_type || $mime_type == '') {
         $mime_type = DEFAULT_MIME;
     }
     $img = $this->getImage($objUser);
     $ret = imgToString($img, $mime_type);
     ImageDestroy($img);
     return $ret;
 }
Exemple #2
0
    if (!isset($_SESSION['objUser'])) {
        $objUser = clsUser::getCookie();
    } else {
        $objUser = $_SESSION['objUser'];
    }
    header("Content-type: application/xhtml+xml");
    $arrPictures = clsPicture::getRecentPictures($objUser, 10);
    $url = "http://" . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/\\/[a-zA-Z0-9.]*\$/", "/index.php", $_SERVER['PHP_SELF']);
    print "<?xml version='1.0' encoding='UTF-8'?>\n<!-- generator='OSPAP2' -->\n<rss version='2.0'\n\txmlns:content='http://purl.org/rss/1.0/modules/content/'\n\txmlns:wfw='http://wellformedweb.org/CommentAPI/'\n\txmlns:dc='http://purl.org/dc/elements/1.1/'\n\t>\n\n<channel>\n\t<title>" . SITE_NAME . "</title>\n\t<link>{$url}</link>\n\t<description>" . SITE_DESCRIPTION . "</description>\n\t<generator>http://www.javaop.com/~ron/ospap2</generator>\n\t<language>en</language>\n";
    foreach ($arrPictures as $objPicture) {
        $objPicture = new clsPicture($objPicture->get('id'));
        $link = "http://" . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/\\/[a-zA-Z0-9.]*\$/", "/index.php?action=picture&amp;" . $objPicture->getIDPair(), $_SERVER['PHP_SELF']);
        print "\t<item>\n";
        print "\t\t<title>" . $objPicture->get('title') . "</title>\n";
        print "\t\t<link>{$link}</link>\n";
        print "\t\t<comments>{$link}</comments>\n";
        print "\t\t<pubDate>" . date("D M j Y G:i:s T", strtotime($objPicture->get('date'))) . "</pubDate>\n";
        print "\t\t<dc:creator>" . $objPicture->getFrom('user', 'username') . "</dc:creator>\n";
        print "\t\t<category><![CDATA[" . $objPicture->getFrom('album', 'name') . "]]></category>\n";
        print "\t\t<guid isPermaLink=\"true\">{$link}</guid>\n";
        print "\t\t<description><![CDATA[" . cut_text($objPicture->get('caption'), 200) . "<br><br>" . $objPicture->getHtmlThumbnail(150, 150) . "]]></description>\n";
        print "\t\t<content:encoded><![CDATA[" . $objPicture->get('caption') . "<br><br>" . $objPicture->getHtml() . "]]></content:encoded>\n";
        print "\t\t<wfw:commentRss>" . $_SERVER['PHP_SELF'] . "</wfw:commentRss>\n";
        print "\t</item>\n";
    }
    print "</channel>\n";
    print "</rss>\n";
} catch (Exception $e) {
    $_SESSION['e'] = $e;
    header("Location: index.php?action=exception&message=" . $e->getMessage());
}