Database-server not found or unavailable!"); mysql_select_db("$database_mysql",$db) or die("Database not found or unavailable!"); $ttl=$_GET['ttl']; $p=$_GET['p']; $param2=$_GET['p2']; $l=$_GET['l']; $rel=$_GET['rel']; $s=$_GET['s']; $max=$_GET['max']; $a=$_GET['a']; if (empty($a)) { $a=5; } if (empty($l)) { $l="n"; } if (empty($p)) { $p="hypotheek"; } if (empty($max)) { $max="none"; $themax=999999; } else { $themax=$max; } if (empty($rel)) { $reltext="rel=\"nofollow\""; $rel=1; } else { if ($rel == "no") { $reltext=""; } } if ($l == "n" or $l == "b") { $text5="gehele artikel"; $text6="Bron"; } if ($l == "e") { $text5="entire article"; $text6="Source"; } if ($l == "d") { $text5="weiter lesen"; $text6="Quelle:"; } if ($l == "s") { $text5="entire article"; $text6="Source"; } $sql="select processed,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12 from mastertable_index_prioritized_request where keyword = \"$p\" and language=\"$l\" "; $resultaat=mysql_query("$sql"); $row=mysql_fetch_array($resultaat, MYSQL_NUM); $processed = $row[0]; $p1 = $row[1];$p2 = $row[2];$p3 = $row[3];$p4 = $row[4];$p5 = $row[5];$p6 = $row[6]; $p7 = $row[7];$p8 = $row[8];$p9 = $row[9];$p10 = $row[10];$p11 = $row[11];$p12 = $row[12]; $level1=$p1; $level2=$p2+$p3+$p4+$p5+$p6; $level3=$p7+$p8+$p9+$p10+$p11+$p12; # print "[$sql]
\n"; # print "level1: [$level1]
\n"; # print "level2: [$level2]
\n"; # print "level3: [$level3]
\n"; $part3=0; $part1=intval(($a / 20) * 16); $part2=$a - $part1; # print "[$part1] :: [$part2] :: [$part3]
\n"; if ($part1>$level1) { $part1=$level1; $part2=$a-$part1; } if ($part2>$level2) { $part2=$level2; $part3=$a-$part1-$part2; } $total=$part1+$part2; if ($total<$a) { $part3=$a-$total; } # print "[$part1] :: [$part2] :: [$part3]
\n"; $uidx=0; if ($processed == "3") { $idc=0; $uidx=1; } else { $sql="select count(*) from mastertable_index_prioritized where keyword = \"$p\" and language=\"$l\" "; $resultaat=mysql_query("$sql"); $row=mysql_fetch_array($resultaat, MYSQL_NUM); $idc = $row[0]; } if ($idc==0 and $uidx==0) { #print "check for indexing
\n"; #eerst checken of ie geindexeerd wordt, of niet geindexeerd kan worden $sql="select processed from mastertable_index_prioritized_request where keyword = \"$p\" and language=\"$l\""; $resultaat=mysql_query("$sql"); $row=mysql_fetch_array($resultaat, MYSQL_NUM); $processed = $row[0]; if ($processed>0) { } else { #print "processed: [$processed]
\n"; $sqladd="insert into mastertable_index_prioritized_request (keyword,language,processed) values (\"$p\",\"$l\",1)"; $addresultaat=mysql_query("$sqladd"); } } $res1=0; $res2=0; $res3=0; if ($part1>0) { $res1=showmessages(1,$part1,$p,$l,$idc,$s); } if ($part2>0) { $res2=showmessages(2,$part2,$p,$l,$idc,$s); } if ($part3>0) { $res3=showmessages(3,$part3,$p,$l,$idc,$s); } #echo("p: $p :: p2: $param2 :: res1: $res1 :: res2: $res2
\n"); if ($res1==0 and $res2==0 and $res3==0 and $param2 !="") { $sql="select processed,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12 from mastertable_index_prioritized_request where keyword = \"$param2\" and language=\"$l\" "; $resultaat=mysql_query("$sql"); $row=mysql_fetch_array($resultaat, MYSQL_NUM); $processed = $row[0]; $p1 = $row[1];$p2 = $row[2];$p3 = $row[3];$p4 = $row[4];$p5 = $row[5];$p6 = $row[6]; $p7 = $row[7];$p8 = $row[8];$p9 = $row[9];$p10 = $row[10];$p11 = $row[11];$p12 = $row[12]; $level1=$p1; $level2=$p2+$p3+$p4+$p5+$p6; $level3=$p7+$p8+$p9+$p10+$p11+$p12; # print "[$sql]
\n"; # print "level1: [$level1]
\n"; # print "level2: [$level2]
\n"; # print "level3: [$level3]
\n"; $part3=0; $part1=intval(($a / 20) * 16); $part2=$a - $part1; # print "[$part1] :: [$part2] :: [$part3]
\n"; if ($part1>$level1) { $part1=$level1; $part2=$a-$part1; } if ($part2>$level2) { $part2=$level2; $part3=$a-$part1-$part2; } $total=$part1+$part2; if ($total<$a) { $part3=$a-$total; } # print "[$part1] :: [$part2] :: [$part3]
\n"; $uidx=0; if ($processed == "3") { $idc=0; $uidx=1; } else { $sql="select count(*) from mastertable_index_prioritized where keyword = \"$param2\" and language=\"$l\" "; $resultaat=mysql_query("$sql"); $row=mysql_fetch_array($resultaat, MYSQL_NUM); $idc = $row[0]; } if ($idc==0 and $uidx==0) { #print "check for indexing
\n"; #eerst checken of ie geindexeerd wordt, of niet geindexeerd kan worden $sql="select processed from mastertable_index_prioritized_request where keyword = \"$param2\" and language=\"$l\""; $resultaat=mysql_query("$sql"); $row=mysql_fetch_array($resultaat, MYSQL_NUM); $processed = $row[0]; if ($processed>0) { } else { #print "processed: [$processed]
\n"; $sqladd="insert into mastertable_index_prioritized_request (keyword,language,processed) values (\"$param2\",\"$l\",1)"; $addresultaat=mysql_query("$sqladd"); } } $res1=0; $res2=0; $res3=0; if ($part1>0) { $res1=showmessages(1,$part1,$param2,$l,$idc,$s); } if ($part2>0) { $res2=showmessages(2,$part2,$param2,$l,$idc,$s); } if ($part3>0) { $res3=showmessages(3,$part3,$param2,$l,$idc,$s); } } function showmessages($mmode = 1,$mnumber = 5,$keyw,$lang,$idcount,$short) { #echo("going into function
"); if ($mmode==1) { $sqlprio="and (prio = 1) "; } if ($mmode==2) { $sqlprio="and (prio >= 2 and prio <=6) "; } if ($mmode==3) { $sqlprio="and (prio >= 7 and prio <=12) "; } $sql="select id from mastertable_index_prioritized where keyword = \"$keyw\" and language=\"$lang\" $sqlprio order by rand() limit $mnumber"; # echo("
sq;: [$sql]
"); # echo("$sql
"); $resultaat=mysql_query("$sql"); $fid=1; $idlist=""; while ($row=mysql_fetch_array($resultaat, MYSQL_NUM)) { $iid=$row[0]; if ($fid==1) { $fid=0; $idlist=$iid; } else { $idlist.=",$iid"; } } # echo("idlist [$idlist][$idcount]
"); if ($idcount>0 and $idlist != "") { $sql8="select url,page,title,date,source,originalurl,sourcetype,filetitle from mastertable where id in ($idlist) order by rand() "; #echo("hmm: [$sql8]
"); $resultaat8=mysql_query("$sql8"); while ($row8=mysql_fetch_array($resultaat8, MYSQL_NUM)) { $link = $row8[0]; $page = $row8[1]; $title = $row8[2]; $datum = $row8[3]; $bron = $row8[4]; $orgurl = $row8[5]; $st = $row8[6]; $cftitel = $row8[7]; $jaar=substr($datum,0,4); $maand=substr($datum,4,2); $dag=substr($datum,6,2); $hpage=html_entity_decode($page); $page=html_entity_decode($hpage); $s2=$short; if ($lang == "d") { if ($bron == "none") { $bron="Algemein"; } if ($st == "2") { $bron="Algemein"; } $link="http://www.ihrenachrichten.de/nachrichten/$bron/$jaar/$maand/$dag/$cftitel.html"; } if ($lang == "e") { if ($bron == "none") { $bron="General"; } if ($st == "2") { $bron="General"; } $link="http://www.news-from-newspapers.com/en/$bron/$jaar/$maand/$dag/$cftitel.html"; } if ($lang == "s") { if ($bron == "none") { $bron="General"; } if ($st == "2") { $bron="General"; } $link="http://www.nyhetsarkiv.se/se/$bron/$jaar/$maand/$dag/$cftitel.shtml"; } if ($lang == "n") { if ($bron == "none") { $bron="Algemeen"; } if ($st == "2") { $bron="Algemeen"; } if (strstr($bron,"hypotheek-verzekeringen-vragen")) { $link=$orgurl; } else { $rbron = str_replace("http://", "", $bron); $bron=$rbron; $link="http://www.financielevragen.com/nieuws/nl/$bron/$jaar/$maand/$dag/$cftitel.html"; } } if ($lang == "b") { if ($bron == "none") { $bron="Algemeen"; } if (strstr($bron,"hypotheek-verzekeringen-vragen")) { $link=$orgurl; } else { $rbron = str_replace("http://", "", $bron); $bron=$rbron; $link="http://www.nieuwsbelgie.be/nieuws/$bron/$jaar/$maand/$dag/$cftitel.html"; } } # tekst $spage=str_replace("XFX001","\"",$page); $page=str_replace("\r","",$spage); $spage=str_replace("\n\n","\n",$page); $page=strip_tags($spage); if (strstr($s2,"-")) { list($smin, $smax) = split("-", $s2, 2); $sdiff=$smax - $smin; #$s = int(rand($sdiff)+$smin); $s2=rand($smin, $smax); $ingekort=0; $tekstLengte = strlen($page); $nieuweLengte = $s2; if ($nieuweLengte > 0) { #echo("[$nieuweLengte][$themax]
\n"); if ($tekstLengte > $themax) { $afkortenTekst = substr($page,0,$nieuweLengte); $ingekort=1; $page=$afkortenTekst; #if ($afkortenTekst =~ / /) { # ($spatieTekst) = $afkortenTekst =~ /(.*)\s/sgi; # $afkortenTekst = $spatieTekst; #} } } echo("

$title

$page"); if ($ingekort == 1) { $tshowlink=str_replace("www.hypotheek-verzekeringen-vragen.nl", "www.financielevragen.com", $link); echo("... $text5: $title"); } print "\n"; } else { if ($s2 < strlen($page)) { $ingekort=0; $tekstLengte = strlen($page); $nieuweLengte = $s2; if ($nieuweLengte > 0) { if ($tekstLengte > $themax) { $afkortenTekst = substr($page,0,$nieuweLengte); $ingekort=1; $page=$afkortenTekst; #if ($afkortenTekst =~ / /) { # ($spatieTekst) = $afkortenTekst =~ /(.*)\s/sgi; # $afkortenTekst = $spatieTekst; #} } } echo ("

$title

$spage"); if ($ingekort == 1) { echo("... $text5: $title"); } print "\n"; } else { echo("$spage\n"); } } # end tekst } # while } # if idcount>0 return $idcount; } # end function ?>