tips:subscription
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tips:subscription [2008-08-09 17:16] – created clorr | tips:subscription [2015-09-14 11:33] (current) – davemidd | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Linked from [[: | ||
+ | |||
+ | ^It appears this is now included in DokuWiki 2009-02-14 (which confused me after upgrading, cos I initially thought the upgrade had broken subscriptions! LOL ). It's hardcoded to not send subscription emails to the editor of the page. If for some reason you want the old behaviour back (i.e. //do// get emails for your own edits), modify the call to '' | ||
+ | |||
+ | ====== Prevent Email Of Changes to Subscribed Author ====== | ||
+ | |||
+ | You may wish to avoid sending emails to the author of the change, if the author is subscribed. Because- of course the author already knows that he/she made a change. I submit the below code change in order to work around this issue. It may be desirable to add a config flag for this setting. Possibly something each individual user can toggle for him/ | ||
+ | |||
+ | In Detritus (& possibly older?) a change is needed to ' | ||
+ | < | ||
+ | diff -Naur common.php.orig common.php | ||
+ | --- common.php.orig | ||
+ | +++ common.php | ||
+ | @@ -1318,7 +1318,7 @@ | ||
+ | } elseif($who == ' | ||
+ | | ||
+ | | ||
+ | - $data = array(' | ||
+ | + $data = array(' | ||
+ | | ||
+ | ' | ||
+ | | ||
+ | </ | ||
+ | --- [[user> | ||
+ | ===== Implementation Of Work-Around ===== | ||
+ | |||
+ | * Edit the **inc/ | ||
+ | * At the end of this file is a function called **subscriber_addresslist(...)**. This function gets the list of subscribers to a page. This function should now have a new parameter ($exclude_current_user). And it checks if the given user is the current user in the foreach loop and skips it. Replace your version with this new version: | ||
+ | |||
+ | < | ||
+ | /** | ||
+ | * Return a string with the email addresses of all the | ||
+ | * users subscribed to a page | ||
+ | * | ||
+ | * @param | ||
+ | * @param | ||
+ | | ||
+ | * @author Steven Danz < | ||
+ | * @author (Workaround to skip current user) Sherri Wheeler (www.start.ofitall.com) | ||
+ | */ | ||
+ | function subscriber_addresslist($id, | ||
+ | global $conf; | ||
+ | global $auth; | ||
+ | global $USERINFO; | ||
+ | |||
+ | $emails = ''; | ||
+ | |||
+ | if (!$conf[' | ||
+ | |||
+ | $mlist = array(); | ||
+ | $file=metaFN($id,' | ||
+ | if (@file_exists($file)) { | ||
+ | $mlist = file($file); | ||
+ | } | ||
+ | foreach ($mlist as $who) { | ||
+ | $who = rtrim($who); | ||
+ | $info = $auth-> | ||
+ | $level = auth_aclcheck($id, | ||
+ | |||
+ | if( $exclude_current_user && ($info[' | ||
+ | continue; | ||
+ | } | ||
+ | |||
+ | if ($level >= AUTH_READ) { | ||
+ | if (strcasecmp($info[' | ||
+ | if (empty($emails)) { | ||
+ | $emails = $info[' | ||
+ | } else { | ||
+ | $emails = " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | return $emails; | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | * Finally, in the same file, the **notify(...)** function makes a call to the subscriber_addresslist function (around line 841). Change this to the following: | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | $bcc = subscriber_addresslist($id, | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | * That's it! It may be helpful to, instead of hard-coding the ' | ||
+ | |||
+ | * This work-around/ | ||