diff options
Diffstat (limited to 'update')
| -rw-r--r-- | update/plugin/wordpress/trunk/instadisc/instadisc.php | 30 |
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 | ||
| 133 | add_action('publish_post','sendPost'); | ||
| 134 | |||
| 135 | include('xmlrpc/xmlrpc.inc'); | 133 | include('xmlrpc/xmlrpc.inc'); |
| 136 | 134 | ||
| 135 | add_action('publish_post','sendPost'); | ||
| 136 | |||
| 137 | function sendPost($id) | 137 | function 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 | ||
| 158 | add_action('comment_post','sendComment'); | ||
| 159 | |||
| 160 | function 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 | ?> |
