Revision history for UserChangesAction


Revision [19295]

Last edited on 2008-01-28 00:14:45 by JavaWoman [Modified links pointing to docs server]

No Differences

Revision [17222]

Edited on 2007-07-07 15:17:50 by JavaWoman [updated Carlo Zottmann link in **code**]
Additions:
* @author {@link http://web.archive.org/web/20040616194824/http://www.wakkawiki.com/CarloZottmann Carlo Zottmann} (original code)
echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", ordered by the time of last edit (<a
Deletions:
* @author {@link http://www.wakkawiki.de/CarloZottmann Carlo Zottmann} (original code)
echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", ordered by the time of last edit (<a


Revision [17038]

Edited on 2007-05-31 23:27:50 by DarTar [Reverted]
Additions:
case (isset($_GET['user']) && $this->LoadUser($_GET['user'])): # a valid user is specified as an URL parameter
$author = $_GET['user'];
break;
case (isset($user) && $this->LoadUser($user)): # a valid user parameter is used
$author = $user;
break;
case ($this->GetUser()):
$author = $this->GetUserName();
break;
}
$page = $this->GetPageTag();
if ($author)
{
$user_edits_count = 0;
if ($_GET["alpha"] == 1)
{
echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", along with the time of the last edit (<a
href=\"".$this->Href("", "", "user=".$author."&date=1&action=changes")."\">order by date</a>).<br /><br />\n");
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($author)."' ORDER BY tag ASC, time DESC"))
{
foreach ($pages as $page)
{
if ($last_tag != $page["tag"]) {
$last_tag = $page["tag"];
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}

if ($firstChar != $curChar) {
if ($curChar) print("<br />\n");
print("<strong>$firstChar</strong><br />\n");
$curChar = $firstChar;
}

// print entry
print("   (".$page["time"].") (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");

$user_edits_count++;
}
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
else
{
echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", ordered by the time of last edit (<a
href=\"".$this->Href("", "", "user=".$author."&alpha=1&action=changes")."\">order alphabetically</a>).<br /><br />\n");
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($author)."' ORDER BY time ASC, tag ASC"))
{
foreach ($pages as $page)
{
$edited_pages[$page["tag"]] = $page["time"];
}
$edited_pages = array_reverse($edited_pages);
foreach ($edited_pages as $page["tag"] => $page["time"])
{
// day header
list($day, $time) = explode(" ", $page["time"]);
if ($day != $curday)
{
if ($curday) print("<br />\n");
print("<strong>$day:</strong><br />\n");
$curday = $day;
}
// print entry
print("   ($time) (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");
$user_edits_count++;
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
}
else
{
print("<em>No user specified</em>");
}
?>
%%
CategoryDevelopmentActions CategoryDevelopmentAdmin
Deletions:
case (isset($_GET['user'])


Revision [16837]

Edited on 2007-05-31 10:54:47 by Zw5Qd9 [Reverted]
Additions:
case (isset($_GET['user'])
Deletions:
case (isset($_GET['user']) && $this->LoadUser($_GET['user'])): # a valid user is specified as an URL parameter
$author = $_GET['user'];
break;
case (isset($user) && $this->LoadUser($user)): # a valid user parameter is used
$author = $user;
break;
case ($this->GetUser()):
$author = $this->GetUserName();
break;
}
$page = $this->GetPageTag();
if ($author)
{
$user_edits_count = 0;
if ($_GET["alpha"] == 1)
{
echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", along with the time of the last edit (<a
href=\"".$this->Href("", "", "user=".$author."&date=1&action=changes")."\">order by date</a>).<br /><br />\n");
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($author)."' ORDER BY tag ASC, time DESC"))
{
foreach ($pages as $page)
{
if ($last_tag != $page["tag"]) {
$last_tag = $page["tag"];
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}

if ($firstChar != $curChar) {
if ($curChar) print("<br />\n");
print("<strong>$firstChar</strong><br />\n");
$curChar = $firstChar;
}

// print entry
print("   (".$page["time"].") (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");

$user_edits_count++;
}
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
else
{
echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", ordered by the time of last edit (<a
href=\"".$this->Href("", "", "user=".$author."&alpha=1&action=changes")."\">order alphabetically</a>).<br /><br />\n");
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($author)."' ORDER BY time ASC, tag ASC"))
{
foreach ($pages as $page)
{
$edited_pages[$page["tag"]] = $page["time"];
}
$edited_pages = array_reverse($edited_pages);
foreach ($edited_pages as $page["tag"] => $page["time"])
{
// day header
list($day, $time) = explode(" ", $page["time"]);
if ($day != $curday)
{
if ($curday) print("<br />\n");
print("<strong>$day:</strong><br />\n");
$curday = $day;
}
// print entry
print("   ($time) (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");
$user_edits_count++;
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
}
else
{
print("<em>No user specified</em>");
}
?>
%%
CategoryDevelopmentActions CategoryDevelopmentAdmin


Revision [9771]

Edited on 2005-07-05 08:13:33 by DarTar [adding link]
Additions:
>>**See also:**
AdminModules
>><<This action is meant as a module to integrate the MyChanges action into the **UserAdmin** tool.
Deletions:
<<This action is meant as a module to integrate the MyChanges action into the **UserAdmin** tool.


Revision [8696]

Edited on 2005-05-29 12:25:32 by JavaWoman [new categories]
Additions:
CategoryDevelopmentActions CategoryDevelopmentAdmin
Deletions:
CategoryUserContributions


Revision [7345]

Edited on 2005-04-18 07:34:19 by DarTar [UserChanges v.0.4 - added action parameter support]
Additions:
This is an upgraded version of the MyChanges action. It allows not only to display pages edited by current user but also by any other registered user specified either via a ##user## action parameter or via a ##user## GET variable.
Deletions:
This is an upgraded version of the MyChanges action. It allows not only to display pages edited by current user but also by any other registered user via a ##user## GET variable


Revision [7344]

Edited on 2005-04-18 07:33:00 by DarTar [UserChanges v.0.4]
Additions:
===== ""UserChanges"" Action =====
{{lastedit}}

<<This action is meant as a module to integrate the MyChanges action into the **UserAdmin** tool.
To use it as a standalone action simply add: --- ##""{{userchanges user="UserName"}}""## in the page body.<< ::c::

This is an upgraded version of the MyChanges action. It allows not only to display pages edited by current user but also by any other registered user via a ##user## GET variable

Save the code below as ##actions/userchanges.php##.

=== The action ===
Current version: 0.4

Changes:
~-Added documentation header;
~-Initialized variables;
~-User is checked in the following order: GET parameter, action parameter, current user;

To do:
~-(Optionally) create a config option allowing admins to decide whether users can display pages modified by other users;


----

<<##actions/userchanges.php##<<


%%(php)
<?php

/**
* Display a list of recent changes made by a user.
*
* This action can be used to display a list of pages modified by a specific user. It
* accepts a user value both as an action parameter and as a GET parameter. The
* specified user must be an existing user. If no user parameter is specified
* or the specified user is invalid, an error message is printed. If no user parameter
* is specified or the specified user is invalid, and the current user is logged in,
* the action will display a list of pages recently changed by the current user.
*
* @package Actions
* @name Userchanges
*
* @author {@link http://www.wakkawiki.de/CarloZottmann Carlo Zottmann} (original code)
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli} (modified action)
* @version 0.4
* @since Wikka 1.1.X.X
* @output list of pages recently modified by the specified user
* @input string $user optional: a valid user name;
* default: current user, if user is logged in;
* the default can be overridden by providing a URL parameter 'user';
* @todo
* - (Optionally) create a config option allowing admins to decide whether users can
* display pages modified by other users;
*/

$author =''; #initializing variable

switch(true) {
case (isset($_GET['user']) && $this->LoadUser($_GET['user'])): # a valid user is specified as an URL parameter
$author = $_GET['user'];
break;

case (isset($user) && $this->LoadUser($user)): # a valid user parameter is used
$author = $user;
break;

case ($this->GetUser()):
$author = $this->GetUserName();
break;
}

$page = $this->GetPageTag();

if ($author)
{
$user_edits_count = 0;

if ($_GET["alpha"] == 1)
{
echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", along with the time of the last edit (<a
href=\"".$this->Href("", "", "user=".$author."&date=1&action=changes")."\">order by date</a>).<br /><br />\n");

if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($author)."' ORDER BY tag ASC, time DESC"))
{
foreach ($pages as $page)
{
if ($last_tag != $page["tag"]) {
$last_tag = $page["tag"];
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}

if ($firstChar != $curChar) {
if ($curChar) print("<br />\n");
print("<strong>$firstChar</strong><br />\n");
$curChar = $firstChar;
}

// print entry
print("   (".$page["time"].") (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");

$user_edits_count++;
}
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
else
{

echo $this->Format("== Pages modified by [[".$author."]] == --- --- ");
print("This is a list of pages edited by ".$this->Link($author).", ordered by the time of last edit (<a
href=\"".$this->Href("", "", "user=".$author."&alpha=1&action=changes")."\">order alphabetically</a>).<br /><br />\n");

if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($author)."' ORDER BY time ASC, tag ASC"))
{
foreach ($pages as $page)
{
$edited_pages[$page["tag"]] = $page["time"];
}

$edited_pages = array_reverse($edited_pages);

foreach ($edited_pages as $page["tag"] => $page["time"])
{
// day header
list($day, $time) = explode(" ", $page["time"]);
if ($day != $curday)
{
if ($curday) print("<br />\n");
print("<strong>$day:</strong><br />\n");
$curday = $day;
}

// print entry
print("   ($time) (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");

$user_edits_count++;
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
}
else
{
print("<em>No user specified</em>");
}

?>
%%

----
Deletions:
===== ""UserChanges"" Action =====
''Last Updated: 2004-11-23 - ""RewriteRules"" bug fixed''

This is an upgraded version of the MyChanges action. It allows not only to display pages edited by current user but also by any other registered user via a ##user## GET variable

<<This action is meant as a module to integrate the MyChanges action into the **UserAdmin** tool.
To use it as a standalone action simply add ##""{{userchanges}}""## in one of your pages.<< ::c::


Save the following code as ##actions/userchanges.php##.

-- DarTar

----

<<##actions/userchanges.php##<<


%%(php)
<?php

// Shows pages modified by $_GET["user"] or, if this is not provided, by the current user.
// Adapted from actions/mychanges.php written by Carlo Zottmann

$page = $this->GetPageTag();
$user = (($_GET["user"])? $_GET["user"] : $this->GetUserName());

if ($user)
{
$user_edits_count = 0;

if ($_GET["alpha"] == 1)
{
echo $this->Format("== Pages modified by [[".$user."]] == --- --- ");
print("<strong>This is a list of pages edited by ".$this->Link($user).", along with the time of the last edit (<a
href=\"".$this->Href("", "", "user=".$user."&date=1&action=changes")."\">order by date</a>).</strong><br /><br />\n");

if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($user)."' ORDER BY tag ASC, time DESC"))
{
foreach ($pages as $page)
{
if ($last_tag != $page["tag"]) {
$last_tag = $page["tag"];
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}

if ($firstChar != $curChar) {
if ($curChar) print("<br />\n");
print("<strong>$firstChar</strong><br />\n");
$curChar = $firstChar;
}

// print entry
print("   (".$page["time"].") (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");

$user_edits_count++;
}
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
else
{

echo $this->Format("== Pages modified by [[".$user."]] == --- --- ");
print("<strong>This is a list of pages edited by ".$this->Link($user).", ordered by the time of last edit (<a
href=\"".$this->Href("", "", "user=".$user."&alpha=1&action=changes")."\">order alphabetically</a>).</strong><br /><br />\n");

if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user =
'".mysql_real_escape_string($user)."' ORDER BY time ASC, tag ASC"))
{
foreach ($pages as $page)
{
$edited_pages[$page["tag"]] = $page["time"];
}

$edited_pages = array_reverse($edited_pages);

foreach ($edited_pages as $page["tag"] => $page["time"])
{
// day header
list($day, $time) = explode(" ", $page["time"]);
if ($day != $curday)
{
if ($curday) print("<br />\n");
print("<strong>$day:</strong><br />\n");
$curday = $day;
}

// print entry
print("   ($time) (".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."<br />\n");

$user_edits_count++;
}

if ($user_edits_count == 0)
{
print("<em>User has not edited any pages yet.</em>");
}
}
else
{
print("<em>No pages found.</em>");
}
}
}
else
{
print("<em>No user specified</em>");
}

?>

%%


----


Revision [4765]

Edited on 2005-01-17 14:58:14 by NilsLindenberg [cat. changed]
Additions:
CategoryUserContributions
Deletions:
CategoryDevelopment


Revision [2378]

Edited on 2004-11-23 08:54:50 by DarTar [RewriteRules bug fixed]
Additions:
''Last Updated: 2004-11-23 - ""RewriteRules"" bug fixed''
href=\"".$this->Href("", "", "user=".$user."&date=1&action=changes")."\">order by date</a>).</strong><br /><br />\n");
href=\"".$this->Href("", "", "user=".$user."&alpha=1&action=changes")."\">order alphabetically</a>).</strong><br /><br />\n");
Deletions:
href=\"".$page."?user=".$user."&date=1&action=changes\">order by date</a>).</strong><br /><br />\n");
href=\"".$page."?user=".$user."&alpha=1&action=changes\">order alphabetically</a>).</strong><br /><br />\n");


