General Package Information

This is general information about the package, such as the package ID and name.

Package ID: Niko:Arcade
Package name: SMF Arcade
Package version: E2.0.1
Package type: modification

Installation instructions for SMF versions: 1.1 RC3, 1.1 - 1.1.2

PHP script to execute: package_install.php

Files installed

Directories installed

Directories created

Modifications to SMF files

In file $boarddir/index.php

Find:
	elseif (empty($_REQUEST['action']))


Add before:
	// Check for arcade actions
	// IBPArcade v2.x.x Games support
	elseif (isset($_REQUEST['act']) && strtolower($_REQUEST['act']) == 'arcade')

	{
		$_REQUEST['action'] = 'arcade';
		$_REQUEST['ibpa'] = 2;
		
		if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'newscore')

			$_REQUEST['sa'] = 'ibpsubmit';
			
		require_once($sourcedir . '/Arcade.php');
		return 'Arcade';   
	}

	// IBPArcade v3.x.x Games support
	elseif (isset($_REQUEST['autocom']) && $_REQUEST['autocom'] == 'arcade')

	{
		$_REQUEST['action'] = 'arcade';
		$_REQUEST['ibpa'] = 3;
		
		if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'savescore')

			$_REQUEST['sa'] = 'ibpsubmit';
			
		elseif (isset($_REQUEST['do']) && $_REQUEST['do'] = 'verifyscore')

			$_REQUEST['sa'] = 'ibpverify';
		
		require_once($sourcedir . '/Arcade.php');
		return 'Arcade';   
	}

	elseif (isset($_REQUEST['play']))
	{
		$_REQUEST['game'] = $_REQUEST['play'];
		unset($_REQUEST['play']);
		$_REQUEST['sa'] = 'play';
		
		require_once($sourcedir . '/Arcade.php');
		return 'Arcade';			
	}

	elseif (isset($_REQUEST['highscore']))
	{
		$_REQUEST['game'] = $_REQUEST['highscore'];
		unset($_REQUEST['highscore']);
		$_REQUEST['sa'] = 'highscore';
		
		require_once($sourcedir . '/Arcade.php');
		return 'Arcade';
	}

	elseif (isset($_REQUEST['game']) && !isset($_REQUEST['action']))
	{
		require_once($sourcedir . '/Arcade.php');
		return 'Arcade';
	}



Find:
		'announce' => array('Post.php', 'AnnounceTopic'),


Add after:
        'arcade' => array('Arcade.php','Arcade'),
		'managegames' => array('ManageGames.php', 'GamesAdmin'),
		'arcadecategory' => array('ArcadeSettings.php', 'ArcadeCategory'),
		'arcadesettings' => array('ArcadeSettings.php', 'ArcadeSettings'),



In file $sourcedir/ManagePermissions.php

