<?php
/*********************************************
  CPG Dragonfly - DF_Arcade Module
  ********************************************
  CPG Dragonfly is copyright © 2004 - 2005 by CPG Dev Team
  http://www.dragonflycms.com

  Dragonfly and DF_Arcade are released under the terms
  and conditions of the GNU GPL version 2 or any later version

  port of pnFlashGames - http://pnflashgames.com/
  Written by gerry@redgerry.com
  redgerry.com - Home of RG_Sports
  Revision Date: 16/10/2005 11:46
  Version Number 1.00

  UNDER NO CIRCUMSTANCES MAY THIS GPL CODE BE USED FOR ANY COMMERCIAL
  PURPOSES UNDER THE GUISE OF V.I.P. OR ANY OTHER DESCRIPTION
********************************************************/
if (!defined('CPG_NUKE')) { exit; }
global $MAIN_CFG, $admin, $module_name, $bgcolor2, $func, $game_id, $cat_id;
	$language = $MAIN_CFG['global']['language'];
    	$sitename = $MAIN_CFG['global']['sitename'];
	$pagetitle = " DF_Arcade";
	$module_name = "DF_Arcade";
	$func =  (isset($_POST['func']) ? Fix_Quotes($_POST['func']): (isset($_GET['func']) ? Fix_Quotes($_GET['func']) : ''));
	$game_id =  (isset($_POST['game_id']) ? intval($_POST['game_id']): (isset($_GET['game_id']) ? intval($_GET['game_id']) : ''));
	$cat_id =  (isset($_POST['cat_id']) ? intval($_POST['cat_id']): (isset($_GET['cat_id']) ? intval($_GET['cat_id']) : ''));
	require_once('language/'.$language.'/DF_Arcade.php');
	require_once ( "header.php" );
	require_once ( "functions.php" );
	OpenTable();
        echo "<div align=\"center\"><table width=\"500\" cellpadding=\"0\" border=\"0\" bgcolor=\"$bgcolor2\">"
        ."<tr><td>"
        	."<table width=\"100%\" cellpadding=\"5\" border=\"0\">"
    		."<tr><td align=\"center\"><img src=\"images/DF_Arcade/heading.gif\" alt=\"DF_Arcade by RedGerry.com\">";
    		if (is_admin($admin)) {
			echo "<br/><br/><a href=\"".adminlink('DF_Arcade')."\">"._RGAACP."</a>";
		}
    		echo "</td></tr></table>"
    	."</td></tr></table>";
    	CloseTable();
switch($func) {

    default:
    arcadehome();
    break;

    case "yourarcade":
    yourarcade();
    break;

    case "leaderboard":
    leaderboard();
    break;

    case "displaycategories":
    displaycategories();
    break;

    case "displaycat":
    displaycat();
    break;

    case "playgame":
    playgame();
    break;

    case "storeScore":
    storeScore($game_id, $player_score);
    break;

    case "listgames":
    listgames();
    break;

}
?>