コード例 #1
0
ファイル: newsfeeds.php プロジェクト: allenahner/mizzou
function showFeed($feedid)
{
    global $database, $mainframe, $mosConfig_absolute_path, $mosConfig_cachepath, $Itemid, $my;
    // check if cache directory is writeable
    $cacheDir = $mosConfig_cachepath . '/';
    if (!is_writable($cacheDir)) {
        echo 'Cache Directory Unwriteable';
        return;
    }
    require_once $mainframe->getPath('class');
    $newsfeed = new mosNewsFeed($database);
    $newsfeed->load((int) $feedid);
    /*
     * Check if newsfeed is published
     */
    if (!$newsfeed->published) {
        mosNotAuth();
        return;
    }
    $category = new mosCategory($database);
    $category->load((int) $newsfeed->catid);
    /*
     * Check if newsfeed category is published
     */
    if (!$category->published) {
        mosNotAuth();
        return;
    }
    /*
     * check whether category access level allows access
     */
    if ($category->access > $my->gid) {
        mosNotAuth();
        return;
    }
    // full RSS parser used to access image information
    require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_rss.php';
    $LitePath = $mosConfig_absolute_path . '/includes/Cache/Lite.php';
    // Adds parameter handling
    $menu = $mainframe->get('menu');
    $params = new mosParameters($menu->params);
    $params->def('page_title', 1);
    $params->def('header', $menu->name);
    $params->def('pageclass_sfx', '');
    $params->def('back_button', $mainframe->getCfg('back_button'));
    // Feed Display control
    $params->def('feed_image', 1);
    $params->def('feed_descr', 1);
    $params->def('item_descr', 1);
    $params->def('word_count', 0);
    // Encoding
    $params->def('utf8', 1);
    if (!$params->get('page_title')) {
        $params->set('header', '');
    }
    $and = '';
    if ($feedid) {
        $and = "\n AND id = {$feedid}";
    }
    $mainframe->SetPageTitle($menu->name);
    HTML_newsfeed::showNewsfeeds($newsfeed, $LitePath, $cacheDir, $params);
}
コード例 #2
0
    public static function displaylist(&$categories, &$rows, $catid, $currentcat = NULL, &$params, $tabclass)
    {
        global $Itemid, $mosConfig_live_site, $hide_js;
        if ($params->get('page_title')) {
            ?>
			<div class="componentheading<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
			<?php 
            echo $currentcat->header;
            ?>
			</div>
			<?php 
        }
        ?>
		<form action="index.php" method="post" name="adminForm">

		<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="contentpane<?php 
        echo $params->get('pageclass_sfx');
        ?>
">
		<tr>
			<td width="60%" valign="top" class="contentdescription<?php 
        echo $params->get('pageclass_sfx');
        ?>
" colspan="2">
			<?php 
        // show image
        if ($currentcat->img) {
            ?>
				<img src="<?php 
            echo $currentcat->img;
            ?>
" align="<?php 
            echo $currentcat->align;
            ?>
" hspace="6" alt="<?php 
            echo _WEBLINKS_TITLE;
            ?>
" />
				<?php 
        }
        echo $currentcat->descrip;
        ?>
			</td>
		</tr>
		<tr>
			<td>
			<?php 
        if (count($rows)) {
            HTML_newsfeed::showTable($params, $rows, $catid, $tabclass);
        }
        ?>
			</td>
		</tr>
		<tr>
			<td>&nbsp;

			</td>
		</tr>
		<tr>
			<td>
			<?php 
        // Displays listing of Categories
        if ($params->get('type') == 'category' && $params->get('other_cat')) {
            HTML_newsfeed::showCategories($params, $categories, $catid);
        } else {
            if ($params->get('type') == 'section' && $params->get('other_cat_section')) {
                HTML_newsfeed::showCategories($params, $categories, $catid);
            }
        }
        ?>
			</td>
		</tr>
		</table>
		</form>
		<?php 
        // displays back button
        mosHTML::BackButton($params, $hide_js);
    }
コード例 #3
0
ファイル: newsfeeds.php プロジェクト: jwest00724/mambo
function showFeed($option, $feedid)
{
    global $database, $mainframe, $mosConfig_absolute_path, $Itemid;
    // Adds parameter handling
    $menu =& new mosMenu($database);
    $menu->load($Itemid);
    $params =& new mosParameters($menu->params);
    $params->def('page_title', 1);
    $params->def('header', $menu->name);
    $params->def('pageclass_sfx', '');
    $params->def('back_button', $mainframe->getCfg('back_button'));
    // Feed Display control
    $params->def('feed_image', 1);
    $params->def('feed_descr', 1);
    $params->def('item_descr', 1);
    $params->def('word_count', 0);
    if (!$params->get('page_title')) {
        $params->set('header', '');
    }
    $_and = '';
    if ($feedid) {
        $_and = "\n AND id='" . $feedid . "'";
    }
    $query = "SELECT name, link, numarticles, cache_time" . "\n FROM #__newsfeeds" . "\n WHERE published='1'" . "\n AND checked_out='0'" . $_and . "\n ORDER BY ordering";
    $database->setQuery($query);
    $newsfeeds = $database->loadObjectList();
    $mainframe->SetPageTitle($menu->name);
    HTML_newsfeed::showNewsfeeds($newsfeeds, $params);
}
コード例 #4
0
ファイル: newsfeeds.php プロジェクト: cwcw/cms
function showFeed($option, $feedid)
{
    global $database, $mainframe, $mosConfig_absolute_path, $Itemid;
    require_once $mosConfig_absolute_path . "/includes/domit/xml_domit_rss_lite.php";
    $cacheDir = $mosConfig_absolute_path . "/cache/";
    $LitePath = $mosConfig_absolute_path . "/includes/Cache/Lite.php";
    // Adds parameter handling
    $menu =& new mosMenu($database);
    $menu->load($Itemid);
    $params =& new mosParameters($menu->params);
    $params->def('page_title', 1);
    $params->def('header', $menu->name);
    $params->def('pageclass_sfx', '');
    $params->def('back_button', $mainframe->getCfg('back_button'));
    if (!$params->get('page_title')) {
        $params->set('header', '');
    }
    $and = '';
    if ($feedid) {
        $and = "\n AND id='" . $feedid . "'";
    }
    $query = "SELECT name, link, numarticles, cache_time" . "\n FROM #__newsfeeds" . "\n WHERE published='1'" . "\n AND checked_out='0'" . $and . "\n ORDER BY ordering";
    $database->setQuery($query);
    $newsfeeds = $database->loadObjectList();
    $mainframe->SetPageTitle($menu->name);
    HTML_newsfeed::showNewsfeeds($newsfeeds, $LitePath, $cacheDir, $params);
}