diff -ru /home/kevin/Desktop/Games/games1.2RC3.1.1/admin/modules/games/games.php /home/kevin/Desktop/Games/games1.2RC3.2/admin/modules/games/games.php --- /home/kevin/Desktop/Games/games1.2RC3.1.1/admin/modules/games/games.php 2009-07-18 23:01:39.000000000 +0200 +++ /home/kevin/Desktop/Games/games1.2RC3.2/admin/modules/games/games.php 2009-12-20 15:17:37.000000000 +0100 @@ -6,7 +6,7 @@ * * Website: http://www.gamesection.org * - * Last modified: 16/04/2009 by Paretje + * Last modified: 20/12/2009 by Paretje * ***************************************************************************/ @@ -380,8 +380,8 @@ 'what' => addslashes($config['object']), 'use_keys' => addslashes($config['gkeys']), 'bgcolor' => addslashes($config['bgcolor']), - 'width' => addslashes($config['gwidth']), - 'height' => addslashes($config['gheight']), + 'width' => intval($config['gwidth']), + 'height' => intval($config['gheight']), 'dateline' => TIME_NOW, 'score_type' => addslashes($high), 'active' => intval($mybb->input['active']) @@ -632,8 +632,8 @@ 'what' => addslashes($config['object']), 'use_keys' => addslashes($config['gkeys']), 'bgcolor' => addslashes($config['bgcolor']), - 'width' => addslashes($config['gwidth']), - 'height' => addslashes($config['gheight']), + 'width' => intval($config['gwidth']), + 'height' => intval($config['gheight']), 'dateline' => TIME_NOW, 'score_type' => addslashes($high), 'active' => intval($mybb->input['active']) diff -ru /home/kevin/Desktop/Games/games1.2RC3.1.1/admin/modules/games/version.php /home/kevin/Desktop/Games/games1.2RC3.2/admin/modules/games/version.php --- /home/kevin/Desktop/Games/games1.2RC3.1.1/admin/modules/games/version.php 2008-12-27 23:12:25.000000000 +0100 +++ /home/kevin/Desktop/Games/games1.2RC3.2/admin/modules/games/version.php 2010-01-01 15:45:12.000000000 +0100 @@ -2,11 +2,11 @@ /*************************************************************************** * * Game Section for MyBB - * Copyright: © 2006-2008 The Game Section Development Group + * Copyright: © 2006-2010 The Game Section Development Group * * Website: http://www.gamesection.org * - * Last modified: 24/12/2008 by Paretje + * Last modified: 01/01/2010 by Paretje * ***************************************************************************/ @@ -137,10 +137,11 @@ $current_version = $parser->get_tree(); //Load your version - $plugins->run_hooks("admin_games_version_current"); + require_once MYBB_ROOT."inc/plugins/games.php"; + $info = games_info(); //Control version - if($current_version['version_check']['version']['value'] != $version) + if($current_version['version_check']['version']['value'] != $info['version']) { $latest_version = "".$current_version['version_check']['version']['value'].""; } @@ -162,7 +163,7 @@ $table = new Table; $table->construct_cell($lang->version_your, array("width" => "40%")); - $table->construct_cell($version); + $table->construct_cell($info['version']); $table->construct_row(); $table->construct_cell($lang->version_latest, array("width" => "40%")); @@ -196,4 +197,4 @@ $table->output($lang->nav_version); $page->output_footer(); } -?> \ Geen regeleindeteken (LF) aan einde van bestand +?> diff -ru /home/kevin/Desktop/Games/games1.2RC3.1.1/games/templates.php /home/kevin/Desktop/Games/games1.2RC3.2/games/templates.php --- /home/kevin/Desktop/Games/games1.2RC3.1.1/games/templates.php 2009-11-28 16:08:21.000000000 +0100 +++ /home/kevin/Desktop/Games/games1.2RC3.2/games/templates.php 2010-01-02 15:03:02.000000000 +0100 @@ -2,11 +2,11 @@ /*************************************************************************** * * Game Section for MyBB - * Copyright: © 2006-2009 The Game Section Development Group + * Copyright: © 2006-2010 The Game Section Development Group * * Website: http://www.gamesection.org * - * Last modified: 28/11/2009 by Paretje + * Last modified: 02/01/2010 by Paretje * ***************************************************************************/ @@ -244,7 +244,7 @@ Powered by the Game Section
-Copyright © 2006-2009 Game Section Development Group +Copyright © 2006-{\$copy_year} Game Section Development Group

