$additionalTables = ' LEFT JOIN ' . TBL_USERS . ' cre_username ON cre_username.usr_id = lnk_usr_id_create '; } // read weblinks from database $sql = 'SELECT cat.*, lnk.*, ' . $additionalFields . ' FROM ' . TBL_CATEGORIES . ' cat, ' . TBL_LINKS . ' lnk ' . $additionalTables . ' WHERE lnk_cat_id = cat_id AND cat_org_id = ' . $gCurrentOrganization->getValue('org_id') . ' AND cat_type = \'LNK\' ORDER BY lnk_timestamp_create DESC'; $statement = $gDb->query($sql); // start defining the RSS Feed // create RSS feed object with channel information $rss = new RSSfeed($gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline, $gCurrentOrganization->getValue('org_homepage'), $gL10n->get('LNK_LINKS_FROM', $gCurrentOrganization->getValue('org_longname')), $gCurrentOrganization->getValue('org_longname')); $weblink = new TableWeblink($gDb); // Dem RSSfeed-Objekt jetzt die RSSitems zusammenstellen und hinzufuegen while ($row = $statement->fetch()) { // submit links to object $weblink->clear(); $weblink->setArray($row); // set data for attributes of this entry $title = $weblink->getValue('lnk_name'); $description = '<a href="' . $weblink->getValue('lnk_url') . '" target="_blank">' . $weblink->getValue('lnk_url') . '</a>' . '<br /><br />' . $weblink->getValue('lnk_description'); $link = $g_root_path . '/adm_program/modules/links/links.php?id=' . $weblink->getValue('lnk_id'); $author = $row['create_name']; $pubDate = date('r', strtotime($weblink->getValue('lnk_timestamp_create'))); // add entry to RSS feed $rss->addItem($title, $description, $link, $author, $pubDate); }
public static function main($argv) { global $settings; $s = empty($_SERVER["HTTPS"]) ? '' : $_SERVER["HTTPS"] == "on" ? "s" : ""; $matches = array(); preg_match('/(\\w*)/', strtolower($_SERVER["SERVER_PROTOCOL"]), $matches); $protocol = $matches[0] . $s; $rss = new RSSfeed($settings['league_name'] . ' feed', $protocol . "://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']), 'Blood bowl league RSS feed', 'en-EN', explode(',', RSS_FEEDS)); echo $rss->generateNewsRssFeed(); }