You can define some settings in the constants.php
- TCG_CARDS_FILE_TYPE - default
'png'- file type of cards
- accepted values:
'gif','jpg','png' - use only one!
- TCG_CARDS_FILLER_NAME - default:
'filler'- name of the filler/search card - should be placed in the the folder "/assets/cards/"
- will be used for missing cards in the member profile and cards page
- TCG_CARDS_HEIGHT - default:
100- height of a single card
- accepted values: from
1to whatever you like - all cards have the same height
- TCG_CARDS_UPLOAD_REQUIRED - default:
true- is cardupload required on add card deck page?
- accepted values:
true(means yes),false(means no) - if
falseyou must upload the cards by your own but with correct naming- example:
muffinmaster.png,muffin01.png, ...muffin12.png - folder structure:
/assets/cards/muffin/ muffinis your carddeck name
- example:
- TCG_CARDS_PER_ROW - default:
4- how many cards are in one row
- accepted values: from
1to whatever you like - will be used on card deck pages and in member profile "collect"
- TCG_CARDS_WIDTH - default:
100- width of a single card
- accepted values: from
1to whatever you like - all cards have the same width
- TCG_CARDS_START_PACKAGE - default
12- card amount of start package after successful registration with account activation
- accepted values: from
1to whatever you like
- TCG_CARDDECK_MAX_CARDS - default:
12- card amount of a card deck
- accepted values: from
1to whatever you like - all card decks have the same amount of cards
- TCG_CATEGORY_KEEP_USE - default
true- should it be possible to use the keep category
- TCG_CURRENCY - default:
'Dollar'- currency name
- accepted values: whatever you like
- will be used for the shop to buy cards
- TCG_CURRENCY_USE - default:
true- will you use the currency?
- accepted values:
true(means yes),false(means no)
- TCG_LEVEL_UP_CARD_REWARD - default
3- reward card amount for level up
- TCG_MAIN_LANGUAGE - default:
'en'- main language of the TCG
- accepted values:
'en'and'de'
- TCG_MASTER_CARD_REWARD - default:
3- reward card amount for mastering a card deck
- TCG_MASTERCARDS_HEIGHT - default:
100- height of a single master card
- accepted values: from
1to whatever you like - all master cards have the same height
- TCG_MASTERCARDS_WIDTH - default:
100- width of a single master card
- accepted values: from
1to whatever you like - all master cards have the same width
- TCG_META_AUTHOR
- name of the TCG owner
- meta tags are used for search engine pages like google, bing, ...
- TCG_META_DESC
- short description of your TCG
- meta tags are used for search engine pages like google, bing, ...
- TCG_META_KEYWORDS
- keywords for your TCG
- meta tags are used for search engine pages like google, bing, ...
- TCG_META_TITLE
- title-tag & meta title
- meta tags are used for search engine pages like google, bing, ...
- TCG_DEFAULT_TIMEZONE
- default timezone
- choose your timezone value from this list: https://www.php.net/manual/en/timezones.php
- TCG_META_OWNER
- email address to contact the TCG owner and for mails (forget password, questions, ...)
- meta tags are used for search engine pages like google, bing, ...
- will be used for all mailings (contact admin)
- TCG_NAME
- for title-attribute & meta title
- the name of your TCG
- TCG_MULTI_MASTER - default
false- should it be possible to master a deck multiple times
- accepted values:
true(means yes),false(means no)
- TCG_SHOP_CURRENCY_FOR_CARD_RANGE_MAX - default
150- how much currency do 1 card in shop cost? Range max value
- accepted values: from
1to whatever you like
- TCG_SHOP_CURRENCY_FOR_CARD_RANGE_MIN - default
100- how much currency do 1 card in shop cost? Range min value
- accepted values: from
1to whatever you like
- TCG_SHOP_CURRENCY_FOR_RANDOM - default
100- how much currency do 1 random cost?
- accepted values: from
1to whatever you like
- TCG_SHOP_MAX_CARDS - default:
20- card amount shown in shop
- accepted values: from
1to whatever you like
- TCG_SHOW_TRADE_FILTER - default
true- will you use the trade filter function?
- accepted values:
true(means yes),false(means no)
- TCG_TRADE_IN_HOURS - default
4- how many hours do you need to wait to trade in new duplicate cards?
- accepted values: from
0to24 - use value
0for no cool down time
- TCG_SLOGAN
- for title-attribute & meta title
- TCG_TEMPLATE - default:
1- switch template
- accepted values:
1,2 - which template you want to use
- TCG_WISH - default:
'Wish'- wish name
- accepted values: whatever you like
- will be used for the shop to change into specific card
- TCG_WISH_USE - default:
true- will you use wish?
- accepted values:
true(means yes),false(means no)
To add a new page you must follow these steps
- open the file
index.php- search for
* routes you can change and add more - paste the following code after the last
Route::addblock
- search for
Route::add("/PAGEURL",function() {
require_once("PATHTOFILE/FILENAME.php");
});
- change `PAGEURL` - something which should be in the browser url bar - example `about` (don't delete the `/`!)
- change `PATHTOFILE/FILENAME` - the place where you put the file - example `main/about.php`
- create your PHP-file in the defined path from above - example file
about.phpin/main/ - open your created PHP-file - example
/main/about.php- paste the following code
<?php
$breadcrumb = array(
'/' => 'Home',
'/PAGEURL' => 'PAGENAME',
);
breadcrumb($breadcrumb);
title('PAGENAME');
?>
<div class="row">
<div class="col">
TEXT
</div>
</div>
- change
PAGEURL- the defined string form above - exampleabout - change
PAGENAME- the subject of your created page - exampleAbout the site - change
TEXT- here you can add your text/code of your new page - open the file
/inc/navigation/header.php- search for
<div class="dropdown-menu" aria-labelledby="navbarDropdownMain"> - paste the following code after the last
navlink()line
- search for
navlink('PAGENAME','PAGEURL');
- change `PAGENAME` - the defined subject from above - example `About the site`
- change `PAGEURL` - the defined string form above - example `about`
Done.
You can now open your TCG and hover in the top menu over Main - you should see the created page link About the site.
After clicking on it you will be redirected to the new created page.
To add new translations you must follow these steps
- open the file
/inc/translations/en.php- you can create a new block for your new texts
- go to the end of the file and paste the following code
'newtexts' => array(
'KEY' => 'VALUE',
),
- change `KEY` - example `text_about_headline`
- change `VALUE` - example `About the site`
- do the same with the other translation file
/inc/translations/de.phpKEYmust be the same like in theen.phpfileVALUEshould be the translated text in german - exampleÜber die Seite(hint: use HTML Codes for umlauts - exampleÜforÜ)
To use your added translations use following code
TRANSLATIONS[$GLOBALS['language']]['newtexts']['KEY']
in our example
TRANSLATIONS[$GLOBALS['language']]['newtexts']['text_about_headline']
To run the script in subfolder you must follow there steps
- open the file
/inc/constants.php- fill
HOST_URL_SUBFOLDERwith your subfolder name - exampletcg
- fill
- open the file
/.htaccess- search for
RewriteBase / - add the subfolder name after
/- exampleRewriteBase /tcg - search for
RewriteRule ^(login|logout)/?$ /inc/$1.php [L] - add the subfolder name before
/inc- exampleRewriteRule ^(login|logout)/?$ /tcg/inc/$1.php [L]
- search for
- Why can't I select a category at a card deck?
- You must add at least 1 main and 1 sub category then you can select a category
- Why don't I see any active games?
- You must add at least 3 card decks to see the active games
- Why can't I activate my account using the link in the activation email?
- You must add at least the amount of card decks you specify in
TCG_CARDS_START_PACKAGEin theconstants.php
- Can you add a specific feature?
- Just open an issue with some informations about the feature you want to have :) The more detailed the better.
- Can you add a new game?
- Open an issue with the game you want to be added. It would be good if you can also provide the url of an existing script.