about summary refs log tree commit diff stats
path: root/update/plugin/wordpress/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'update/plugin/wordpress/trunk')
-rw-r--r--update/plugin/wordpress/trunk/instadisc/instadisc.php14
-rw-r--r--update/plugin/wordpress/trunk/instadisc/subscription.php52
2 files changed, 44 insertions, 22 deletions
diff --git a/update/plugin/wordpress/trunk/instadisc/instadisc.php b/update/plugin/wordpress/trunk/instadisc/instadisc.php index 3cb711c..d084aa2 100644 --- a/update/plugin/wordpress/trunk/instadisc/instadisc.php +++ b/update/plugin/wordpress/trunk/instadisc/instadisc.php
@@ -63,6 +63,13 @@ function id_settings_page()
63</TABLE> 63</TABLE>
64<H3>Blog Posts Subscription</H3> 64<H3>Blog Posts Subscription</H3>
65<TABLE CLASS="form-table"> 65<TABLE CLASS="form-table">
66<TR VALIGN="top">
67 <TH SCOPE="row"><LABEL>Subscription File URL</LABEL>
68 <TD>
69 <?php echo(get_option('siteurl') . '/wp-content/plugins/instadisc/subscription.php'); ?>
70 <BR>This is the URL that you advertise, the URL people use to subscribe to your subscription.
71 </TD>
72</TR>
66<?php 73<?php
67 if (extension_loaded('mcrypt')) 74 if (extension_loaded('mcrypt'))
68 { 75 {
@@ -80,6 +87,13 @@ function id_settings_page()
80</TABLE> 87</TABLE>
81<H3>Comments Subscription</H3> 88<H3>Comments Subscription</H3>
82<TABLE CLASS="form-table"> 89<TABLE CLASS="form-table">
90<TR VALIGN="top">
91 <TH SCOPE="row"><LABEL>Subscription File URL</LABEL>
92 <TD>
93 <?php echo(get_option('siteurl') . '/wp-content/plugins/instadisc/subscription.php?comment='); ?>
94 <BR>This is the URL that you advertise, the URL people use to subscribe to your subscription.
95 </TD>
96</TR>
83<?php 97<?php
84 if (extension_loaded('mcrypt')) 98 if (extension_loaded('mcrypt'))
85 { 99 {
diff --git a/update/plugin/wordpress/trunk/instadisc/subscription.php b/update/plugin/wordpress/trunk/instadisc/subscription.php index ef5edf9..9889655 100644 --- a/update/plugin/wordpress/trunk/instadisc/subscription.php +++ b/update/plugin/wordpress/trunk/instadisc/subscription.php
@@ -2,6 +2,8 @@
2 2
3include('../../../wp-blog-header.php'); 3include('../../../wp-blog-header.php');
4 4
5echo('<DIV STYLE="display: none">: ' . "\n");
6
5if (isset($_GET['comment'])) 7if (isset($_GET['comment']))
6{ 8{
7 echo('Subscription: '); 9 echo('Subscription: ');
@@ -16,11 +18,23 @@ if (isset($_GET['comment']))
16 echo('Category: blog-comment'); 18 echo('Category: blog-comment');
17 echo("\n"); 19 echo("\n");
18 20
19 if (get_option('instaDisc_comment_centralServer_activationKey') != '') 21 if (get_option('instaDisc_comment_password') != '')
20 { 22 {
21 echo('Key: '); 23 $verID = rand(1,2147483647);
22 echo(get_option('instaDisc_comment_centralServer_activationKey')); 24
25 echo('Verification: ' . md5(get_option('instaDisc_subscription_title') . ':' . md5(get_option('instaDisc_comment_password')) . ':' . $verID) . "\n");
26 echo('Verification-ID: ' . $verID . "\n");
23 } 27 }
28
29?>
30End: </DIV><DIV STYLE="margin: 0 auto; margin-top: 5em; width: 500px; background-color: #FBEC5D; text-align: center; padding: 4px;"><B>This is an InstaDisc Subscription file.</B><P>If you would like to subscribe to the InstaDisc subscription:<BR><I><?php echo(get_option('instaDisc_subscription_title')); ?></I> (<U>blog-comment</U>)<BR>Copy the address of this file to the "Add Subscription" form on your InstaDisc client.</DIV>
31<?php
32
33 if (get_option('instaDisc_comment_password') != '')
34 {
35?><!--Notice-->: <CENTER><B>Please note that this is an <I>encrypted</I> subscription.</B><BR>To subscribe to it, you must know its password.</CENTER><?php
36 }
37
24} else { 38} else {
25 echo('Subscription: '); 39 echo('Subscription: ');
26 echo('http://' . $_SERVER['SERVER_NAME'] . '/blog-post/' . generateSlug(get_option('instaDisc_subscription_title')) . '/'); 40 echo('http://' . $_SERVER['SERVER_NAME'] . '/blog-post/' . generateSlug(get_option('instaDisc_subscription_title')) . '/');
@@ -33,28 +47,22 @@ if (isset($_GET['comment']))
33 echo('Category: blog-post'); 47 echo('Category: blog-post');
34 echo("\n"); 48 echo("\n");
35 49
36 if (get_option('instaDisc_blogPost_centralServer_activationKey') != '') 50 if (get_option('instaDisc_blogPost_password') != '')
37 { 51 {
38 echo('Key: '); 52 $verID = rand(1,2147483647);
39 echo(get_option('instaDisc_blogPost_centralServer_activationKey')); 53
54 echo('Verification: ' . md5(get_option('instaDisc_subscription_title') . ':' . md5(get_option('instaDisc_blogPost_password')) . ':' . $verID) . "\n");
55 echo('Verification-ID: ' . $verID . "\n");
40 } 56 }
41}
42 57
43function generateSlug($title) 58?>
44{ 59End: </DIV><DIV STYLE="margin: 0 auto; margin-top: 5em; width: 500px; background-color: #FBEC5D; text-align: center; padding: 4px;"><B>This is an InstaDisc Subscription file.</B><P>If you would like to subscribe to the InstaDisc subscription:<BR><I><?php echo(get_option('instaDisc_subscription_title')); ?></I> (<U>blog-post</U>)<BR>Copy the address of this file to the "Add Subscription" form on your InstaDisc client.</DIV>
45 $title = preg_replace('/[^A-Za-z0-9]/','-',$title); 60<?php
46 $title = preg_replace('/-{2,}/','-',$title); 61
47 if (substr($title,0,1) == '-') 62 if (get_option('instaDisc_blogPost_password') != '')
48 { 63 {
49 $title = substr($title,1); 64?><!--Notice-->: <CENTER><B>Please note that this is an <I>encrypted</I> subscription.</B><BR>To subscribe to it, you must know its password.</CENTER><?php
50 } 65 }
51 if (substr($title,strlen($title)-1,1) == '-')
52 {
53 $title = substr($title,0,strlen($title)-1);
54 }
55 $title = strtolower($title);
56
57 return($title);
58} 66}
59 67
60?> 68?>