[Home]WikiPatches/PoweredByWithLinesOfCode

UseModWiki | WikiPatches | RecentChanges | Preferences

This patch adds:

"Powered by UsemodWiki (nnnn lines)"

at the bottom of each page, where "nnnn" means lines of code of Usemod Wiki.

The Patch

sub GetFooterText {
  my ($id, $rev) = @_;
  my $result;
+  my $lines = 0;
+  my $buffer;
...
    . $ConfigError . '<br>';
  }
+  open(SCRIPT, $ENV{SCRIPT_FILENAME} ) || die(Ts('Can not open %s', $ENV{SCRIPT_NAME}) . ": $!");
+  while (sysread SCRIPT, $buffer, 4096) {
    $lines += ($buffer =~ tr/\n//);
+  }
+  close SCRIPT;
+  $result .= '<br><i>' . Ts('Powered by UsemodWiki with %s lines of code', $lines) . '</i>';

To Do

License

I don't know for the time being if this piece of code has a free license; some help will be appreciated.

--JuanmaMP


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited July 19, 2009 2:17 am by JuanmaMP (diff)
Search: