about summary refs log tree commit diff stats
path: root/update/plugin
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-05 13:40:55 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-05 13:40:55 +0000
commit1566230aefb3aa471e0ef75a2af6919a791918f1 (patch)
tree2e27c021ca895c9cec441106469d718632a8879a /update/plugin
parent88d571f729d396dc4c08ae1e53b0533fc79de484 (diff)
downloadinstadisc-1566230aefb3aa471e0ef75a2af6919a791918f1.tar.gz
instadisc-1566230aefb3aa471e0ef75a2af6919a791918f1.tar.bz2
instadisc-1566230aefb3aa471e0ef75a2af6919a791918f1.zip
Update: Added comment feed to Wordpress plugin
Now with the addition of the comment feed, the Wordpress plugin is complete. (Well, it needs some
tweaking, #17). Closes #6.
Diffstat (limited to 'update/plugin')
-rw-r--r--update/plugin/wordpress/trunk/instadisc/instadisc.php30
1 files changed, 27 insertions, 3 deletions
diff --git a/update/plugin/wordpress/trunk/instadisc/instadisc.php b/update/plugin/wordpress/trunk/instadisc/instadisc.php index ba65516..2419e70 100644 --- a/update/plugin/wordpress/trunk/instadisc/instadisc.php +++ b/update/plugin/wordpress/trunk/instadisc/instadisc.php
@@ -130,16 +130,16 @@ function id_settings_page()
130</FORM></DIV><?php 130</FORM></DIV><?php
131} 131}
132 132
133add_action('publish_post','sendPost');
134
135include('xmlrpc/xmlrpc.inc'); 133include('xmlrpc/xmlrpc.inc');
136 134
135add_action('publish_post','sendPost');
136
137function sendPost($id) 137function sendPost($id)
138{ 138{
139 $post = get_post($id); 139 $post = get_post($id);
140 $title = $post->post_title; 140 $title = $post->post_title;
141 $author = $post->post_author; 141 $author = $post->post_author;
142 $url = $post->guid; 142 $url = get_permalink($id);
143 143
144 $verID = rand(1,65536); 144 $verID = rand(1,65536);
145 145
@@ -155,4 +155,28 @@ function sendPost($id)
155 $client->send($msg); 155 $client->send($msg);
156} 156}
157 157
158add_action('comment_post','sendComment');
159
160function sendComment($id)
161{
162 $comment = get_comment($id);
163 $post = get_post($comment->comment_post_ID);
164 $title = $post->post_title;
165 $author = $comment->comment_author;
166 $url = get_permalink($comment->comment_post_ID) . "#comments";
167
168 $verID = rand(1,65536);
169
170 $client = new xmlrpc_client(get_option('instaDisc_comment_centralServer'));
171 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval(get_option('instaDisc_comment_centralServer_username'), 'string'),
172 new xmlrpcval(md5(get_option('instaDisc_comment_centralServer_username') . ':' . md5(get_option('instaDisc_comment_centralServer_password')) . ':' . $verID), 'string'),
173 new xmlrpcval($verID, 'int'),
174 new xmlrpcval(get_option('siteurl') . '/comments/', 'string'),
175 new xmlrpcval($title, 'string'),
176 new xmlrpcval($author, 'string'),
177 new xmlrpcval($url, 'string'),
178 new xmlrpcval(array(), 'array')));
179 $client->send($msg);
180}
181
158?> 182?>