on your suggestion Sergey i made a little change ... so this is what i've got:
please note: this modifications are written to be used on the original versions of script filesFirst undo the PREFIX_games table modification ( default prefix is pas_ ):
ALTER TABLE `pas_games` DROP `controls`
new we create a new table to store the information:
CREATE TABLE IF NOT EXISTS `pas_games_controls` (
`game_id` int(10) NOT NULL auto_increment,
`game_title` varchar(255) NOT NULL,
`controls` varchar(255) NOT NULL,
UNIQUE KEY `game_id` (`game_id`),
KEY `game_title` (`game_title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
now open the admin\content.php file and find:
case "doaddgame":
and inside this action search for:
"GAMEKEYWORDS" => $_REQUEST["keywords"],
after it insert:
/* game controls mod var */
"GAMECONTROLS" => $_REQUEST["controls"],
/* game controls mod var */
now find this long line:
$query = 'INSERT DELAYED INTO '.$cMain['dbPrefix'].'games SET category_id='.$_POST['cat'].', added='.time().', active='.$nActive.', title="'.$sTitle.'", latin_title="'.$sLatinTitle.'", file="'.$sFile.'",
thumbnail="'.$_FILES['thumbnail']['name'].'", keywords="'.$sKeywords.'", description="'.$sDescr.'", width='.$width.', height='.$height.', featured='.$nFeatured;
and after it add:
/* game controls added query */
$query_controls = 'INSERT DELAYED INTO '.$cMain['dbPrefix'].'games_controls SET game_title="'.$sTitle.'", controls="'.$sControls.'"';
/* game controls added query */
and a few lines lower find:
$db->query( $query );
and after it add:
/* game controls added query */
$db->query( $query_controls );
/* game controls added query */
now find the followind action:
case "doeditgame":
find the query:
$res = $db->super_query( "SELECT * FROM ".$cMain["dbPrefix"]."games WHERE id=".$_REQUEST["id"]." LIMIT 1", false );
and after it add:
/* game controls mod */
$query = ' SELECT * FROM '.$cMain["dbPrefix"].'games_controls WHERE game_title="'.$res["title"].'" LIMIT 1';
$ctrl = $db->super_query( $query );
if (!$ctrl)
{
$query_controls = 'INSERT DELAYED INTO '.$cMain['dbPrefix'].'games_controls SET game_title="'.$res["title"].'", controls=""';
$db->query ( $query_controls );
}
/* game controls mod */
and a few lines lower find:
"GAMEKEYWORDS" => $res["keywords"],
and after it add:
/* game controls mod */
"GAMECONTROLS" => $ctrl["controls"],
/* game controls mod */
now a few lines lower find:
$sKeywords = get_magic_quotes_gpc() ? $_POST["keywords"] : mysql_escape_string($_POST["keywords"]);
and after it add:
/* game controls mod */
$sControls = get_magic_quotes_gpc() ? $_POST["controls"] : mysql_escape_string($_POST["controls"]);
/* game controls mod */
and again a few lines lower find:
$query .= ', keywords="' . $sKeywords . '", description="' . $sDescr . '", featured=' . $nFeatured;
after it add:
/* game controls query */
$query_ctrl = 'UPDATE '.$cMain['dbPrefix'].'games_controls SET game_title="'.$sTitle.'", controls="'.$sControls.'" WHERE game_title="'.$res["title"].'" LIMIT 1';
/* game controls query */
and a few lines lower find:
$db->query( $query );
after it add:
/* game controls query */
$db->query( $query_ctrl );
/* game controls query */
now find the following line:
case "dodelgame":
and a few lines lower find:
$db->query( "DELETE FROM ".$cMain["dbPrefix"]."games WHERE id=".$_REQUEST["id"]." LIMIT 1" );
after it add:
/* game controls mod */
$db->query( "DELETE FROM ".$cMain["dbPrefix"]."games_controls WHERE game_title='".$res["title"]."' LIMIT 1");
/* game controls mod */
now save and close the content.php file
remember that always backup your original filesnow open game.php file and find the following comment:
// In case we have an uploaded game or a direct URL to the game's file, use template.
above it ( between the line and { sign ) insert:
/* added query for game controls */
$query = 'SELECT * FROM ' . $cMain['dbPrefix'] . 'games_controls WHERE game_title="'.$gameres["title"].'" LIMIT 1';
$ctrl = $db->super_query( $query, false );
/* added query for game controls */
so that it will look like
{
/* added query for game controls */
$query = 'SELECT * FROM ' . $cMain['dbPrefix'] . 'games_controls WHERE game_title="'.$gameres["title"].'" LIMIT 1';
$ctrl = $db->super_query( $query, false );
/* added query for game controls */
// In case we have an uploaded game or a direct URL to the game's file, use template.
and now a few lines lower find:
'GAMEFILE' => substr($gameres['file'], 0, 7) == 'http://' ? $gameres['file'] : $cSite['sSiteRoot'] . 'content/swf/' . $gameres['file'],
and below it add:
/* game controls mod */
"GAMECONTROLS" => $ctrl["controls"],
/* game controls mod */
hope that this will hit your suggestion Sergey