From 43f8a9d35e74f71a7cdb71a3663befe8e51b8608 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger <fefferburbia@gmail.com> Date: Sun, 21 Sep 2008 23:28:55 +0000 Subject: Update: Added SF generator to Wordpress Closes #59 --- .../wordpress/trunk/instadisc/subscription.php | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 update/plugin/wordpress/trunk/instadisc/subscription.php (limited to 'update') 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 @@ +<?php + +include('../../../wp-blog-header.php'); + +if (isset($_GET['comment'])) +{ + echo('Subscription: '); + echo('http://' . $_SERVER['SERVER_NAME'] . '/blog-comment/' . generateSlug(get_option('instaDisc_subscription_title')) . '/'); + echo("\n"); + + echo('Title: '); + echo(get_option('instaDisc_subscription_title')); + echo(' Comments'); + echo("\n"); + + echo('Category: blog-comment'); + echo("\n"); + + if (get_option('instaDisc_comment_centralServer_activationKey') != '') + { + echo('Key: '); + echo(get_option('instaDisc_comment_centralServer_activationKey')); + } +} else { + echo('Subscription: '); + echo('http://' . $_SERVER['SERVER_NAME'] . '/blog-post/' . generateSlug(get_option('instaDisc_subscription_title')) . '/'); + echo("\n"); + + echo('Title: '); + echo(get_option('instaDisc_subscription_title')); + echo("\n"); + + echo('Category: blog-post'); + echo("\n"); + + if (get_option('instaDisc_blogPost_centralServer_activationKey') != '') + { + echo('Key: '); + echo(get_option('instaDisc_blogPost_centralServer_activationKey')); + } +} + +function generateSlug($title) +{ + $title = preg_replace('/[^A-Za-z0-9]/','-',$title); + $title = preg_replace('/-{2,}/','-',$title); + if (substr($title,0,1) == '-') + { + $title = substr($title,1); + } + if (substr($title,strlen($title)-1,1) == '-') + { + $title = substr($title,0,strlen($title)-1); + } + $title = strtolower($title); + + return($title); +} + +?> -- cgit 1.4.1