about summary refs log tree commit diff stats
path: root/data/maps/daedalus/rooms/Blue Hallway.txtpb
diff options
context:
space:
mode:
Diffstat (limited to 'data/maps/daedalus/rooms/Blue Hallway.txtpb')
0 files changed, 0 insertions, 0 deletions
burbia@gmail.com> 2008-08-21 14:54:15 +0000 Update: Added default values' href='/instadisc/commit/update/plugin/wordpress/trunk/instadisc/instadisc.php?id=09d7b6c435b4884cff4d2c3da6bc6807cacaaef0'>09d7b6c ^
34fa030 ^
09d7b6c ^



7fbab89 ^















0abc3d2 ^
7fbab89 ^

7fbab89 ^





54595b1 ^
2565efd ^
54595b1 ^

2565efd ^


54595b1 ^
88d571f ^
54595b1 ^

7fbab89 ^

34fa030 ^



c7cfdc1 ^






34fa030 ^


7fbab89 ^



54595b1 ^
7fbab89 ^
54595b1 ^

7fbab89 ^


54595b1 ^
7fbab89 ^
54595b1 ^

7fbab89 ^

34fa030 ^



c7cfdc1 ^






34fa030 ^


7fbab89 ^

54595b1 ^
7fbab89 ^



88d571f ^

1566230 ^

88d571f ^



0abc3d2 ^

1566230 ^
88d571f ^
132f502 ^





2d998db ^
88d571f ^
54595b1 ^


88d571f ^
0abc3d2 ^
88d571f ^
132f502 ^

1ef9b23 ^






88d571f ^

1566230 ^









132f502 ^





2d998db ^
1566230 ^
54595b1 ^


1566230 ^


132f502 ^

1ef9b23 ^






1566230 ^

132f502 ^



























7fbab89 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233


























                                                                                                                              




                                                                          
                                                                                         



                                                     
                                                                                        



                                                    















                                                                                                
                                                  

                                                                                                                                      





                                
                                                  
     

                                                                                                                                      


                 
                                               
     

                                                                                                                                                    

      



                                       






                                                                                                                                                                                                                                                


         



                              
                                                  
     

                                                                                                                                    


                 
                                               
     

                                                                                                                                                  

      



                                       






                                                                                                                                                                                                                                                


         

                                                  
                                                                                                                                                                                                                                                                 



                                                                                             

                             

                                      



                                   

                                                   
                                  
 





                                                                                                       
                                    
 


                                                                                                                               
                                                                                                
                                                                                                     
                                                                                              

                                                                                                            






                                           

 









                                                                      





                                                                                                      
                                    
 


                                                                                                                              


                                                                                                 

                                                                                                            






                                           

 



























                                                                           
  
<?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'));
}

if ((get_option('instaDisc_blogPost_password') === FALSE) || !extension_loaded('mcrypt'))
{
	add_option('instaDisc_blogPost_password','');
}

if ((get_option('instaDisc_comment_password') === FALSE) || !extension_loaded('mcrypt'))
{
	add_option('instaDisc_comment_password','');
}

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>Series Control URL</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_blogPost_seriesURL" VALUE="<?php echo(get_option('instaDisc_blogPost_seriesURL')); ?>" SIZE="40">
  <BR>This is the XML-RPC URL of your Series Control.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Subscription ID</LABEL>
 <TD>
  <INPUT TYPE="password" NAME="instaDisc_blogPost_subscriptionID" VALUE="<?php echo(get_option('instaDisc_blogPost_subscriptionID')); ?>" SIZE="40">
  <BR>This is the unique identifier this subscription is listed under on your Series Control.
 </TD>
</TR>
<?php
	if (extension_loaded('mcrypt'))
	{
?>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Encryption Password</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_blogPost_password" VALUE="<?php echo(get_option('instaDisc_blogPost_password')); ?>" SIZE="40">
  <BR>If you would like to password-protect your feed, enter a password into this box. That password will need to be known by anyone allowed to view your subscription. If you don't want to password protect this feed, leave this field blank.
 </TD>
</TR>
<?php
	}
