assign("full_list", $full_list ); $tpl->assign("meta_robots", "index, follow" ); if( get('subscribe') && get('mailinglist_email') ) { $email = get('mailinglist_email'); $group = get('group'); query("INSERT INTO mailinglist (email,grouping) VALUES ('$email','$group');"); $_SESSION['subscribed'] = true; header("location: ".$_SERVER['REQUEST_URI']); exit(); } if( get('unsubscribe') && get('mailinglist_email') ) { $email = get('mailinglist_email'); query("UPDATE mailinglist SET unsubscribe='1' WHERE email='$email';"); $_SESSION['subscribed'] = false; $_SESSION['unsubscribed'] = true; header("location: ".$_SERVER['REQUEST_URI']); exit(); } if( isset($_SESSION['subscribed']) ) { $tpl->assign("subscribed", true); } if( isset($_SESSION['unsubscribed']) ) { $tpl->assign("unsubscribed", true); } if( isset( $_GET['dev'] )) { // //print "foo"; //dump($_SERVER); } $hidden_object = false; //if( $ref = get('ref') ) if( isset($_SERVER['HTTP_REFERER'])) { $ref = $_SERVER['HTTP_REFERER']; //$ref = "http://www.google.dk/search?hl=da&q=hidden+object+games"; if( strpos( $ref, "google" ) !== FALSE ) { $url = parse_url( $ref ); $qs = $url[ 'query' ]; //$qry = urldecode( $qs ); $parts = array(); parse_str( $qs, $parts ); if( isset( $parts['q'] ) ) { $search_string = $parts['q']; $tpl->assign("search_string", $search_string ); if( strpos( $search_string, "hid" ) !== FALSE ) { $tpl->assign("hidden_object", true ); $hidden_object = true; } } } } //dump($_GET); if( get('shop') ) $category = get('category', $_GET, "all"); else $category = false; $sort = get('sort', $_GET, "popularity"); $pn = get('pn', $_GET, 0 ); $tpl->assign("pn", $pn); if( stripos($_SERVER['HTTP_USER_AGENT'], "macintosh" ) !== FALSE ) { $this_platform = 'mac'; $this_platform_nice = 'Mac'; } else { $this_platform = 'pc'; $this_platform_nice = 'PC'; } $tpl->assign("this_platform_nice", $this_platform_nice ); $platform = get('platform'); if( $platform != 'pc' && ($platform == 'mac' || stripos($_SERVER['HTTP_USER_AGENT'], "macintosh" ) !== FALSE) ) $mac = true; else $mac = false; $tpl->assign("mac", $mac ); if( !$platform) { if( $mac ) $platform = 'mac'; else $platform = 'pc'; } switch($platform) { case 'pc': $platform_nice = "PC"; break; case 'mac': $platform_nice = "Mac"; break; } $tpl->assign("platform", $platform); $tpl->assign("platform_nice", $platform_nice); $current_list = "/{$platform}-games/{$category}/by/$sort/"; $tpl->assign("current_list",$current_list ); $tpl->assign("popularity_list", "/{$platform}-games/{$category}/by/popularity/"); $tpl->assign("age_list", "/{$platform}-games/{$category}/by/age/"); $tpl->assign("rating_list", "/{$platform}-games/{$category}/by/rating/"); $tpl->assign("alpha_list", "/{$platform}-games/{$category}/by/alpha/"); switch( $sort ) { case "popularity": $sort_nice = "Most Popular First"; $sort_headline = "Most Popular"; break; case "age": $sort_nice = "Newest First"; $sort_headline = "Newest"; break; case "alpha": $sort_nice = "Alphabetically"; $sort_headline = "By Name"; break; case "rating": $sort_nice = "Highest Rated"; $sort_headline = "Highest Rated"; break; } $tpl->assign("sort_nice", $sort_nice ); $tpl->assign("sort_headline", $sort_headline ); //$categories = query("SELECT * FROM shop_category WHERE active=1 ORDER BY seq, nice_name"); $categories = query("SELECT * FROM shop_category WHERE active=1 AND url_name='our-games' ORDER BY seq, nice_name"); $tpl->assign("categories", $categories ); $tpl->assign("sort", $sort ); if( $category == "all") $category_nice = "All"; else { $q = query("SELECT nice_name from shop_category WHERE url_name='$category'"); $category_nice = $q->nice_name; } if( $category != 'all' ) $tpl->assign("category_nice_no_all", $category_nice ); $tpl->assign("category_nice", $category_nice ); $tpl->assign("category", $category ); $tpl->assign("this_page", get( 'REDIRECT_URL', $_SERVER, $_SERVER['REQUEST_URI'])); $tpl->assign("page", $page); $tpl->assign("game", $game); $tpl->assign("title", "Hidden Object Games, Free Game Downloads, PC and Mac Games | The Game Equation" ); $tpl->assign("meta_info", "The Game Equation develops and sells casual and indie games for Mac OS X and Windows. Free game downloads of hidden object games, puzzle games and more." ); $tpl->assign("foo", get('foo')); $tpl->assign("sidemenu", get("side")); if( time() < strtotime("June 13th 2008 12:00:00")) { $tpl->assign("intro", true ); } if( $game ) { $php_file = LOCALSITEROOT."/pages/{$page}_{$game}.php"; } else { $php_file = LOCALSITEROOT."/pages/$page.php"; } if( file_exists( $php_file ) ) { include( $php_file ); } print $tpl->fetch( LOCALSITEROOT."/pages/index.tpl" ); // test ?>