array( 'design_category' => COMP_ID ), 'size' => $size, 'offset' => $offset ); $search_params = array( 'email' => array( 'field' => 'owner_email', 'like' => false ), 'tag' => array( 'field' => 'name', 'like' => true ), 'date' => array( 'field' => 'last_saved', 'like' => false ) ); if($search = getv('search', null)){ $search = MysqlDB::Escapestring($search); $q = array(); foreach($search_params AS $k=>$v){ if($v['like']){ $q[] = $v['field'] ." like '%$search%'"; }else{ $q[] = $v['field'] ." = '$search'"; } } $condition['condition'] = implode(' OR ', $q); $condition['condition'] = "( " . $condition['condition'] . ") AND (design_category = " . COMP_ID . ")"; } $sort_params = array('like'=>'count','date'=>'id'); $get_keys = array_keys($_GET); $order_by = cookieget('sort') ? cookieget('sort') : 'count'; foreach($sort_params AS $one=>$value){ if(request_exist($one)){ $order_by = $value; cookieset('sort', $value, 7*24*60*60); break; } } $condition['order'] = "ORDER BY $order_by DESC"; $designs = MysqlDB::LimitQuery(TABLE_SAVEDDESIGN, $condition); $total = Table::Count(TABLE_SAVEDDESIGN, $condition['condition']); $user_emails = Utility::GetColumn($designs,'owner_email'); $users = Table::Fetch(TABLE_USERS, $user_emails, 'user_email'); $users = Utility::AssColumn($users, 'user_email'); $imp_pts = array( array( 'icon' => 't-shirt', 'heading' => 'Design your Biking T-shirt', 'desc' => 'Add text, images and cliparts to your Tshirt design using our design-studio' ), array( 'icon' => 'share', 'heading' => 'Share & Win', 'desc' => 'Share your design on facebook, twitter, pinterest and google+ to win the contest' ), /*array( 'icon' => 'crown', 'heading' => 'Earn Money', 'desc' => 'Sell your design and earn profit with no upfront cost.' )*/ ); $title = "India Bike Week - India's Biggest Biking T-Shirt College Festival"; $desc = "After the successful coolest college competition and sunburn, we are revealing new platform for college designers to draw their skill in our design studio."; $keyword= "bike, biking, bikers, moto, race, t-shirt, contest"; foreach($designs AS $k=>$one){ $designs[$k]['user'] = $users[$one['owner_email']]; } if(true==$AJAX){ die(render('ajax_almafest_imagesharer.php',array('designs' => $designs))); } include template("almafest_index.php");