|
From: Jon O. <jon...@us...> - 2005-04-12 19:48:47
|
Update of /cvsroot/mxbb/mx_act In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14412/modules/mx_act Modified Files: activity.php game.php newscore.php Log Message: Index: newscore.php =================================================================== RCS file: /cvsroot/mxbb/mx_act/newscore.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** newscore.php 9 Jan 2005 21:30:34 -0000 1.4 --- newscore.php 12 Apr 2005 19:48:18 -0000 1.5 *************** *** 1,769 **** ! <?php ! /** ! * newscore.php ! * ------------------ ! * begin : Thursday, August 1, 2002 ! * copyright : (c)2002 iNetAngel ! * email : su...@in... ! * ! * $Id$ ! * [...1511 lines suppressed...] ! // put it back the way it was. ! if ( $userdata['user_session_page'] == PAGE_PLAYING_GAMES ) ! { ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_session_page = '" . PAGE_ACTIVITY . "' ! WHERE user_id = " . $userdata['user_id']; ! if ( !$db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, $lang['no_user_update'], '', __LINE__, __FILE__, $sql ); ! } ! } ! } ! } ! // Generate page ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! $template->pparse( 'body' ); ! include( $mx_root_path . 'includes/page_tail.' . $phpEx ); ! ?> \ No newline at end of file Index: game.php =================================================================== RCS file: /cvsroot/mxbb/mx_act/game.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** game.php 9 Jan 2005 21:30:34 -0000 1.2 --- game.php 12 Apr 2005 19:48:18 -0000 1.3 *************** *** 1,213 **** ! <?php ! /** ! * game.php ! * ------------------ ! * begin : Thursday, August 1, 2002 ! * copyright : (c) 2002 iNetAngel ! * email : su...@iN... ! * ! * $Id$ ! * ! * ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * ! * ! * This is a MOD for phpbb v2+. The phpbb group has all rights to the ! * phpbb source. They can be contacted at : ! * ! * I-Net : www.phpbb.com ! * E-Mail: su...@ph... ! * ! * If you have made any changes then please notify me so they can be added ! * if they are improvments. You of course will get the credit for helping ! * out. If you would like to see other MODs that I have made then check ! * out my forum at : www.iNetAngel.com and click on the community button. ! */ ! ! define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; ! $module_root_path = './'; ! ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! ! include( $module_root_path . 'includes/act_constants.' . $phpEx ); ! include( $module_root_path . 'includes/act_functions.' . $phpEx ); ! ! // Start session management ! ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! ! // End session management ! ! /* ! define('IN_PHPBB', true); ! $phpbb_root_path = './'; ! include($phpbb_root_path . 'extension.inc'); ! include($phpbb_root_path . 'common.'.$phpEx); ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_activity.' . $phpEx); ! ! // Start session management ! $userdata = session_pagestart($user_ip, PAGE_PLAYING_GAMES); ! init_userprefs($userdata); ! // End session management ! ! */ ! // For some reason user_session_page is not always updated with session_pagestart. ! // So we check for it and if not set, we have game.php set it. This is needed to ! // keep others from cheating. ! // define('INA_BAN', $table_prefix .'ina_ban'); ! // define('INA_TROPHY', $table_prefix .'ina_top_scores'); ! if ( $userdata['user_session_page'] != PAGE_PLAYING_GAMES ) ! { ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_session_page = '" . PAGE_PLAYING_GAMES . "' ! WHERE user_id = " . $userdata['user_id']; ! if ( !$db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, $lang['no_user_update'], '', __LINE__, __FILE__, $sql ); ! } ! } ! ! /* Do a quick ban check */ ! $q = "SELECT id ! FROM " . INA_BAN . " ! WHERE id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_1 = $row['id']; ! if ( $ban_1 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! ! $q = "SELECT * ! FROM " . INA_BAN . " ! WHERE username = '" . $userdata['username'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_2 = $row['username']; ! if ( $ban_2 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! /* Finished with ban check */ ! ! $game_id = ( isset( $HTTP_GET_VARS['id'] ) ) ? intval( $HTTP_GET_VARS['id'] ) : 0; ! // Grab Game info from game_id ! $sql = "SELECT * FROM " . iNA_GAMES . " ! WHERE game_id = " . $game_id; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, $lang['no_game_data'], "", __LINE__, __FILE__, $sql ); ! } ! $game_info = $db->sql_fetchrow( $result ); ! // Extra Vars ! $game_name = $game_info['game_name']; ! $game_width = $game_info['win_width']; ! $game_height = $game_info['win_height']; ! $game_path = $game_info['game_path']; ! $game_flash = $game_info['game_flash']; ! $game_title = $board_config['sitename'] . $lang['game_dash'] . $lang['game_dash'] . $game_name; ! ! if ( ( $game_flash ) && ( !$_GET['parent'] ) ) ! { ! $template->set_filenames( array( 'body' => 'flash_body.tpl' ) ); ! // Generate page ! $template->assign_vars( array( 'TITLE' => $game_title, ! 'WIDTH' => $game_width, ! 'HEIGHT' => $game_height, ! 'SWFNAME' => $game_name . '.swf', ! 'PATH' => $module_root_path . $game_path ) ! ); ! $template->pparse( 'body' ); ! }elseif ( ( $game_flash ) && ( $_GET['parent'] ) ) ! { ! $template->set_filenames( array( 'body' => 'flash_body2.tpl' ) ); ! ! $q = "SELECT * ! FROM " . INA_TROPHY . " ! WHERE game_name = '$game_name'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $t_holder_id = $row['player']; ! $t_holder_sc = $row['score']; ! $t_holder_da = $row['date']; ! $trophy_score = number_format( $t_holder_sc ); ! $trophy_date = strftime( "%b. %d, %Y @ %H:%M:%S", $t_holder_da ); ! ! $q1 = "SELECT username ! FROM " . USERS_TABLE . " ! WHERE user_id = '$t_holder_id'"; ! $r1 = $db->sql_query( $q1 ); ! $row = $db->sql_fetchrow( $r1 ); ! $t_holder_name = $row['username']; ! ! $t_link = $t_holder_name . "'s <a href='" . $phpbb_root_path . "profile.php?mode=viewprofile&u=$t_holder_id&sid=" . $userdata['session_id'] . "'>" . $lang['main_profile'] . "</a>", ! $t_link1 = $t_holder_name . "'s <a href='" . this_act_mxurl( "mode=act_trophy&user=$t_holder_name&sid=" . $userdata['session_id'] ) . "'>" . $lang['game_profile'] . "</a>", ! ! $template->assign_vars( array( 'T_HOLDER' => $lang['trophy_holder'], ! 'T_HOLDER_1' => $t_holder_name, ! 'T_DATE' => $trophy_date, ! 'T_DATE_1' => $lang['trophy_held_since'], ! 'T_SCORE' => $trophy_score, ! 'T_SCORE_1' => $lang['score_to_beat'], ! 'T_LINK' => $t_link, ! 'T_LINK_1' => $t_link1, ! 'T_IMAGE' => "images/trophy.gif", ! 'R_TITLE' => $lang['top_ten'], ! 'NAME' => $game_name, ! 'TITLE' => $game_title, ! 'WIDTH' => $game_width, ! 'HEIGHT' => $game_height, ! 'SWFNAME' => $game_name . '.swf', ! 'PATH' => $module_root_path . $game_path ) ! ); ! ! $q2 = "SELECT *, MAX(score) AS hscore ! FROM " . iNA_SCORES . " ! WHERE game_name = '$game_name' ! GROUP BY player ! ORDER BY score DESC ! LIMIT 0,10"; ! $r2 = $db->sql_query( $q2 ); ! if ( $row = $db->sql_fetchrow( $r2 ) ) ! { ! $p = 1; ! do ! { ! $runner_up_name = $row['player']; ! $runner_up_score1 = $row['hscore']; ! $runner_up_score = number_format( $runner_up_score1 ); ! ! $template->assign_block_vars( "runner", array( 'R_U_NAME' => $runner_up_name, ! 'R_U_SCORE' => $runner_up_score ) ! ); ! ! $p++; ! } ! while ( $row = $db->sql_fetchrow( $r2 ) ); ! } ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! $template->pparse( 'body' ); ! include( $mx_root_path . 'includes/page_tail.' . $phpEx ); ! } ! else ! { ! $template->set_filenames( array( 'body' => $game_name . '_body.tpl' ) ); ! ! $template->assign_vars( array( 'USERNAME' => $userdata['username'], ! 'PATH' => $module_root_path . $game_path, ! 'GAMELIB' => "./" . $act_config['games_path'] . "/" . $act_config['gamelib_path'] . "/", ! 'S_GAME_ACTION' => append_sid( $module_root_path . 'newscore.' . $phpEx . '?mode=check_score&game_name=' . $game_name ) ) ! ); ! $template->pparse( 'body' ); ! } ! ?> \ No newline at end of file --- 1,213 ---- ! <?php ! /** ! * game.php ! * ------------------ ! * begin : Thursday, August 1, 2002 ! * copyright : (c) 2002 iNetAngel ! * email : su...@iN... ! * ! * $Id$ ! * ! * ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * ! * ! * This is a MOD for phpbb v2+. The phpbb group has all rights to the ! * phpbb source. They can be contacted at : ! * ! * I-Net : www.phpbb.com ! * E-Mail: su...@ph... ! * ! * If you have made any changes then please notify me so they can be added ! * if they are improvments. You of course will get the credit for helping ! * out. If you would like to see other MODs that I have made then check ! * out my forum at : www.iNetAngel.com and click on the community button. ! */ ! ! define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; ! $module_root_path = './'; ! ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! ! include( $module_root_path . 'includes/act_constants.' . $phpEx ); ! include( $module_root_path . 'includes/act_functions.' . $phpEx ); ! ! // Start session management ! ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! ! // End session management ! ! /* ! define('IN_PHPBB', true); ! $phpbb_root_path = './'; ! include($phpbb_root_path . 'extension.inc'); ! include($phpbb_root_path . 'common.'.$phpEx); ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); ! ! // Start session management ! $userdata = session_pagestart($user_ip, PAGE_PLAYING_GAMES); ! init_userprefs($userdata); ! // End session management ! ! */ ! // For some reason user_session_page is not always updated with session_pagestart. ! // So we check for it and if not set, we have game.php set it. This is needed to ! // keep others from cheating. ! // define('INA_BAN', $table_prefix .'ina_ban'); ! // define('INA_TROPHY', $table_prefix .'ina_top_scores'); ! if ( $userdata['user_session_page'] != PAGE_PLAYING_GAMES ) ! { ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_session_page = '" . PAGE_PLAYING_GAMES . "' ! WHERE user_id = " . $userdata['user_id']; ! if ( !$db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, $lang['no_user_update'], '', __LINE__, __FILE__, $sql ); ! } ! } ! ! /* Do a quick ban check */ ! $q = "SELECT id ! FROM " . INA_BAN . " ! WHERE id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_1 = $row['id']; ! if ( $ban_1 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! ! $q = "SELECT * ! FROM " . INA_BAN . " ! WHERE username = '" . $userdata['username'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_2 = $row['username']; ! if ( $ban_2 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! /* Finished with ban check */ ! ! $game_id = ( isset( $HTTP_GET_VARS['id'] ) ) ? intval( $HTTP_GET_VARS['id'] ) : 0; ! // Grab Game info from game_id ! $sql = "SELECT * FROM " . iNA_GAMES . " ! WHERE game_id = " . $game_id; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, $lang['no_game_data'], "", __LINE__, __FILE__, $sql ); ! } ! $game_info = $db->sql_fetchrow( $result ); ! // Extra Vars ! $game_name = $game_info['game_name']; ! $game_width = $game_info['win_width']; ! $game_height = $game_info['win_height']; ! $game_path = $game_info['game_path']; ! $game_flash = $game_info['game_flash']; ! $game_title = $board_config['sitename'] . $lang['game_dash'] . $lang['game_dash'] . $game_name; ! ! if ( ( $game_flash ) && ( !$_GET['parent'] ) ) ! { ! $template->set_filenames( array( 'body' => 'flash_body.tpl' ) ); ! // Generate page ! $template->assign_vars( array( 'TITLE' => $game_title, ! 'WIDTH' => $game_width, ! 'HEIGHT' => $game_height, ! 'SWFNAME' => $game_name . '.swf', ! 'PATH' => $module_root_path . $game_path ) ! ); ! $template->pparse( 'body' ); ! }elseif ( ( $game_flash ) && ( $_GET['parent'] ) ) ! { ! $template->set_filenames( array( 'body' => 'flash_body2.tpl' ) ); ! ! $q = "SELECT * ! FROM " . INA_TROPHY . " ! WHERE game_name = '$game_name'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $t_holder_id = $row['player']; ! $t_holder_sc = $row['score']; ! $t_holder_da = $row['date']; ! $trophy_score = number_format( $t_holder_sc ); ! $trophy_date = strftime( "%b. %d, %Y @ %H:%M:%S", $t_holder_da ); ! ! $q1 = "SELECT username ! FROM " . USERS_TABLE . " ! WHERE user_id = '$t_holder_id'"; ! $r1 = $db->sql_query( $q1 ); ! $row = $db->sql_fetchrow( $r1 ); ! $t_holder_name = $row['username']; ! ! $t_link = $t_holder_name . "'s <a href='" . $phpbb_root_path . "profile.php?mode=viewprofile&u=$t_holder_id&sid=" . $userdata['session_id'] . "'>" . $lang['main_profile'] . "</a>", ! $t_link1 = $t_holder_name . "'s <a href='" . this_act_mxurl( "mode=act_trophy&user=$t_holder_name&sid=" . $userdata['session_id'] ) . "'>" . $lang['game_profile'] . "</a>", ! ! $template->assign_vars( array( 'T_HOLDER' => $lang['trophy_holder'], ! 'T_HOLDER_1' => $t_holder_name, ! 'T_DATE' => $trophy_date, ! 'T_DATE_1' => $lang['trophy_held_since'], ! 'T_SCORE' => $trophy_score, ! 'T_SCORE_1' => $lang['score_to_beat'], ! 'T_LINK' => $t_link, ! 'T_LINK_1' => $t_link1, ! 'T_IMAGE' => "images/trophy.gif", ! 'R_TITLE' => $lang['top_ten'], ! 'NAME' => $game_name, ! 'TITLE' => $game_title, ! 'WIDTH' => $game_width, ! 'HEIGHT' => $game_height, ! 'SWFNAME' => $game_name . '.swf', ! 'PATH' => $module_root_path . $game_path ) ! ); ! ! $q2 = "SELECT *, MAX(score) AS hscore ! FROM " . iNA_SCORES . " ! WHERE game_name = '$game_name' ! GROUP BY player ! ORDER BY score DESC ! LIMIT 0,10"; ! $r2 = $db->sql_query( $q2 ); ! if ( $row = $db->sql_fetchrow( $r2 ) ) ! { ! $p = 1; ! do ! { ! $runner_up_name = $row['player']; ! $runner_up_score1 = $row['hscore']; ! $runner_up_score = number_format( $runner_up_score1 ); ! ! $template->assign_block_vars( "runner", array( 'R_U_NAME' => $runner_up_name, ! 'R_U_SCORE' => $runner_up_score ) ! ); ! ! $p++; ! } ! while ( $row = $db->sql_fetchrow( $r2 ) ); ! } ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! $template->pparse( 'body' ); ! include( $mx_root_path . 'includes/page_tail.' . $phpEx ); ! } ! else ! { ! $template->set_filenames( array( 'body' => $game_name . '_body.tpl' ) ); ! ! $template->assign_vars( array( 'USERNAME' => $userdata['username'], ! 'PATH' => $module_root_path . $game_path, ! 'GAMELIB' => "./" . $act_config['games_path'] . "/" . $act_config['gamelib_path'] . "/", ! 'S_GAME_ACTION' => append_sid( $module_root_path . 'newscore.' . $phpEx . '?mode=check_score&game_name=' . $game_name ) ) ! ); ! $template->pparse( 'body' ); ! } ! ?> \ No newline at end of file Index: activity.php =================================================================== RCS file: /cvsroot/mxbb/mx_act/activity.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** activity.php 18 Feb 2005 10:05:36 -0000 1.4 --- activity.php 12 Apr 2005 19:48:18 -0000 1.5 *************** *** 1,438 **** ! <?php ! /** ! * activity.php ! * ------------------- ! * begin : Thursday, August 1, 2002 ! * copyright : (c) 2002 iNetAngel ! * email : su...@in... ! * ! * $Id$ ! * ! * ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * ! * ! * This is a MOD for phpbb v2.0.+ The phpbb group has all rights to the ! * phpbb source. They can be contacted at : ! * ! * I-Net : www.phpbb.com ! * E-Mail: su...@ph... ! * ! * If you have made any changes then please notify me so they can be added ! * if they are improvments. You of course will get the credit for helping ! * out. If you would like to see other MODs that I have made then check ! * out my forum at : www.iNetAngel.com and click on the community button. ! */ ! // MX ! if ( !function_exists( 'read_block_config' ) ) ! { ! define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! ! // Start session management ! ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! ! // End session management ! ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if ( empty( $block_id ) ) ! { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'ActivityGames' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query Activity Mod module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; ! } ! $is_block = false; ! } ! else ! { ! ! // Read block Configuration ! ! $block_config = read_block_config( $block_id ); ! $title = $block_config[$block_id]['block_title']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! ! $is_block = true; ! global $images; ! } ! ! include( $module_root_path . 'includes/act_constants.' . $phpEx ); ! include( $module_root_path . 'includes/act_functions.' . $phpEx ); ! ! /* Original code ! define('IN_PHPBB', true); ! $phpbb_root_path = './'; ! include($phpbb_root_path . 'extension.inc'); ! include($phpbb_root_path . 'common.'.$phpEx); ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_activity.' . $phpEx); ! define('INA_TROPHY', $table_prefix .'ina_top_scores'); ! define('INA_CHEAT', $table_prefix .'ina_cheat_fix'); ! define('INA_BAN', $table_prefix .'ina_ban'); ! ! // Start session management ! $userdata = session_pagestart($user_ip, PAGE_ACTIVITY); ! init_userprefs($userdata); ! // End session management ! */ ! // Make sure the player is registered ! $user_id = $userdata['user_id']; ! if ( $act_config['ina_guest_play'] == "2" ) ! { ! if ( !$userdata['session_logged_in'] && $user_id == ANONYMOUS ) ! { ! mx_message_die( GENERAL_ERROR, $lang['not_logged_in'], $lang['info'] ); ! // $header_location = ( @preg _match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; ! // header($header_location . append_sid("login.$phpEx?redirect=activity.$phpEx", true)); ! // exit; ! } ! } ! ! $q = "UPDATE " . SESSIONS_TABLE . " ! SET session_page = '" . PAGE_ACTIVITY . "' ! WHERE session_user_id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! ! $q = "UPDATE " . USERS_TABLE . " ! SET session_page = '" . PAGE_ACTIVITY . "' ! WHERE user_id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! ! /* Start Restriction Checks */ ! /* Start Ban Check */ ! $q = "SELECT id ! FROM " . INA_BAN . " ! WHERE id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_1 = $row['id']; ! if ( $ban_1 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! ! $q = "SELECT * ! FROM " . INA_BAN . " ! WHERE username = '" . $userdata['username'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_2 = $row['username']; ! if ( $ban_2 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! /* End Ban Check */ ! /* Start Post Count Check */ ! if ( $act_config['ina_post_block'] == "1" ) ! { ! if ( $userdata['user_posts'] < $act_config['ina_post_block_count'] ) ! { ! mx_message_die( GENERAL_ERROR, "Sorry, The Admin Requires " . $act_config['ina_post_block_count'] . " Posts Before Playing These Games.", $lang['ban_error'] ); ! } ! } ! /* End Post Count Check */ ! /* Start Registration Date Check */ ! if ( $act_config['ina_join_block'] == "1" ) ! { ! $days_block = $act_config['ina_join_block_count']; ! $length_check = time() - $userdata['user_regdate']; ! $length_block = $length_check / 86400; ! $rounded = round( $length_block ); ! if ( $rounded < $days_block ) ! { ! mx_message_die( GENERAL_ERROR, "Sorry, The Admin Requires Being A Member For " . $act_config['ina_join_block_count'] . " Day(s) Before Playing These Games.", $lang['ban_error'] ); ! } ! } ! /* End Registration Date Check */ ! /* End Restriction Checks */ ! ! if ( $act_config['use_rewards_mod'] ) ! { ! if ( $act_config['use_point_system'] ) ! { ! include( $phpbb_root_path . 'includes/functions_points.' . $phpEx ); ! } ! if ( $act_config['use_cash_system'] || $act_config['use_allowance_system'] ) ! { ! include( $module_root_path . 'includes/rewards_api.' . $phpEx ); ! } ! if ( ( $act_config['use_point_system'] ) && ( file_exists( $phpbb_root_path . 'includes/functions_points.' . $phpEx ) == 0 ) ) ! { ! function get_user_points( $user_id ) ! { ! global $db; ! ! $sql = "SELECT user_points ! FROM " . USERS_TABLE . " ! WHERE user_id = $user_id"; ! ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get user_points from $user_id.", '', __LINE__, __FILE__, $sql ); ! } ! $points = $db->sql_fetchrow( $result ); ! ! return $points['user_points']; ! } ! ! function get_username_from_id( $user_id ) ! { ! global $db; ! ! $sql = "SELECT username ! FROM " . USERS_TABLE . " ! WHERE user_id = $user_id ! AND user_id != " . ANONYMOUS; ! ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get username from $user_id.", '', __LINE__, __FILE__, $sql ); ! } ! $username = $db->sql_fetchrow( $result ); ! ! return $username['username']; ! } ! ! function get_userid_from_name( $username ) ! { ! global $db; ! ! $username = str_replace( "\'", "''", trim( $username ) ); ! ! $sql = "SELECT user_id ! FROM " . USERS_TABLE . " ! WHERE username = '$username' ! AND user_id != " . ANONYMOUS; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get user_id from $username.", '', __LINE__, __FILE__, $sql ); ! } ! $user_id = $db->sql_fetchrow( $result ); ! ! return $user_id['user_id']; ! } ! ! function add_points( $user_id, $amount ) ! { ! global $db; ! ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_points = user_points + $amount ! WHERE user_id = $user_id"; ! if ( !$db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not update user's points", '', __LINE__, __FILE__, $sql ); ! } ! ! return; ! } ! ! function subtract_points( $user_id, $amount ) ! { ! global $db; ! ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_points = user_points - $amount ! WHERE user_id = $user_id"; ! if ( !$db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not update user's points", '', __LINE__, __FILE__, $sql ); ! } ! ! return; ! } ! } ! } ! ! if ( isset( $HTTP_GET_VARS['mode'] ) || isset( $HTTP_POST_VARS['mode'] ) ) ! { ! $mode = ( isset( $HTTP_GET_VARS['mode'] ) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; ! } ! else ! { ! if ( isset( $HTTP_POST_VARS['game'] ) ) ! { ! $mode = "game"; ! } ! else if ( isset( $HTTP_POST_VARS['stats'] ) ) ! { ! $mode = "stats"; ! } ! else ! { ! $mode = ""; ! } ! } ! ! $q = "SELECT game_id ! FROM " . iNA_GAMES . " ! ORDER BY RAND() ! LIMIT 1"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $random_game = append_sid( this_act_mxurl( "mode=game&id=" . $row['game_id'] . "&parent=true" ) ); ! $random_image = $phpbb_root_path . "templates/subSilver/images/icon_mini_faq.gif"; ! // Challenge -------------------------------- ! if ( $mode == "challenge" ) ! { ! include( $module_root_path . 'includes/act_challenges_main.' . $phpEx ); ! } ! ! $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; ! $finish = $act_config['games_per_page']; ! ! if ( isset( $HTTP_POST_VARS['order'] ) ) ! { ! $sort_order = ( $HTTP_POST_VARS['order'] == 'DESC' ) ? 'DESC' : 'ASC'; ! }elseif ( isset( $HTTP_GET_VARS['order'] ) ) ! { ! $sort_order = ( $HTTP_GET_VARS['order'] == 'DESC' ) ? 'DESC' : 'ASC'; ! } ! else ! { ! $sort_order = 'DESC'; ! } ! ! if ( $act_config['use_point_system'] ) ! { ! $game_cost = $act_config['points_name']; ! } ! else ! { ! $game_cost = $lang['game_cost']; ! } ! ! $mode_types_text = array( $lang['game_instructions'], $game_cost, $lang['game_bonuses'], $lang['game_played'] ); ! $mode_types = array( 'game_instructions', 'game_charge', 'game_bonus', 'game_played' ); ! ! $select_sort_mode = '<select name="mode">'; ! ! for( $i = 0; $i < count( $mode_types_text ); $i++ ) ! { ! $selected = ( $mode == $mode_types[$i] ) ? ' selected="selected"' : ''; ! $select_sort_mode .= '<option value="' . $mode_types[$i] . '"' . $selected . '>' . $mode_types_text[$i] . '</option>'; ! } ! $select_sort_mode .= '</select>'; ! ! $select_sort_order = '<select name="order">'; ! if ( $sort_order == 'DESC' ) ! { ! $select_sort_order .= '<option value="DESC" selected="selected">' . $lang['Sort_Descending'] . '</option><option value="ASC">' . $lang['Sort_Ascending'] . '</option>'; ! } ! else ! { ! $select_sort_order .= '<option value="DESC">' . $lang['Sort_Descending'] . '</option><option value="ASC" selected="selected">' . $lang['Sort_Ascending'] . '</option>'; ! } ! $select_sort_order .= '</select>'; ! ! switch ( $mode ) ! { ! case 'game_instructions': ! $order_by = "instructions $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! case 'game_charge': ! $order_by = "game_charge $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! case 'game_bonus': ! $order_by = "game_bonus $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! case 'game_played': ! $order_by = "played $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! default: ! $order_by = "game_id $sort_order LIMIT $start, " . $act_config['games_per_page']; ! break; ! } ! ! if ( $mode != "" ) ! { ! if ( $mode == "game" ) ! { ! include( $module_root_path . 'includes/act_games.' . $phpEx ); ! } ! else if ( $mode == "stats" ) ! { ! include( $module_root_path . 'includes/act_stats.' . $phpEx ); ! } ! else if ( $mode == "act_scores" ) ! { ! include( $module_root_path . 'includes/act_scores.' . $phpEx ); ! } ! else if ( $mode == "act_top_scores" ) ! { ! include( $module_root_path . 'includes/act_top_scores.' . $phpEx ); ! } ! else if ( $mode == "act_top_scores_search" ) ! { ! include( $module_root_path . 'includes/act_top_scores_search.' . $phpEx ); ! } ! else if ( $mode == "act_trophy" ) ! { ! include( $module_root_path . 'includes/act_trophy.' . $phpEx ); ! } ! else if ( $mode == "act_trophy_comments" ) ! { ! include( $module_root_path . 'includes/act_trophy_comments.' . $phpEx ); ! } ! else if ( $mode == "act_challenges" ) ! { ! include( $module_root_path . 'includes/act_challenges.' . $phpEx ); ! } ! else if ( $mode == "category_play" ) ! { ! include( $module_root_path . 'includes/act_cat_play.' . $phpEx ); ! } ! } ! else ! { ! include( $module_root_path . 'includes/act_main.' . $phpEx ); ! } ! ! $template->assign_vars( array( "U_INDEX" => append_sid( $mx_root_path ), ! "L_INDEX" => '<< ' . $lang['site_home'], ! "U_TROPHY" => append_sid( this_act_mxurl( "mode=act_trophy" ) ), ! "L_TROPHY" => $lang['trophy_count_link'], ! "U_TOP_SCORES" => append_sid( this_act_mxurl( "mode=act_top_scores" ) ), ! "L_TOP_SCORES" => $lang['game_highscores'], ! "U_ACTIVITY" => append_sid( this_act_mxurl() ), ! "L_ACTIVITY" => $lang['act_home'], ! "U_STATS" => append_sid( this_act_mxurl( "mode=stats" ) ), ! "L_STATS" => $lang['game_stats'], ! "U_GAMES" => append_sid( this_act_mxurl( "mode=games" ) ), ! "L_GAMES" => $lang['game'], ! "L_COMMENTS_TITLE" => $lang['comments_title'], ! "L_HIGHSCORES_TITLE" => $lang['game_highscores'], ! ) ); ! // Generate page ! if ( !$is_block ) ! { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! } ! include ( $module_root_path . "includes/act_header." . $phpEx ); ! ! $template->pparse( 'body' ); ! ! include ( $module_root_path . "includes/act_footer." . $phpEx ); ! ! if ( !$is_block ) ! { ! include( $mx_root_path . 'includes/page_tail.' . $phpEx ); ! } ! ?> \ No newline at end of file --- 1,438 ---- ! <?php ! /** ! * activity.php ! * ------------------- ! * begin : Thursday, August 1, 2002 ! * copyright : (c) 2002 iNetAngel ! * email : su...@in... ! * ! * $Id$ ! * ! * ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * ! * ! * This is a MOD for phpbb v2.0.+ The phpbb group has all rights to the ! * phpbb source. They can be contacted at : ! * ! * I-Net : www.phpbb.com ! * E-Mail: su...@ph... ! * ! * If you have made any changes then please notify me so they can be added ! * if they are improvments. You of course will get the credit for helping ! * out. If you would like to see other MODs that I have made then check ! * out my forum at : www.iNetAngel.com and click on the community button. ! */ ! // MX ! if ( !function_exists( 'read_block_config' ) ) ! { ! define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! ! // Start session management ! ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! ! // End session management ! ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if ( empty( $block_id ) ) ! { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'ActivityGames' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query Activity Mod module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; ! } ! $is_block = false; ! } ! else ! { ! ! // Read block Configuration ! ! $block_config = read_block_config( $block_id ); ! $title = $block_config[$block_id]['block_title']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! ! $is_block = true; ! global $images; ! } ! ! include( $module_root_path . 'includes/act_constants.' . $phpEx ); ! include( $module_root_path . 'includes/act_functions.' . $phpEx ); ! ! /* Original code ! define('IN_PHPBB', true); ! $phpbb_root_path = './'; ! include($phpbb_root_path . 'extension.inc'); ! include($phpbb_root_path . 'common.'.$phpEx); ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); ! define('INA_TROPHY', $table_prefix .'ina_top_scores'); ! define('INA_CHEAT', $table_prefix .'ina_cheat_fix'); ! define('INA_BAN', $table_prefix .'ina_ban'); ! ! // Start session management ! $userdata = session_pagestart($user_ip, PAGE_ACTIVITY); ! init_userprefs($userdata); ! // End session management ! */ ! // Make sure the player is registered ! $user_id = $userdata['user_id']; ! if ( $act_config['ina_guest_play'] == "2" ) ! { ! if ( !$userdata['session_logged_in'] && $user_id == ANONYMOUS ) ! { ! mx_message_die( GENERAL_ERROR, $lang['not_logged_in'], $lang['info'] ); ! // $header_location = ( @preg _match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; ! // header($header_location . append_sid("login.$phpEx?redirect=activity.$phpEx", true)); ! // exit; ! } ! } ! ! $q = "UPDATE " . SESSIONS_TABLE . " ! SET session_page = '" . PAGE_ACTIVITY . "' ! WHERE session_user_id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! ! $q = "UPDATE " . USERS_TABLE . " ! SET session_page = '" . PAGE_ACTIVITY . "' ! WHERE user_id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! ! /* Start Restriction Checks */ ! /* Start Ban Check */ ! $q = "SELECT id ! FROM " . INA_BAN . " ! WHERE id = '" . $userdata['user_id'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_1 = $row['id']; ! if ( $ban_1 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! ! $q = "SELECT * ! FROM " . INA_BAN . " ! WHERE username = '" . $userdata['username'] . "'"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $ban_2 = $row['username']; ! if ( $ban_2 ) ! { ! mx_message_die( GENERAL_ERROR, $lang['ban'], $lang['ban_error'] ); ! } ! /* End Ban Check */ ! /* Start Post Count Check */ ! if ( $act_config['ina_post_block'] == "1" ) ! { ! if ( $userdata['user_posts'] < $act_config['ina_post_block_count'] ) ! { ! mx_message_die( GENERAL_ERROR, "Sorry, The Admin Requires " . $act_config['ina_post_block_count'] . " Posts Before Playing These Games.", $lang['ban_error'] ); ! } ! } ! /* End Post Count Check */ ! /* Start Registration Date Check */ ! if ( $act_config['ina_join_block'] == "1" ) ! { ! $days_block = $act_config['ina_join_block_count']; ! $length_check = time() - $userdata['user_regdate']; ! $length_block = $length_check / 86400; ! $rounded = round( $length_block ); ! if ( $rounded < $days_block ) ! { ! mx_message_die( GENERAL_ERROR, "Sorry, The Admin Requires Being A Member For " . $act_config['ina_join_block_count'] . " Day(s) Before Playing These Games.", $lang['ban_error'] ); ! } ! } ! /* End Registration Date Check */ ! /* End Restriction Checks */ ! ! if ( $act_config['use_rewards_mod'] ) ! { ! if ( $act_config['use_point_system'] ) ! { ! include( $phpbb_root_path . 'includes/functions_points.' . $phpEx ); ! } ! if ( $act_config['use_cash_system'] || $act_config['use_allowance_system'] ) ! { ! include( $module_root_path . 'includes/rewards_api.' . $phpEx ); ! } ! if ( ( $act_config['use_point_system'] ) && ( file_exists( $phpbb_root_path . 'includes/functions_points.' . $phpEx ) == 0 ) ) ! { ! function get_user_points( $user_id ) ! { ! global $db; ! ! $sql = "SELECT user_points ! FROM " . USERS_TABLE . " ! WHERE user_id = $user_id"; ! ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get user_points from $user_id.", '', __LINE__, __FILE__, $sql ); ! } ! $points = $db->sql_fetchrow( $result ); ! ! return $points['user_points']; ! } ! ! function get_username_from_id( $user_id ) ! { ! global $db; ! ! $sql = "SELECT username ! FROM " . USERS_TABLE . " ! WHERE user_id = $user_id ! AND user_id != " . ANONYMOUS; ! ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get username from $user_id.", '', __LINE__, __FILE__, $sql ); ! } ! $username = $db->sql_fetchrow( $result ); ! ! return $username['username']; ! } ! ! function get_userid_from_name( $username ) ! { ! global $db; ! ! $username = str_replace( "\'", "''", trim( $username ) ); ! ! $sql = "SELECT user_id ! FROM " . USERS_TABLE . " ! WHERE username = '$username' ! AND user_id != " . ANONYMOUS; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get user_id from $username.", '', __LINE__, __FILE__, $sql ); ! } ! $user_id = $db->sql_fetchrow( $result ); ! ! return $user_id['user_id']; ! } ! ! function add_points( $user_id, $amount ) ! { ! global $db; ! ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_points = user_points + $amount ! WHERE user_id = $user_id"; ! if ( !$db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not update user's points", '', __LINE__, __FILE__, $sql ); ! } ! ! return; ! } ! ! function subtract_points( $user_id, $amount ) ! { ! global $db; ! ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_points = user_points - $amount ! WHERE user_id = $user_id"; ! if ( !$db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not update user's points", '', __LINE__, __FILE__, $sql ); ! } ! ! return; ! } ! } ! } ! ! if ( isset( $HTTP_GET_VARS['mode'] ) || isset( $HTTP_POST_VARS['mode'] ) ) ! { ! $mode = ( isset( $HTTP_GET_VARS['mode'] ) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; ! } ! else ! { ! if ( isset( $HTTP_POST_VARS['game'] ) ) ! { ! $mode = "game"; ! } ! else if ( isset( $HTTP_POST_VARS['stats'] ) ) ! { ! $mode = "stats"; ! } ! else ! { ! $mode = ""; ! } ! } ! ! $q = "SELECT game_id ! FROM " . iNA_GAMES . " ! ORDER BY RAND() ! LIMIT 1"; ! $r = $db->sql_query( $q ); ! $row = $db->sql_fetchrow( $r ); ! $random_game = append_sid( this_act_mxurl( "mode=game&id=" . $row['game_id'] . "&parent=true" ) ); ! $random_image = $phpbb_root_path . "templates/subSilver/images/icon_mini_faq.gif"; ! // Challenge -------------------------------- ! if ( $mode == "challenge" ) ! { ! include( $module_root_path . 'includes/act_challenges_main.' . $phpEx ); ! } ! ! $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; ! $finish = $act_config['games_per_page']; ! ! if ( isset( $HTTP_POST_VARS['order'] ) ) ! { ! $sort_order = ( $HTTP_POST_VARS['order'] == 'DESC' ) ? 'DESC' : 'ASC'; ! }elseif ( isset( $HTTP_GET_VARS['order'] ) ) ! { ! $sort_order = ( $HTTP_GET_VARS['order'] == 'DESC' ) ? 'DESC' : 'ASC'; ! } ! else ! { ! $sort_order = 'DESC'; ! } ! ! if ( $act_config['use_point_system'] ) ! { ! $game_cost = $act_config['points_name']; ! } ! else ! { ! $game_cost = $lang['game_cost']; ! } ! ! $mode_types_text = array( $lang['game_instructions'], $game_cost, $lang['game_bonuses'], $lang['game_played'] ); ! $mode_types = array( 'game_instructions', 'game_charge', 'game_bonus', 'game_played' ); ! ! $select_sort_mode = '<select name="mode">'; ! ! for( $i = 0; $i < count( $mode_types_text ); $i++ ) ! { ! $selected = ( $mode == $mode_types[$i] ) ? ' selected="selected"' : ''; ! $select_sort_mode .= '<option value="' . $mode_types[$i] . '"' . $selected . '>' . $mode_types_text[$i] . '</option>'; ! } ! $select_sort_mode .= '</select>'; ! ! $select_sort_order = '<select name="order">'; ! if ( $sort_order == 'DESC' ) ! { ! $select_sort_order .= '<option value="DESC" selected="selected">' . $lang['Sort_Descending'] . '</option><option value="ASC">' . $lang['Sort_Ascending'] . '</option>'; ! } ! else ! { ! $select_sort_order .= '<option value="DESC">' . $lang['Sort_Descending'] . '</option><option value="ASC" selected="selected">' . $lang['Sort_Ascending'] . '</option>'; ! } ! $select_sort_order .= '</select>'; ! ! switch ( $mode ) ! { ! case 'game_instructions': ! $order_by = "instructions $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! case 'game_charge': ! $order_by = "game_charge $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! case 'game_bonus': ! $order_by = "game_bonus $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! case 'game_played': ! $order_by = "played $sort_order LIMIT $start," . $act_config['games_per_page']; ! $mode = ""; ! break; ! default: ! $order_by = "game_id $sort_order LIMIT $start, " . $act_config['games_per_page']; ! break; ! } ! ! if ( $mode != "" ) ! { ! if ( $mode == "game" ) ! { ! include( $module_root_path . 'includes/act_games.' . $phpEx ); ! } ! else if ( $mode == "stats" ) ! { ! include( $module_root_path . 'includes/act_stats.' . $phpEx ); ! } ! else if ( $mode == "act_scores" ) ! { ! include( $module_root_path . 'includes/act_scores.' . $phpEx ); ! } ! else if ( $mode == "act_top_scores" ) ! { ! include( $module_root_path . 'includes/act_top_scores.' . $phpEx ); ! } ! else if ( $mode == "act_top_scores_search" ) ! { ! include( $module_root_path . 'includes/act_top_scores_search.' . $phpEx ); ! } ! else if ( $mode == "act_trophy" ) ! { ! include( $module_root_path . 'includes/act_trophy.' . $phpEx ); ! } ! else if ( $mode == "act_trophy_comments" ) ! { ! include( $module_root_path . 'includes/act_trophy_comments.' . $phpEx ); ! } ! else if ( $mode == "act_challenges" ) ! { ! include( $module_root_path . 'includes/act_challenges.' . $phpEx ); ! } ! else if ( $mode == "category_play" ) ! { ! include( $module_root_path . 'includes/act_cat_play.' . $phpEx ); ! } ! } ! else ! { ! include( $module_root_path . 'includes/act_main.' . $phpEx ); ! } ! ! $template->assign_vars( array( "U_INDEX" => append_sid( $mx_root_path ), ! "L_INDEX" => '<< ' . $lang['site_home'], ! "U_TROPHY" => append_sid( this_act_mxurl( "mode=act_trophy" ) ), ! "L_TROPHY" => $lang['trophy_count_link'], ! "U_TOP_SCORES" => append_sid( this_act_mxurl( "mode=act_top_scores" ) ), ! "L_TOP_SCORES" => $lang['game_highscores'], ! "U_ACTIVITY" => append_sid( this_act_mxurl() ), ! "L_ACTIVITY" => $lang['act_home'], ! "U_STATS" => append_sid( this_act_mxurl( "mode=stats" ) ), ! "L_STATS" => $lang['game_stats'], ! "U_GAMES" => append_sid( this_act_mxurl( "mode=games" ) ), ! "L_GAMES" => $lang['game'], ! "L_COMMENTS_TITLE" => $lang['comments_title'], ! "L_HIGHSCORES_TITLE" => $lang['game_highscores'], ! ) ); ! // Generate page ! if ( !$is_block ) ! { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! } ! include ( $module_root_path . "includes/act_header." . $phpEx ); ! ! $template->pparse( 'body' ); ! ! include ( $module_root_path . "includes/act_footer." . $phpEx ); ! ! if ( !$is_block ) ! { ! include( $mx_root_path . 'includes/page_tail.' . $phpEx ); ! } ! ?> \ No newline at end of file |