Hallo Leute,
ich hab folgendes Problem.
Bei uns im Radio möchten wir gern eine Suchfunktion in den Songlisten einfügen.
Jetzt haben wir hier ein schönes php-Script gefunden. aber es zeigt nur die ersten treffer an.
leider kenn ich mich damit so gar nicht wirklich aus und würde mich freuen, wenn ihr mir helfen könntet.
und das hier ist die "config"
Danke für Eure Hilfe
Gruß
Aramis
ich hab folgendes Problem.
Bei uns im Radio möchten wir gern eine Suchfunktion in den Songlisten einfügen.
Jetzt haben wir hier ein schönes php-Script gefunden. aber es zeigt nur die ersten treffer an.
leider kenn ich mich damit so gar nicht wirklich aus und würde mich freuen, wenn ihr mir helfen könntet.
PHP:
<?
if(!$parser){
?>
<BODY>
<?
}
?>
<?
include("settings.apo");
include("results_header.apo");
include("results_footer.apo");
error_reporting(0);
if(isset($path)){
$pr="$rpath$path/"; $pr=trim($pr);
chdir($pr);
} else { $pr=$fl; }
$handle=opendir($pr);
$x=readdir($handle);
$x=readdir($handle);
while($fl=readdir($handle)){
if(is_dir($fl)){
if($parser=="yes" or $parser=="YES") echo "<B>[<A HREF=$fl/>+</A>] $fl/</B><BR><BR>";
$handle2=opendir($fl);
$x=readdir($handle2);
$x=readdir($handle2);
while($fll=readdir($handle2)){
if(is_dir($fll)){
if($parser=="yes" or $parser=="YES") echo "<B>[<A HREF=$path/$fl/$fll/>+</A>] $fl/$fll/</B><BR>BR>";
$handle3=opendir($fll);
$x=readdir($handle3);
$x=readdir($handle3);
while($flll=readdir($handle3)){
if($parser=="yes" or $parser=="YES") echo "--->    $fl/$fll/<A HREF=$path/$fl/$fll/$flll>$flll</A><BR><br>";
if(!$parser) $filesearch[]="$fl/$fll/$flll";
}
} else {
if($parser=="yes" or $parser=="YES") echo "   $fl/<A HREF=$path/$fl/$fll>$fll</A><BR><br>";
if(!$parser) $filesearch[]="$fl/$fll";
}
}
} else {
if($parser=="yes" or $parser=="YES") echo " <A HREF=$path/$fl>$path/$fl</A><BR><BR>";
if(!$parser) $filesearch[]=$fl;
}
}
echo "<CENTER><TABLE border=0 cellspacing=1>";
foreach($filesearch as $this){
$fpath="$rpath$this";
if($infile=file($this)){
$done="NO";
$that=split("\.",$this);
if($that[1]==$ftype[0] or $that[1]==$ftype[1] or $that[1]==$ftype[2] or $that[1]==$ftype[3] or $that[1]==$ftype[4] or $that[1]==$ftype[5]){
if(eregi(strtolower($stext),strtolower($this))){
show_headers();
echo "<A href=$path/$this>  $this</A>  <B>filename match</B><BR><BR>";
}
foreach($infile as $outfile){
if($done!="yes"){
if(eregi(strtolower($stext),strtolower($outfile))){
$outfile=strip_tags($outfile);
show_headers();
echo "$outfile<BR><BR>";
$done="yes";
$np++;
}
}
}
}
}
}
echo "</TABLE><B>$np</B> Ergebnisse";
?>
und das hier ist die "config"
PHP:
<?
#DONT TOUCH THESE
global $ftype;
global $fl;
global $rpath;
# USER SEARCH SETTINGS
# 1) FILETYPES to search, enter the extentions here (lowercase)
# if you only want to search 1 or 2 filetypes, just repeat
# them here, as duplicates are fine, but empty values are NOT.
# if you leave one empty, it should search anything that has
# no file extension.
$ftype[0]="txt";
$ftype[1]="htm";
$ftype[2]="html";
$ftype[3]="php";
$ftype[4]="log";
$ftype[5]="asp";
# 2) STARTING DIRECTORY, here you may specify a different
# starting directory. THIS MUST be a full path if you
# want to use it. DEFAULT is '.', just the period, which
# means the current directory.
$fl=".";
# 3) RPATH, this is important, set this to the place where the
# trinity.php file lives.
$rpath="/var/www/htdocs/cisne/";
# 4) FILE LISTING. if you want you can un-comment the following
# 2 lines and the script will simply list evey file, up to 3
# directories deep from the start. It links them as well.
# global $parser;
# $parser="NO";
# THAT IS IT FOR NOW
# REMEMBER NOT TO EDIT THE ACTUAL SEARCH SCRIPT
# REMEMBER TO EDIT results_headers.apo and
# results_footers.apo to make a custom search
# results page. the headers will go before
# EVERY search result, and the footers will
# go AFTER every search result. USE basic html,
# as aditional php code may slow the results
# and fail. As always I am available at:
# contact@pyroxpro.com for questions, and be
# sure to vote nice and vote often on my
# scripts page
# www.pyroxpro.com
# contact@pyroxpro.com
# Justin Carlson
?>
Danke für Eure Hilfe
Gruß
Aramis