]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
New feature: export URL for Google Custom Search (api/export/gcs)
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 11 Apr 2008 06:56:09 +0000 (06:56 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 11 Apr 2008 06:56:09 +0000 (06:56 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@103 b3834d28-1941-0410-a4f8-b48e95affb8f

api/export_gcs.php [new file with mode: 0644]

diff --git a/api/export_gcs.php b/api/export_gcs.php
new file mode 100644 (file)
index 0000000..9cf34f7
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+/*
+Export for Google Custom Search
+*/\r
+\r
+// Force HTTP authentication first!
+require_once('httpauth.inc.php');\r
+require_once('../header.inc.php');\r
+\r
+$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');\r
+$userservice =& ServiceFactory::getServiceInstance('UserService');
+
+/*
+// Restrict to admins?
+if(!$userservice->isAdmin($userservice->getCurrentUserId())) {
+    die(T_('You are not allowed to do this action (admin access)'));
+}*/
+
+\r
+\r
+// Check to see if a tag was specified.\r
+if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))\r
+    $tag = trim($_REQUEST['tag']);\r
+else\r
+    $tag = NULL;\r
+\r
+// Get the posts relevant to the passed-in variables.\r
+$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, NULL, $tag, NULL, getSortOrder());\r
+\r
+$currentuser = $userservice->getCurrentUser();\r
+$currentusername = $currentuser[$userservice->getFieldName('username')];\r
+\r
+// Set up the plain file and output all the posts.\r
+header('Content-Type: text/plain');\r\r
+foreach($bookmarks['bookmarks'] as $row) {\r
+    echo $row['bAddress']."\n";\r
+}\r
+\r
+\r\r
+?>\r