about summary refs log tree commit diff stats
path: root/update/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'update/plugin')
-rw-r--r--update/plugin/mediawiki/trunk/instadisc/instadisc.php (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/instadisc.php)27
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/array_key_exists.php (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/array_key_exists.php)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/is_a.php (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_a.php)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/is_callable.php (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_callable.php)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/is_scalar.php (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_scalar.php)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/var_export.php (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/var_export.php)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/version_compare.php (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/version_compare.php)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpc.inc (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpc.inc)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpc_wrappers.inc (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpc_wrappers.inc)0
-rwxr-xr-xupdate/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpcs.inc (renamed from update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpcs.inc)0
10 files changed, 23 insertions, 4 deletions
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/instadisc.php b/update/plugin/mediawiki/trunk/instadisc/instadisc.php index 1cc0683..ecaed84 100644 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/instadisc.php +++ b/update/plugin/mediawiki/trunk/instadisc/instadisc.php
@@ -15,9 +15,9 @@ $wgHooks['ArticleSaveComplete'][] = 'instaDisc_sendItem';
15 15
16function instaDisc_sendItem(&$article, &$user, &$text, &$summary, &$minoredit, &$watchthis, &$sectionanchor, &$flags, &$revision) 16function instaDisc_sendItem(&$article, &$user, &$text, &$summary, &$minoredit, &$watchthis, &$sectionanchor, &$flags, &$revision)
17{ 17{
18 global $instaDisc_password, $instaDisc_subscriptionURL; 18 global $instaDisc_title, $instaDisc_password;
19 19
20 if (!isset($instaDisc_password) || !isset($instaDisc_subscriptionURL)) 20 if (!isset($instaDisc_title))
21 { 21 {
22 return false; 22 return false;
23 } 23 }
@@ -26,8 +26,10 @@ function instaDisc_sendItem(&$article, &$user, &$text, &$summary, &$minoredit, &
26 $author = $user->getName(); 26 $author = $user->getName();
27 $url = $article->getTitle()->getFullURL(); 27 $url = $article->getTitle()->getFullURL();
28 28
29 $subscriptionURL = 'http://' . $_SERVER['SERVER_NAME'] . '/page-change/' . generateSlug($instaDisc_title) . '/';
30
29 $encID = 0; 31 $encID = 0;
30 if (($instaDisc_password != '') && (extension_loaded('mcrypt'))) 32 if ((!isset($instaDisc_password) && ($instaDisc_password != '')) && (extension_loaded('mcrypt')))
31 { 33 {
32 $encID = encryptData($title, $author, $url, $instaDisc_password); 34 $encID = encryptData($title, $author, $url, $instaDisc_password);
33 } 35 }
@@ -35,7 +37,7 @@ function instaDisc_sendItem(&$article, &$user, &$text, &$summary, &$minoredit, &
35 $verID = rand(1,2147483647); 37 $verID = rand(1,2147483647);
36 38
37 $client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php'); 39 $client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php');
38 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($instaDisc_subscriptionURL, 'string'), 40 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($subscriptionURL, 'string'),
39 new xmlrpcval($title, 'string'), 41 new xmlrpcval($title, 'string'),
40 new xmlrpcval($author, 'string'), 42 new xmlrpcval($author, 'string'),
41 new xmlrpcval($url, 'string'), 43 new xmlrpcval($url, 'string'),
@@ -55,6 +57,23 @@ function instaDisc_sendItem(&$article, &$user, &$text, &$summary, &$minoredit, &
55 } 57 }
56} 58}
57 59
60function generateSlug($title)
61{
62 $title = preg_replace('/[^A-Za-z0-9]/','-',$title);
63 $title = preg_replace('/-{2,}/','-',$title);
64 if (substr($title,0,1) == '-')
65 {
66 $title = substr($title,1);
67 }
68 if (substr($title,strlen($title)-1,1) == '-')
69 {
70 $title = substr($title,0,strlen($title)-1);
71 }
72 $title = strtolower($title);
73
74 return($title);
75}
76
58function encryptData(&$title, &$author, &$url, $password) 77function encryptData(&$title, &$author, &$url, $password)
59{ 78{
60 $encID = rand(1,2147483647); 79 $encID = rand(1,2147483647);
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/array_key_exists.php b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/array_key_exists.php index c5ae519..c5ae519 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/array_key_exists.php +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/array_key_exists.php
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_a.php b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/is_a.php index d98db1f..d98db1f 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_a.php +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/is_a.php
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_callable.php b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/is_callable.php index b769c41..b769c41 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_callable.php +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/is_callable.php
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_scalar.php b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/is_scalar.php index c8f2bfc..c8f2bfc 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/is_scalar.php +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/is_scalar.php
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/var_export.php b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/var_export.php index 3a5ac3f..3a5ac3f 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/var_export.php +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/var_export.php
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/version_compare.php b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/version_compare.php index fc3abac..fc3abac 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/version_compare.php +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/version_compare.php
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpc.inc b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpc.inc index 06c6e44..06c6e44 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpc.inc +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpc.inc
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpc_wrappers.inc b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpc_wrappers.inc index cd0a56f..cd0a56f 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpc_wrappers.inc +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpc_wrappers.inc
diff --git a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpcs.inc b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpcs.inc index 9588919..9588919 100755 --- a/update/plugin/mediawiki/trunk/extensions/instadisc/xmlrpc/xmlrpcs.inc +++ b/update/plugin/mediawiki/trunk/instadisc/xmlrpc/xmlrpcs.inc