?>
</TABLE>
<H3>Comments Subscription</H3>
<TABLE CLASS="form-table">
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Series Control URL</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_comment_seriesURL" VALUE="<?php echo(get_option('instaDisc_comment_seriesURL')); ?>" SIZE="40">
  <BR>This is the XML-RPC URL of your Series Control.
 </TD>
</TR>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Subscription ID</LABEL>
 <TD>
  <INPUT TYPE="password" NAME="instaDisc_comment_subscriptionID" VALUE="<?php echo(get_option('instaDisc_comment_subscriptionID')); ?>" SIZE="40">
  <BR>This is the unique identifier this subscription is listed under on your Series Control.
 </TD>
</TR>
<?php
	if (extension_loaded('mcrypt'))
	{
?>
<TR VALIGN="top">
 <TH SCOPE="row"><LABEL>Encryption Password</LABEL>
 <TD>
  <INPUT TYPE="text" NAME="instaDisc_comment_password" VALUE="<?php echo(get_option('instaDisc_comment_password')); ?>" SIZE="40">
  <BR>If you would like to password-protect your feed, enter a password into this box. That password will need to be known by anyone allowed to view your subscription. If you don't want to password protect this feed, leave this field blank.
 </TD>
</TR>
<?php
	}
?>
</TABLE>
<INPUT TYPE="hidden" NAME="action" VALUE="update">
<INPUT TYPE="hidden" NAME="page_options" VALUE="instaDisc_subscription_title,instaDisc_blogPost_seriesURL,instaDisc_blogPost_subscriptionID,instaDisc_comment_seriesURL,instaDisc_comment_subscriptionID,instaDisc_blogPost_password,instaDisc_comment_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);

	$encID = 0;
	if (get_option('instaDisc_blogPost_password') != '')
	{
		$encID = encryptData($title, $author, $url, get_option('instaDisc_blogPost_password'));
	}

	$verID = rand(1,2147483647);

	$client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php');
	$msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval(get_option('instaDisc_blogPost_seriesURL')),
								new xmlrpcval(get_option('instaDisc_blogPost_subscriptionID')),
								new xmlrpcval($title, 'string'),
								new xmlrpcval($authorName, 'string'),
								new xmlrpcval($url, 'string'),
								new xmlrpcval(serialize(array()), 'string'),
								new xmlrpcval($encID, 'int')));
	$resp = $client->send($msg);
	$val = $resp->value()->scalarVal();

	if ($val == 2)
	{
		sendPost($id);
	}
}

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";

	$encID = 0;
	if (get_option('instaDisc_comment_password') != '')
	{
		$encID = encryptData($title, $author, $url, get_option('instaDisc_comment_password'));
	}

	$verID = rand(1,2147483647);

	$client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php');
	$msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array(	new xmlrpcval(get_option('instaDisc_comment_seriesURL')),
								new xmlrpcval(get_option('instaDisc_comment_subscriptionID')),
								new xmlrpcval($title, 'string'),
								new xmlrpcval($author, 'string'),
								new xmlrpcval($url, 'string'),
								new xmlrpcval(serialize(array()), 'string'),
								new xmlrpcval($encID, 'int')));
	$resp = $client->send($msg);
	$val = $resp->value()->scalarVal();

	if ($val == 2)
	{
		sendComment($id);
	}
}

function encryptData(&$title, &$author, &$url, $password)
{
	$encID = rand(1,2147483647);

	$cipher = "rijndael-128";
	$mode = "cbc";
	$key = substr(md5(substr(str_pad($password,16,$encID),0,16)),0,16);

	$td = mcrypt_module_open($cipher, "", $mode, "");

	$title = encryptString($td, $key, $title);
	$author = encryptString($td, $key, $author);
	$url = encryptString($td, $key, $url);

	mcrypt_module_close($td);

	return $encID;
}

function encryptString($td, $key, $string)
{
	mcrypt_generic_init($td, $key, strrev($key));
	$string = bin2hex(mcrypt_generic($td, $string));
	mcrypt_generic_deinit($td);

	return $string;
}

?>