Standard Page Structure

Download example page code.

  • Please strictly follow the example page.
  • Simutransltor is (trying to be) XHTML strcit W3C compatible, please design your html code so.
  • Please try to distinguish html output functions and data processing functions.

This header will specify document type, encoding (UTF-8), it will handle the session, open the connection to the database, do security procedures, print the page header (both html header and translator header).

The page title should be the name of your module or something similar and closer specification of current position in it if necessary (for example: Text Importer - Step 2/3; Text Editor - Object: RES_05_05). The page name should clearly tell the visitor where he or she is. Any other heading on the page should be of the type h2 or lower!

Then you can include the code of your page. Please abstain from definitions of font colors and sizes in your php file! Try to use predefined styles and classes from css style. If you need some css positioning on your site, you can put it to the page_file_name.css file in the include directory. This file will be included by the header. Try to use this file for positioning only, all text styles should be defined in the style.css and should be common for all pages.

When you want to return your visitor back to the translator root, send him to the main.php (in script directory). This is important, because index.php is used for logging in. User who is already logged in will be redirected to main, but unknown user will be asked for login again (which might be annoying).

File include/dblib.php offers wrappers for PHP MySQL database access functions, try to use those when possible. This is used to provide some level of abstraction in the case thet different databes will be used. There are also a higher level db functions defined useful specially for SimuTranslator environment.

File include/object.php defines PHP class holding complete Simutrans object (read from the dat file or databaase). Try to use this class for manipulation with objects to ensure consistency and also allow easy upgrading in the case when object definition changes.

 
   
   
   
 



SimuTranslator: ©2004-2005 SimuTranslator Team
Documentation: ©2004-2005 Tomáš Kubeš
SimuTranslator documentation home