Add custom genre categories to your SGS Print E-mail
Written by Stephen Harrow   
Monday, 25 January 2010 16:54

This guide will show you how you can add custom genre categrories to your Satellite Gamesite System. These categories can be genres such as Adventure, Shooter, Mystery etc. The full official list can be viewed here, and some additional genres can be located here (search for $bfg_genres = array).

For SGS v0.7 so far the new categories seems to work only for the ones with the genres that has the option ispri: yes. With the SGS v0.8 all these categories have been included and by following this tutorial all the other categories can be added.


SGS v0.7

In this guide we will add the Strategy category with genreid=29 . You can follow the steps to add any of the categories by using their correct sname and genreid.

The following files need editing:

\browse.php

\download-games.php

\online-games.php

\template\{Template_Name}\main_online.php

\language\en\en_language.php

\include\site_game.class.php




\browse.php

Search for the following line:

foreach(array(1=>'action',2=>'jigsaw',3=>'mahjong',4=>'puzzle',5=>'card',6=>'word') as  
$key=>$genre)

Add another argument with 29=>'strategy'
foreach(array(1=>'action',2=>'jigsaw',3=>'mahjong',4=>'puzzle',5=>'card',6=>'word',  
29=>'strategy') as $key=>$genre)


\download-games.php

Search for the following line:
if(!in_array($request,array('glrelease','glrank', 'action', 'card', 'mahjong', 
'puzzle', 'word')))

Add 'strategy'
if(!in_array($request,array('glrelease','glrank', 'action', 'card', 'mahjong', 
'puzzle', 'word', 'strategy')))

Find the following line:

$featureclass  = array  ('glrelease'=>'newdownload','glrank'=>'topdownload','action'=>
'topaction', 'card'=>'topcard', 'mahjong'=>'topmahjong','puzzle'=>'toppuzzle','word'=>
'topword');

Add 'strategy'=>'topstrategy'
$featureclass  = array  ('glrelease'=>'newdownload','glrank'=>'topdownload','action'=>
'topaction', 'card'=>'topcard', 'mahjong'=>'topmahjong','puzzle'=>'toppuzzle','word'=>
'topword','strategy'=>'topstrategy');


\online-games.php

Find the following line:
foreach(array('action_games'=>1,'mahjong_games'=>3,'puzzle_games'=>4,'card_games'=>5,
'word_games'=>6) as $tagname=>$genre)

Add 'strategy_games'=>29
foreach(array('action_games'=>1,'mahjong_games'=>3,'puzzle_games'=>4,'card_games'=>5,
'word_games'=>6,'strategy_games'=>29) as $tagname=>$genre)


\template\{Template_Name}\main_online.php

This file will contain the following list responsible for the online-games.php page:
{ONLINEFEATURE} 
{PUZZLE_GAMES}
{WORD_GAMES}
{ACTION_GAMES}
{MAHJONG_GAMES}
{CARD_GAMES}

If you want the new category to be listed as well add {STRATEGY_GAMES}

\language\en\en_language.php

Find the following lines:
'genre_info_5_caption'=>'Card & Board', 
'genre_info_5_text'=>'Classic and familiar games with innovative twists.',
'genre_info_6_caption'=>'Word',
'genre_info_6_text'=>'Work out your brain with ubiquitous word games.',
'genre_info_253_caption'=>'All',
'genre_info_253_text'=>'Our game archive, a new game added daily!',

Add
'genre_info_29_caption'=>'Strategy', 
'genre_info_29_text'=>'Strategically minded? Play the best Strategy Games
available online for download.',

The code should look now like this:
'genre_info_5_caption'=>'Card & Board',
'genre_info_5_text'=>'Classic and familiar games with innovative twists.',
'genre_info_6_caption'=>'Word',
'genre_info_6_text'=>'Work out your brain with ubiquitous word games.',
'genre_info_29_caption'=>'Strategy',
'genre_info_29_text'=>'Strategically minded? Play the best Strategy Games
available online for download.',

'genre_info_253_caption'=>'All',
'genre_info_253_text'=>'Our game archive, a new game added daily!',

Find the following lines:

'select_genre_mahjong'=>'mahjong', 
'select_genre_puzzle'=>'puzzle',
'select_genre_word'=>'word',

