[Comoblog-commit] comoblog/modules/mod_rss rss.php,1.3,1.4
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2008-02-19 03:34:08
|
Update of /cvsroot/comoblog/comoblog/modules/mod_rss In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11414 Modified Files: rss.php Log Message: 1896613 - Fix RSS field validation problems Index: rss.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/modules/mod_rss/rss.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- rss.php 4 Oct 2005 06:55:56 -0000 1.3 +++ rss.php 19 Feb 2008 03:34:02 -0000 1.4 @@ -13,7 +13,7 @@ $blog['title'] = htmlspecialchars(strip_tags(CFG_TITLE)); $blog['link'] = CFG_SITE_URL; $blog['description'] = htmlspecialchars(strip_tags(CFG_INTRO_TEXT)); -$blog['language'] = CFG_LANG; +$blog['language'] = $SET_LOCALE; $blog['generator'] = 'CoMoblog '.CFG_VERSION; $blog['logo'] = CFG_SITE_URL.'img/comoblog/'.CFG_LOGO_IMG; $blog['copyright'] = htmlspecialchars(strip_tags(CFG_RSS_COPYRIGHT)); @@ -40,15 +40,33 @@ for ($c = 0; $c < count($posts); $c++) { $posts[$c]['post_mail_subject'] = htmlspecialchars(strip_tags($posts[$c]['post_mail_subject'])); - $posts[$c]['post_mail_body'] = htmlspecialchars(strip_tags($posts[$c]['post_mail_body'])); - $posts[$c]['post_mail_from'] = htmlspecialchars(strip_tags($posts[$c]['post_mail_from'])); - $posts[$c]['post_mail_date'] = strftime($CAL_DATE_FORMAT." %H:%M", $posts[$c]['post_mail_date']); - $post['post_category'] = ''; + $posts[$c]['post_mail_body'] = $posts[$c]['post_mail_body']; + $posts[$c]['post_mail_desc'] = $posts[$c]['post_mail_body']; + + if (strlen($posts[$c]['post_mail_desc']) > 200) { + $cutpost = strpos($posts[$c]['post_mail_desc'], "\n<br />"); + if ($cutpost > 0) { + $posts[$c]['post_mail_desc'] = substr($posts[$c]['post_mail_desc'], 0, $cutpost); + $posts[$c]['post_mail_desc'] = $posts[$c]['post_mail_desc']." ........"; + } + } + + $posts[$c]['post_mail_from'] = htmlspecialchars($posts[$c]['post_mail_from']); + $posts[$c]['post_mail_date'] = strftime("%a, %d %b %Y %H:%M:%S %z", $posts[$c]['post_mail_date']); + + if ($posts[$c]['topic_name'] == "") + $posts[$c]['post_category'] = "uncategorised"; + else + $posts[$c]['post_category'] = $posts[$c]['topic_name']; + + if ($rss_version == '1.0') + $posts[$c]['post_mail_body'] = filter_html(str_replace("<br>", "\n", $posts[$c]['post_mail_body'])); $tpl->assign('POST', $posts[$c]); - if ($rss_version == '1.0') + if ($rss_version == '1.0') { $tpl->parse('main.item'); + } $tpl->parse('main.post'); } |