Revision history for NotifyOnChange


Revision [23225]

Last edited on 2016-05-20 07:38:47 by AdamCrews [Replaces old-style internal links with new pipe-split links.]
Additions:
[**Credits**: Charles Nepote, [[http://www.wikini.net/ | Wikini]] ]
This simple patch, adapted from a [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel | suggestion]] made by Charles Nepote on [[http://www.wikini.net/ | Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.
Deletions:
[**Credits**: Charles Nepote, [[http://www.wikini.net/ Wikini]] ]
This simple patch, adapted from a [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel suggestion]] made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.


Revision [19199]

Edited on 2008-01-28 00:14:43 by AdamCrews [Modified links pointing to docs server]

No Differences

Revision [16975]

Edited on 2007-05-31 23:27:32 by AdamCrews [Reverted]
Additions:
if (function_exists('mail') && $this->config["notify_users"]) {
$Watchers = explode(",", $this->config["notify_users"]);
if ($pages = $this->LoadRevisions($this->tag)) {
$c = 0;
$diff = $this->GetPageTag() . "/diff?";
foreach ($pages as $page) {
$c++;
if ($c <= 3) {
if ($c == 1) $diff .= "a=".$page["id"];
if ($c == 2) $diff .= "&b=".$page["id"];
}
}
}
foreach ($Watchers as $Watcher) {
$MailAdr = $this->LoadSingle("select email from " .$this->config["table_prefix"]."users where name = '".mysql_escape_string($Watcher)."'");
$subject = "[".$this->config["wakka_name"]."] The page \"" . $this->GetPageTag() . "\" has been edited by " .
$this->GetUserName();
$message = "<p>Hi, " . $Watcher . "</p>";
$message .= "<p>The following page has been edited : <a
href=\"".$this->Href("",$tag,"")."\">".$this->Href("",$tag,"")."<a></p>";
if ($pages) $message .= "<p>Modifications : <a href=\"".$this->Href("",$diff,"")."\">".$this->Href("",$diff,"")."<a></p>";
$message .= "<p>-- The ".$this->config["wakka_name"]." robot</p>";
$headers = "From: " . $this->config["wakka_name"] . "_notifier\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
//comment this to send text format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($MailAdr["email"], $subject, $message, $headers);
}
}
-- DarTar
Since I like to test with a 'SandBox' page, but dont want emails sent for edits to this page, I changed the first line of the above code to the following:
if (function_exists('mail') && $this->config["notify_users"] && ($this->GetPageTag() != 'SandBox')) {
Other than this small change, I love this feature.
-- AdamCrews
----
CategoryUserContributions
Deletions:
if (function_exists('mail')


Revision [16774]

Edited on 2007-05-31 10:46:35 by LirWqz [Reverted]
Additions:
if (function_exists('mail')
Deletions:
if (function_exists('mail') && $this->config["notify_users"]) {
$Watchers = explode(",", $this->config["notify_users"]);
if ($pages = $this->LoadRevisions($this->tag)) {
$c = 0;
$diff = $this->GetPageTag() . "/diff?";
foreach ($pages as $page) {
$c++;
if ($c <= 3) {
if ($c == 1) $diff .= "a=".$page["id"];
if ($c == 2) $diff .= "&b=".$page["id"];
}
}
}
foreach ($Watchers as $Watcher) {
$MailAdr = $this->LoadSingle("select email from " .$this->config["table_prefix"]."users where name = '".mysql_escape_string($Watcher)."'");
$subject = "[".$this->config["wakka_name"]."] The page \"" . $this->GetPageTag() . "\" has been edited by " .
$this->GetUserName();
$message = "<p>Hi, " . $Watcher . "</p>";
$message .= "<p>The following page has been edited : <a
href=\"".$this->Href("",$tag,"")."\">".$this->Href("",$tag,"")."<a></p>";
if ($pages) $message .= "<p>Modifications : <a href=\"".$this->Href("",$diff,"")."\">".$this->Href("",$diff,"")."<a></p>";
$message .= "<p>-- The ".$this->config["wakka_name"]." robot</p>";
$headers = "From: " . $this->config["wakka_name"] . "_notifier\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
//comment this to send text format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($MailAdr["email"], $subject, $message, $headers);
}
}
-- DarTar
Since I like to test with a 'SandBox' page, but dont want emails sent for edits to this page, I changed the first line of the above code to the following:
if (function_exists('mail') && $this->config["notify_users"] && ($this->GetPageTag() != 'SandBox')) {
Other than this small change, I love this feature.
-- AdamCrews
----
CategoryUserContributions


Revision [13234]

Edited on 2006-02-20 14:22:54 by AdamCrews [Added note about excluding the SandBox page.]
Additions:
=====Notify On Change=====

[**Credits**: Charles Nepote, [[http://www.wikini.net/ Wikini]] ]

This simple patch, adapted from a [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel suggestion]] made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.

__Watch out!__: consider that each edited page generates an email, so add this patch at your own risk.

How to install the notification function:

1. Add the following line to ##wakka.config.php##:

%%(php) "notify_users" =>"DarTar, OtherUser",
%%

2. Add the following code in ##handlers/page/edit.php## just before ##""//forward""##

%%(php)
if (function_exists('mail') && $this->config["notify_users"]) {
$Watchers = explode(",", $this->config["notify_users"]);
if ($pages = $this->LoadRevisions($this->tag)) {
$c = 0;
$diff = $this->GetPageTag() . "/diff?";
foreach ($pages as $page) {
$c++;
if ($c <= 3) {
if ($c == 1) $diff .= "a=".$page["id"];
if ($c == 2) $diff .= "&b=".$page["id"];
}
}
}
foreach ($Watchers as $Watcher) {
$MailAdr = $this->LoadSingle("select email from " .$this->config["table_prefix"]."users where name = '".mysql_escape_string($Watcher)."'");
$subject = "[".$this->config["wakka_name"]."] The page \"" . $this->GetPageTag() . "\" has been edited by " .
$this->GetUserName();
$message = "<p>Hi, " . $Watcher . "</p>";
$message .= "<p>The following page has been edited : <a
href=\"".$this->Href("",$tag,"")."\">".$this->Href("",$tag,"")."<a></p>";
if ($pages) $message .= "<p>Modifications : <a href=\"".$this->Href("",$diff,"")."\">".$this->Href("",$diff,"")."<a></p>";
$message .= "<p>-- The ".$this->config["wakka_name"]." robot</p>";
$headers = "From: " . $this->config["wakka_name"] . "_notifier\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
//comment this to send text format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($MailAdr["email"], $subject, $message, $headers);
}
}
%%

-- DarTar


Since I like to test with a 'SandBox' page, but dont want emails sent for edits to this page, I changed the first line of the above code to the following:

%%(php)
if (function_exists('mail') && $this->config["notify_users"] && ($this->GetPageTag() != 'SandBox')) {
%%
Other than this small change, I love this feature.

-- AdamCrews
----
Deletions:
=====Notify On Change=====

[**Credits**: Charles Nepote, [[http://www.wikini.net/ Wikini]] ]

This simple patch, adapted from a [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel suggestion]] made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.

__Watch out!__: consider that each edited page generates an email, so add this patch at your own risk.

How to install the notification function:

1. Add the following line to ##wakka.config.php##:

%%(php) "notify_users" =>"DarTar, OtherUser",
%%

2. Add the following code in ##handlers/page/edit.php## just before ##""//forward""##

%%(php)
if (function_exists('mail') && $this->config["notify_users"]) {
$Watchers = explode(",", $this->config["notify_users"]);
if ($pages = $this->LoadRevisions($this->tag)) {
$c = 0;
$diff = $this->GetPageTag() . "/diff?";
foreach ($pages as $page) {
$c++;
if ($c <= 3) {
if ($c == 1) $diff .= "a=".$page["id"];
if ($c == 2) $diff .= "&b=".$page["id"];
}
}
}
foreach ($Watchers as $Watcher) {
$MailAdr = $this->LoadSingle("select email from " .$this->config["table_prefix"]."users where name = '".mysql_escape_string($Watcher)."'");
$subject = "[".$this->config["wakka_name"]."] The page \"" . $this->GetPageTag() . "\" has been edited by " .
$this->GetUserName();
$message = "<p>Hi, " . $Watcher . "</p>";
$message .= "<p>The following page has been edited : <a
href=\"".$this->Href("",$tag,"")."\">".$this->Href("",$tag,"")."<a></p>";
if ($pages) $message .= "<p>Modifications : <a href=\"".$this->Href("",$diff,"")."\">".$this->Href("",$diff,"")."<a></p>";
$message .= "<p>-- The ".$this->config["wakka_name"]." robot</p>";
$headers = "From: " . $this->config["wakka_name"] . "_notifier\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
//comment this to send text format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($MailAdr["email"], $subject, $message, $headers);
}
}
%%

-- DarTar


----


Revision [4739]

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


Revision [2015]

Edited on 2004-10-26 10:05:58 by NilsLindenberg [category added]
Additions:
=====Notify On Change=====

[**Credits**: Charles Nepote, [[http://www.wikini.net/ Wikini]] ]

This simple patch, adapted from a [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel suggestion]] made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.

__Watch out!__: consider that each edited page generates an email, so add this patch at your own risk.

How to install the notification function:

1. Add the following line to ##wakka.config.php##:

%%(php) "notify_users" =>"DarTar, OtherUser",
%%

2. Add the following code in ##handlers/page/edit.php## just before ##""//forward""##

%%(php)
if (function_exists('mail') && $this->config["notify_users"]) {
$Watchers = explode(",", $this->config["notify_users"]);
if ($pages = $this->LoadRevisions($this->tag)) {
$c = 0;
$diff = $this->GetPageTag() . "/diff?";
foreach ($pages as $page) {
$c++;
if ($c <= 3) {
if ($c == 1) $diff .= "a=".$page["id"];
if ($c == 2) $diff .= "&b=".$page["id"];
}
}
}
foreach ($Watchers as $Watcher) {
$MailAdr = $this->LoadSingle("select email from " .$this->config["table_prefix"]."users where name = '".mysql_escape_string($Watcher)."'");
$subject = "[".$this->config["wakka_name"]."] The page \"" . $this->GetPageTag() . "\" has been edited by " .
$this->GetUserName();
$message = "<p>Hi, " . $Watcher . "</p>";
$message .= "<p>The following page has been edited : <a
href=\"".$this->Href("",$tag,"")."\">".$this->Href("",$tag,"")."<a></p>";
if ($pages) $message .= "<p>Modifications : <a href=\"".$this->Href("",$diff,"")."\">".$this->Href("",$diff,"")."<a></p>";
$message .= "<p>-- The ".$this->config["wakka_name"]." robot</p>";
$headers = "From: " . $this->config["wakka_name"] . "_notifier\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
//comment this to send text format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($MailAdr["email"], $subject, $message, $headers);
}
}
%%

-- DarTar


----
CategoryDevelopment
Deletions:
=====Notify On Change=====

[**Credits**: Charles Nepote, [[http://www.wikini.net/ Wikini]] ]

This simple patch, adapted from a [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel suggestion]] made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.

__Watch out!__: consider that each edited page generates an email, so add this patch at your own risk.

How to install the notification function:

1. Add the following line to ##wakka.config.php##:

%%(php) "notify_users" =>"DarTar, OtherUser",
%%

2. Add the following code in ##handlers/page/edit.php## just before ##""//forward""##

%%(php)if (function_exists('mail') && $this->config["notify_users"]) {
$Watchers = explode(",", $this->config["notify_users"]);
if ($pages = $this->LoadRevisions($this->tag)) {
$c = 0;
$diff = $this->GetPageTag() . "/diff?";
foreach ($pages as $page) {
$c++;
if ($c <= 3) {
if ($c == 1) $diff .= "a=".$page["id"];
if ($c == 2) $diff .= "&b=".$page["id"];
}
}
}
foreach ($Watchers as $Watcher) {
$MailAdr = $this->LoadSingle("select email from " .$this->config["table_prefix"]."users where name = '".mysql_escape_string($Watcher)."'");
$subject = "[".$this->config["wakka_name"]."] The page \"" . $this->GetPageTag() . "\" has been edited by " .
$this->GetUserName();
$message = "<p>Hi, " . $Watcher . "</p>";
$message .= "<p>The following page has been edited : <a
href=\"".$this->Href("",$tag,"")."\">".$this->Href("",$tag,"")."<a></p>";
if ($pages) $message .= "<p>Modifications : <a href=\"".$this->Href("",$diff,"")."\">".$this->Href("",$diff,"")."<a></p>";
$message .= "<p>-- The ".$this->config["wakka_name"]." robot</p>";
$headers = "From: " . $this->config["wakka_name"] . "_notifier\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
//comment this to send text format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($MailAdr["email"], $subject, $message, $headers);
}
}
%%

-- DarTar


Revision [827]

Edited on 2004-07-30 11:16:26 by DarTar [fixed credit links to wikini]
Additions:
[**Credits**: Charles Nepote, [[http://www.wikini.net/ Wikini]] ]
This simple patch, adapted from a [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel suggestion]] made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.
Deletions:
[**Credits**: Charles Nepote, [[http://www.wikini.net/wakka.php?wiki=NotificationParCourriel Wikini]] ]
This simple patch, adapted from a suggestion made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.


Revision [812]

Edited on 2004-07-29 15:04:44 by DarTar [fixed credit links to wikini]
Additions:
%%(php)if (function_exists('mail') && $this->config["notify_users"]) {
Deletions:
%%(php)if (function_exists('mail') and $this->config["notify_users"]) {


Revision [811]

Edited on 2004-07-29 15:04:15 by DarTar [fixed credit links to wikini]
Additions:
This simple patch, adapted from a suggestion made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should simply be inactive if the function is not enabled on the server.
Deletions:
This simple patch, adapted from a suggestion made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should be transparent if the function is not enabled on the server.


Revision [810]

Edited on 2004-07-29 15:03:15 by DarTar [fixed credit links to wikini]
Additions:
This simple patch, adapted from a suggestion made by Charles Nepote on [[http://www.wikini.net/ Wikini]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should be transparent if the function is not enabled on the server.
Deletions:
This simple patch, adapted from a suggestion made by Charles Nepote on [[Wikini http://www.wikini.net/]], allows the administrator or an arbitrary list of registered users to monitor the wiki and be notified by email each time a page is edited. The patch uses the php built-in mail() function and should be transparent if the function is not enabled on the server.


Revision [809]

Edited on 2004-07-29 15:02:58 by DarTar [code fixed]
Additions:
%%(php)if (function_exists('mail') and $this->config["notify_users"]) {
$Watchers = explode(",", $this->config["notify_users"]);
Deletions:
%%(php)if (function_exists('mail') and $this->config["UsersToBeMailed"]) {
$Watchers = explode(",", $this->config["UsersToBeMailed"]);


Revision [808]

Edited on 2004-07-29 15:02:16 by DarTar [code fixed]
Additions:
__Watch out!__: consider that each edited page generates an email, so add this patch at your own risk.


Revision [803]

Edited on 2004-07-29 14:48:02 by DarTar [code fixed]
Additions:
-- DarTar


Revision [802]

The oldest known version of this page was created on 2004-07-29 14:47:33 by DarTar [code fixed]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki