From 912c0cfdc2e5f103f10b2a5e15541b8e69f80753 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 30 Sep 2008 01:56:40 +0000 Subject: Update: Wrote SFGen Closes #58 --- update/sfgen/trunk/index.php | 71 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 update/sfgen/trunk/index.php (limited to 'update/sfgen/trunk/index.php') diff --git a/update/sfgen/trunk/index.php b/update/sfgen/trunk/index.php new file mode 100644 index 0000000..fd9f241 --- /dev/null +++ b/update/sfgen/trunk/index.php @@ -0,0 +1,71 @@ +: ' . "\n"); +echo('Subscription: ' . $idusSubscriptionURL . "\n"); +echo('Title: ' . $idusTitle . "\n"); +echo('Category: ' . $idusCategory . "\n"); + +if (($idusPassword != '') && extension_loaded('mcrypt')) +{ + $verID = rand(1,2147483647); + + echo('Verification: ' . md5($idusTitle . ':' . md5($idusPassword) . ':' . $verID) . "\n"); + echo('Verification-ID: ' . $verID . "\n"); +} + +echo('End:
This is an InstaDisc Subscription file.

If you would like to subscribe to the InstaDisc subscription:
' . $idusTitle . ' (' . $idusCategory . ')
Copy the address of this file to the "Add Subscription" form on your InstaDisc client.

' . "\n"); + +if (($idusPassword != '') && extension_loaded('mcrypt')) +{ + echo('
Please note that this is an encrypted subscription.
To subscribe to it, you must know its password.
' . "\n"); +} + +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