Revision [1982]

Edited on 2004-10-25 18:16:24 by NilsLindenberg [category added]
Additions:
%%
CategoryDevelopment
Deletions:
%%


Revision [1265]

Edited on 2004-09-16 09:38:56 by DarTar [category added]
Additions:
<<This action is meant as a module to integrate the MyChanges action into the **UserAdmin** tool.
Deletions:
<<This action is meant as a module to integrate the MyChanges action into the UserAdmin tool.


Revision [1264]

Edited on 2004-09-16 09:38:35 by DarTar [category added]
Additions:
<<This action is meant as a module to integrate the MyChanges action into the UserAdmin tool.
To use it as a standalone action simply add ##""{{userchanges}}""## in one of your pages.<< ::c::
Deletions:
<<This action is meant as a module to integrate the MyChanges action into the UserAdmin tool. To use it as a standalone action simply add ##{{userchanges}} in one of your pages<<


Revision [1263]

Edited on 2004-09-16 09:37:17 by DarTar [category added]
Additions:
<<This action is meant as a module to integrate the MyChanges action into the UserAdmin tool. To use it as a standalone action simply add ##{{userchanges}} in one of your pages<<
Deletions:
<<(This action is meant as a module to integrate the MyChanges action into the UserAdmin tool).<<


Revision [1255]

Edited on 2004-09-16 09:26:59 by DarTar [category added]
Additions:
----
<<##actions/userchanges.php##<<


Revision [1244]

The oldest known version of this page was created on 2004-09-16 09:11:25 by DarTar [category added]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki