From The Mana World
Revision as of 11:10, 3 September 2008 by Exceptionfault (talk | contribs) (Updated with contents from README)

The Mana World Account Manager

The Account Manager is the web interface for users to manage their account from outside the game.

Users can reset their password, see their character stats, and change the email associated with the account.

Installation

To install you need to checkout tmwweb from SVN, specifically the ExceptionFault branch.

svn co https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmwweb/branches/ExceptionFault

You will need a web server running PHP 5.1 or later, with pdo_sqlite.

On FreeBSD you will need to install ports databases/php5-pdo_sqlite and security/pecl-hash along with lang/php5.

Configuration

There are several config files that have to be prepared for your specific environment. You can find all config files under ./system/application/config

Tmwweb comes with a default configuration file called "config.default.php" You should use this file as template to set up your individual configuration. Make a copy of this file and name rename it to "config.php". In general you have to modify the following settings:

   set the "base_url" to the url of your installation.
   define the desired "log_threshold" to your needs

Do the same with the file "database.default.php" and "email.default.php". Rename them to "database.php" and "email.php" configure the options inside for your needs.

The following configuration files are shipped with defaults that may or may not be suitable for you.

   menu.php
   tmw_config.php
   

Instead of modifying the files directly you should make a copy of them and rename them to <prefix>.user.php, so "menu.php" gets "menu.user.php". Tmwweb first loads menu.php, afterwards menu.user.php (if it exists) and overrides the default values with your custom settings. The advantage of this method is, that upgrading tmwweb won't break your configuration.

All other files in the config directory shouldn`t get touched by you!

After proper configuration of all files you have to ensure that the webserver has write access to the ./system/logs, the ./images/items and ./data directory.

   chmod 777 ./system/logs
   chmod 777 ./data
   chmod 777 ./images/items
   

Tmwweb tries to store cached data read from other modules like tmwserv in the data directory for faster access. Therefore you should allow the webserver to create files there. The logs directory is used for logging as you can think.

Troubleshooting

After uploading and configuring tmwweb it might happen that every site you call is only white and blank. Lets set loglevel in config.php to 4 and after refreshing your site in the browser have a look at the logfiles under ./system/logs If there is no file except index.html please recheck your directory permissions. Again, the webserver needs write permissions to ./system/logs. If you cannot find a file that is named "config.php", please go back to the chapter #Configuration and read it more carefully!

Translations

Tmwweb has a simple multilanguage support integrated. During login into your account you can choose one of the currently translated languages. If your native language is not available yet, feel free to support the dev team and translate tmwweb.

Howto translate into your language

To start with a new language there are two simple steps to do:

Copy the directoy ./system/application/language/english as it is the shipped language with tmwweb and should contain all necessary strings. Also you have to copy ./system/language/english to your new language. This directory contains strings comming from CodeIgniter, the used php framework.

Ensure not to copy the hidden directory .svn if you checked out from subversion. Each php file ending with *_lang.php needs to be translated.

      $lang['character'] = '<put your translation here>';        

Ensure to double quote inside of your strings if necessary.


Lastly you have to add your new language to the config file tmwweb/system/application/conf/tmw_conf.php. Just add your language to the array $_tmw_languages like shown below. The parameter 'dir' has to be the name of your added directory, e.g. 'german'. The parameter 'name' is the displayed string during login. This should be the native name of the language, like 'deutsch'.

Don't forget a comma to separate language arrays.

      $_tmw_languages = array( 
         array('dir'=>'english', 'name'=>'english'),
         array('dir'=>'german', 'name'=>'deutsch')
      );

Maintenance

The intention of tmwweb is to be a slim, administrative frontend for tmwserv. Therfor it is natural to use as much as data, information and configuration we can get from tmwserv. Because tmwserv makes extensive use of xml configuration files, which would be too expensive to parse on every page request, tmwweb uses different methods to cache those informations for faster access.

From time to time, if the data in tmwserv was modified, a admin user has to refresh the caches of tmwweb. Therefor you can find a menuoption "maintance" when logged in with an administrative account. This page shows you all caches and allows you to refresh them with a single click.

items.xml

Refreshing the items database is a bit special, thats why it is mentioned here additionally. To show the inventory of a character, the images of those items have to be available for a webbrowser. Therfore they have to reside somewhere under the DOCUMENT_ROOT of your webserver. To keep all things together, we decided to store them under ./images/items. When refreshing the items database, tmwweb looks in that directory and compares the images located there to all items in the database. If a image is missing, tmwweb tries to copy this image from your tmwdata path, you can configure in tmw_config.php (see chapter 2).

To copy those images, the webserver needs write permission to the images/items directory. If tmwweb can't find the image in the tmwdata directory is is not allowed to write to the ./images/items directory, the refresh procedure will show you a list with all missing images. Then you will have to copy those images yourself.