[Comoblog-commit] modules/mod_rss2 mod_rss2.php,1.1,1.2
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-02-16 23:09:39
|
Update of /cvsroot/comoblog/modules/mod_rss2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23969/mod_rss2 Modified Files: mod_rss2.php Log Message: RSS FEEDS FOR POSTS AND COMMENTS changed the templates so that they validate, removed the latest comments from the side bar and put them into there own module (mod_latest_comments) Index: mod_rss2.php =================================================================== RCS file: /cvsroot/comoblog/modules/mod_rss2/mod_rss2.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_rss2.php 28 Nov 2005 11:05:36 -0000 1.1 +++ mod_rss2.php 16 Feb 2006 23:09:35 -0000 1.2 @@ -1,50 +1,6 @@ <?php - -function comments_last2 ($howmany) { - if (CFG_USE_PATH_INFO == 'no') - $iisbug = '?'; - else - $iisbug = ''; - - $query = "select p.post_mail_subject,p.post_id,c.comment_added as post_mail_date, c.comment_author_email as post_mail_from from easymoblog_posts p , easymoblog_comments c where p.post_id =c.post_id order by comment_id desc limit 0,".$howmany.";"; - $res = mysql_query($query); - if (!$res || !mysql_num_rows($res)) - return (false); - - $rss = array(); - while ($row = mysql_fetch_array($res)) - { - $row['post_permalink'] = CFG_SITE_URL.'post.php'.$iisbug.'/'.$row['post_id']; - #$row['post_permalink'] = CFG_SITE_URL.'post/'.$row['post_id']; - $rss[] = $row; - } - - return ($rss); -} - - -$mod_contents = ''; -$rss = comments_last2(10); -$rss_tpl = new XTemplate (CFG_BASE_PATH.'/modules/mod_rss2/templates/rss2.tpl.html'); - if ($rss) - { - - for ($c = 0; $c < count($rss); $c++) - { - - $rss[$c]['post_mail_subject'] = htmlspecialchars(strip_tags($rss[$c]['post_mail_subject'])); - $rss[$c]['post_mail_from'] = htmlspecialchars(strip_tags($rss[$c]['post_mail_from'])); - $rss_tpl->assign('RSS', $rss[$c]); - $rss_tpl->parse('main.rss'); - } - - $mod_contents .= $rss_tpl->parse('main'); - $mod_contents .= $rss_tpl->text("main"); - - } - -else - { - $mod_contents =""; - } + $mod_contents = ''; + $rss_tpl = new XTemplate (CFG_BASE_PATH.'/modules/mod_rss2/templates/rss2.tpl.html'); + $mod_contents .= $rss_tpl->parse('main'); + $mod_contents .= $rss_tpl->text("main"); ?> |