[Home]WikiPatches/Comments On

UseModWiki | WikiPatches | RecentChanges | Preferences

Inspired by the "Comments on this page" feature of other wikis, e.g. OddMuse and running into a comment on WikiPatches about talk space - I hacked the following. The code is unfinished and some things are hardcoded. I am not proud of it. Enhancements are welcome.

At the moment $CommentsPrefix? is misplaced and mostly unused. It is work in progress. Use with caution and at your own risk. Enhancements are highly appreciated.

This patch is made with diff -c as suggested on WikiPatches/Where.

--TilmannHolst, 29.5.2004


*** wiki.pl	2004-05-29 16:08:41.000000000 +0200
--- larpwiki-comments-on.pl	2004-05-29 16:09:35.000000000 +0200
***************
*** 26,31 ****
--- 26,33 ----
  #    59 Temple Place, Suite 330
  #    Boston, MA 02111-1307 USA
  
+ # applied patch: larpwiki-comments-on
+ 
  package UseModWiki;
  use strict;
  local $| = 1;  # Do not buffer output (localized for mod_perl)
***************
*** 53,59 ****
    @IsbnNames @IsbnPre @IsbnPost $EmailFile $FavIcon $RssDays $UserHeader
    $UserBody $StartUID $ParseParas $AuthorFooter $UseUpload $AllUpload
    $UploadDir $UploadUrl $LimitFileUrl $MaintTrimRc $SearchButton 
!   $EditNameLink $UseMetaWiki @ImageSites $BracketImg );
  # Note: $NotifyDefault is kept because it was a config variable in 0.90
  # Other global variables:
  use vars qw(%Page %Section %Text %InterSite %SaveUrl %SaveNumUrl
--- 55,61 ----
    @IsbnNames @IsbnPre @IsbnPost $EmailFile $FavIcon $RssDays $UserHeader
    $UserBody $StartUID $ParseParas $AuthorFooter $UseUpload $AllUpload
    $UploadDir $UploadUrl $LimitFileUrl $MaintTrimRc $SearchButton 
!   $EditNameLink $UseMetaWiki @ImageSites $BracketImg $CommentsPrefix );
  # Note: $NotifyDefault is kept because it was a config variable in 0.90
  # Other global variables:
  use vars qw(%Page %Section %Text %InterSite %SaveUrl %SaveNumUrl
***************
*** 1472,1484 ****
  sub GetGotoBar {
    my ($id) = @_;
    my ($main, $bartext);
! 
    $bartext  = &GetPageLink($HomePage);
    if ($id =~ m|/|) {
      $main = $id;
      $main =~ s|/.*||;  # Only the main page name (remove subpage)
      $bartext .= " | " . &GetPageLink($main);
    }
    $bartext .= " | " . &GetPageLink($RCName);
    $bartext .= " | " . &GetPrefsLink();
    if ($UseUpload && &UserCanUpload()) {
--- 1474,1493 ----
  sub GetGotoBar {
    my ($id) = @_;
    my ($main, $bartext);
!   $CommentsPrefix = "Comments_on_"; # FIXME
    $bartext  = &GetPageLink($HomePage);
    if ($id =~ m|/|) {
      $main = $id;
      $main =~ s|/.*||;  # Only the main page name (remove subpage)
      $bartext .= " | " . &GetPageLink($main);
    }
+   if ($id =~ m/Comments_On_/){ # FIXME
+     $main = $id;
+     $main =~ s/Comments_On_//; # Remove comment prefix # FIXME
+     $bartext .= " | " . &GetPageLink($main);
+   } elsif ($id ne '') {
+     $bartext .= " | " . &GetPageOrEditLink("${CommentsPrefix}${id}", ""); # TEST
+   }
    $bartext .= " | " . &GetPageLink($RCName);
    $bartext .= " | " . &GetPrefsLink();
    if ($UseUpload && &UserCanUpload()) {


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited November 4, 2007 3:15 pm by MarkusLude (diff)
Search: