about summary refs log tree commit diff stats
path: root/update/plugin/phpBB3/trunk/root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'update/plugin/phpBB3/trunk/root/includes')
-rw-r--r--update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php b/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php index 738cab9..b973020 100644 --- a/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php +++ b/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php
@@ -42,6 +42,8 @@ function sendItem($title, $userID, $url, $fourm)
42 $db->sql_freeresult($getfourm2); 42 $db->sql_freeresult($getfourm2);
43 $semantics = array('forum' => $getfourm3['forum_name']); 43 $semantics = array('forum' => $getfourm3['forum_name']);
44 44
45 $subscriptionURL = 'http://' . $_SERVER['SERVER_NAME'] . '/forum-post/' . generateSlug($config['id_subscription_title']) . '/';
46
45 $encID = 0; 47 $encID = 0;
46 if (($config['id_encryption_key'] != '') && extension_loaded('mcrypt')) 48 if (($config['id_encryption_key'] != '') && extension_loaded('mcrypt'))
47 { 49 {
@@ -66,7 +68,7 @@ function sendItem($title, $userID, $url, $fourm)
66 } 68 }
67 69
68 $client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php'); 70 $client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php');
69 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($config['id_subscription_url'], 'string'), 71 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($subscriptionURL, 'string'),
70 new xmlrpcval($title, 'string'), 72 new xmlrpcval($title, 'string'),
71 new xmlrpcval($author, 'string'), 73 new xmlrpcval($author, 'string'),
72 new xmlrpcval($url, 'string'), 74 new xmlrpcval($url, 'string'),
@@ -81,6 +83,23 @@ function sendItem($title, $userID, $url, $fourm)
81 } 83 }
82} 84}
83 85
86function generateSlug($title)
87{
88 $title = preg_replace('/[^A-Za-z0-9]/','-',$title);
89 $title = preg_replace('/-{2,}/','-',$title);
90 if (substr($title,0,1) == '-')
91 {
92 $title = substr($title,1);
93 }
94 if (substr($title,strlen($title)-1,1) == '-')
95 {
96 $title = substr($title,0,strlen($title)-1);
97 }
98 $title = strtolower($title);
99
100 return($title);
101}
102
84function encryptString($td, $key, $string) 103function encryptString($td, $key, $string)
85{ 104{
86 mcrypt_generic_init($td, $key, strrev($key)); 105 mcrypt_generic_init($td, $key, strrev($key));