'event', 'Air_Force-t-shirts' => 'air-force', 'independence_day-t-shirts' => 'independence-day', 'green_revolution-t-shirts' => 'green-revolution', 'mission_trip-t-shirts' => 'mission-trip', 'hen_party-t-shirts' => 'hen-party', 'stag_party-t-shirts' => 'stag-party', 'charity_run-t-shirts' => 'charity-run', 'medicals_college-t-shirts' => 'medicals-college', 'design_genius-t-shirts' => 'design-genius', 'view-all-52-t-shirts' => 'funny', 'valentine-t-shirts' => 'valentine-day' ); if(in_array($durl, array_keys($redirection))){ redirect_301(WEB_ROOT . "/" . $redirection[$durl] ."-t-shirts"); } if(!$_SERVER['REDIRECT_URL'] && $search){ $search = urlencode($search); //die($search); redirect_301(WEB_ROOT . '/' .$search . '-t-shirt-designs'); } if(!$_SERVER['REDIRECT_URL'] && $durl){ $durl = str_ireplace(array("tshirts","t-shirts","t_shirts"),"", $durl) . "-t-shirts"; redirect_301(WEB_ROOT . '/' .$durl); } $ideas_home = !($durl||$search)?true:false; $last_level = false; $bc_array = array("Home"=>"/designideas.html"); $current_page = getpg(); $page = $current_page; $size = 12; $offset = $size*(getpg()-1); /*if(!$AJAX && $offset && $format!='json'){ $first_page = preg_replace('/\/[0-9]+/',"",$_SERVER['REQUEST_URI']); redirect($first_page); }*/ if($ideas_home){ $list = MysqlDB::LimitQuery(TABLE_IDEA_CATEGORY, array( 'condition' => array( 'active' => 1, 'domain_id' => array( DOMAIN_ALL, DOMAIN_ID ) ) )); $ideas = Utility::GroupByColumn($list,'parent_category'); $parents = Utility::SortArrayByColumn($ideas[0],'category'); $children = array(); $heading = "T-Shirt Designs"; foreach($parents AS $one){ $children[] = $ideas[$one['id']][0]['id']; } $condition = array( 'condition' => array( 'design_category' => $children ), 'order' => 'GROUP BY design_category DESC', 'select'=> 'design_category,location' ); $children = MysqlDB::LimitQuery(TABLE_SAVEDDESIGN,$condition); $children = Utility::AssColumn($children,'design_category'); //$title = "T-Shirt Designs for All Occassions at " . $INI['system']['sitename'] . " " . $INI['system']['country']; $title = "T-Shirt Designs for all Occassions for Men and Women [Editable Designs]"; $desc = "Customize from over 1,50,000 T-Shirt Designs for every T-Shirt design category in " . $INI['system']['country'] . " for Best Prices. Search for the coolest and latest t-shirt designs with keywords and customize them in the design studio. T-Shirt designs are also listed as per category and designs. You can also upload your own design in the design studio. "; $keyword= "Design, Custom T-Shirt, Personalized T-Shirts, ideas " . $INI['system']['country']; }else if($durl){ //$idea = Table::Fetch(TABLE_IDEA_CATEGORY,$durl,'url'); $idea = MysqlDB::LimitQuery(TABLE_IDEA_CATEGORY, array( 'condition' => array( 'url' => $durl, 'active' => 1, 'domain_id' => array( DOMAIN_ALL, DOMAIN_ID ) ), 'one' => true )); if(!$idea){ $unwrapped = urlencode(preg_replace("/-$product_name_pluralize/", "", $durl)); redirect_301(WEB_ROOT . '/' . $unwrapped . "-$product_name_singular-designs"); } $heading = "".$idea['category']." T-Shirts"; $title = $idea['category']." " . $product_name_pluralize . " for Men and Women [Editable Designs]"; $desc = "Get" .$idea['category']." $product_name_pluralize and personalize them for men and women from customizable templates. With over 7 Million T-Shirts delivered and 99% satisfied customers, iLogo is the Best solutions for Custom " .$idea['category']. " T-shirts" ; $keyword= $idea['category'] .", $product_name_pluralize, Design, Print, Screen, Embroidery " . $INI['system']['country']; // here check for the image if it exists based on the cucstom_url then use that else use the old type of image $mobile_prefix = ''; if(file_exists(SRC1 . '/images/banner/idea-category/' . $idea['url'] . '.jpg')) { $banner_image_src = '/images/banner/idea-category/' . $idea['url'] . '.jpg'; $mobile_prefix = 'mobile-'; $idea['banner'] = WEBSRC . $banner_image_src; } //echo "
"; print_r($idea); echo ""; if($idea['parent_category']==0){ $condition = array( 'condition' => array( 'parent_category' => $idea['id'], 'active' => 1, 'domain_id' => array( DOMAIN_ALL, DOMAIN_ID ) ), ); $parents = MysqlDB::LimitQuery(TABLE_IDEA_CATEGORY,$condition); $children= Utility::GetColumn($parents,'id'); $latest_design_ids = MysqlDB::LimitQuery(TABLE_SAVEDDESIGN, array( 'order' => 'GROUP BY design_category', 'select'=> 'max(id) AS max_id, count(*) AS count, design_category', 'condition' => array( 'design_category' => $children ) )); $latest_design_ids = Utility::AssColumn($latest_design_ids, 'design_category'); $condition = array( 'condition' => array( 'id' => Utility::GetColumn($latest_design_ids, 'max_id') ), //'order' => 'GROUP BY design_category', 'select'=> 'design_category, location' ); $children = MysqlDB::LimitQuery(TABLE_SAVEDDESIGN,$condition); foreach($children AS $k => $child){ $children[$k]['count'] = $latest_design_ids[$child['design_category']]['count']; } $children = Utility::AssColumn($children,'design_category'); }else{ if($idea['user_id'] > 0){ $store_user = Table::Fetch(TABLE_USERS, $idea['user_id'], 'user_id'); } $condition = array( 'condition' => array( 'design_category' => $idea['id'] ), 'order' => 'ORDER BY id DESC', //'select'=> 'design_category,location, count(design_category) as count', 'size' => $size, 'offset'=> $offset, ); $total = Table::Count(TABLE_SAVEDDESIGN,$condition['condition']); $children = MysqlDB::LimitQuery(TABLE_SAVEDDESIGN,$condition); $children = Utility::AssColumn($children); $last_level = true; foreach($children AS $k=>$onec){ $children[$k]['design_tags'] = trimarray(explode(",",$onec['design_tags']),true); } $parent = Table::Fetch(TABLE_IDEA_CATEGORY,$idea['parent_category']); $new_key = "Custom ".$parent['category'] . " T-Shirts"; $bc_array[$new_key] = "/".$parent['url']; } $new_key = $idea['category'] . " T-Shirt Designs " ;//. $idea['category']; $bc_array[$new_key] = "/".$idea['url']; $uri = "/".$idea['url']; }else if($search){ $page_url = "/" . $search . "-" . $product_name . "-designs"; if($search=="" || is_null($search)){ redirect(WEB_ROOT . '/designideas.html'); } $idea = array('category'=>''); $result = search($search, $size, $offset); $total = $result['total_designs']; $children = $result['designs']; $uri = $result['uri']; $last_level = true; if($total<1 && !$AJAX){ Session::Set('error','no design idea found!'); //redirect(WEB_ROOT . '/designideas.html'); } if($total){ $relevance = $children[0]['relevance']; if(!$relevance){ //Session::Set('error', 'No exact match found for ' . $search . ''); } } foreach($children AS $k=>$onec){ $children[$k]['design_tags'] = trimarray(explode(",",$onec['design_tags']),true); } $title = "$search T-Shirts | Buy $search T-shirts online for Men and Women [Editable Designs]"; $desc = "Customize $search t-shirts from Design Templates and personalize them to meet your specific requirements. Over 1,50,000 T-Shirt Design Templates available to be customized online in ".$INI['system']['sitename']." features live help, quick delivery and free shipping. " . $INI['system']['country']; $keyword= $search . ', screen print, embroidery, single t-shirt, print, corporate shirt, promotional gifts, ideas, design online ' . $INI['system']['country']; $heading = "Custom ".$search." T-Shirt Designs"; $parent = Table::Fetch(TABLE_IDEA_CATEGORY,$idea['parent_category']); $new_key = "Custom ". $search . " T-Shirts"; $bc_array[$new_key] = ""; } $breadcrumb = Page::addBreadCrumb($bc_array); if($last_level){ $css = Page::addCSS('og-expanding-preview-1.css?v=1.8'); $js = Page::addJS(array('og-grid.1.8.js?version=20150222','jquery.elevateZoom-3.0.8.min.js?uia')); } if($last_level && $format == 'json'){ $children = empty($children) ? array() : $children; die(json_print($children)); } $_offer = 'hide'; if(!empty($idea) && 671 == $idea['id']){//ar-rehman store $custom_style = ".logo a, .jqm-header .jqm-logo a{visibility: hidden;}"; } $total_pages = ceil($total / $size); //echo $total; exit; $next_page_link = ""; if($current_page < $total_pages) { $next_page_link = $page_url . "/" . ($current_page + 1); } $prev_page_link = ""; if($current_page > 1) { $prev_page_link = $page_url . "/" . ($current_page - 1); } include template("designideas.php");