Server IP : 51.89.169.208 / Your IP : 216.73.216.57 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/business/ |
Upload File : |
<?php $path = $_SERVER['DOCUMENT_ROOT']; include_once $path."/connect_db.php"; $id = explode(' ',$id); $id = $id[0]; $yadsq1 = $connect->query("SELECT * FROM locations WHERE `area_id`='{$id}' LIMIT 1") or die($connect->error); while($row = @$yadsq1->fetch_array()){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } $long=$area_lon; $lat=$area_lat; } $yadsq2 = $connect->query("SELECT * FROM cats WHERE `pop`>'100' AND `no_results`>'20' AND `content_active`='1' ORDER BY cat_name ASC LIMIT 50") or die($connect->error); while($row = @$yadsq2->fetch_array()){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } $r_area_name=strtolower($area_name); $r_area_name= preg_replace("/[^A-Za-z 0-9]/", "", $r_area_name); $r_area_name=str_replace(" "," ",$r_area_name); $ad_area_name=str_replace(" ","-",$r_area_name); $urlcat_name = str_replace(" ","-",strtolower($cat_name)); $suggest .= "<div><a title=\"$cat_name in $area_name\" href=\"/{$urlcat_name}/{$area_id}-{$ad_area_name}.html\">$cat_name in $area_name</a></div>"; } $radius = 200; $kilometers=6371; // reference to calculate with kilometers $miles=3959; // reference to calculate with miles $yadsq3 = "SELECT *, ( {$miles} * acos( cos( radians(' ".mysql_real_escape_string($lat)." ') ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(' ".mysql_real_escape_string($long)." ') ) + sin( radians(' ".mysql_real_escape_string($lat)." ') ) * sin( radians( latitude ) ) ) ) AS distance FROM ads WHERE `active`='1' HAVING distance < '".mysql_real_escape_string($radius)."' ORDER BY distance LIMIT 10"; $query_result = $connect->query($yadsq3) or die($connect->error); $check = $query_result->num_rows; if ($check===0) {header('Location: http://www.yellowleaf.co.uk/'); die; } while($row = @$query_result->fetch_array()){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } $r_ad_name=strtolower($companyname); $r_ad_name = preg_replace("/[^A-Za-z 0-9]/", "", $r_ad_name); $r_ad_name=str_replace(" "," ",$r_ad_name); $ad_name=str_replace(" ","-",$r_ad_name); $desc = explode(".", $description); $desc=$desc[0].'. '.$desc[1].'.'; $subArea=substr($areas_cover,0,200); if(strlen($str)<200){$Area=$subArea.'...';}else{$Area=$areas_cover;} if ($street2) {$fulladd=ucwords(strtolower("$street1, $street2, $town_name, $county_name, "));} else {$fulladd=ucwords(strtolower("$street1, $town_name, $county_name, "));} if($seo_title) { $seo_title = explode(' Xx ',ucwords($seo_title)); if(preg_match("/$area_name/i", $fulladd) == TRUE){ $servtown_name = " Serving $area_name"; } else { $servtown_name = $town_name;} $mheader = '<div style="margin:10px 0px;font-size:14pt !important"><a style="font-size:12pt;" href="/pages/'.$adid.'-'.$ad_name.'.html">'.$companyname.', '.$servtown_name.'</a></div><B>'.$seo_title[0].' in '.$seo_title[1].'</B>'; } else {$mheader = '<a style="font-size:12pt;" href="/pages/'.$adid.'-'.$ad_name.'.html"><B>'.$companyname.', '.$town_name.', '.$servtown_name.'</B></a><div style="margin:10px 0px;font-size:14pt !important">'.$companyname.', '.$town_name.'</div>';} $result .= '<div class="cn_shaddow sresult"> <table width="100%"> <tr> <td width="90" valign="top" style="text-align:center;padding:10px 2px;"> <div style="width:100px;height:100px;overflow:hidden;"> '; if($row['image']!=''){ $result .= '<img width="200" style="margin-left:-80px" src="/members/uploads/logo/'.$row['image'].'">'; }else{ $result .= '<img width="100" src="/img/no_logo.png">'; } $result .= '</div>'; $result .= '</td><td valign="top" style="padding:10px;"> '.$mheader.' <div style="margin:6px 0px;color:#666;font-size:10pt;">'.$desc.'</div></td></tr> </table></div>'; } $murl= preg_replace("/\?page\=(.*)/i", "", $_SERVER["REQUEST_URI"]); $remove_id = str_replace('Greater ','',$area_name); $title ="$area_name Business Directory"; if($current_page>1){ $page_no =" Page ".$current_page; } // floating advertise button on right if(isset($_SESSION['ename'])||isset($_COOKIE['yl_user'])){$yleaf_url='/members/';}else{$yleaf_url='/advertise/';} $provided_by_btn='<a style="border:0px;outline:none;" href="'.$yleaf_url.'"> <img src="/img/providedby.png" onmouseover="this.src=\'/img/providedby_hover.png\'" onmouseout="this.src=\'/img/providedby.png\'" style="border:0;outline:none;"> </a>'; if (!$suggest) {$suggest='No popular searches available.';} $tplbody= file_get_contents("town_tpl.html"); $footer= file_get_contents("../footer.php"); include_once('../top_bar2.php'); $tplbody = str_replace("{top_bar}", "$top_bar", $tplbody); $tplbody = str_replace("{provided_by_btn}", "$provided_by_btn", $tplbody); $tplbody = str_replace("{header}", "$header", $tplbody); $tplbody = str_replace("{footer}", "$footer", $tplbody); $tplbody = str_replace("{title}", $title, $tplbody); $tplbody = str_replace("{area_search}", "$area_name, $area_parent_name", $tplbody); $tplbody = str_replace("{area_id}", $area_id, $tplbody); $tplbody = str_replace("{page_no}", $page_no, $tplbody); $tplbody = str_replace("{results}", $result, $tplbody); $tplbody = str_replace("{pagin_prev}", $pagin_prev, $tplbody); $tplbody = str_replace("{pagin_next}", $pagin_next, $tplbody); $tplbody = str_replace("{county}", "$remove_id", $tplbody); $tplbody = str_replace("{murl}", "$murl", $tplbody); $tplbody = str_replace("{type}", "$cattype", $tplbody); $tplbody = str_replace("{area_found}", "$area_found", $tplbody); $tplbody = str_replace("{longlat}", "$long|$lat", $tplbody); $tplbody = str_replace("{suggest}", $suggest, $tplbody); $outputline = split("\n",$tplbody); foreach ($outputline as $line) { if (trim($line)) { echo trim($line); echo " "; } } ?>