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 : |
<? session_start(); include_once('../connect.php'); $url=ucwords(str_replace('-',' ',$_GET['id'])); $q = $url; $title = ucwords($q); $category = str_replace(' ',' +',$q); /* $yadsq1 = mysql_query("SELECT * FROM locations WHERE `area_id`='{$id}' LIMIT 1") or die(mysql_error()); while($row = @mysql_fetch_array($yadsq1)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } $long=$area_lon; $lat=$area_lat; } if (!$area_id) {header('Location: http://www.yellowleaf.co.uk/'); die;} if ($url != $area_name) {header('Location: http://www.yellowleaf.co.uk/'); die;} */ $radius = 200; $kilometers=6371; // reference to calculate with kilometers $miles=3959; // reference to calculate with miles $query = mysql_query("SELECT * FROM ads WHERE MATCH (`companyname`,`description`,`services_offered`,`category_plural`,`products_plural`) AGAINST ('+{$category}' IN BOOLEAN MODE) AND `active`='1' ORDER BY review_rate DESC LIMIT 10") or die(mysql_error()); //$num_rows = mysql_num_rows($query); while ($row = mysql_fetch_array($query)){ $words_array=array();$filtered='';$word_pos=0;$last_pos=0; foreach($row as $a=>$b){$$a=$b;} $joinq = "$q $town_name"; $q_words = explode(" ",strtolower($joinq)); $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); if (!$metadesc) {$metadesc = $companyname;} $content_data = "$companyname $street1 $street2 $county_name $district_name $town_name $postcode $description $category Directory $services_offered $areas_cover directory $products"; $content_data = preg_replace('/\s+/', ' ', $content_data); $split_words=explode(' ',$content_data); if ($street2) {$fulladd=ucwords(strtolower("$street1, $street2, $town_name, $county_name, "));} else {$fulladd=ucwords(strtolower("$street1, $town_name, $county_name, "));} foreach($split_words as $single_word){ if(in_array(preg_replace('/[^a-zA-Z0-9]/','',strtolower($single_word)),$q_words)){ construct_array($word_pos); } $word_pos++; } foreach($words_array as $word_pos=>$a){ if(($word_pos-$last_pos)>1 && $word_pos && $last_pos){$filtered.='..';} $last_pos=$word_pos; $filtered.=$split_words[$word_pos].' '; } // <div style="padding: 0px 11px;font-size: 8pt;font-weight: bold;background: #ff7301;color: #fff;float: left;border: 2px solid transparent;"></div> //reviews if($review_rate>0){ $averageCss=str_replace(".","-",$review_rate); $review_html='<img class="srate_'.$averageCss.'" style="margin:0px 4px -1px;border:0" src="/img/img_trans.gif" width="1" height="1" />'; }else{ $review_html=''; } $time=time(); // calculating promotions date $promo_diff = ($time-$promo_date); if($promo_diff<=120){$promos='<div style="width:68px;height:69px;position:absolute;right:-4px;top:-6px;background:url(\'/img/offer_gif.gif\') no-repeat"></div>';}else{$promos='';} // calculating last update $diff = ($time-$last_update); $days = floor($diff/84600); if($days<=90){$lupdate='<div style="width:115px;height:22px;margin-top:3px;background:url(\'/img/updated.png\') -2px 0 no-repeat"></div>';}else{$lupdate='';} if(!$words_array[0]){$filtered='..'.$filtered;} // results display $result .= '<div class="cn_shaddow sresult">'.$promos.' <table width="100%"> <tr> <td width="90" valign="top" style="text-align:center;padding:5px 4px;"> <div style="width:110px;height:110px;overflow:hidden;">'; if($row['image']!=''){ $result .= '<img width="250" style="margin-left:-80px" src="/members/uploads/logo/'.$row['image'].'">'; }else{ $result .= '<img width="125" src="/img/no_logo.png">'; } $result .= '</div>'; $result .= $lupdate; // echo last update $filtered = str_replace(" || "," ",$filtered); if ($filtered == "..") { $addtitle=" $q"; $subDesc=substr($description,0,200); if(strlen($str)<200){$filtered=$subDesc.'...'; } else {$filtered=$description;} } if (strlen($filtered) > 300) {$filtered = substr($filtered,0,300);} $result .= '</td><td valign="top" style="padding:1px 6px 1px 10px;"> <a style="font-size:13pt;line-height:26px" href="/pages/'.$adid.'-'.$ad_name.'.html"><b>'.$row['companyname'].''.$addtitle.'</b>'.$review_html.'</a> <div style="padding-top:1px;font-size:9pt;color:#008000;"><b>'.$fulladd.' '.strtoupper($postcode).'.</b></div> <div style="margin:5px 0px;color:#666;font-size:10pt;">'.highlightWords($filtered,$q).'..</div></td></tr> </table></div>'; $addtitle=''; } // 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 ="Currently no counties available for <b>$title</b>."; } $tplbody= file_get_contents("directory_tpl.html"); $footer= file_get_contents("../footer.php"); $search_box = file_get_contents("../search_box2.php"); include_once('../top_bar2.php'); // top bar $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("{metadesc}", $metadesc, $tplbody); $tplbody = str_replace("{title}", $title, $tplbody); $tplbody = str_replace("{page_no}", $page_no, $tplbody); $tplbody = str_replace("{search_box}", $search_box, $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}", "$area_county", $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}", "$longlat", $tplbody); $tplbody = str_replace("{suggest}", $suggest, $tplbody); $outputline = split("\n",$tplbody); foreach ($outputline as $line) { if (trim($line)) { echo trim($line); echo " "; } } function highlightWords($string, $q) { $words=explode(' ',$q); foreach ( $words as $word ) { $word=trim(quotemeta(stripslashes($word))); $color_pos=1; $string = preg_replace('#([^a-zA-Z0-9])('.$word.')([^a-zA-Z0-9])#Usi', '\1<b>\2</b>\3', $string); $color_pos++; } return $string; } function construct_array($pos){ global $words_array; $words_include=13; for ($i=$words_include;$i>0;$i--) { if(($pos-$i)>=0){$words_array[$pos-$i]=1; } } $words_array[$pos]=1; for ($i=1;$i<=$words_include;$i++) { $words_array[$pos+$i]=1; } } ?>