about summary refs log tree commit diff stats
path: root/data/maps/the_sweet/doors.txtpb
diff options
context:
space:
mode:
Diffstat (limited to 'data/maps/the_sweet/doors.txtpb')
0 files changed, 0 insertions, 0 deletions
1'>71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
<?php
/*
Plugin Name: InstaDisc Update Server
Plugin URI: http://fourisland.com/projects/instadisc/wiki/Update_Wordpress_Plugin
Description: This plugin provides two InstaDisc feeds for your Wordpress blog, a post subscription and a comment subscription.
Version: 1.0
Author: Starla Insigna
Author URI: http://fourisland.com
*/

/*  Copyright 2008  Starla Insigna  (email : hatkirby@fourisland.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

if (get_option('instaDisc_subscription_title') === FALSE)
{
	add_option('instaDisc_subscription_title',get_option('blogname'));
}

add_action('admin_menu', 'am_pages');

function am_pages()
{
	add_options_page('InstaDisc Settings', 'InstaDisc', 8, 'instadisc', 'id_settings_page');
}

function id_settings_page()
{
?><DIV CLASS="wrap"><H2>InstaDisc Settings</H2>
<FORM METHOD="post" ACTION="options.php"><?php
	wp_nonce_field('update-options');
?>
<H3>General</H3>
<TABLE CLASS="form-table">
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Subscription Title</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_subscription_title" VALUE="<?php echo(get_option('instaDisc_subscription_title')); ?>" SIZE="40">
 </TD>
</TR>
</TABLE>
<H3>Blog Posts Subscription</H3>
<TABLE CLASS="form-table">
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Subscription File URL</LABEL>
 <TD>
  <?php echo(get_option('siteurl') . '/wp-content/plugins/instadisc/subscription.php'); ?>
  <BR>This is the URL that you advertise, the URL people use to subscribe to your subscription.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server Username</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_blogPost_centralServer_username" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer_username')); ?>" SIZE="40">
  <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.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server Password</LABEL>
 <TD>
  <INPUT TYPE="password" NAME="instaDisc_blogPost_centralServer_password" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer_password')); ?>" SIZE="40">
  <BR>This is the password for the user above
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server Activation Key</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_blogPost_centralServer_activationKey" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer_activationKey')); ?>" SIZE="40">
  <BR>When activating your subscription with a Central Server, it will require you to add an "activation key" to your "Subscription File" so as to prove that you actually do own the subscription.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server URL</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_blogPost_centralServer" VALUE="<?php echo(get_option('instaDisc_blogPost_centralServer')); ?>" SIZE="40">
  <BR>Both after registration and after activation, the Central Server you are using should tell you it's XML-RPC URL (usually a URL containing the string "xmlrpc.php"). Copy that URL into this field.
 </TD>
</TR>
</TABLE>
<H3>Comments Subscription</H3>
<TABLE CLASS="form-table">
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Subscription File URL</LABEL>
 <TD>
  <?php echo(get_option('siteurl') . '/wp-content/plugins/instadisc/subscription.php?comment='); ?>
  <BR>This is the URL that you advertise, the URL people use to subscribe to your subscription.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server Username</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_comment_centralServer_username" VALUE="<?php echo(get_option('instaDisc_comment_centralServer_username')); ?>" SIZE="40">
  <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.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server Password</LABEL>
 <TD>
  <INPUT TYPE="password" NAME="instaDisc_comment_centralServer_password" VALUE="<?php echo(get_option('instaDisc_comment_centralServer_password')); ?>" SIZE="40">
  <BR>This is the password for the user above
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server Activation Key</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_comment_centralServer_activationKey" VALUE="<?php echo(get_option('instaDisc_comment_centralServer_activationKey')); ?>" SIZE="40">
  <BR>When activating your subscription with a Central Server, it will require you to add an "activation key" to your "Subscription File" so as to prove that you actually do own the subscription.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Central Server URL</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_comment_centralServer" VALUE="<?php echo(get_option('instaDisc_comment_centralServer')); ?>" SIZE="40">
  <BR>Both after registration and after activation, the Central Server you are using should tell you it's XML-RPC URL (usually a URL containing the string "xmlrpc.php"). Copy that URL into this field.
 </TD>
</TR>
</TABLE>
<INPUT TYPE="hidden" NAME="action" VALUE="update">
<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_password">
<P CLASS="submit"><INPUT TYPE="submit" NAME="Submit" VALUE="<?php _e('Save Changes') ?>"></P>
</FORM></DIV><?php
}

include('xmlrpc/xmlrpc.inc');

add_action('publish_post','sendPost');

function sendPost($id)
{
	$post = get_post($id);
	$title = $post->post_title;
	$author = get_userdata($post->post_author);
	$authorName = $author->display_name;
	$url = get_permalink($id);

	$verID = rand(1,65536);

	$client = new xmlrpc_client(get_option('instaDisc_blogPost_centralServer'));
	$msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array(	new xmlrpcval(get_option('instaDisc_blogPost_centralServer_username'), 'string'),
								new xmlrpcval(md5(get_option('instaDisc_blogPost_centralServer_username') . ':' . md5(get_option('instaDisc_blogPost_centralServer_password')) . ':' . $verID), 'string'),
								new xmlrpcval($verID, 'int'),
								new xmlrpcval(get_option('siteurl') . '/', 'string'),
								new xmlrpcval($title, 'string'),
								new xmlrpcval($authorName, 'string'),
								new xmlrpcval($url, 'string'),
								new xmlrpcval(serialize(array()), 'string')));
	$client->send($msg);
}

add_action('comment_post','sendComment');

function sendComment($id)
{
	$comment = get_comment($id);
	$post = get_post($comment->comment_post_ID);
	$title = $post->post_title;
	$author = $comment->comment_author;
	$url = get_permalink($comment->comment_post_ID) . "#comments";

	$verID = rand(1,65536);

	$client = new xmlrpc_client(get_option('instaDisc_comment_centralServer'));
	$msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array(	new xmlrpcval(get_option('instaDisc_comment_centralServer_username'), 'string'),
								new xmlrpcval(md5(get_option('instaDisc_comment_centralServer_username') . ':' . md5(get_option('instaDisc_comment_centralServer_password')) . ':' . $verID), 'string'),
								new xmlrpcval($verID, 'int'),
								new xmlrpcval(get_option('siteurl') . '/comments/', 'string'),
								new xmlrpcval($title, 'string'),
								new xmlrpcval($author, 'string'),
								new xmlrpcval($url, 'string'),
								new xmlrpcval(serialize(array()), 'string')));
	$client->send($msg);
}

?>