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/wordpress/trunk/instadisc/instadisc.php55
1 files changed, 54 insertions, 1 deletions
diff --git a/update/plugin/wordpress/trunk/instadisc/instadisc.php b/update/plugin/wordpress/trunk/instadisc/instadisc.php index c5eae1f..ba65516 100644 --- a/update/plugin/wordpress/trunk/instadisc/instadisc.php +++ b/update/plugin/wordpress/trunk/instadisc/instadisc.php
@@ -58,6 +58,20 @@ function id_settings_page()
58 </TD> 58 </TD>
59</TR> 59</TR>
60<TR VALIGN="top"> 60<TR VALIGN="top">
61 <TH SCOPE="row"><LABEL>Central Server Username</LABEL>
62 <TD>
63 <INPUT TYPE="text" NAME="instaDisc_blogPost_centralServer_username" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer_username')); ?>" SIZE="40">
64 <BR>This is the username you signed up with at your central server, and the one that you will/have register(ed) this subscription under.
65 </TD>
66</TR>
67<TR VALIGN="top">
68 <TH SCOPE="row"><LABEL>Central Server Password</LABEL>
69 <TD>
70 <INPUT TYPE="password" NAME="instaDisc_blogPost_centralServer_password" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer_password')); ?>" SIZE="40">
71 <BR>This is the password for the user above
72 </TD>
73</TR>
74<TR VALIGN="top">
61 <TH SCOPE="row"><LABEL>Central Server Activation Key</LABEL> 75 <TH SCOPE="row"><LABEL>Central Server Activation Key</LABEL>
62 <TD> 76 <TD>
63 <INPUT TYPE="text" NAME="instaDisc_blogPost_centralServer_activationKey" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer_activationKey')); ?>" SIZE="40"> 77 <INPUT TYPE="text" NAME="instaDisc_blogPost_centralServer_activationKey" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer_activationKey')); ?>" SIZE="40">
@@ -82,6 +96,20 @@ function id_settings_page()
82 </TD> 96 </TD>
83</TR> 97</TR>
84<TR VALIGN="top"> 98<TR VALIGN="top">
99 <TH SCOPE="row"><LABEL>Central Server Username</LABEL>
100 <TD>
101 <INPUT TYPE="text" NAME="instaDisc_comment_centralServer_username" VALUE="<?php echo(get_option('instaDisc_comment_centralServer_username')); ?>" SIZE="40">
102 <BR>This is the username you signed up with at your central server, and the one that you will/have register(ed) this subscription under.
103 </TD>
104</TR>
105<TR VALIGN="top">
106 <TH SCOPE="row"><LABEL>Central Server Password</LABEL>
107 <TD>
108 <INPUT TYPE="password" NAME="instaDisc_comment_centralServer_password" VALUE="<?php echo(get_option('instaDisc_comment_centralServer_password')); ?>" SIZE="40">
109 <BR>This is the password for the user above
110 </TD>
111</TR>
112<TR VALIGN="top">
85 <TH SCOPE="row"><LABEL>Central Server Activation Key</LABEL> 113 <TH SCOPE="row"><LABEL>Central Server Activation Key</LABEL>
86 <TD> 114 <TD>
87 <INPUT TYPE="text" NAME="instaDisc_comment_centralServer_activationKey" VALUE="<?php echo(get_option('instaDisc_comment_centralServer_activationKey')); ?>" SIZE="40"> 115 <INPUT TYPE="text" NAME="instaDisc_comment_centralServer_activationKey" VALUE="<?php echo(get_option('instaDisc_comment_centralServer_activationKey')); ?>" SIZE="40">
@@ -97,9 +125,34 @@ function id_settings_page()
97</TR> 125</TR>
98</TABLE> 126</TABLE>
99<INPUT TYPE="hidden" NAME="action" VALUE="update"> 127<INPUT TYPE="hidden" NAME="action" VALUE="update">
100<INPUT TYPE="hidden" NAME="page_options" VALUE="instaDisc_subscription_title,instadisc_blogPost_centralServer_activationKey,instaDisc_blogPost_centralServer,instaDisc_comment_centralServer_activationKey,instaDisc_comment_centralServer"> 128<INPUT TYPE="hidden" NAME="page_options" VALUE="instaDisc_subscription_title,instadisc_blogPost_centralServer_activationKey,instaDisc_blogPost_centralServer,instaDisc_comment_centralServer_activationKey,instaDisc_comment_centralServer,instaDisc_blogPost_centralServer_username,instaDisc_blogPost_centralServer_password,instaDisc_comment_centralServer_username,instaDisc_comment_centralServer_passsword">
101<P CLASS="submit"><INPUT TYPE="submit" NAME="Submit" VALUE="<?php _e('Save Changes') ?>"></P> 129<P CLASS="submit"><INPUT TYPE="submit" NAME="Submit" VALUE="<?php _e('Save Changes') ?>"></P>
102</FORM></DIV><?php 130</FORM></DIV><?php
103} 131}
104 132
133add_action('publish_post','sendPost');
134
135include('xmlrpc/xmlrpc.inc');
136
137function sendPost($id)
138{
139 $post = get_post($id);
140 $title = $post->post_title;
141 $author = $post->post_author;
142 $url = $post->guid;
143
144 $verID = rand(1,65536);
145
146 $client = new xmlrpc_client(get_option('instaDisc_blogPost_centralServer'));
147 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval(get_option('instaDisc_blogPost_centralServer_username'), 'string'),
148 new xmlrpcval(md5(get_option('instaDisc_blogPost_centralServer_username') . ':' . md5(get_option('instaDisc_blogPost_centralServer_password')) . ':' . $verID), 'string'),
149 new xmlrpcval($verID, 'int'),
150 new xmlrpcval(get_option('siteurl') . '/', 'string'),
151 new xmlrpcval($title, 'string'),
152 new xmlrpcval($author, 'string'),
153 new xmlrpcval($url, 'string'),
154 new xmlrpcval(array(), 'array')));
155 $client->send($msg);
156}
157
105?> 158?>