0) { $type = $_REQUEST['type']; } else if($_REQUEST['type']=='taipeicycleshow' || $_REQUEST['type']=='eurobike') { $type = $_REQUEST['type']; } else if($_REQUEST['type']) { //possible injection or wrong type header("Location: ../articles/index.php"); exit; } if($type == 3 || $type == 4 || $type == 7) { //header("HTTP/1.1 301 Moved Permanently"); header("Location: ../articles/index.php"); exit; } if($type==1) { $MENU_ID = 'NEWS'; //highlight the menubar } if($type==17) { $MENU_ID = 'BLOG'; //highlight the menubar } $SUB_APP_ID = "ROADTEST"; $ENTRIESPERPAGE = 8; if ($_POST['Clear']) { $_REQUEST['search'] = ""; //reset search fields } else if($_GET['Clear']) { $_REQUEST['search'] = ""; } if (!$_REQUEST['search']) { $search = ""; //make empty string for search } else { $search = trim($_REQUEST['search']); $SEARCH_HIGHLIGHT = true; } $makeid=0; /* if(isset($_REQUEST['makeid']) && $_REQUEST['makeid']>0) { $makeid=$_REQUEST['makeid']; } */ //inclusive of 1 for news if (($type>=1 && $type<=17) && is_numeric($type)) { if($type == 8) { //echo "in"; $articletype_array = array($type, 5); $arttype = $type; //echo $arttype; $section = new Section ($arttype); } else { //echo "in"; $articletype_array = array($type); $arttype = $type; //echo $arttype; $section = new Section ($arttype); } $section_type = $section->getName(); } else if($type==='eurobike') { $articletype_array = array(9, 14, 18); //now default includes new 1 $arttype='eurobike'; $section_name = "Editorial"; $section_type = 'Eurobike'; } else if($type==='taipeicycleshow') { $articletype_array = array(11, 13, 16, 19); //now default includes new 1 $arttype='taipeicycleshow'; $section_name = "Editorial"; $section_type = 'Taipei Cycle Show'; } else { $articletype_array = array(1,2,3,4,5,6,8,9,11,12,13,14,16); //now default includes new 1 $arttype=0; $section_name = "Editorial"; } if (!$pageid) { $pageid=1; } else { if(!is_numeric($pageid)) { $pageid = 1; } } /* if (!$makeid) { $makeid=0; } */ /* if($makeid>0) { //cater to makeid search $articleCount = count(getArticleCarReviewIDByMakeID($makeid, isArticlesadmin(), $link)); //$articleCount = count(searchArticlesNew (isArticlesAdmin(), -1, $search, 0, 0, array(1))); //echo $articleCount; //echo('a1'); exit; } else { //cater to text and regular query // The following function is replaced by searchArticles //$articleCount = count(getAllArticles(isArticlesAdmin(), $search, 0, 0, 1)); $articleCount = count(searchArticlesNew (isArticlesAdmin(), -1, $search, 0, 0, $articletype_array)); //echo('a2'); exit; } */ //$articleCount = count(searchArticlesNew (isArticlesAdmin(), -1, $search, 0, 0, $articletype_array)); //will fail for admin etc $articleCount = getArticleCountByTypeIDs(isArticlesAdmin(), '', $articletype_array); //echo('$articleCount='.$articleCount); //exit; //calculate pages. $pages = new Pages($ENTRIESPERPAGE, $ENTRIESPERPAGE, $articleCount, $pageid); $pageOffset = $pages->getSQLOffset(); $pageLimit = $pages->getSQLLimit(); //$productMakes = getProductMakeForAllArticles($link); /* if ($articleCount > 0) { if($makeid>0) { $articles = getArticleCarReviewIDByMakeID2($makeid, isArticlesadmin(), $pageOffset, $pageLimit, $link); } else { // The following function is replaced by searchArticles // $articles = getAllArticles(isArticlesAdmin(), $search, $pageOffset, $pageLimit, 1); $articles = searchArticlesNew (isArticlesAdmin(), -1, $search, $pageOffset, $pageLimit, $articletype_array); } } */ if(getCountryCodeSelected() == 'SG'){ $country = 'SG'; } else if(getCountryCodeSelected() == 'MY'){ $country = 'MY'; } $articles = searchArticlesNewByCountry($country, isArticlesAdmin(), -1, $search, $pageOffset, $pageLimit, $articletype_array); //Title tag // $WEBPAGE_TITLE = ''; // if($type==1) { // $WEBPAGE_TITLE = 'Cycling News'; //.' Singapore' // } // else if($type==17) { // $WEBPAGE_TITLE = 'Blog'; //.' Singapore' // } // else if($type==='eurobike') { // $WEBPAGE_TITLE = 'Eurobike 2015'; // } // else { // //else if($type==11 || $type==9 || $type==12 || $type==13) { // if($section) { // $WEBPAGE_TITLE = $section->getName().' Cycling Articles'; // } // else { // //$WEBPAGE_TITLE = 'Bike Tests & Reviews'; // $WEBPAGE_TITLE = 'Bicycles, MTB, Folding Bikes, Road Bikes Tests & Revews'; // } // } // /* // else { // $WEBPAGE_TITLE = 'Bike Tests & Reviews'; // .' Singapore' // } // */ // $WEBPAGE_TITLE .= ' | '.$GLOBAL_PORTAL_NAME; $WEBPAGE_TITLE = "Reviews of Bicycles, MTB, Folding Bikes, Road Bikes | Bike Shops | Buy Sell MTB Road Tri Folding | " . $GLOBAL_PORTAL_NAME; ?> */ ?>