From: Geoffrey T. D. <da...@us...> - 2001-12-11 22:45:42
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv11353/lib/plugin Modified Files: RecentChanges.php Log Message: Set RSS channel title from new config var WIKI_NAME. Added "RSS" icon (which links to RSSified RecentChanges) to the HTML version of RecentChanges. Index: RecentChanges.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** RecentChanges.php 2001/12/08 16:30:44 1.4 --- RecentChanges.php 2001/12/11 22:45:39 1.5 *************** *** 25,35 **** 'exclude_major_revisions' => !$show_major, 'include_all_revisions' => $show_all); ! if ($days > 0.0) { $params['since'] = time() - 24 * 3600 * $days; - $title = sprintf(_("RecentChanges in the past %.1f days"), $args['days']); - } - else { - $title = _("RecentChanges"); - } $changes = $dbi->mostRecent($params); --- 25,31 ---- 'exclude_major_revisions' => !$show_major, 'include_all_revisions' => $show_all); ! ! if ($days > 0.0) $params['since'] = time() - 24 * 3600 * $days; $changes = $dbi->mostRecent($params); *************** *** 44,48 **** header("Content-Type: application/xml; charset=" . RSS_ENCODING); ! $xml = $this->__format_as_rss($changes, $title, $args, $request); printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); printf("<!-- Generated by PhpWiki:\n%s-->\n", $GLOBALS['RCS_IDS']); --- 40,44 ---- header("Content-Type: application/xml; charset=" . RSS_ENCODING); ! $xml = $this->__format_as_rss($changes, $args, $request); printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); printf("<!-- Generated by PhpWiki:\n%s-->\n", $GLOBALS['RCS_IDS']); *************** *** 51,60 **** break; default: ! return $this->__format_as_html($changes, $title, $args); break; } } ! function __format_as_html($changes, $title, $args) { global $dateformat; --- 47,56 ---- break; default: ! return $this->__format_as_html($changes, $args, $request); break; } } ! function __format_as_html($changes, $args, $request) { global $dateformat; *************** *** 67,71 **** // FIXME: add XML icon (and link) to title? ! $html = QElement('h3', $title); $limit = $args['limit']; --- 63,73 ---- // FIXME: add XML icon (and link) to title? ! $rss_url = $request->getURLtoSelf(array('format' => 'rss')); ! $rss_icon = Element('a', array('href' => $rss_url), ! Element('img', array('src' => DataURL('images/rss.png'), ! 'alt' => 'RSS available', ! 'class' => 'linkicon'))); ! ! $html = Element('h3', htmlspecialchars(_("RecentChanges")) . " $rss_icon"); $limit = $args['limit']; *************** *** 120,130 **** } ! function __format_as_rss($changes, $title, $args, $request) { include_once('lib/RssWriter.php'); $rss = new RssWriter; $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); ! ! $chan = array('title' => 'PhpWiki', // FIXME: this should be a config define ! 'dc:description' => $title, 'link' => $rc_url, 'dc:date' => Iso8601DateTime(time())); --- 122,132 ---- } ! function __format_as_rss($changes, $args, $request) { include_once('lib/RssWriter.php'); $rss = new RssWriter; $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); ! ! $chan = array('title' => WIKI_NAME, ! 'dc:description' => _("RecentChanges"), 'link' => $rc_url, 'dc:date' => Iso8601DateTime(time())); |