[hr]
[center][size=25pt][color=green]SMF Arcade - Toolbar Block Code & Icons[/color][/size][/center]
[hr]

This will add additional image files into your arc_icons directory for use with the Arcade Toolbar Block Code.

The Arcade Toolbar Block Code for your portal is shown below:
[code]
/*  SMF Arcade Toolbar  */
/* For use with a PHP portal block or insert into your arcade template  */

global $scripturl, $context, $modSettings, $settings;
$modSettings['arcadeEnableDownload'] = !empty($modSettings['arcadeEnableDownload']) ? $modSettings['arcadeEnableDownload'] : false;
$id_of_game = isset($_REQUEST['game']) ? (int)$_REQUEST['game'] : 0;
$image_width = 30;
$image_height = 30;
$candown = allowedTo('arcade_download') && !empty($modSettings['arcadeEnableDownload']) ? true : false;
$admin_only = array('admin', 'category', 'edit', 'maintain');
$no_guest = array('arena', 'download', 'favorites');
$id = 0;
$button_icons = array(
	'home' => array('action=arcade;sort=name;desc=DESC', 'arcade_home.png'),
	'stats' => array('action=arcade;sa=stats', 'arcade_stats.jpg'),
	'admin' => array('action=admin;area=arcade;sa=main', 'arcade_admin.jpg'),
	'edit' => array('action=admin;area=managegames;sa=main', 'arcade_edit.png'),
	'category' => array('action=admin;area=arcadecategory;sa=list', 'arcade_category.png'),
	'maintain' => array('action=admin;area=arcademaintenance;sa=main', 'arcade_maintain.png'),
	'arena' => array('action=arcade;sa=arena', 'arcade_arena.png'),
	'download' => array('action=arcade;sa=download;game=' . $id_of_game, 'arcade_download.png'),
	'most_played' => array('action=arcade;sortby=plays;desc=DESC', 'arcade_most_played.png'),
	'favorites' => array('action=arcade;favorites', 'arcade_favorites.jpg'),
	'new' => array('action=arcade;sortby=age;desc=DESC', 'arcade_newgames.jpg'),
);

$tabStart = '
		<div class="windowbg2" style="white-space: nowrap;border-spacing: 0px;display: table-cell;cursor: pointer; font-size: 11px; padding: 6px 10px 6px 10px;border: solid 1px #ADADAD;border-top: 0px; border-bottom:0px; border-left:0px;text-align:center;vertical-align:top;" onmouseover="this.style.backgroundPosition=\'0 -5px\'" onmouseout="this.style.backgroundPosition=\'0 0px\'">';
$tabLast = '
		<div class="windowbg2" style="white-space: nowrap;border-spacing: 0px;display: table-cell;cursor: pointer; font-size: 11px; padding: 6px 10px 6px 10px;  border-top: 0px; border-bottom:0px; border-left:0px;text-align:center;vertical-align:top;">';
$tabEnd = '
		</div>';
$viewit = '
	<div summary="arcade_toolbar" style="overflow:hidden;display: table;border: 0px;padding: 0px;margin: 0 auto;width: 100%;">
		<div style="display: table-row;vertical-align: top;text-align: left;">';

foreach ($button_icons as $bname => $button) {
	if (in_array($bname, $admin_only) && !allowedTo('arcade_admin'))
		continue;
	if (in_array($bname, $no_guest) && $context['user']['is_guest'])
		continue;
	if ($bname == 'download' && !$candown && !allowedTo('arcade_admin'))
		continue;
	if ($bname == 'download' && empty($id_of_game))
		continue;

	$viewit	.=	(array_key_last($button_icons) == $bname ? $tabLast : $tabStart) . '
				<a href="' . $scripturl . '?' . $button[0] . '">
					<img id="arcadeButtonBar' . $id . '" onmouseover="arcadeButtonOver(\'arcadeButtonBar' . $id . '\')" onmouseout="arcadeButtonOut(\'arcadeButtonBar' . $id . '\')" src="' . $settings['default_theme_url'] . '/images/arc_icons/' . $button[1] . '" style="width: ' . $image_width . 'px;height: ' . $image_height . 'px" title="ARCADE ' . strtoupper($bname) . '" alt="" />
				</a>
			' . $tabEnd;
	$id++;
}

$viewit .= '
		</div>
	</div>
	<span style="display: block;line-height: 1em;"></span>
	<span style="display: block;line-height: 1em;"></span>
	<span style="display: block;line-height: 1em;"></span>
	<script type="text/javascript">
		function arcadeButtonOver(buttonLinkId) {
			document.getElementById(buttonLinkId).style.width = "' . ($image_width * 1.2) . 'px";
			document.getElementById(buttonLinkId).style.height = "' . ($image_height * 1.2) . 'px";
		}
		function arcadeButtonOut(buttonLinkId) {
			document.getElementById(buttonLinkId).style.width = "' . $image_width . 'px";
			document.getElementById(buttonLinkId).style.height = "' . $image_height . 'px";
		}
	</script>';

echo $viewit;
[/code]

[hr]
License:
Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
https://creativecommons.org/licenses/by-sa/4.0/

Disclaimer:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

