Wiki source for WikkaChangeNotifier


Show raw source

=====Wikka Change Notifier=====
This script will email user of changes in a wikka wiki via cron job. It uses the [[http://simplepie.org/ SimplePie library]] to read the Wikka RecentChanges XML page and [[http://phpmailer.sourceforge.net/ PHPMailer library]] to email the notice. It is packaged with both under terms of the [[http://www.opensource.org/licenses/gpl-license.php GPL]].

**[[http://code.google.com/p/klenwell/downloads/list download here]]**

====Documentation====
**installation**
Because of the wikka .htaccess settings, you can't put it in the wikka directory (as far as I know). I usually upload to the web root directory.

To test, set $_SET['call_directly'] = 1 and call page in browser.

**configuration**
I've tried to minimize changes needed to configure. There are two sections marked setting: Path Settings and Script Settings:

%%(php)
// * Path Settings
$_DIR['super'] = dirname($_SERVER['DOCUMENT_ROOT']) . _DS;
$_DIR['this_root'] = dirname(__FILE__) . _DS;
$_DIR['wikka_root'] = $_SERVER['DOCUMENT_ROOT'] . _DS . 'wikka' . _DS;
$_DIR['simplepie'] = $_DIR['this_root'] . 'SimplePie' . _DS;
$_DIR['phpmailer'] = $_DIR['this_root'] . 'phpmailer' . _DS;
$_PATH['simplepie_cache'] = $_DIR['this_root'] . 'cache' . _DS;

// * Script Settings
$_SET['update_period'] = 6; // hours
$_SET['wikka_xml_feed'] = 'http://DOMAIN.com/wikka' . '/RecentChanges/recentchanges.xml';
$_SET['email_to'] = 'YOUR_EMAIL@gmail.com';
$_SET['email_to_name'] = 'Wikka Admin';
$_SET['email_from_name'] = 'Wikka Update Notifier';
$_SET['email_from'] = $_SERVER['SERVER_ADMIN'];
$_SET['email_subject'] = 'Wikka Changes Update : ' . date('r');
$_SET['call_directly'] = 0; // for testing, set to 0 to run as cron exclusively
%%

Coordinate cron tab with **$_SET['update_period']** -- i.e., if it is set to 6 (hours), run your cron every 6 hours. With my cPanel accounts, I use the following command:

""<span style='color:blue;'>lynx -dump 'http://yourdomain.com/wikka_changemail/cron.changemail.php</span>'""

**result**
When successfully run, the script will send an email that looks like this:

%%
SUBJECT: Wikka Changes Update : Fri, 16 Mar 2007 18:30:01 -0500

2 changes to http://www.klenwell.net/is/ in last 6 hours

KlenwellAdmin (2007-03-16 14:30:52 by KlenwellAdmin)
http://www.klenwell.net/is/KlenwellAdmin
updated 0 days 3 hours 59 mins 9 secs ago

HostingAdminCron (2007-03-16 12:42:10 by KlenwellAdmin)
http://www.klenwell.net/is/HostingAdminCron
updated 0 days 5 hours 47 mins 51 secs ago
%%

====Reference====
**Other Wikka Notification Scripts**
[[http://wikkawiki.org/PageWatches Page Watches (db-based email script)]]
[[http://wikkawiki.org/RyeBreadDraftsEventNotification Events Notification (db-based email script)]]
[[http://wikkawiki.org/NotifyOnChange?show_comments=1 Notify on Change (simple email script)]]
Valid XHTML 1.0 TransitionalValid CSSWikkaWiki