assign('item', $Item); // Lang checken if(isset($Languages[$Item['language']]) != '' && PAGE_LANGUAGE != $Item['language']) { Main::redirect(WEB_PROTOCOL . '//' . $Languages[$Item['language']]['domain'] . '/' . $Item['url'] . $AppendString); } // Mode definieren $Mode = 'start'; // App Game Result if($Item['type'] == 'apps' && isset($_GET['result_id'])) { // Redirect To Base $RedirectToBase = false; // Result ID $ResultID = isset($_GET['result_id']) ? $_GET['result_id'] : 0; $ParamID = $ResultID; if(strpos($ResultID, '-') === false) $ResultID = Main::resolveShortKey($ResultID); // Get App Result $AppGameResult = Main::getAppGameResult($ResultID); if($AppGameResult !== false) { $smarty->assign('app_game_result', $AppGameResult); if(isset($_SESSION['current_game_result']) && $_SESSION['current_game_result'] == $ParamID) $Mode = 'result'; } // redirect to base if($RedirectToBase) { $AppendString = ''; if(isset($_GET['utm_source']) && isset($_GET['utm_medium']) && isset($_GET['utm_campaign'])) { $AppendString = '?utm_source=' . $_GET['utm_source'] . '&utm_medium=' . $_GET['utm_medium'] . '&utm_campaign=' . $_GET['utm_campaign']; } Main::redirect('/' . $Item['url'] . $AppendString); } } // Set Mode to Template $smarty->assign('mode', $Mode); // Hit zählen Main::countHit($Item['id']); // Facebook URL if(isset($AppGameResult)) { $smarty->assign('og_image', $AppGameResult['image_url']); $smarty->assign('og_author', $AppGameResult['author_name']); $smarty->assign('PAGE_URL', HOME_URL . '/' . $Item['url'] . ( (isset($ParamID)) ? '/' . $ParamID : '' ) ); } elseif(isset($Item['media_data']['images']['big']['media_url'])) { $MediaURLExplode = explode('.', $Item['media_data']['images']['big']['media_url']); unset($MediaURLExplode[count($MediaURLExplode)-1]); $OGImage = implode('.', $MediaURLExplode) . $Item['language'] . '.jpg'; $smarty->assign('og_image', $OGImage); $smarty->assign('PAGE_URL', HOME_URL . '/' . $Item['url']); } // Share Object $ShareObject = array('url' => HOME_URL . '/' . $Item['url'] . ( (isset($ParamID)) ? '/' . $ParamID : '' ) ); $smarty->assign('share_object', $ShareObject); // Items holen $Excluded = array($Item['id']); $List = Main::getItemList(array('limit' => 6, 'exclude' => $Excluded)); $smarty->assign('sidebar_list', $List); // Excluded mergen $Excluded = array_merge($Excluded, $List['item_ids']); // More List holen $List = Main::getItemList(array('limit' => 12, 'exclude' => $Excluded)); $smarty->assign('more_list', $List); // Page title & desc $smarty->assign('PAGE_TYPE', 'item'); $smarty->assign('PAGE_TITLE', $Item['title']); $smarty->assign('PAGE_DESC', $Item['excerpt']); // Templates laden $smarty->display('header.tpl'); $smarty->display('item.tpl'); $smarty->display('footer.tpl'); ?>