"; @@ -294,79 +294,79 @@ "; -$theme_templates['games_play'] = " - -{\$mybb->settings[\'bbname\']} - {\$lang->gamesection} - {\$game[\'title\']} -{\$headerinclude} - - -{\$header} -{\$games_menu} -
- - - - - - - - -
{\$game[\'title\']}
- - - - - - - - - - - {\$lang->flashisntinstall} - - - - - - - - - - - - - - - - - - - - - -
-\"\" -
-\"\"
-{\$lang->champ} -
-{\$lang->yourhighscore}
-{\$game[\'pscore\']} -
-{\$lang->back}
-{\$lang->viewhighscores} -
-{\$lang->purpose} {\$game[\'title\']}
-{\$game[\'what\']} -
-{\$lang->keys}
-{\$game[\'use_keys\']} -
-
-{\$online} -{\$games_footer} -{\$footer} - +$theme_templates['games_play'] = " + +{\$mybb->settings[\'bbname\']} - {\$lang->gamesection} - {\$game[\'title\']} +{\$headerinclude} + + +{\$header} +{\$games_menu} +
+ + + + + + + + +
{\$game[\'title\']}
+ + + + + + + + + + + {\$lang->flashisntinstall} + + + + + + + + + + + + + + + + + + + + + +
+\"\" +
+\"\"
+{\$lang->champ} +
+{\$lang->yourhighscore}
+{\$game[\'pscore\']} +
+{\$lang->back}
+{\$lang->viewhighscores} +
+{\$lang->purpose} {\$game[\'title\']}
+{\$game[\'what\']} +
+{\$lang->keys}
+{\$game[\'use_keys\']} +
+
+{\$online} +{\$games_footer} +{\$footer} + "; $theme_templates['games_rate'] = " @@ -938,11 +938,13 @@ {\$lang->play_game}
-{\$lang->join_tournament}
-{\$lang->added}: {\$pubdate} +{\$lang->added}: {\$pubdate}
+{\$lang->starteddate}: {\$startdate}
+{\$lang->endeddate}: {\$enddate} -{\$lang->openplaces}: {\$freeplaces}/{\$tournament[\'maxplayers\']}
+{\$lang->champion} {\$tournament[\'championname\']}
+{\$lang->numberplayers}: {\$tournament[\'maxplayers\']}
{\$lang->tournament_maxtries} {\$tournament[\'maxtries\']}
{\$lang->tournament_roundtime} {\$tournament[\'roundtime\']} @@ -957,7 +959,7 @@ {\$lang->play_game}
-{\$lang->join_tournament}
+{\$tournament_joinlink} {\$lang->added}: {\$pubdate} @@ -978,7 +980,7 @@ {\$lang->play_game}
{\$tournament_playlink} {\$lang->added}: {\$pubdate}
-{\$lang->started}: {\$startdate} +{\$lang->starteddate}: {\$startdate} {\$lang->numberplayers}: {\$tournament[\'maxplayers\']}
diff -ru /home/kevin/Desktop/Games/games1.2RC3.1.1/games.php /home/kevin/Desktop/Games/games1.2RC3.2/games.php --- /home/kevin/Desktop/Games/games1.2RC3.1.1/games.php 2009-07-28 12:21:52.000000000 +0200 +++ /home/kevin/Desktop/Games/games1.2RC3.2/games.php 2010-01-02 12:16:14.000000000 +0100 @@ -2,11 +2,11 @@ /*************************************************************************** * * Game Section for MyBB - * Copyright: © 2006-2009 The Game Section Development Group + * Copyright: © 2006-2010 The Game Section Development Group * * Website: http://www.gamesection.org * - * Last modified: 28/07/2009 by Paretje + * Last modified: 02/01/2010 by Paretje * ***************************************************************************/ @@ -298,7 +298,7 @@ } //Tournaments - if($games_core->settings['tournaments_activated'] == 1 && $mybb->usergroup['canaddtournaments'] == 1) + if($games_core->settings['tournaments_activated'] == 1 && $mybb->usergroup['canaddtournaments'] == 1 && $mybb->user['uid'] != 0) { eval("\$games_tournament = \"".$games_core->template("games_bit_tournament")."\";"); } @@ -665,7 +665,7 @@ } //Tournaments - if($games_core->settings['tournaments_activated'] == 1 && $mybb->usergroup['canaddtournaments'] == 1) + if($games_core->settings['tournaments_activated'] == 1 && $mybb->usergroup['canaddtournaments'] == 1 && $mybb->user['uid'] != 0) { eval("\$games_tournament = \"".$games_core->template("games_bit_tournament")."\";"); } @@ -1084,7 +1084,7 @@ //Champion if(isset($search['username'])) { - $search['username'] = "".$search['username'].""; + $search['username'] = build_profile_link($search['username'], $search['uid']); $search['score'] = my_number_format(floatval($search['score'])); } else @@ -1684,7 +1684,7 @@ } //Test scores - $query = $db->query("SELECT * FROM ".TABLE_PREFIX."games_scores WHERE gid='".$gid."' ORDER BY score ".$game['score_type']." LIMIT ".$start.",".$maxscores); + $query = $db->query("SELECT * FROM ".TABLE_PREFIX."games_scores WHERE gid='".$gid."' ORDER BY score ".$game['score_type'].", dateline ASC LIMIT ".$start.",".$maxscores); $scores_test = $db->num_rows($query); //Plugin @@ -1974,4 +1974,4 @@ output_page($user_settings); break; } -?> \ Geen regeleindeteken (LF) aan einde van bestand +?> diff -ru /home/kevin/Desktop/Games/games1.2RC3.1.1/inc/languages/english/tournaments.lang.php /home/kevin/Desktop/Games/games1.2RC3.2/inc/languages/english/tournaments.lang.php --- /home/kevin/Desktop/Games/games1.2RC3.1.1/inc/languages/english/tournaments.lang.php 2009-07-29 17:43:43.000000000 +0200 +++ /home/kevin/Desktop/Games/games1.2RC3.2/inc/languages/english/tournaments.lang.php 2010-01-02 14:57:44.000000000 +0100 @@ -2,11 +2,11 @@ /*************************************************************************** * * Game Section for MyBB - * Copyright: © 2006-2009 The Game Section Development Group + * Copyright: © 2006-2010 The Game Section Development Group * * Website: http://www.gamesection.org * - * Last modified: 29/07/2009 by Paretje + * Last modified: 02/01/2010 by Paretje * ***************************************************************************/ @@ -65,4 +65,8 @@ $l['tournament_tries'] = "Tries: {1}/{2}"; $l['tournament_tries_needed'] = "{1} tries needed"; $l['tournamentdoesntexist'] = "Tournament doesn't exist."; -?> \ Geen regeleindeteken (LF) aan einde van bestand + +$l['tournamentfull'] = "The tournament is already full, you can't join anymore!"; +$l['alreadyjoined'] = "You've already joined this tournament!"; +$l['joined_tournament'] = "You've joined the tournament"; +?> diff -ru /home/kevin/Desktop/Games/games1.2RC3.1.1/inc/plugins/games.php /home/kevin/Desktop/Games/games1.2RC3.2/inc/plugins/games.php --- /home/kevin/Desktop/Games/games1.2RC3.1.1/inc/plugins/games.php 2009-12-17 23:56:28.000000000 +0100 +++ /home/kevin/Desktop/Games/games1.2RC3.2/inc/plugins/games.php 2010-01-01 15:41:09.000000000 +0100 @@ -2,11 +2,11 @@ /*************************************************************************** * * Game Section for MyBB - * Copyright: © 2006-2009 The Game Section Development Group + * Copyright: © 2006-2010 The Game Section Development Group * * Website: http://www.gamesection.org * - * Last modified: 17/12/2009 by Paretje + * Last modified: 01/01/2010 by Paretje * ***************************************************************************/ @@ -48,7 +48,6 @@ $plugins->add_hook("admin_user_groups_edit_graph_tabs", "games_groups_graph_tabs"); $plugins->add_hook("admin_user_groups_edit_graph", "games_groups_graph"); $plugins->add_hook("admin_user_groups_edit_commit", "games_groups_commit"); -$plugins->add_hook("admin_games_version_current", "games_version"); function games_info() { @@ -58,7 +57,7 @@ "website" => "http://www.gamesection.org", "author" => "Paretje", "authorsite" => "http://www.gamesection.org", - "version" => "1.2 RC3.1.1", + "version" => "1.2 RC3.2", "guid" => "db37073977904e9458f54937ceb13a9f", "compatibility" => "14*" ); @@ -928,11 +927,4 @@ $updated_group['canplaytournaments'] = $mybb->input['canplaytournaments']; $updated_group['canaddtournaments'] = $mybb->input['canaddtournaments']; } - -function games_version() -{ - global $version; - - $version = "1.2 RC3.1"; -} ?> diff -ru /home/kevin/Desktop/Games/games1.2RC3.1.1/tournaments.php /home/kevin/Desktop/Games/games1.2RC3.2/tournaments.php --- /home/kevin/Desktop/Games/games1.2RC3.1.1/tournaments.php 2009-07-29 17:41:32.000000000 +0200 +++ /home/kevin/Desktop/Games/games1.2RC3.2/tournaments.php 2010-01-02 14:58:37.000000000 +0100 @@ -2,11 +2,11 @@ /*************************************************************************** * * Game Section for MyBB - * Copyright: © 2006-2009 The Game Section Development Group + * Copyright: © 2006-2010 The Game Section Development Group * * Website: http://www.gamesection.org * - * Last modified: 28/07/2009 by Paretje + * Last modified: 02/01/2010 by Paretje * ***************************************************************************/ @@ -132,7 +132,7 @@ $gid = intval($mybb->input['gid']); //Test user - if($mybb->usergroup['canaddtournaments'] == 0) + if($mybb->usergroup['canaddtournaments'] == 0 && $mybb->user['uid'] == 0) { error_no_permission(); } @@ -195,12 +195,12 @@ $tournaments_stats['open']++; $cache->update("games_tournaments_stats", $tournaments_stats); - redirect("games.php?action=tournaments&status=open", $lang->added_tournament); + redirect("tournaments.php?status=open", $lang->added_tournament); } break; case 'add': //Test user - if($mybb->usergroup['canaddtournaments'] == 0) + if($mybb->usergroup['canaddtournaments'] == 0 && $mybb->user['uid'] == 0) { error_no_permission(); } @@ -312,6 +312,19 @@ //Status specific information if($tournament['status'] == "open") { + //Join link + if($mybb->usergroup['canplaytournaments'] == 1 && $mybb->user['uid'] != 0 && $tournament['joinedplayers'] < $tournament['maxplayers']) + { + //Test player table + $query = $db->query("SELECT * FROM ".TABLE_PREFIX."games_tournaments_players WHERE tid='".intval($mybb->input['tid'])."' AND uid='".intval($mybb->user['uid'])."'"); + $player_test = $db->num_rows($query); + + if($player_test == 0) + { + $tournament_joinlink = "".$lang->join_tournament."
"; + } + } + $freeplaces = $tournament['maxplayers']-$tournament['joinedplayers']; } elseif($tournament['status'] == "started") @@ -319,7 +332,7 @@ $startdate = my_date($mybb->settings['dateformat'], $tournament['roundinformation']['1']['starttime']).", ".my_date($mybb->settings['timeformat'], $tournament['roundinformation']['1']['starttime']); //Play link - if($mybb->user['uid'] != 0) + if($mybb->usergroup['canplaytournaments'] == 1 && $mybb->user['uid'] != 0) { //Test player table $query = $db->query("SELECT * FROM ".TABLE_PREFIX."games_tournaments_players WHERE tid='".intval($mybb->input['tid'])."' AND rid='".(count($tournament['roundinformation'])+1)."' AND uid='".$mybb->input['uid']."'"); @@ -461,5 +474,55 @@ eval("\$tournament_view = \"".$games_core->template('games_tournaments_view')."\";"); output_page($tournament_view); break; + case 'join': + //Test user + if($mybb->usergroup['canplaytournaments'] == 0 && $mybb->user['uid'] == 0) + { + error_no_permission(); + } + + //Test tournament + $query = $db->query("SELECT DISTINCT t.*, g.active, p.uid + FROM ".TABLE_PREFIX."games_tournaments t + LEFT JOIN ".TABLE_PREFIX."games g ON (t.gid=g.gid) + LEFT JOIN ".TABLE_PREFIX."games_tournaments_players p ON (t.tid=p.tid AND p.uid='".$mybb->user['uid']."') + WHERE t.tid='".intval($mybb->input['tid'])."' AND g.active='1'"); + $tournament = $db->fetch_array($query); + $tournament_test = $db->num_rows($query); + + if($tournament_test == 0) + { + error($lang->tournamentdoesntexist, $lang->error); + } + + if($tournament['joinedplayers'] >= $tournament['maxplayers']) + { + error($lang->tournamentfull, $lang->error); + } + + if($mybb->user['uid'] == $tournament['uid']) + { + error($lang->alreadyjoined, $lang->error); + } + + //Update tournament + $db->write_query("UPDATE ".TABLE_PREFIX."games_tournaments SET joinedplayers=joinedplayers+1 WHERE tid='".intval($mybb->input['tid'])."'"); + + //Input of player + $add_player = array( + 'tid' => intval($mybb->input['tid']), + 'rid' => intval("1"), + 'uid' => intval($mybb->user['uid']), + 'username' => addslashes($mybb->user['username']), + 'dateline' => TIME_NOW + ); + + //Plugins + $plugins->run_hooks("games_tournaments_join"); + + $db->insert_query("games_tournaments_players", $add_player); + + redirect("tournaments.php?action=view&tid=".intval($mybb->input['tid']), $lang->joined_tournament); + break; } -?> \ Geen regeleindeteken (LF) aan einde van bestand +?>