Find:
	$permissionList = array(
		'membergroup' => array(


Add after:
            'arcade' => array(
                'arcade_view' => false,
                'arcade_play' => false,
                'arcade_admin' => false, 
                'arcade_favorite' => false,
                'arcade_submit' => false, 
                'arcade_comment' => true, 
                'arcade_rate' => false,             
            ),



Find:
	$non_guest_permissions = array(


Add after:
 
		'arcade_rate',
		'arcade_favorite',
		'arcade_admin',



In file $sourcedir/Subs.php

Find:
	// Admin area 'Members'.
	if (allowedTo(array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum')))


Add before:
	// Admin area 'Arcade'
	if (allowedTo(array('arcade_admin')))
	{
		$context['admin_areas']['admin'] = array(

			'title' => $txt['arcade_admin'],
			'areas' => array(
				'manage_games' => '<a href="' . $scripturl . '?action=managegames">' . $txt['arcade_manage_games'] . '</a>',
				'manage_category' => '<a href="' . $scripturl . '?action=arcadecategory">' . $txt['arcade_manage_category'] . '</a>',
				'arcade_settings' => '<a href="' . $scripturl . '?action=arcadesettings">' . $txt['arcade_settings'] . '</a>',
			)

		);
                	
	}



In file $sourcedir/Who.php

Find:
		// Probably an error or some goon?


Add before:
		elseif ($actions['action'] == 'arcade')

		{
					
			if (!isset($actions['sa']) || $actions['sa'] == 'list')

				// Viewing index
				$data[$k] = $txt['who_arcade'];
			elseif ($actions['sa'] == 'play' && isset($actions['game']))

				// Playing game
				$game_ids[(int) $actions['game']][$k] = $txt['who_arcade_play'];
			elseif ($actions['sa'] == 'highscore' && isset($actions['game']))

				// Viewing highscores of game
				$game_ids[(int) $actions['game']][$k] = $txt['who_arcade_highscore'];
			else

				// Something else, let's say it's index
				$data[$k] = $txt['who_arcade'];
			
		}
 



Find:
	// Load member names for the profile.


Add before:
	if (!empty($game_ids) && allowedTo('view_arcade'))
	{

		$result = db_query("
			SELECT ID_GAME, gameName
			FROM {$db_prefix}arcade_games
			WHERE ID_GAME IN (". implode(', ', array_keys($game_ids)) . ")
			LIMIT ". count($game_ids), __FILE__, __LINE__);
		
		while ($row = mysql_fetch_assoc($result))

			foreach ($game_ids[$row['ID_GAME']] as $k => $session_text)
				$data[$k] = sprintf($session_text, $row['ID_GAME'], $row['gameName']);				
	
	  mysql_free_result($result);	
	}

 



In file $themes_dir/default/index.template.php

Find:
	if (in_array($context['current_action'], array('admin',


Add after:
'managegames', 'arcadesettings', 'arcadecategory',



Find:
	if (in_array($context['current_action'], array('search',


Add after:
'arcade',



Find:
// How about the [search] button?


Add before:
    echo ($current_action == 'arcade' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'arcade' ? 'active_back' : 'back' , '">

				<a href="', $scripturl, '?action=arcade">' , $txt['arcade'] , '</a>

			</td>' , $current_action == 'arcade' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



In file $themes_dir/default/languages/Modifications.english.php

Find:
?>


Add before:
$txt['arcade'] = 'Arcade';

$txt['arcade_admin'] = 'Arcade Admin';   
$txt['arcade_manage_games'] = 'Games';
$txt['arcade_manage_category'] = 'Categories'; 

$txt['arcade_settings'] = 'Settings'; 
 
// Permission names and help
$txt['permissiongroup_arcade'] = 'Arcade';
$txt['permissionname_arcade_view'] = 'View Arcade';

$txt['permissionhelp_arcade_view'] = 'May access Arcade and use basic features like search and view highscores';
$txt['permissionname_arcade_play'] = 'Play on Arcade';
$txt['permissionhelp_arcade_play'] = 'Allows member to play on arcade, in games which he/she has rights to';

$txt['permissionname_arcade_admin'] = 'Administrate arcade';
$txt['permissionhelp_arcade_admin'] = 'Arcade Administarator can Install/Edit/Delete game, Delete scores and edit settings for arcade';
$txt['permissionname_arcade_view'] = 'View Arcade';

$txt['permissionhelp_arcade_view'] = 'May access Arcade and use basic features like search and view highscores';
$txt['permissionname_arcade_favorite'] = 'Use Favorites feature'; 
$txt['permissionhelp_arcade_favorite'] = 'Allows member to favorite and unfavorite games';

$txt['permissionname_arcade_submit'] = 'Save scores'; 
$txt['permissionhelp_arcade_submit'] = 'Allows users to save their scores.';
$txt['permissionname_arcade_rate'] = 'Rate games'; 

$txt['permissionhelp_arcade_rate'] = 'Allows users to rate games.';
$txt['permissionname_arcade_comment'] = 'Allow to comment/edit comment'; 
$txt['permissionhelp_arcade_comment'] = 'Allows user to edit comments, own or any';

$txt['permissionname_arcade_comment_any'] = 'Any';
$txt['permissionname_arcade_comment_own'] = 'Own';
 
// Errors if they can't do something
$txt['cannot_arcade_play'] = 'You are not allowed to play games!';

$txt['cannot_arcade_view'] = 'You are not allowed to access arcade.';
$txt['cannot_arcade_favorite'] = 'You are not allowed to favorite games';
$txt['cannot_arcade_rate'] = 'You are not allowed to rate games';

$txt['cannot_arcade_comment_own'] = 'You are not allowed to comment';
 
// Who's online
$txt['who_arcade'] = 'Viewing Arcade index';
$txt['who_arcade_play'] = 'Playing <a href="' . $scripturl . '?action=arcade;sa=play;game=%d">%s</a> on Arcade';

$txt['who_arcade_highscore'] = 'Viewing highscores of <a href="' . $scripturl . '?action=arcade;sa=play;game=%d">%s</a> on Arcade';

 
// Help
$txt['arcade_max_scores_help'] = 'Maximum scores that will be stored per member. (0 means unlimited)';
$txt['arcade_membergroups_help'] = 'These groups will be allowed to play and view highscores. Others will not see this game, only used if permission mode will use game permissions.';
 
 



In file $themedir/Profile.template.php

Find:
</table>
				</td>
			</tr>
		</table>';
}

 
// Template for changing user account information.


Replace with:
</table>
				</td>
			</tr>';
	profile_stats();
echo'
		</table>';
}

 
// Template for changing user account information.



Find:
<label for="popup_messages"><input type="checkbox" name="default_options[popup_messages]" id="popup_messages" value="1"', !empty($context['member']['options']['popup_messages']) ? ' checked="checked"' : '', ' class="check" /> ', $txt['popup_messages'], '</label><br />


Add after:
 
									<input type="hidden" name="default_options[arcade_messages]" value="0" />

									<label for="arcade_messages"><input type="checkbox" name="default_options[arcade_messages]" id="arcade_messages" value="1"', !empty($context['member']['options']['arcade_messages']) ? ' checked="checked"' : '', ' class="check" /> ', $txt['arcade_messages'], '</label><br />



In file $languagedir/Profile.english.php

Find:
$txt['popup_messages'] = 'Show a popup when you receive new messages?';


Add after:
 
$txt['arcade_messages'] = 'Send a PM when your highscore is beaten?';



In file $themedir/Display.template.php

Find:
global $context, $settings, $options, $txt, $scripturl, $modSettings;


Replace with:
 
	global $context, $settings, $options, $txt, $scripturl, $sourcedir, $modSettings;

 
	require_once($sourcedir.'/ArcadeSigsStats_v2.php');
 



Find:
// Done with the information about the poster... on to the post itself.


Add before:
 

//-- start champ in post profile --------------
		arcade_champs_post_profile($message);
//--  end champ in post profile ---------------
 



Find:
		if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))

			echo '
							<hr width="100%" size="1" class="hrcolor" />
							<div class="signature">', $message['member']['signature'], '</div>';


Replace with:
 
		/* //-- Disabled for Arcade Champs in Sig Mod ----------------------------------------
		if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
		echo '
		<hr width="100%" size="1" class="hrcolor" />

		<div class="signature">', $message['member']['signature'], '</div>';
		//-- Disabled for Arcade Champs in Sig Mod ------------------------------------------*/
		arcade_champs_sig($message);
 



In file $sourcedir/Display.php

Find:
// The central part of the board - topic display.


Add before:
 
require_once($sourcedir.'/ArcadeSigsStats_v2.php');
 



Find:
$attachments = array();


Add after:
 
//---start champs in sig ---
	build_champ_sigs();
//----end champs in sig ----
 



In file $sourcedir/Profile.php

Find:
global $txt, $scripturl, $user_info, $context, $ID_MEMBER, $sourcedir, $user_profile, $modSettings;


Add after:
 
require_once($sourcedir.'/ArcadeSigsStats_v2.php');
 



Find:
ksort($context['posts_by_time']);


Add after:
 
	build_champ_profile($memID);
 



SMF Package Parser, by Daniel15.