Add
'select_genre_strategy'=>'strategy',
/** 
* select genre
*/
'select_genre_all'=>'all',
'select_genre_action'=>'action',
'select_genre_card'=>'card',
'select_genre_jigsaw'=>'jigsaw',
'select_genre_mahjong'=>'mahjong',
'select_genre_puzzle'=>'puzzle',
'select_genre_word'=>'word',
'select_genre_strategy'=>'strategy',
/**

Find the following lines:

/** 
* index feature game text
*/
'index_feature_glrelease'=>'Today\'s New Release',
'index_feature_glrank'=>'#1 Hit Game',
'index_feature_action'=>'#1 Hit Game',
'index_feature_card'=>'#1 Hit Game',
'index_feature_mahjong'=>'#1 Hit Game',
'index_feature_puzzle'=>'#1 Hit Game',
'index_feature_word'=>'#1 Hit Game',
/**

Add
'index_feature_strategy'=>'#1 Hit Game',
/** 
* index feature game text
*/
'index_feature_glrelease'=>'Today\'s New Release',
'index_feature_glrank'=>'#1 Hit Game',
'index_feature_action'=>'#1 Hit Game',
'index_feature_card'=>'#1 Hit Game',
'index_feature_mahjong'=>'#1 Hit Game',
'index_feature_puzzle'=>'#1 Hit Game',
'index_feature_word'=>'#1 Hit Game',
'index_feature_strategy'=>'#1 Hit Game',
/**


\include\site_game.class.php

Find the following lines:
$this->set('genreList',array( 
0=>"NULL",
1=>"action",
2=>"jigsaw",
3=>"mahjong",
4=>"puzzle",
5=>"card",
6=>"word",
16=>"mac",
26=>"kids",
253=>"all",
254=>"glrelease",
255=>"glrank"
));

Add 29=>"strategy", :
$this->set('genreList',array( 
0=>"NULL",
1=>"action",
2=>"jigsaw",
3=>"mahjong",
4=>"puzzle",
5=>"card",
6=>"word",
16=>"mac",
26=>"kids",
29=>"strategy",
253=>"all",
254=>"glrelease",
255=>"glrank"
));

Find the following lines:

16=>array('caption'=>"Mac",'text'=>"MOMA mac"), 
26=>array('caption'=>"kids",'text'=>"MOMA kids"),
253=>array('caption'=>$sl->class['site_language']->display('genre_info_253_caption'),
'text'=>$sl->class['site_language']->display('genre_info_253_text')),

Add 29=>array('caption'=>$sl->class['site_language']->display('genre_info_29_caption'),'text'=>$sl->
class['site_language']->display('genre_info_29_text')),

16=>array('caption'=>"Mac",'text'=>"MOMA mac"), 
26=>array('caption'=>"kids",'text'=>"MOMA kids"),
29=>array('caption'=>$sl->class['site_language']->display('genre_info_29_caption'),
'text'=>$sl->class['site_language']->display('genre_info_29_text')),

253=>array('caption'=>$sl->class['site_language']->display('genre_info_253_caption'),
'text'=>$sl->class['site_language']->display('genre_info_253_text')),

Find the following lines:

$select_genre  = array( 
array('all'=>$sl->class['site_language']->display('select_genre_all')),
array('action'=>$sl->class['site_language']->display('select_genre_action')),
array('card'=>$sl->class['site_language']->display('select_genre_card')),
array('jigsaw'=>$sl->class['site_language']->display('select_genre_jigsaw')),
array('mahjong'=>$sl->class['site_language']->display('select_genre_mahjong')),
array('puzzle'=>$sl->class['site_language']->display('select_genre_puzzle')),
array('word'=>$sl->class['site_language']->display('select_genre_word'))
);

Add
, array('strategy'=>$sl->class['site_language']->display('select_genre_strategy'))
$select_genre  = array( 
array('all'=>$sl->class['site_language']->display('select_genre_all')),
array('action'=>$sl->class['site_language']->display('select_genre_action')),
array('card'=>$sl->class['site_language']->display('select_genre_card')),
array('jigsaw'=>$sl->class['site_language']->display('select_genre_jigsaw')),
array('mahjong'=>$sl->class['site_language']->display('select_genre_mahjong')),
array('puzzle'=>$sl->class['site_language']->display('select_genre_puzzle')),
array('word'=>$sl->class['site_language']->display('select_genre_word')),
array('strategy'=>$sl->class['site_language']->display('select_genre_strategy'))
);


When you are done the following links should work:
download-games.php?games=strategy and browse.php?genre=strategy , and if you choose to include it, the online-games.php page should display a box with the strategy games that can be played online.


SEO option enabled

To make the new categories work with the SEO option you also have to edit the .htaccess file in the main folder of your SGS script.

\.htaccess
After the lines:
#puzzle 
RewriteRule ^puzzle-games.(htm|html)/?$
/download-games.php?games=puzzle [L]
#word
RewriteRule ^word-games.(htm|html)/?$
/download-games.php?games=word [L]


Add:
#strategy 
RewriteRule ^strategy-games.(htm|html)/?$
/download-games.php?games=strategy [L]

Now after the lines:
#puzzle 
RewriteRule ^online-puzzle-games.(htm|html)/?$
/online-games.php?games=puzzle [L]
#word
RewriteRule ^online-word-games.(htm|html)/?$
/online-games.php?games=word [L]

Add:
#strategy 
RewriteRule ^online-strategy-games.(htm|html)/?$
/online-games.php?games=strategy [L]


SGS v0.8

In this guide we will add the Shooter category . You can follow the steps to add any of the categories by using their correct sname from the lists provided on this guide.

The following file need editing:
\_include\site_genre.class.php

Find the following lines:
$genreList[] = array('name'=>$sl->class['site_language']->display
('genre_info_253_caption'),'sname'=>'all','description'=>$sl->class
['site_language']->display('genre_info_253_text'));

Add $allowedGenre[]='shooter'; :
$allowedGenre[]='shooter';
$genreList[]=array('name'=>$sl->class['site_language']->display
('genre_info_253_caption'),'sname'=>'all','description'=>$sl->class
['site_language']->display('genre_info_253_text'));

After doing this the files in the \_cache folder should be deleted and the website reloaded a few times for the new changes to take effect.

$allowedGenre[]='shooter';
        $genreList[] = array('name'=>$sl->class['site_language']->display('genre_info_253_caption'),'sname'=>'all','description'=>$sl->class['site_language']->display('genre_info_253_text'));
Comments (1)Add Comment
...
written by Escaper, January 25, 2010
Thanks but It doesn't work with SEO links.

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.
busy
Last Updated on Wednesday, 10 March 2010 13:21