示例#1
0
     // Check if this is IE 6
     if (strstr($sReferrer, 'MSIE 6.0')) {
         header('Content-Type: application/rss+xml; charset=utf-8;');
         header('Content-Disposition: inline; filename="rss.xml"');
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
         header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     }
 }
 if (KTUtil::arrayGet($_REQUEST, 'docId')) {
     // if a docId parameter is passed
     // get document id from http request object
     $iDocumentId = KTUtil::arrayGet($_REQUEST, 'docId');
     if (KTrss::validateDocumentPermissions($id, $iDocumentId)) {
         // if document passes validation check
         // get document info
         $aDocumentInfo[] = KTrss::getOneDocument($iDocumentId, $id);
         if ($aDocumentInfo) {
             // create rss xml for document
             $documentFeed = KTrss::arrayToXML($aDocumentInfo);
         } else {
             // create rss xml for the error
             $error = KTrss::errorToXML(_kt('This document has returned a empty response'));
         }
     } else {
         // create rss xml for error
         $error = KTrss::errorToXML(_kt('You are either not authorised to view details on this document or it does not exist.' . ' Please visit http://' . $_SERVER['HTTP_HOST'] . '/' . $GLOBALS['KTRootUrl'] . '/ to browse for a valid document.'));
     }
     if (isset($error)) {
         // if an error exist, output...else out the result
         echo $error;
     } else {
示例#2
0
 function getDocuments($iUserId)
 {
     $aDList = KTrss::getDocumentList($iUserId);
     if ($aDList) {
         foreach ($aDList as $document_id) {
             $document = KTrss::getOneDocument($document_id, $iUserId);
             if ($document) {
                 $aDocuments[] = $document;
             }
         }
     }
     if (PEAR::isError($aDocuments)) {
         // XXX: log error
         return false;
     }
     if ($aDocuments) {
         return $aDocuments;
     }
 }