Empty commit

This commit is contained in:
Git 2013-08-13 08:00:43 +00:00
parent c5e5105cca
commit d16aef7dbf
6 changed files with 26 additions and 10 deletions

View File

@ -29,6 +29,9 @@ abstract protected function listener_events();
public $Restart = 0; //Die by default
public function __construct() {
if (isset($_SERVER['HOME']) && is_dir($_SERVER['HOME']) && getcwd() != $_SERVER['HOME']) {
chdir($_SERVER['HOME']);
}
//ini_set('memory_limit', '12M');
restore_error_handler(); //Avoid PHP error logging
set_time_limit(0);

View File

@ -24,7 +24,6 @@
case 'artists':
?>
<Url type="text/html" method="get" template="http<?=($SSL?'s':'')?>://<?=SITE_URL?>/artist.php?artistname={searchTerms}"></Url>
<Url type="application/x-suggestions+json" template="http<?=($SSL?'s':'')?>://<?=SITE_URL?>/artist.php?action=autocomplete&amp;name={searchTerms}" />
<moz:SearchForm>http<?=($SSL?'s':'')?>://<?=SITE_URL?>/torrents.php?action=advanced</moz:SearchForm>
<?
break;

View File

@ -1,4 +1,7 @@
<?
if (empty($_GET['query'])) {
error(0);
}
header('Content-Type: application/json; charset=utf-8');
$FullName = rawurldecode($_GET['query']);
@ -30,10 +33,11 @@
}
$Matched = 0;
$Suggestions = array();
$ArtistIDs = array();
$Response = array();
$Response['query'] = $FullName;
$Response = array(
'query' => $FullName,
'suggestions' => array()
);
foreach ($AutoSuggest as $Suggestion) {
list($ID, $Name) = $Suggestion;
if (stripos($Name, $FullName) === 0) {

View File

@ -24,10 +24,11 @@
}
$Matched = 0;
$Suggestions = array();
$ArtistIDs = array();
$Response = array();
$Response['query'] = $FullName;
$Response = array(
'query' => $FullName,
'suggestions' => array()
);
foreach ($AutoSuggest as $Suggestion) {
list($Name) = $Suggestion;
if (stripos($Name, $FullName) === 0) {

View File

@ -5,26 +5,31 @@ $(document).ready(function() {
var url = new URL();
$('#artistsearch' + SELECTOR).autocomplete({
serviceUrl : ARTIST_AUTOCOMPLETE_URL,
deferRequestBy: 300,
onSelect : function(suggestion) {
window.location = 'artist.php?id=' + suggestion['data'];
},
serviceUrl : ARTIST_AUTOCOMPLETE_URL,
});
if (url.path == 'torrents' || url.path == 'upload' || url.path == 'artist' || (url.path == 'requests' && url.query['action'] == 'new') || url.path == 'collages') {
$("#artist" + SELECTOR).autocomplete({
deferRequestBy: 300,
serviceUrl : ARTIST_AUTOCOMPLETE_URL
});
$("#artistsimilar" + SELECTOR).autocomplete({
deferRequestBy: 300,
serviceUrl : ARTIST_AUTOCOMPLETE_URL
});
}
if (url.path == 'torrents' || url.path == 'upload' || url.path == 'collages' || url.path == 'requests' || url.path == 'top10' || (url.path == 'requests' && url.query['action'] == 'new')) {
$("#tags" + SELECTOR).autocomplete({
serviceUrl : TAGS_AUTOCOMPLETE_URL,
delimiter: ','
deferRequestBy: 300,
delimiter: ',',
serviceUrl : TAGS_AUTOCOMPLETE_URL
});
$("#tagname" + SELECTOR).autocomplete({
deferRequestBy: 300,
serviceUrl : TAGS_AUTOCOMPLETE_URL,
});
}

View File

@ -547,3 +547,7 @@ tr.torrent .bookmark>a:after {
width: 250px;
display: block;
}
.setting_description p {
margin-top: 1em;
}