<?php
/************************************************************************/
/* Top Music: Search block */
/* =========================== */
/* */
/* Copyright (c) 2005 by SergiDs */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
//set the real name of your Top Music module (module directory name)
$tmModuleName="topMusic";
/*
Don't touch the following code please
*/
if (eregi("block-TMSearch.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $currentlang;
include_once("modules/".$tmModuleName."/language/lang-".$currentlang.".php");
$content="\n\n
<script>\n
function searchTM(){\n
var tmsearch=document.getElementById('TMSearch');
if(tmsearch.query.value!=''){
tmsearch.what.value=tmsearch.what2[tmsearch.what2.selectedIndex].value;\n
if(tmsearch.what2[tmsearch.what2.selectedIndex].value=='artists'){\n
tmsearch.artistname.value=tmsearch.query.value;\n
}else{
if(tmsearch.what2[tmsearch.what2.selectedIndex].value=='albums'){\n
tmsearch.albumname.value=tmsearch.query.value;\n
}else{
if(tmsearch.what2[tmsearch.what2.selectedIndex].value=='songs')\n
tmsearch.songname.value=tmsearch.query.value;\n
}\n
}\n
tmsearch.submit();
}else{
alert('"._TOPMUSIC_NOQUERY."');
}
}\n
</script>\n\n
";
$content.= "<form name=\"TMSearch\" id=\"TMSearch\" action=\"modules.php?name=".$tmModuleName."&op=search\" method=\"post\">\n";
$content.= "<br><center><input type=\"text\" name=\"query\" size=\"15\">\n";
$content.= "<br><center><select name=\"what2\">\n";
$content.= "<option value=\"artists\">"._TOPMUSIC_ARTISTS."/"._TOPMUSIC_GROUPS."</option>\n";
$content.= "<option value=\"albums\">"._TOPMUSIC_ALBUMS."</option>\n";
$content.= "<option value=\"songs\">"._TOPMUSIC_SONGS."/"._TOPMUSIC_LYRICS."</option>\n";
$content.="</select>\n";
$content.="
<input type=\"hidden\" name=\"artistname\">
<input type=\"hidden\" name=\"albumname\">
<input type=\"hidden\" name=\"songname\">
<input type=\"hidden\" name=\"what\">
";
$content.= "<br><input type=\"button\" value=\""._TOPMUSIC_SEARCH."\" onClick=\"searchTM()\"></center></form>";
$content.= "<br><br><a href=\"modules.php?name=".$tmModuleName."&op=search\">"._TOPMUSIC_ADVSEARCH."</a>";
?>