Old version of Author Contribution

Summary: Author Contribution, old version
Version:
Prerequisites:
Status:
Maintainer:

See AuthorContribution

Goal

Show all pages a specific author contributes to.

Solution

If an author has a page in the group "Profiles" it generates a page with his name in the group "Contributions". Every time an author saves a wikipage this contribution is collected there in the same way like RecentChanges does.

include_once("$FarmD/scripts/author.php");
if (PageExists($AuthorPage))
  $RecentChangesFmt['Contributions.$Author'] =
    '* [[$Group.$Name]]  . . . $CurrentTime - \'\' [=$ChangeSummary=]=][= \'\' ';
Note: the two spaces after "* [[$Group.$Name]]" are important if you want only the last edit to a page to appear (like in RecentChanges)! If you want all edits to appear in the contributions page (multiple links to the same page, one for every edit), your format must not have double spaces.

For your comfort you can use (:include Contributions.{$Name}:) to include this on the profile page.

Contributors

  • Pm

Discussion

  • How would you apply the lowercase username fix if you're using the code PM posted above instead of the authorcontribution.php solution? I'm not a coder so I have no idea, thanks. -JC

I simply added a ucfirst call:

    
    include_once("$FarmD/scripts/author.php");
    $Authoruc = ucfirst($Author);
    if (PageExists($AuthorPage))
      $RecentChangesFmt['Contributions.$Author'] =
        '* [[$Group.$Name]]  . . . $CurrentTime - \'\' [=$ChangeSummary=] \'\' ';
    

celok

Here's an alternative approach.
These lines produce a Profiles.<author's name>-Contrib page for any author with an existing page in the Profiles group. Other authors' contributions are placed in a single Profiles.Other-Contrib page.

if ($action == 'edit' || $action == 'comment') {
  include_once("$FarmD/scripts/author.php");
  if (PageExists($AuthorPage)) {
    $RecentChangesFmt['Profiles.{$Author}-Contrib'] =
      '* [[$Group.$Name]]  ([[($Group.$Name?action=)diff]])'
      .' . . . $CurrentTime - [=$ChangeSummary=]';
  } else {
    $RecentChangesFmt['Profiles.Other-Contrib'] =
      '* [[$Group.$Name]]  ([[($Group.$Name?action=)diff]])'
    .' . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';
  }
}

--Hagan