|
From: OryNider <ory...@us...> - 2008-01-31 08:50:54
|
Update of /cvsroot/mxbb/mx_act/root In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8846/root Added Files: Tag: core28x newscore.php Log Message: my_act/root/newscore.php should be copyed @ the mxBB root and the score will be saved ... --- NEW FILE: newscore.php --- <?php /** * * @package mxBB Portal Module - mx_act * @version $Id: newscore.php,v 1.1.2.1 2008/01/31 08:50:41 orynider Exp $ * @copyright (c) 2002-2006 [Napoleon/aUsTiN-Inc, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // // ERROR HANDLING // error_reporting( E_ALL ); @ini_set( 'display_errors', '1' ); define( 'IN_PORTAL', true ); $mx_root_path = './'; $module_root_path = $mx_root_path . 'modules/mx_act/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once( $mx_root_path . 'common.' . $phpEx ); $is_block = FALSE; // // Start session management // $mx_user->init($user_ip, PAGE_INDEX); // // End session management // // ********************************************************************** // Read language definition // ********************************************************************** if ( file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } else if ( file_exists( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ); } $page_title = $mx_block->block_info['block_title']; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); global $images; include( $module_root_path . 'includes/act_constants.' . $phpEx ); include($module_root_path. 'includes/act_functions.'.$phpEx); 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)) { 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)) { 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)) { 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)) { 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)) { 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']; } /* 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($_GET['mode'] == "highscore") { mx_redirect(this_act_mxurl("mode=act_scores"), true); } $mode = "check_score"; if(!$mode) { mx_redirect(this_act_mxurl(), true); } $template->set_filenames(array('body' => 'saved_body.tpl')); // ------------------------------------------------------------------------------------------------------------ if($_GET['mode'] == "check_score" || $_POST['mode'] == "check_score") { $cheat_name = $userdata['username']; $game_name = (!empty($HTTP_POST_VARS['game_name'])) ? $HTTP_POST_VARS['game_name'] : $HTTP_GET_VARS['game_name']; /* Start Cheat Fix For Old newscore.php By aUsTiN */ if($act_config['ina_disable_cheat'] == "1") { /* Start Pulling The Data Entered Into The Database When They Clicked The Game */ $q = "SELECT i.*, u.ina_cheat_fix FROM ". INA_CHEAT ." i, ". USERS_TABLE ." u WHERE i.player = '$cheat_name' AND u.username = '$cheat_name'"; $r = $db -> sql_query($q); $row = $db -> sql_fetchrow($r); $players_there = $row['player']; $players_game = $row['game_id']; $players_game_num1 = $row['game_count']; $players_game_num2 = $row['ina_cheat_fix']; $q = "SELECT game_id FROM ". iNA_GAMES ." WHERE game_name = '$game_name'"; $r = $db -> sql_query($q); $row = $db -> sql_fetchrow($r); $game_id_match = $row['game_id']; /* Start Make Sure The Game Numbers Are The Same */ if($players_game_num1 <> $players_game_num2) { mx_message_die(GENERAL_ERROR, $lang['not_nice_to_cheat'] . $cheat_name . $lang['period'], $lang['cheat_warning']); } /* End Make Sure The Game Numbers Are The Same */ /* Start Make Sure The Game Id They Clicked, Is The One Being Submitted */ if($players_game <> $game_id_match) { /* Start Delete Their Record So They Can Play Again */ $q = "DELETE FROM ". INA_CHEAT ." WHERE player = '$cheat_name'"; $r = $db -> sql_query($q); /* End Delete Their Record So They Can Play Again */ mx_message_die(GENERAL_ERROR, $lang['not_nice_to_cheat']. $cheat_name . $lang['period'], $lang['cheat_warning']); } /* End Make Sure The Game Id They Clicked, Is The One Being Submitted */ if(($players_there) && ($players_game)) { /* Start Delete Their Record So They Can Play Again */ $q = "DELETE FROM ". INA_CHEAT ." WHERE player = '$cheat_name'"; $r = $db -> sql_query($q); /* End Delete Their Record So They Can Play Again */ } /* End Pulling The Data Entered Into The Database When They Clicked The Game */ } } /* End Cheat Fix For Old newscore.php By aUsTiN */ $spidy = $_POST['game_name']; if(!$spidy) { $spidy = $_GET['game_name']; } // ----------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------- if(($mode == "check_score") && (file_exists($module_root_path . $act_config['ina_default_g_path'] ."/". $spidy ."/". $spidy .".". $phpEx))) { $game_name = (!empty($HTTP_POST_VARS['game_name'])) ? $HTTP_POST_VARS['game_name'] : $HTTP_GET_VARS['game_name']; $score = (!empty($HTTP_POST_VARS['score'])) ? $HTTP_POST_VARS['score'] : $HTTP_GET_VARS['score']; $name = $userdata['username']; $gen_simple_header = TRUE; if($score > "0") { $sql = "SELECT * FROM ". iNA_GAMES ." WHERE game_name = '". $game_name ."'"; if(!$result = $db -> sql_query($sql)) { mx_message_die(GENERAL_ERROR, $lang['no_game_data'], "", __LINE__, __FILE__, $sql); } $game_info = $db->sql_fetchrow($result); $sql = "SELECT * FROM ". iNA_SCORES ." WHERE game_name = '". $game_name ."' ORDER BY score DESC"; if(!$result = $db->sql_query($sql)) { mx_message_die(GENERAL_ERROR, $lang['no_score_data'], "", __LINE__, __FILE__, $sql); } $score_info = $db->sql_fetchrow($result); /* Start Trophies */ $q = "SELECT * FROM ". INA_TROPHY ." WHERE game_name = '$game_name'"; $r = $db -> sql_query($q) or die("Error Selecting Top Score."); $row = $db -> sql_fetchrow($r); $old_score = $row['score']; $t_holder = $row['player']; if(($game_info['reverse_list'] == "1") && ($score < $old_score)) { $q = "SELECT user_id FROM ". USERS_TABLE ." WHERE username = '$name'"; $r = $db -> sql_query($q) or die("Error Selecting Top Score."); $row = $db -> sql_fetchrow($r); $name_id = $row['user_id']; $q1 = "UPDATE ". INA_TROPHY ." SET player = '$name_id', score = '$score', date = '". time() ."' WHERE game_name = '$game_name'"; $r1 = $db -> sql_query($q1) or die("Error Updating Top Score."); $trophy_won = $lang['trophy_won_notice']; $message_sent = $act_config['ina_pm_trophy_msg']; $message_sent = str_replace("%n%", $userdata['username'], $message_sent); $message_sent = str_replace("%g%", $game_name, $message_sent); if(($act_config['ina_pm_trophy'] == "1") && ($t_holder != "-1") && ($t_holder != $userdata['user_id'])) { send_challenge_pm($t_holder, $act_config['ina_pm_trophy_sub'], $message_sent); } $template->assign_block_vars("comment", array( "COMMENT_LINK" => "<br><a href='".this_act_mxurl("mode=act_trophy_comments&comments_mode=leave_comment&game=". $game_name ."&user=". $name_id ."&sid=". $userdata['session_id']) ."'>". $lang['trophy_comment_notice'] ."</a>") ); } if(($game_info['reverse_list'] == "0") && ($score > $old_score)) { $q = "SELECT user_id FROM ". USERS_TABLE ." WHERE username = '$name'"; $r = $db -> sql_query($q) or die("Error Selecting Top Score."); $row = $db -> sql_fetchrow($r); $name_id = $row['user_id']; $q1 = "UPDATE ". INA_TROPHY ." SET player = '$name_id', score = '$score', date = '". time() ."' WHERE game_name = '$game_name'"; $r1 = $db -> sql_query($q1) or die("Error Updating Top Score."); $trophy_won = $lang['trophy_won_notice']; $message_sent = $act_config['ina_pm_trophy_msg']; $message_sent = str_replace("%n%", $userdata['username'], $message_sent); $message_sent = str_replace("%g%", $game_name, $message_sent); if(($act_config['ina_pm_trophy'] == "1") && ($t_holder != "-1") && ($t_holder != $userdata['user_id'])) { send_challenge_pm($t_holder, $act_config['ina_pm_trophy_sub'], $message_sent); } $template->assign_block_vars("comment", array( "COMMENT_LINK" => "<br><a href='".this_act_mxurl("mode=act_trophy_comments&comments_mode=leave_comment&game=". $game_name ."&user=". $name_id ."&sid=". $userdata['session_id']) ."'>". $lang['trophy_comment_notice'] ."</a>") ); } /* End Trophies */ $bonus = 0; if ($score > $score_info['score']) { $bonus = $game_info['game_bonus']; } $q = "SELECT player, score FROM ". iNA_SCORES ." WHERE player = '". $userdata['username'] ."' AND game_name = '$game_name'"; $r = $db -> sql_query($q); $row = $db -> sql_fetchrow($r); $exist = $row['player']; $e_score = $row['score']; /* See if we have a score already & if its a higher score for this game */ if(($exist) && ($game_info['reverse_list'] == "1") && ($score < $e_score)) { $sql = "UPDATE " . iNA_SCORES . " SET score = '$score', date = '" . time() . "' WHERE player = '". $userdata['username'] ."' AND game_name = '$game_name'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, $lang['no_score_insert'], "", __LINE__, __FILE__, $sql); } $msg = $lang['game_score_saved']; } elseif(($exist) && ($game_info['reverse_list'] == "0") && ($score > $e_score)) { $sql = "UPDATE " . iNA_SCORES . " SET score = '$score', date = '" . time() . "' WHERE player = '". $userdata['username'] ."' AND game_name = '$game_name'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, $lang['no_score_insert'], "", __LINE__, __FILE__, $sql); } $msg = $lang['game_score_saved']; } /* See if we dont have a score for this game */ elseif((!$exist) && (!$e_score)) { $sql = "INSERT INTO " . iNA_SCORES . " (game_name, player, score, date) VALUES ('$game_name', '$name', '$score', '" . time() . "')"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, $lang['no_score_insert'], "", __LINE__, __FILE__, $sql); } $msg = $lang['game_score_saved']; } else { $msg = $lang['no_score_saved']; } $user_id = $userdata['user_id']; if($act_config['use_point_system'] && $act_config['use_rewards_mod'] && ($game_info['game_reward'] > 0)) { $reward = (intval($score) / intval($game_info['game_reward']) + $bonus); add_points($user_id,$reward); } if(($act_config['use_cash_system'] || $act_config['use_allowance_system']) && $act_config['use_rewards_mod'] && ($game_info['game_reward'] > 0)) { $reward = (intval($score) / intval($game_info['game_reward']) + $bonus); add_reward($user_id,$reward); } if ( $trophy_won != '' ) { $template->assign_block_vars("trophy_won", array()); } $template->assign_vars(array( 'GAME_NAME' => $game_name, 'MSG' => $msg, 'T_WON' => $trophy_won, 'U_RETURN' => this_act_mxurl("sid=". $userdata['session_id'] ), 'U_CLOSE' => "javascript:parent.window.close();", 'L_RETURN' => $lang['go_back_to_games'], 'L_CLOSE' => $lang['game_score_close']) ); } else { if ( $trophy_won != '' ) { $template->assign_block_vars("trophy_won", array()); } $template->assign_vars(array( 'GAME_NAME' => $game_name, 'MSG' => $msg, 'T_WON' => $trophy_won, 'U_RETURN' => this_act_mxurl("sid=". $userdata['session_id'] ), 'U_CLOSE' => "javascript:parent.window.close();", 'L_RETURN' => $lang['go_back_to_games'], 'L_CLOSE' => $lang['game_score_close']) ); } // This may have been set by game.php so if it is, then we'll // 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); } } } else { // ----------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------- if(($mode == "check_score") && ($_POST['game_name']) && ($_POST['score']) && (!file_exists($module_root_path . $act_config['ina_default_g_path'] ."/". $spidy ."/". $spidy .".". $phpEx))) { $game_name = (!empty($HTTP_POST_VARS['game_name'])) ? $HTTP_POST_VARS['game_name'] : $HTTP_POST_VARS['game_name']; $score = (!empty($HTTP_POST_VARS['score'])) ? $HTTP_POST_VARS['score'] : $HTTP_POST_VARS['score']; $name = $userdata['username']; $gen_simple_header = TRUE; if($score > "0") { $sql = "SELECT * FROM ". iNA_GAMES ." WHERE game_name = '". $game_name ."'"; if(!$result = $db->sql_query($sql)) { mx_message_die(GENERAL_ERROR, $lang['no_game_data'], "", __LINE__, __FILE__, $sql); } $game_info = $db->sql_fetchrow($result); $sql = "SELECT * FROM ". iNA_SCORES ." WHERE game_name = '". $game_name ."' ORDER BY score DESC"; if(!$result = $db->sql_query($sql)) { mx_message_die(GENERAL_ERROR, $lang['no_score_data'], "", __LINE__, __FILE__, $sql); } $score_info = $db->sql_fetchrow($result); /* Start Trophies */ $q = "SELECT * FROM ". INA_TROPHY ." WHERE game_name = '$game_name'"; $r = $db -> sql_query($q) or die("Error Selecting Top Score."); $row = $db -> sql_fetchrow($r); $old_score = $row['score']; $t_holder = $row['player']; if(($game_info['reverse_list'] == "1") && ($score < $old_score)) { $q = "SELECT user_id FROM ". USERS_TABLE ." WHERE username = '$name'"; $r = $db -> sql_query($q) or die("Error Selecting Top Score."); $row = $db -> sql_fetchrow($r); $name_id = $row['user_id']; $q1 = "UPDATE ". INA_TROPHY ." SET player = '$name_id', score = '$score', date = '". time() ."' WHERE game_name = '$game_name'"; $r1 = $db -> sql_query($q1) or die("Error Updating Top Score."); $trophy_won = $lang['trophy_won_notice']; $message_sent = $act_config['ina_pm_trophy_msg']; $message_sent = str_replace("%n%", $userdata['username'], $message_sent); $message_sent = str_replace("%g%", $game_name, $message_sent); if(($act_config['ina_pm_trophy'] == "1") && ($t_holder != "-1") && ($t_holder != $userdata['user_id'])) { send_challenge_pm($t_holder, $act_config['ina_pm_trophy_sub'], $message_sent); } $template->assign_block_vars("comment", array( "COMMENT_LINK" => "<br><a href='".this_act_mxurl("mode=act_trophy_comments&comments_mode=leave_comment&game=". $game_name ."&user=". $name_id ."&sid=". $userdata['session_id'] )."'>". $lang['trophy_comment_notice'] ."</a>") ); } if(($game_info['reverse_list'] == "0") && ($score > $old_score)) { $q = "SELECT user_id FROM ". USERS_TABLE ." WHERE username = '$name'"; $r = $db -> sql_query($q) or die("Error Selecting Top Score."); $row = $db -> sql_fetchrow($r); $name_id = $row['user_id']; $q1 = "UPDATE ". INA_TROPHY ." SET player = '$name_id', score = '$score', date = '". time() ."' WHERE game_name = '$game_name'"; $r1 = $db -> sql_query($q1) or die("Error Updating Top Score."); $trophy_won = $lang['trophy_won_notice']; $message_sent = $act_config['ina_pm_trophy_msg']; $message_sent = str_replace("%n%", $userdata['username'], $message_sent); $message_sent = str_replace("%g%", $game_name, $message_sent); if(($act_config['ina_pm_trophy'] == "1") && ($t_holder != "-1") && ($t_holder != $userdata['user_id'])) { send_challenge_pm($t_holder, $act_config['ina_pm_trophy_sub'], $message_sent); } $template->assign_block_vars("comment", array( "COMMENT_LINK" => "<br><a href='".this_act_mxurl("mode=act_trophy_comments&comments_mode=leave_comment&game=". $game_name ."&user=". $name_id ."&sid=". $userdata['session_id']) ."'>". $lang['trophy_comment_notice'] ."</a>") ); } /* End Trophies */ $bonus = 0; if ($score > $score_info['score']) { $bonus = $game_info['game_bonus']; } $q = "SELECT player, score FROM ". iNA_SCORES ." WHERE player = '". $userdata['username'] ."' AND game_name = '$game_name'"; $r = $db -> sql_query($q); $row = $db -> sql_fetchrow($r); $exist = $row['player']; $e_score = $row['score']; /* See if we have a score already & if its a higher score for this game */ if(($exist) && ($game_info['reverse_list'] == "1") && ($score < $e_score)) { $sql = "UPDATE " . iNA_SCORES . " SET score = '$score', date = '" . time() . "' WHERE player = '". $userdata['username'] ."' AND game_name = '$game_name'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, $lang['no_score_insert'], "", __LINE__, __FILE__, $sql); } $msg = $lang['game_score_saved']; } elseif(($exist) && ($game_info['reverse_list'] == "0") && ($score > $e_score)) { $sql = "UPDATE " . iNA_SCORES . " SET score = '$score', date = '" . time() . "' WHERE player = '". $userdata['username'] ."' AND game_name = '$game_name'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, $lang['no_score_insert'], "", __LINE__, __FILE__, $sql); } $msg = $lang['game_score_saved']; } /* See if we dont have a score for this game */ elseif((!$exist) && (!$e_score)) { $sql = "INSERT INTO " . iNA_SCORES . " (game_name, player, score, date) VALUES ('$game_name', '$name', '$score', '" . time() . "')"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, $lang['no_score_insert'], "", __LINE__, __FILE__, $sql); } $msg = $lang['game_score_saved']; } else { $msg = $lang['no_score_saved']; } //Update Users Money $user_id = $userdata['user_id']; if($act_config['use_point_system'] && $act_config['use_rewards_mod'] && ($game_info['game_reward'] > 0)) { $reward = (intval($score) / intval($game_info['game_reward']) + $bonus); add_points($user_id,$reward); } if(($act_config['use_cash_system'] || $act_config['use_allowance_system']) && $act_config['use_rewards_mod'] && ($game_info['game_reward'] > 0)) { $reward = (intval($score) / intval($game_info['game_reward']) + $bonus); add_reward($user_id,$reward); } if ( $trophy_won != '' ) { $template->assign_block_vars("trophy_won", array()); } $template->assign_vars(array( 'GAME_NAME' => $game_name, 'MSG' => $msg, 'T_WON' => $trophy_won, 'U_RETURN' => this_act_mxurl("sid=". $userdata['session_id'] ), 'U_CLOSE' => "javascript:parent.window.close();", 'L_RETURN' => $lang['go_back_to_games'], 'L_CLOSE' => $lang['game_score_close']) ); } else { if ( $trophy_won != '' ) { $template->assign_block_vars("trophy_won", array()); } $template->assign_vars(array( 'GAME_NAME' => $game_name, 'MSG' => $msg, 'T_WON' => $trophy_won, 'U_RETURN' => this_act_mxurl("sid=". $userdata['session_id'] ), 'U_CLOSE' => "javascript:parent.window.close();", 'L_RETURN' => $lang['go_back_to_games'], 'L_CLOSE' => $lang['game_score_close']) ); } // This may have been set by game.php so if it is, then we'll // 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); } } } $template->assign_vars(array( 'GAME_NAME' => $game_name, 'MSG' => $msg, 'T_WON' => $trophy_won, 'U_RETURN' => this_act_mxurl("sid=". $userdata['session_id'] ), 'U_CLOSE' => "javascript:parent.window.close();", 'L_RETURN' => $lang['go_back_to_games'], 'L_CLOSE' => $lang['game_score_close']) ); } // Generate page include($mx_root_path . 'includes/page_header.'.$phpEx); $template->pparse('body'); include($mx_root_path . 'includes/page_tail.'.$phpEx); ?> |