diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-20 01:07:46 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-20 01:07:46 +0000 |
commit | 0d637dc342c97a646268aae4852457059e9310b6 (patch) | |
tree | d8e16fd802dce586bbcef99aab4b10799b602a55 /update/plugin/phpBB3/trunk/root | |
parent | f3d9fc3f516913112a5ddfe1a17728cdfba4007e (diff) | |
download | instadisc-0d637dc342c97a646268aae4852457059e9310b6.tar.gz instadisc-0d637dc342c97a646268aae4852457059e9310b6.tar.bz2 instadisc-0d637dc342c97a646268aae4852457059e9310b6.zip |
Update: Changed Subscription URL for phpBB3
Refs #61
Diffstat (limited to 'update/plugin/phpBB3/trunk/root')
-rw-r--r-- | update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html | 7 | ||||
-rw-r--r-- | update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php | 21 |
2 files changed, 20 insertions, 8 deletions
diff --git a/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html b/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html index a3906ee..3443649 100644 --- a/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html +++ b/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html | |||
@@ -15,13 +15,6 @@ | |||
15 | </DL> | 15 | </DL> |
16 | <DL> | 16 | <DL> |
17 | <DT> | 17 | <DT> |
18 | <LABEL FOR="series_url">{L_SUBSCRIPTION_URL}</LABEL> | ||
19 | <BR><SPAN>{L_SUBSCRIPTION_URL_DESC}</SPAN> | ||
20 | </DT> | ||
21 | <DD><INPUT NAME="subscription_url" TYPE="text" ID="subscription_url" MAXLENGTH="255" VALUE="{S_SUBSCRIPTION_URL}" SIZE="40"></DD> | ||
22 | </DL> | ||
23 | <DL> | ||
24 | <DT> | ||
25 | <LABEL FOR="encryption_key">{L_ENCRYPTION}</LABEL> | 18 | <LABEL FOR="encryption_key">{L_ENCRYPTION}</LABEL> |
26 | <BR><SPAN>{L_ENCRYPTION_DESC}</SPAN> | 19 | <BR><SPAN>{L_ENCRYPTION_DESC}</SPAN> |
27 | </DT> | 20 | </DT> |
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 | ||
86 | function 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 | |||
84 | function encryptString($td, $key, $string) | 103 | function encryptString($td, $key, $string) |
85 | { | 104 | { |
86 | mcrypt_generic_init($td, $key, strrev($key)); | 105 | mcrypt_generic_init($td, $key, strrev($key)); |