Goed na dagen sleutelen nog steeds geen resultaten. Wat ik probeer te maken in PHP (zonder MySQL) is het volgende:
http://www.donkeynl.tk is in puur HTML. Dit kost veel tijd om te updaten en wil ik het in PHP gaan doen. Ik wil graag dat er per categorie een bestand is. bijvoorbeeld.
Softwarelinks.txt
kidslinks.txt
etc...
hierin staat.
- plaats van afbeelding
- beschrijving
- link voor edonkey (aanklikbaar, ed2k:// )
Ook zal een zoekfunctie handig zijn. Het volgende heb ik inelkaar weten te zetten met wat hulp van andere search machines MAAR geeft de inhoud van het TXT bestand weer en is dus NIET aanklikbaar:
---search.php----
<HTML><HEAD></HEAD><BODY BACKGROUND=background.gif>
<FONT SIZE=-3 COLOR=BLUE><BR>
<BR>
</FONT>
<BR>
<H1>Zoek resultaten</H1>
<HR>
<TABLE BORDER=0 width=95% spacing=0 CELLPADDING=0 CELLSPACING=0>
<TR><TD background=topbg.gif><BR></TD></TR>
<?Php
error_reporting(0);
$timex=time();
$timey=0;
$bgchange="CCCCCC";
$fchek=0;
$command[0]="0";
$dirtest="false";
#subfolder search options setup starts here
if($where=="index"){
$dirtest="true";
$linkdir="";
$handle=opendir('.');
} elseif($where=="php"){
$linkdir="phpapps/";
chdir('./phpapps');
$handle=opendir('.');
}elseif($where=="other"){
$linkdir="otherscripts/";
chdir('./otherscripts');
$handle=opendir('.');
}elseif($where=="news"){
$linkdir="news/";
chdir('./news');
$handle=opendir('.');
} else {
$dirtest="true";
$linkdir="";
$handle=opendir('.');
}
#Zoeken
while (($file = readdir($handle))!==false){
if (eregi("[a-zA-Z0-p_-]*.txt",$file)or eregi("[a-zA-Z0-p_-]*.html",$file)){
$fchek=$fchek+1;
$sizer=filesize($file);
$sizer=($sizer/1000);
$sizer=round($sizer,1);
$file=trim($file);
$file=chop($file);
$filed=file($file);
$fileold=$file;
$count = count($filed);
$i = $count;
$zt = 0;
$clt=0;
$found=0;
$stringer=0;
for($j=$zt;$j<$i;$j++){
$string=$filed[$j];
$stringer=$filed[$j];
$num = "regPLACE hold";
$string=strtolower($string);
$stringer=strtolower($stringer);
$whatdoreplace=strtolower($whatdoreplace);
$string = ereg_replace($whatdoreplace, $num, $string);
if($string!=$stringer){
$found=$found+1;
$abby=$found;
$show[$found]=$stringer;
}
}
$dircount=count($file);
echo "<FONT SIZE=-1>";
if($found>0){
$command[0]=($command[0]+10);
if(eregi("[a-zA-Z0-p_-]*.txt",$file)){
$fileold=$file;
$file="index.php";
if($dirtest=="true"){
$file=$fileold;
}
}
if($file=="index.html"){
if($bgchange=="cccccc"){
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\" target=_new><FONT SIZE=+2>$file</A><BR>$data</FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
} else {
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\" target=_new><FONT SIZE=+2>$fileold</A> </FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
}
} elseif($bgchange=="cccccc"){
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\"><FONT SIZE=+2>$fileold</A></FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
} else {
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\"><FONT SIZE=+2>$fileold</A></FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
}
$file=$fileold;
for($new=1;$new<=$found;$new++){
$show[$new]=strip_tags($show[$new]);
$show[$new] = ereg_replace($whatdoreplace,"<FONT COLOR=RED><B>$whatdoreplace</FONT></B>",$show[$new]);
echo "<FONT SIZE=-1>";
print "<LI>$show[$new]";
}
echo "</UL></FONT></TD></TR>";
}
}
}
if($command[0]==0){
echo "<BR></TD></TR><TR><TD bgcolor=CCCCCC><CENTER><B><FONT SIZE=+2 COLOR=RED>Geen resultaten!";
}
echo "<BR></TD></TR><TR><TD BGCOLOR=9999FF><CENTER><FONT SIZE=-1>Er zijn/is $fchek bestand(en) doorzocht. Dit duurde";
$timey=time();
$timea=($timey-$timex);
echo " $timea totaal seconde(n)";
?>
<TD/></TD></TR></TABLE><BR>
<BR>
<BR><BR><BR><BR><BR>
<TABLE WIDTH=300><TR>
<TD>Zoek Machine door NiwreNL</TD>
</TR></TABLE>
</HTML>
----------
Wie o wie kan helpen ?
http://www.donkeynl.tk is in puur HTML. Dit kost veel tijd om te updaten en wil ik het in PHP gaan doen. Ik wil graag dat er per categorie een bestand is. bijvoorbeeld.
Softwarelinks.txt
kidslinks.txt
etc...
hierin staat.
- plaats van afbeelding
- beschrijving
- link voor edonkey (aanklikbaar, ed2k:// )
Ook zal een zoekfunctie handig zijn. Het volgende heb ik inelkaar weten te zetten met wat hulp van andere search machines MAAR geeft de inhoud van het TXT bestand weer en is dus NIET aanklikbaar:
---search.php----
<HTML><HEAD></HEAD><BODY BACKGROUND=background.gif>
<FONT SIZE=-3 COLOR=BLUE><BR>
<BR>
</FONT>
<BR>
<H1>Zoek resultaten</H1>
<HR>
<TABLE BORDER=0 width=95% spacing=0 CELLPADDING=0 CELLSPACING=0>
<TR><TD background=topbg.gif><BR></TD></TR>
<?Php
error_reporting(0);
$timex=time();
$timey=0;
$bgchange="CCCCCC";
$fchek=0;
$command[0]="0";
$dirtest="false";
#subfolder search options setup starts here
if($where=="index"){
$dirtest="true";
$linkdir="";
$handle=opendir('.');
} elseif($where=="php"){
$linkdir="phpapps/";
chdir('./phpapps');
$handle=opendir('.');
}elseif($where=="other"){
$linkdir="otherscripts/";
chdir('./otherscripts');
$handle=opendir('.');
}elseif($where=="news"){
$linkdir="news/";
chdir('./news');
$handle=opendir('.');
} else {
$dirtest="true";
$linkdir="";
$handle=opendir('.');
}
#Zoeken
while (($file = readdir($handle))!==false){
if (eregi("[a-zA-Z0-p_-]*.txt",$file)or eregi("[a-zA-Z0-p_-]*.html",$file)){
$fchek=$fchek+1;
$sizer=filesize($file);
$sizer=($sizer/1000);
$sizer=round($sizer,1);
$file=trim($file);
$file=chop($file);
$filed=file($file);
$fileold=$file;
$count = count($filed);
$i = $count;
$zt = 0;
$clt=0;
$found=0;
$stringer=0;
for($j=$zt;$j<$i;$j++){
$string=$filed[$j];
$stringer=$filed[$j];
$num = "regPLACE hold";
$string=strtolower($string);
$stringer=strtolower($stringer);
$whatdoreplace=strtolower($whatdoreplace);
$string = ereg_replace($whatdoreplace, $num, $string);
if($string!=$stringer){
$found=$found+1;
$abby=$found;
$show[$found]=$stringer;
}
}
$dircount=count($file);
echo "<FONT SIZE=-1>";
if($found>0){
$command[0]=($command[0]+10);
if(eregi("[a-zA-Z0-p_-]*.txt",$file)){
$fileold=$file;
$file="index.php";
if($dirtest=="true"){
$file=$fileold;
}
}
if($file=="index.html"){
if($bgchange=="cccccc"){
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\" target=_new><FONT SIZE=+2>$file</A><BR>$data</FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
} else {
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\" target=_new><FONT SIZE=+2>$fileold</A> </FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
}
} elseif($bgchange=="cccccc"){
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\"><FONT SIZE=+2>$fileold</A></FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
} else {
$bgchange="cccccc";
echo "</TD></TR><TR><TD BGCOLOR=$bgchange><BR><A HREF=\"$linkdir$file\"><FONT SIZE=+2>$fileold</A></FONT> Size: $sizer Kb<BR><BR>Dit bestand bevat <B><FONT COLOR=RED>$found</FONT></B> zoekwoorden <B><FONT COLOR=RED>$whatdoreplace</FONT></B> (zie onder) <BR><UL>";
}
$file=$fileold;
for($new=1;$new<=$found;$new++){
$show[$new]=strip_tags($show[$new]);
$show[$new] = ereg_replace($whatdoreplace,"<FONT COLOR=RED><B>$whatdoreplace</FONT></B>",$show[$new]);
echo "<FONT SIZE=-1>";
print "<LI>$show[$new]";
}
echo "</UL></FONT></TD></TR>";
}
}
}
if($command[0]==0){
echo "<BR></TD></TR><TR><TD bgcolor=CCCCCC><CENTER><B><FONT SIZE=+2 COLOR=RED>Geen resultaten!";
}
echo "<BR></TD></TR><TR><TD BGCOLOR=9999FF><CENTER><FONT SIZE=-1>Er zijn/is $fchek bestand(en) doorzocht. Dit duurde";
$timey=time();
$timea=($timey-$timex);
echo " $timea totaal seconde(n)";
?>
<TD/></TD></TR></TABLE><BR>
<BR>
<BR><BR><BR><BR><BR>
<TABLE WIDTH=300><TR>
<TD>Zoek Machine door NiwreNL</TD>
</TR></TABLE>
</HTML>
----------
Wie o wie kan helpen ?