02 Jan 2009 Manual Installation for Arcade 2.0.xWhen you read the .xml file that is used for a mod, you will do the opposite of what you see. For instance, "Add Before" means to actually put that code after the "Find" code. "Add After" means to actually put that code before the "Find" code. "Replace" means to replace the entire code shown in the "Find" code.
However, this tutorial will "buck the system" and do it the way it should be done. So, "Add After" does means "Add After". And, "Add Before" does means "Add Before" just as the parser at SMF does.
Use the menu links below to find a particular file or block of code that you may need or just start from the first code and work your way down.
./Themes/default/index.template.php - the button code
Find: elseif (empty($_REQUEST['action'])) // 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'),
'arcade' => array('Arcade.php','Arcade'),
'managegames' => array('ManageGames.php', 'GamesAdmin'),
'arcadecategory' => array('ArcadeSettings.php', 'ArcadeCategory'),
'arcadesettings' => array('ArcadeSettings.php', 'ArcadeSettings'),
Find: $permissionList = array( 'membergroup' => array( '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( 'arcade_rate', 'arcade_favorite', 'arcade_admin', Find: // Admin area 'Members'.
if (allowedTo(array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum')))
Find: // Probably an error or some goon? 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. 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);
}
Find: if (in_array($context['current_action'], array('admin',
'managegames', 'arcadesettings', 'arcadecategory', Find: if (in_array($context['current_action'], array('search',
'arcade', Find: // How about the [search] button?
Find: ?> $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 Administrator 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 %s on Arcade'; $txt['who_arcade_highscore'] = 'Viewing highscores of %s 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.'; Find: ?> $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 Administrator 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 %s on Arcade'; $txt['who_arcade_highscore'] = 'Viewing highscores of %s 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.'; Please, choose another topic from the list below. 1. Before You Install SMF-Arcade 2. Choosing The Right SMF-Arcade Version 3. Installing SMF Arcade on SMF 1.1.x 4. Installing SMF Arcade on SMF 2 5. Manual Installations for SMF-Arcade <- You are here. 6. Common Problems with SMF-Arcade 7. Error Messages with SMF-Arcade 8. Adding Hacks for SMF-Arcade Enjoy!!!
Courtesy of:
|