Installation

From Game Section

NOTE THAT THIS PAGE IS ABOUT GAME SECTION 1.1.x

This is the Installation guide, this is the online version of the README.txt. To know what to do after the installation, read the After Installation guide.

1. Upload the files to your MyBB forum


2. When you don't use MyBB 1.2.10, open global.php and find:

// Run global_start plugin hook now that the basics are set up
$plugins->run_hooks("global_start");

// Set and load the language
if(!isset($mybb->settings['bblanguage']))
{
	$mybb->settings['bblanguage'] = "english";
}

// Load language
$lang->set_language($mybb->settings['bblanguage']);
$lang->load("global");
$lang->load("messages");

Replace with:

// Set and load the language
if(!isset($mybb->settings['bblanguage']))
{
	$mybb->settings['bblanguage'] = "english";
}

// Load language
$lang->set_language($mybb->settings['bblanguage']);
$lang->load("global");
$lang->load("messages");

// Run global_start plugin hook now that the basics are set up
$plugins->run_hooks("global_start");


3. Open admin/usergroups.php and find:

	tablesubheader($lang->perms_misc);
	makeyesnocode($lang->can_view_mlist, "canviewmemberlist", "yes");
	makeyesnocode($lang->can_send_emails, "cansendemail", "yes");

After add:

	tablesubheader($lang->perm_gamesection);
	makeyesnocode($lang->perm_canviewgames, "canviewgames", "yes");
	makeyesnocode($lang->perm_canplaygames, "canplaygames", "yes");


4. In the same file find:

	tablesubheader($lang->perms_misc);
	makeyesnocode($lang->can_view_mlist, "canviewmemberlist", $usergroup['canviewmemberlist']);
	makeyesnocode($lang->can_send_emails, "cansendemail", $usergroup['cansendemail']);

After add:

	tablesubheader($lang->perm_gamesection);
	makeyesnocode($lang->perm_canviewgames, "canviewgames", $usergroup['canviewgames']);
	makeyesnocode($lang->perm_canplaygames, "canplaygames", $usergroup['canplaygames']);


5. Open online.php and find:

		// forumdisplay.php functions
		case "forumdisplay":
			if($forums[$user['fid']])
			{
				if($forums_linkto[$user['fid']])
				{
					$locationname = sprintf($lang->forum_redirect_to, $user['fid'], $forums[$user['fid']]);
				}
				else
				{
					$locationname = sprintf($lang->viewing_forum2, $user['fid'], $forums[$user['fid']]);
				}
			}
			else
			{
				$locationname = $lang->viewing_forum;
			}
			break;

After add:

		// games.php functions
		case "games":
			$location = my_substr($user['location'], -strpos(strrev($user['location']), "/"));
			
			$locationname = sprintf($lang->viewing_gamesection, $location);
			break;


6. In the same file find:

		case "forumdisplay":
			if(is_numeric($parameters['fid']))
			{
				$fidsql .= ",$parameters[fid]";
			}
			$user['activity'] = "forumdisplay";
			$user['fid'] = $parameters['fid'];
			break;

After add:

		case "games":
			$user['activity'] = "games";
			break;


7. Activate the plugin

NOTES

I wrote in this README MyBB 1.2.10, but this means MyBB 1.2.10 and newer, so you don't need to do this change, too in 1.2.11.