diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-21 23:28:55 +0000 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-21 23:28:55 +0000 |
| commit | 43f8a9d35e74f71a7cdb71a3663befe8e51b8608 (patch) | |
| tree | 947a68094c649634ae6cbc3517ca132b1ff60b00 | |
| parent | a5be7960294b174face2ef8678c87ce2ada7cd6b (diff) | |
| download | instadisc-43f8a9d35e74f71a7cdb71a3663befe8e51b8608.tar.gz instadisc-43f8a9d35e74f71a7cdb71a3663befe8e51b8608.tar.bz2 instadisc-43f8a9d35e74f71a7cdb71a3663befe8e51b8608.zip | |
Update: Added SF generator to Wordpress
Closes #59
| -rw-r--r-- | update/plugin/wordpress/trunk/instadisc/subscription.php | 60 |
1 files changed, 60 insertions, 0 deletions
| diff --git a/update/plugin/wordpress/trunk/instadisc/subscription.php b/update/plugin/wordpress/trunk/instadisc/subscription.php new file mode 100644 index 0000000..ef5edf9 --- /dev/null +++ b/update/plugin/wordpress/trunk/instadisc/subscription.php | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | include('../../../wp-blog-header.php'); | ||
| 4 | |||
| 5 | if (isset($_GET['comment'])) | ||
| 6 | { | ||
| 7 | echo('Subscription: '); | ||
| 8 | echo('http://' . $_SERVER['SERVER_NAME'] . '/blog-comment/' . generateSlug(get_option('instaDisc_subscription_title')) . '/'); | ||
| 9 | echo("\n"); | ||
| 10 | |||
| 11 | echo('Title: '); | ||
| 12 | echo(get_option('instaDisc_subscription_title')); | ||
| 13 | echo(' Comments'); | ||
| 14 | echo("\n"); | ||
| 15 | |||
| 16 | echo('Category: blog-comment'); | ||
| 17 | echo("\n"); | ||
| 18 | |||
| 19 | if (get_option('instaDisc_comment_centralServer_activationKey') != '') | ||
| 20 | { | ||
| 21 | echo('Key: '); | ||
| 22 | echo(get_option('instaDisc_comment_centralServer_activationKey')); | ||
| 23 | } | ||
| 24 | } else { | ||
| 25 | echo('Subscription: '); | ||
| 26 | echo('http://' . $_SERVER['SERVER_NAME'] . '/blog-post/' . generateSlug(get_option('instaDisc_subscription_title')) . '/'); | ||
| 27 | echo("\n"); | ||
| 28 | |||
| 29 | echo('Title: '); | ||
| 30 | echo(get_option('instaDisc_subscription_title')); | ||
| 31 | echo("\n"); | ||
| 32 | |||
| 33 | echo('Category: blog-post'); | ||
| 34 | echo("\n"); | ||
| 35 | |||
| 36 | if (get_option('instaDisc_blogPost_centralServer_activationKey') != '') | ||
| 37 | { | ||
| 38 | echo('Key: '); | ||
| 39 | echo(get_option('instaDisc_blogPost_centralServer_activationKey')); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | function generateSlug($title) | ||
| 44 | { | ||
| 45 | $title = preg_replace('/[^A-Za-z0-9]/','-',$title); | ||
| 46 | $title = preg_replace('/-{2,}/','-',$title); | ||
| 47 | if (substr($title,0,1) == '-') | ||
| 48 | { | ||
| 49 | $title = substr($title,1); | ||
| 50 | } | ||
| 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 | } | ||
| 59 | |||
| 60 | ?> | ||
