Extension talk:RSS (GISWiki)

About this board


Archives
Archive 1


RSS (GISWiki) not working in 1.18.3

1
M2mtech (talkcontribs)

To get rid of some annoying warning messages change in rss.php around line 162 change:

 if ($item['description']) {$description = True; break;}

to

 if (isset($item['description']) && $item['description']) {$description = True; break;}

around line 171 add before the foreach line:

 if (!isset($output)) $output = ""; else $output.="";
 foreach ($rss->items as $item) {

and for the actual functionality - around line 261 change:

 if ($DisableCache) {
   global $wgVersion;
   # Do not cache this wiki page.
   # for details see http://public.kitware.com/Wiki/User:Barre/MediaWiki/Extensions
   global $wgTitle, $wgDBprefix;
   $ts = mktime();
   $now = gmdate("YmdHis", $ts + 120);
   $ns = $wgTitle->getNamespace();
   $ti = wfStrencode($wgTitle->getDBkey());
   $version = preg_replace("/^([1-9]).([1-9]).*/", "\\1\\2", $wgVersion);
   if ($version>14) $sql = "UPDATE $wgDBprefix"."page SET page_touched='$now' WHERE page_namespace=$ns AND page_title='$ti'";
   else             $sql = "UPDATE $wgDBprefix"."cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'";
   wfQuery($sql, DB_WRITE, "");
 }

to

 if ($DisableCache) {
   global $wgVersion;
   $dbr =& wfGetDB( DB_SLAVE );
   # Do not cache this wiki page.
   # for details see http://public.kitware.com/Wiki/User:Barre/MediaWiki/Extensions
   global $wgTitle, $wgDBprefix;
   $ts = mktime();
   $now = gmdate("YmdHis", $ts +120);
   $ns = $wgTitle->getNamespace();
   $ti = $dbr->addQuotes($wgTitle->getDBkey());
   $version = preg_replace("/^([1-9]).([1-9]).*/", "\\1\\2", $wgVersion);
   $sql = "UPDATE $wgDBprefix" . "page SET page_touched='$now' WHERE page_namespace=$ns AND page_title=$ti";
   $dbr->query($sql, __METHOD__);       
 }

In rss_utils.inc around line 28 change

 $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";

to

 $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}\.\d{3}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";

around line 38 change:

 if ( $match[10] == 'Z' ) {

to

 if ( isset($match[10]) && ($match[10] == 'Z') ) {

and finally around line 43 change:

 array( $match[8], $match[9], $match[10]);

to

 array( $match[7], $match[8], $match[9]);
Reply to "RSS (GISWiki) not working in 1.18.3"
There are no older topics