Exemplo n.º 1
0
 public function on_page_view()
 {
     Loader::library('controller', $pkgHandle);
     $path = EasyNewsController::getRssPagePath() . '?c=' . $this->cParentID;
     $imagepath = EasyNewsController::getPackageUrl() . '/templates/img/rss.png';
     $rss = '<link rel="alternate" type="application/rss+xml" title="Feed" href="' . $path . '" />';
     $this->addHeaderItem($rss, 'CONTROLLER');
 }
Exemplo n.º 2
0
//}
$cvID = CollectionVersion::getNumericalVersionID($ct->getCollectionID(), 'ACTIVE');
$vObj = CollectionVersion::get($ct, $cvID);
$newsList = new PageList();
$newsList->filterByParentID($cat);
$newsList->sortBy('cvDatePublic', 'desc');
$newsPage = $newsList->getPage();
//Start creation
Loader::library('3rdparty/feedcreator/include/feedcreator.class', $pkgHandle);
//define channel
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = SITE . ' - ' . $vObj->cvName;
$rss->description = $vObj->cvName . ' updates';
$rss->link = SITE_URL;
$rss->syndicationURL = EasyNewsController::getRssPagePath() . '?c=' . $cat;
//channel items/entries
foreach ($newsPage as $page) {
    $item = new FeedItem();
    $item->title = $page->getCollectionName();
    $item->link = BASE_URL . Loader::helper('navigation')->getLinkToCollection($page);
    $item->description = $page->getCollectionDescription();
    $item->source = BASE_URL;
    $user = UserInfo::getByID($page->getCollectionUserID());
    $item->author = $user->getUserName();
    $item->date = date('r', strtotime($page->getCollectionDatePublic()));
    $rss->addItem($item);
}
//Output
//Valid parameters are RSS0.91, RSS1.0, RSS2.0, PIE0.1 (deprecated),
// MBOX, OPML, ATOM, ATOM1.0, ATOM0.3, HTML, JS
Exemplo n.º 3
0
        } else {
            echo $textHelper->shorten($cobj->getCollectionDescription(), $controller->truncateChars);
        }
        ?>
        <?php 
        $cobj->getCollectionDatePublic();
        ?>
	</div>
	
<?php 
    }
    if (!$previewMode && $controller->rss) {
        Loader::library('controller', $pkgHandle);
        $btID = $b->getBlockTypeID();
        $bt = BlockType::getByID($btID);
        $path = EasyNewsController::getRssPagePath() . '?c=' . $cobj->getCollectionParentID();
        $imagepath = EasyNewsController::getPackageUrl() . '/templates/img/rss.png';
        $rss = '<link rel="alternate" type="application/rss+xml" title="Feed" href="' . $path . '" />';
        ?>
			<div id="easy_news_rss" style="text-align:right"><a href="<?php 
        echo $path;
        ?>
"><img src="<?php 
        echo $imagepath;
        ?>
"></img></a></div>
		<?php 
    }
    ?>
</div>
<?php