[Home]WikiBugs/RssAuthorName

UseModWiki | WikiBugs | RecentChanges | Preferences

After trying to look at the wiki's RSS feed in Thunderbird and Google Reader, I discovered a few problems with it, notably that the author is not displayed properly, every change says it was made by the wiki. The following diff fixes it (I snuck in two other changes, the timezone fix from WikiBugs/RssDateAndTimeZone and I changed the displayed page to be a diff page, which is what Wikipedia does)

 *** wiki.pl@@/main/dev_trent/10 Wed Apr 16 17:32:07 2008
 --- wiki.pl     Thu Apr 24 17:40:25 2008
 ***************
 *** 1009,1038 ****
       $authorLink = 'link="' . $QuotedFullUrl . &ScriptLinkChar() . $author . '"';
     } else {
       $author = $host;
     }
     $status = (1 == $revision) ? 'new' : 'updated';
     $importance = $isEdit ? 'minor' : 'major';
 !   $timestamp += $TimeZoneOffset;
 !   my ($sec, $min, $hour, $mday, $mon, $year) = localtime($timestamp);
     $year += 1900;
     $date = sprintf("%4d-%02d-%02dT%02d:%02d:%02d+%02d:00",
 !     $year, $mon+1, $mday, $hour, $min, $sec, $TimeZoneOffset/(60*60));
     $pagename = &QuoteHtml($pagename);
     # Write it out longhand
     $item = <<RSS ;
       <item rdf:about="$itemID">
           <title>$pagename</title>
 !         <link>$pagePrefix$pagenameEsc</link>
           <description>$description</description>
           <dc:date>$date</dc:date>
           <dc:contributor>
               <rdf:Description wiki:host="$host" $authorLink>
                   <rdf:value>$author</rdf:value>
               </rdf:Description>
           </dc:contributor>
           <wiki:status>$status</wiki:status>
           <wiki:importance>$importance</wiki:importance>
           <wiki:diff>$diffPrefix$pagenameEsc</wiki:diff>
           <wiki:version>$revision</wiki:version>
           <wiki:history>$historyPrefix$pagenameEsc</wiki:history>
       </item>
 --- 1011,1040 ----
       $authorLink = 'link="' . $QuotedFullUrl . &ScriptLinkChar() . $author . '"';
     } else {
       $author = $host;
     }
     $status = (1 == $revision) ? 'new' : 'updated';
     $importance = $isEdit ? 'minor' : 'major';
 !   my ($sec, $min, $hour, $mday, $mon, $year) = gmtime($timestamp);
     $year += 1900;
     $date = sprintf("%4d-%02d-%02dT%02d:%02d:%02d+%02d:00",
 !     $year, $mon+1, $mday, $hour, $min, $sec);
     $pagename = &QuoteHtml($pagename);
     # Write it out longhand
     $item = <<RSS ;
       <item rdf:about="$itemID">
           <title>$pagename</title>
 !         <link>$diffPrefix$pagenameEsc</link>
           <description>$description</description>
           <dc:date>$date</dc:date>
           <dc:contributor>
               <rdf:Description wiki:host="$host" $authorLink>
                   <rdf:value>$author</rdf:value>
               </rdf:Description>
           </dc:contributor>
 +         <dc:creator>$author</dc:creator>
           <wiki:status>$status</wiki:status>
           <wiki:importance>$importance</wiki:importance>
           <wiki:diff>$diffPrefix$pagenameEsc</wiki:diff>
           <wiki:version>$revision</wiki:version>
           <wiki:history>$historyPrefix$pagenameEsc</wiki:history>
       </item>

-- Trent

Thanks for the bug report and the above patch. I'll test it and put it in the wiki script. -- MarkusLude


UseModWiki | WikiBugs | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited April 29, 2008 4:53 pm by MarkusLude (diff)
Search: