"education", "36" => "restaurants", "35" => "bars_and_pubs", "7" => "hotels"); $vibesasia_sql = "SELECT category_id FROM `cms_category` WHERE `category_parent` = 1"; $vibesasia_result = $db->query($vibesasia_sql); while($r = mysql_fetch_array($vibesasia_result)) { $vibesasia_group[$r["category_id"]] = "shopping"; } function replaceForUrl($s) { $sOldPattern = array("/[^a-zA-Z0-9]/", "/_+/", "/_$/"); $sNewPattern = array("_", "_", ""); return strtolower(preg_replace($sOldPattern,$sNewPattern,$s)); } $result = $db->query($sql); $category_cnt = array(); while($r = mysql_fetch_array($result)) { $category_cnt[$r["business_classification"]] = $r["cnt"]; } $cat_coll = new CategoryCollection($db); $catListArr = $cat_coll->getCategoryList(); //print_r($catListArr); // TODO redirect to // Router::map("([\w\-]+)\/homes_and_living\/directory\/(\d+)\/\w+\/content_list\.htm", "homes_and_living/content_list.php"); /* foreach ($catListArr as $group => $cat_arr) { foreach ($cat_arr as $cat_id => $cat_info) { if ($cat_id == $_GET["category"]) { header(""); exit; } } } // Router::map("([\w\-]+)\/homes_and_living\/directory\/index\.htm", "homes_and_living/directory_index.php"); header(""); exit; */ $all_cat = $checker = array(); foreach ($catListArr as $key => $value) { $all_cat[$key] = $checker[$key] = $value; } /*************/ if(isset($_GET["content"])) { /* Set Link to vibesasia */ $vibesasia_link = ""; if(array_key_exists($_GET["category"],$vibesasia_group)) { $vibesasia_link = "http://www.vibesasia.com/".$vibesasia_group[$_GET["category"]]."/search.htm"; } /** Custom JS and CSS config */ require_once("tpl/_directory_js.php"); /** HTML Top Panel Layer */ include("../include/html_header.php"); include("../class/ContentCollectionClass.php"); include("../class/Category.php"); include("../class/Content.php"); //$category_header = "Directory > "; $sql = "SELECT * FROM cms_content WHERE content_id = '".addslashes($_GET["content"])."'"; $result = $db->query($sql); $r = mysql_fetch_array($result); foreach($checker[0] as $cat_key => $category) { foreach($all_cat[$cat_key] as $sub_cat_key => $sub_category) { if($sub_category['category_id'] == $r["business_classification"]) { $refer = parse_url($_SERVER["HTTP_REFERER"]); $ext = ""; if(isset($refer["path"]) && strpos($refer["path"],"content_list.php") !== false) { parse_str($refer["query"], $output); if(isset($output["page"]) && $output["page"] != "") { $ext = "page=".$output["page"]; } } } } } $content_collection = new ContentCollection($db); $cat = array(); $cat["content_id"] = addslashes($_GET["content"]); $cat["orderby"] = "content_district_eng"; $content_collection->loadContents($cat); $r = $content_collection->getContentArr(); $imgs = $content_collection->getContentImage(); foreach($r as $k => $v) { $content_name_eng = $v["content_name_eng"]; $business_classification = $v["business_classification"]; $iBusinessId = $v["business_id"]; $html = ""; $html .= '
'; $html .= ' '; $tmp_height = isset($imgs[$k])?'height="190"':'height="160"'; $html .= ' '; $html .= ' '; $html .= ' '; //get products $prodcut_html = ''; $aQuery['cid'] = $_GET['content']; $aQuery['rpp'] = 10; $oProductCollection = new ProductCollection($db); $oProductCollection->searchByQueryStr($aQuery); $iTotal = $oProductCollection->getTotal(); if ($iTotal>0){ $aResult = $oProductCollection->getResultAry(); //echo "
"; print_r($aResult);echo "
"; $iCounter = 0; foreach ($aResult as $iProductKey => $aProductInfo){ $aPhoto = $oProductCollection->getPhotoByProductId($aProductInfo['product_id']); //link to prodcut info /*$prodcut_html .= << HTML;*/ //link to prodcut list //
origional link $content_name_eng_url = replaceForUrl($content_name_eng); $prodcut_html .= << HTML; $iCounter ++; if ($iCounter%5==0) $prodcut_html .= '
'; } $prodcut_html .= '
'; } $second_table_config = $prodcut_html? '
'; $html .= ' '; // background="'.$sRelativePath.'images/property/photo_frame_hori.gif" //$html .= '
'; //if(1) if(isset($imgs[$k])) { $html .= '
'; $html .= ' '; $html .= '
'; //$html .= ''; //$html .= ' '; $sRelativeRoot = "http://www.vibesasia.com"; $content = new ContentObject($db, addslashes($_GET["content"])); $content_photo_list = $content->getContentPhotos(); $photo_arr = $content_photo_list["current"]["unclassify"]; $aPhoto200 = array(); $aPhoto640 = array(); if ($photo_arr) { foreach ($photo_arr as $aPhoto) { if (strstr($aPhoto['photo_path'],'200x') || strstr($aPhoto['photo_path'],'x200')) { $aPhoto200[$aPhoto['photo_seq']]['desc'] = $aPhoto['photo_desc_eng']; $aPhoto200[$aPhoto['photo_seq']]['key'] = $aPhoto['photo_key']; $aPhoto200[$aPhoto['photo_seq']]['path'] = $aPhoto['photo_path']; $aPhoto200[$aPhoto['photo_seq']]['default'] = $aPhoto['photo_default']; if ($aPhoto['photo_default']>0) { $iDefaultPhoto200 = $aPhoto['photo_seq']; } } elseif (strstr($aPhoto['photo_path'],'640x') || strstr($aPhoto['photo_path'],'x640')) { $aPhoto640[$aPhoto['photo_seq']]['desc'] = $aPhoto['photo_desc_eng']; $aPhoto640[$aPhoto['photo_seq']]['key'] = $aPhoto['photo_key']; $aPhoto640[$aPhoto['photo_seq']]['path'] = $aPhoto['photo_path']; $aPhoto640[$aPhoto['photo_seq']]['default'] = $aPhoto['photo_default']; if ($aPhoto['photo_default']>0) { $iDefaultPhoto640 = $aPhoto['photo_seq']; } } } } $html .= ''; $html .= '
 
 
'; } else { $html .= '
'; $html .= ''; /* $html .= ' '; $html .= ''; */ } $html .= '
'; $html .= ' '; $html .= ' '; $html .= ' '; $html .= ' '; $html .= ' '; $html .= ' '; $html .= ' '; $d = Content::getContentDescription($v); if($d != "") { $html .= ' '; $html .= ' '; $html .= ' '; } $html .= ' '; $html .= ' '; $html .= ' '; $html .= '
'; if ($v['directory_id']==103){//show school detail info include_once("../class/SchoolCollectionClass.php"); $oSchoolCollection = new SchoolCollection($db); $aSchoolInfo = $oSchoolCollection->getDetailByContentId($v['content_id']); $v['school_type'] = SchoolCollection::$school_type[$aSchoolInfo['school_type']]; $v['school_sponsor'] = $aSchoolInfo['school_sponsor']; $v['school_establish_year'] = $aSchoolInfo['school_establish_year']; $v['school_religious_affiliation'] = SchoolCollection::$religious_type[$aSchoolInfo['school_religious_affiliation']]; $v['school_level'] = SchoolCollection::$level_type[$aSchoolInfo['school_level']]; $v['curriculum_1'] = SchoolCollection::$curriculum_type[$aSchoolInfo['curriculum_1']]; $v['curriculum_2'] = SchoolCollection::$curriculum_type[$aSchoolInfo['curriculum_2']]; $v['curriculum_3'] = SchoolCollection::$curriculum_type[$aSchoolInfo['curriculum_3']]; } $html .= Content::getContentHTMLSimple($v); $html .= ' '; if($vibesasia_link != "") { $html .= ''; } else { $html .= ''; } $html .= '
 
'; $html .= '
'; $html .= $d; $html .= '
'; $html .= '
'; /*if($vibesasia_link != "") { $html .= ''; } else { $html .= ''; }*/ //get article(s) $param = ''; $param['biz_id'] = $r[$_GET["content"]]['business_id']; $param['orderby'] = ''; $param['approved'] = 'Yes'; //$param['RECORD_PER_PAGE'] = '6'; $artilce_coll_tmp = new ArticleCollection($db); $artilce_coll_tmp -> loadArticles($param); $r[$_GET["content"]]['article_ary'] = $artilce_coll_tmp -> getArticleArr(); //get article(e) $article_html = ''; if ($r[$_GET["content"]]['article_ary']){ //$html .= 'Featured Article'; foreach ($r[$_GET["content"]]['article_ary'] as $article_key => $article_info){ if (get_magic_quotes_gpc()) { $r[$_GET["content"]]['article_ary'][$article_key]['title_text'] = stripslashes($article_info['title_text']); $r[$_GET["content"]]['article_ary'][$article_key]['author_text'] = stripslashes($article_info['author_text']); } //$html .= '
'.$article_info['title_text'].''; //$article_html .= $article_html?'
':''; $article_html .= '
'.date('d M Y', strtotime($article_info['cre_time'])).''; $article_html .= ''.$article_info['title_text'].'
'; } } $html .= '
': '
'; $html .= << HTML; } if ($article_html){ $html .= << {$second_table_config}
HTML; if ($prodcut_html){ $html .= <<
{$prodcut_html}
Featured Article
{$article_html}
HTML; } $html .= << HTML; $html .= ' '; //if(0) if($v["coor"] != "") { $html .= ' '; } else { $html .= '  '; } $html .= ' '; $html .= ''; //echo 'hihi'; //if(0) if($v["coor"] != "") { $script = ""; } } }else { //echo ""; echo ""; } /**************/ if(isset($_GET["by_keyword"])) { //$category_header = "Directory > Keyword Search "; $category_header = "Directory > Keyword Search "; $namex = ""; if(isset($_GET["bc"])) { foreach($checker[0] as $cat_key => $category) { $matched = false; foreach($all_cat[$cat_key] as $sub_cat_key => $sub_category) { if($sub_category['category_id'] == $_GET["bc"]) { $matched = true; $namex = $sub_category['category_name']; break; } } if($matched) break; } } if($namex != "") { $category_header .= " > ".$namex.""; } } else { //$category_header = "Directory > "; $category_header = "Directory > "; } $current_header = ""; $parent_header = ""; foreach($checker[0] as $cat_key => $category) { foreach($all_cat[$cat_key] as $sub_cat_key => $sub_category) { if($sub_category['category_id'] == $business_classification) { $sub_category_name = $sub_category['category_name']; //array_push($tmp_header_arr, "".$sub_category['category_name'].""); $parent_cat = $checker[0][$sub_category['category_parent']]; //$current_header = "".$sub_category['category_name'].""; $current_header = "".$sub_category_name."";//redirect link if($parent_header == "") { //$parent_header = "".$parent_cat['category_name'].""; $parent_header = "".$parent_cat['category_name'].""; } } } } if(isset($_GET["by_keyword"])) { //$$category_header .= $_GET["cname"]; if(isset($_GET["name"])) { $category_header .= " > ".urldecode($_GET["name"]); } } else { $category_header .= $parent_header." > ".$current_header." > ".$content_name_eng; } ?>
 
"; //echo "
".$category_header."".$sort_by_html."
"; ?>
Search:  


get_ad(); $main_ad = ""; foreach($ads as $k => $v) { //$main_ad .= '
'; if(isset($v["html"]) && isset($v["use_html"]) && $v["use_html"]) $main_ad .= $v["html"]; else $main_ad .= '
'; } echo $main_ad; ?>
Advertise with us