assign("page_tpl",TEMPLATE_DIR . "gallery/user_bikelist.tpl.smrt"); } else { switch($type) { case "new" : $title = "Newly Added Bikes"; break; case "best" : $title = "Highest Ranked Bikes"; break; case "worst" : $title = "Lowest Ranked Bikes"; break; case "opp" : $title = "OPP Approved Bikes"; break; case 'Aprilia' : $title = "Aprilia Bikes"; break; case 'BMW' : $title = "BMW Bikes"; break; case 'Ducati' : $title = "Ducati Bikes"; break; case "Honda" : $title = "Honda Bikes"; break; case "Kawasaki" : $title = "Kawasaki Bikes"; break; case "KTM" : $title = "KTM Bikes"; break; case 'Mondial' : $title = "Mondial Bikes"; break; case 'MV Agusta' : $title = "MV Agusta"; break; case "Suzuki" : $title = "Suzuki Bikes"; break; case "Yamaha" : $title = "Yamaha Bikes"; break; case "popular" : $title = "Most Popular Bikes"; break; } $page = nBase::get_value('page',$_GET,$_POST,1, 1); $smarty->assign("title",$title); $smarty->assign("PAGETITLE",$title); list($bikelist, $numbikes) = db_get_bikes($type, ($page -1) * $per_page_limit,$per_page_limit); $smarty->assign("pagehtml",utils_bg_display_pages("bikes.php","&type=$type", $page, $numbikes, $per_page_limit)); $smarty->assign("page_tpl",TEMPLATE_DIR . "gallery/bikelist.tpl.smrt"); } $smarty->assign("bikelist",$bikelist); } else { $bike = new GalleryBike($db, $bike_id); if ($bike->status != "approved" && $bike->user_id != USERID && !ISADMIN) { $smarty->assign("error","You can not view this bike as it hasn't been approved for OPP Galleries Yet."); $smarty->assign("page_tpl",TEMPLATE_DIR . "gallery/bikelist.tpl.smrt"); die(); } db_add_popular_bikes($bike_id); $bike->get_images('approved'); if (sizeof($bike->images) > 0) { $x = rand(0,sizeof($bike->images)-1); $smarty->assign("show_image", $bike->images[$x]->medium_image); } $bike->get_comments(); if ($bike->rank - floor($bike->rank) > .5) { $rank_image = "rank_" . floor($bike->rank) . "_5.jpg"; } else { $rank_image = "rank_" . floor($bike->rank) . "_0.jpg"; } $smarty->assign("rank_image", $rank_image); $smarty->assign("BIKEDISPLAY", true); $smarty->assign("bike", $bike); $smarty->assign("PAGETITLE",$bike->name . " details"); $smarty->assign("page_tpl", TEMPLATE_DIR . "gallery/bike.tpl.smrt"); } $smarty->display("gallery_template.tpl.smrt"); include BASEDIR . 'includes/postpend.inc.php';