Exemple #1
0
<?php 
// Get news items from database
$t = TIME();
$time_check_str = "(published_when = '0' OR published_when <= " . $t . ") AND (published_until = 0 OR published_until >= " . $t . ")";
//Query
if (isset($group_id)) {
    $query = "SELECT * FROM " . TABLE_PREFIX . "mod_news_posts WHERE group_id=" . $group_id . " AND page_id = " . $page_id . " AND active=1 AND " . $time_check_str . " ORDER BY posted_when DESC";
} else {
    $query = "SELECT * FROM " . TABLE_PREFIX . "mod_news_posts WHERE page_id=" . $page_id . " AND active=1 AND " . $time_check_str . " ORDER BY posted_when DESC";
}
$result = $database->query($query);
//Generating the news items
while ($item = $result->fetchRow()) {
    $description = stripslashes($item["content_short"]);
    // wb->preprocess() -- replace all [wblink123] with real, internal links
    $wb->preprocess($description);
    ?>
	<item>
		<title><![CDATA[<?php 
    echo stripslashes($item["title"]);
    ?>
]]></title>
		<description><![CDATA[<?php 
    echo $description;
    ?>
]]></description>
		<link><?php 
    echo WB_URL . PAGES_DIRECTORY . $item["link"] . PAGE_EXTENSION;
    ?>
</link>
		<pubDate><?php 
Exemple #2
0
</guid>
			<link><?php 
    echo LEPTON_URL . PAGES_DIRECTORY . $item["link"] . PAGE_EXTENSION;
    ?>
</link>
			<pubDate><?php 
    echo date('D, d M Y H:i:s O', $item["published_when"]);
    ?>
</pubDate>
		</item>
<?php 
}
?>
	</channel>
</rss>

<?php 
$output = ob_get_contents();
if (ob_get_length() > 0) {
    ob_end_clean();
}
// wb->preprocess() -- replace all [wblink123] with real, internal links
$wb->preprocess($output);
// Load Droplet engine and process
if (file_exists(LEPTON_PATH . '/modules/droplets/droplets.php')) {
    include_once LEPTON_PATH . '/modules/droplets/droplets.php';
    if (function_exists('evalDroplets')) {
        evalDroplets($output);
    }
}
echo $output;