aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-11-02 09:42:18 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-11-02 09:42:18 +0000
commited1636cb5164aa6b14c3dd5f95ad3fea79939a4a (patch)
treea65c77ef3ffd4a642c3309e9534efaf91415774b /www
parent53319932bd8584a9be50334555bb3767170ac13a (diff)
downloadsemanticscuttle-ed1636cb5164aa6b14c3dd5f95ad3fea79939a4a.tar.gz
semanticscuttle-ed1636cb5164aa6b14c3dd5f95ad3fea79939a4a.tar.bz2
Implement request #2874049: "Feeling lucky" button
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@506 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'www')
-rw-r--r--www/search.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/www/search.php b/www/search.php
index c957b80..11c382c 100644
--- a/www/search.php
+++ b/www/search.php
@@ -113,10 +113,23 @@ if (is_null($terms)) {
}
}
-$bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $s_user, NULL, $terms, getSortOrder(), $s_watchlist, $s_start, $s_end);
+$bookmarks =& $bookmarkservice->getBookmarks(
+ $start, $perpage, $s_user, NULL, $terms, getSortOrder(),
+ $s_watchlist, $s_start, $s_end
+);
// Save search
-$searchhistoryservice->addSearch($terms, $range, $bookmarks['total'], $currentUserId);
+$searchhistoryservice->addSearch(
+ $terms, $range, $bookmarks['total'], $currentUserId
+);
+
+if (isset($_GET['lucky']) && $_GET['lucky']
+ && isset($bookmarks['bookmarks'][0])
+) {
+ $url = $bookmarks['bookmarks'][0]['bAddress'];
+ header('Location: ' . $url);
+ exit();
+}
if ($GLOBALS['enableGoogleCustomSearch']) {
$tplVars['tipMsg'] = T_('Unsatisfied? You can also try our ')