Skip to content
This repository

SuperTuxKart Addons Website

branch: master

This is a fix for issue #16.

Activation links should be sent out correctly now. Now the mail uses the
SITE_ROOT from the config file instead of the domain taken from the url
in the address bar.
latest commit cbb2cd8825
Sebastiaan Provost LeShadow authored stephenjust committed
Octocat-spinner-32 api Fixed small error in the remove-friend API call. March 15, 2014
Octocat-spinner-32 cron Refactoring in Log class December 30, 2013
Octocat-spinner-32 css Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 docs [stkaddons] Commit all changes to addons website to-date March 30, 2011
Octocat-spinner-32 image Remove unused images February 02, 2014
Octocat-spinner-32 include This is a fix for issue #16. March 24, 2014
Octocat-spinner-32 js Remove some unused javascript code March 08, 2014
Octocat-spinner-32 json Remove unused resources January 12, 2014
Octocat-spinner-32 locale [stkaddons] Update Translations January 26, 2013
Octocat-spinner-32 reports Remove dependence of reports on sql.php, December 28, 2013
Octocat-spinner-32 tpl Fixed double site_root in header.tpl March 10, 2014
Octocat-spinner-32 .gitignore Remove dependence on sql.php from stats module December 31, 2013
Octocat-spinner-32 COPYING (stkaddons) Adding stkaddons' code January 30, 2010
Octocat-spinner-32 CREDITS Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 README.md Fix DEBUG_MODE constant use February 28, 2014
Octocat-spinner-32 about.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 addons-panel.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 addons.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 apple-touch-icon-114x114-precomposed.png [stkaddons] Minor locale fix, fix to xml to prevent a warning in-game… July 20, 2012
Octocat-spinner-32 apple-touch-icon-72x72-precomposed.png [stkaddons] Minor locale fix, fix to xml to prevent a warning in-game… July 20, 2012
Octocat-spinner-32 apple-touch-icon.png [stkaddons] Minor locale fix, fix to xml to prevent a warning in-game… July 20, 2012
Octocat-spinner-32 check_server_deps.php [stkaddons] Use PEAR::Mail for sent messages August 04, 2012
Octocat-spinner-32 config-base.php This is a fix for issue #16. March 24, 2014
Octocat-spinner-32 download.php Prevent inconsistencies in download statistics December 30, 2013
Octocat-spinner-32 error.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 generate_xml.php [stkaddons] Rewrote "access denied" page to be less annoying to code … September 26, 2012
Octocat-spinner-32 htaccess.example [stkaddons] Commit the htaccess file we've been using July 20, 2012
Octocat-spinner-32 image.php [stkaddons] Rewrote "access denied" page to be less annoying to code … September 26, 2012
Octocat-spinner-32 include.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 index.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 login.php Add method to StkTemplate to set meta refresh February 01, 2014
Octocat-spinner-32 manage-panel.php Refactor some code into News class January 02, 2014
Octocat-spinner-32 manage.php Refactored news creation into News class January 02, 2014
Octocat-spinner-32 music.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 password-reset.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 privacy.php Refactor template code to be more flexible February 01, 2014
Octocat-spinner-32 register.php User registration page now uses template February 01, 2014
Octocat-spinner-32 table.sql Update SQL February 24, 2014
Octocat-spinner-32 upload.php Complete transition to configurable include dir December 30, 2013
Octocat-spinner-32 users-panel.php Refactoring of coreUsers.php, removed old mysql dependency March 03, 2014
Octocat-spinner-32 users.php Refactoring of coreUsers.php, removed old mysql dependency March 03, 2014
README.md

STK Addons Website

This is the source code for the SuperTuxKart asset sharing and distribution platform. The official location of the operating website is http://www.stkaddons.net/.

Installing Locally

This software has no automated installation mechanism as it is not intended for wide usage. However, you can manually generate all of the necessary database tables and configuration settings manually.

Before you attempt to set up a local installation, you should run check_server_deps.php on your web server. This will check to make sure that several dependencies can be found. There may be other dependencies not tested by that script, but that should be enough to get started.

Dependencies include:

  • PEAR::Mail
  • PHP's gd module
  • PHP's PDO module
  • PHP's MySQL module (in the process of removing)
  • PHP's gettext module
  • Smarty Template Engine

You can generate the database tables, procedures, and relations by using a tool such as PHPMyAdmin to import the table.sql file found in the repository. You may need to edit the provided SQL file, as it assumes a table prefix of 'v2_' and a database username of 'stkaddons_stkbase'.

On your web server, you must edit the provided config-base.php to match your database and system configuration. Save this file as config.php. Enable the debugging mode in the configuration file to assist with resolving any errors.

Download Smarty (http://www.smarty.net/) and make sure it is located in your PHP include path, as directed by the PHP errors that will appear if Smarty cannot be found. Any 3.1.x version should work.

Register a new user using the web interface. Don't worry about configuring your SMTP server. After creating your user from the web interface, use a tool such as PHPMyAdmin to change that user's role to 'root', and set their 'active' value to 1. You can delete the relevant row in the 'verifications' table.

The source tree contains an 'api' folder. On the production STK Addons server, these files exist in a separate sub-domain. For testing on a local machine, you may wish to copy these files to the parent folder if you intend to test API functionality.

About the Code

The STKAddons source code tree has grown somewhat organically over the years. There are many places where the source could be cleaned up.

There are a number of ongoing refactoring projects within the code-base:

  • Converting all database calls to use PDO rather than mysqli, through the DBConnection class. It is intended to eventually remove sql.php completely. Transactions should be used where applicable.
  • Making use of a template engine for all UI code. The first version of STKAddons had html baked right into the PHP code, and this is generally considered bad practice. I (Stephen) have been trying to slowly weed that out and move to template files for everything, so that we might offer customizable themes or a mobile UI for example.

There are also a number of particularly ugly sections of code which need major refactoring:

  • Addon Upload: This is probably the most convoluted process in the entire system. There is a lot of validation that is performed, and many many code paths lumped into one hastily written class. I have not yet had the courage to wade through this code and fix it. The Upload class could very likely be refactored into several smaller classes based on the type of operation being performed.
Something went wrong with that request. Please try again.