Skip to content

Instantly share code, notes, and snippets.

@KalleZ
Created October 30, 2017 09:43
Show Gist options
  • Select an option

  • Save KalleZ/b669c089902d7130d15a93bd725447ea to your computer and use it in GitHub Desktop.

Select an option

Save KalleZ/b669c089902d7130d15a93bd725447ea to your computer and use it in GitHub Desktop.
js/search.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/js/search.js b/js/search.js
index 74764b2..391cb5c 100644
--- a/js/search.js
+++ b/js/search.js
@@ -11,7 +11,13 @@ $('input.search').autocomplete({
minChars:2,
maxHeight:400,
fnFormatResult: fnFormatSearchResult,
- onSelect: function(value, data){ window.location = "/" + users[value]["username"]; },
+ onSelect: function(value, data){
+ if (window.location.host == 'master.php.net') {
+ window.location = "/manage/users.php?username=" + users[value]["username"];
+ } else {
+ window.location = "/" + users[value]["username"];
+ }
+ },
lookup: lookup
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment