function postMedia($sid) { $sql = "SELECT * FROM `images` WHERE `images`.`sid` = '" . $sid . "'"; if (!($result = $GLOBALS['db']->query($sql))) { die("Database error! (postMedia)"); } while ($row = $result->fetch_assoc()) { if ($row['type'] == 0) { postImage($sid); } else { postVideo($sid); } } }
function blog_rss() { global $clerk, $blog; $feed = new FeedWriter(RSS2); $title = $clerk->getSetting("site", 1); $feed->setTitle($title . ' / Blog Feed'); $feed->setLink(linkToSite()); $feed->setDescription('Live feed of blog posts on ' . $title); $feed->setChannelElement('pubDate', date(DATE_RSS, time())); $get = $clerk->query_select("secretary_blog", "", "ORDER BY date DESC"); while ($blog = $clerk->query_fetchArray($get)) { $newItem = $feed->createNewItem(); $newItem->setTitle($blog['title']); $newItem->setLink(html_entity_decode(linkToPost(false, $blog['id']))); $newItem->setDate($blog['date']); $desc = postImage() . '<br />' . postText(); $desc = call_anchor("blogRssDescription", $desc); $newItem->setDescription('' . $desc . ''); $newItem->addElement('guid', linkToPost(), array('isPermaLink' => 'true')); $feed->addItem($newItem); $count = 0; $desc = ""; } $feed->genarateFeed(); }