aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
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 ')