summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/common.php170
-rw-r--r--includes/conf/mysql.conf.php.example8
-rw-r--r--includes/email.php63
-rwxr-xr-xincludes/fetch-news.sh8
-rw-r--r--includes/libs/libmysql.php89
-rw-r--r--includes/libs/libstrutils.php10
-rw-r--r--includes/models/account.php114
-rw-r--r--includes/news.php24
8 files changed, 0 insertions, 486 deletions
diff --git a/includes/common.php b/includes/common.php
deleted file mode 100644
index ea8a63f..0000000
--- a/includes/common.php
+++ /dev/null
@@ -1,170 +0,0 @@
-<?php
-/* Main include file for TMW website, including header and footer
- * (c) 2005 Bjorn Lindeijer
- */
-
-define('TMWWEBSITE', true);
-
-function placeHeader($page_title)
-{
- echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>The Mana World - <?php echo $page_title; ?></title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <meta http-equiv="Content-Style-Type" content="text/css"/>
- <meta http-equiv="Content-Language" content="en"/>
- <link rel="icon" type="image/png" href="images/icon16.png"/>
- <meta name="description" content="The Mana World is a free MMORPG game for Linux, MacOS X and Windows"/>
- <meta name="keywords" content="The Mana World, Mana, World, MMORPG, RPG, free, GPL, Open Source, Pixel Art, 2D, Software Development, MacOSX, Windows, Linux, desktop, tablet, Game, 16-bit, Retro, Fantasy, 8-bit, Indie, Game Development, Game Engine, Open Source MMORPG"/>
- <meta name="author" content="The Mana World Dev Team"/>
- <meta name="globalsign-domain-verification" content="wfLgRJB6QP57zObNXrUNC-w-kN0x55jjXhQza9tnsx" />
- <link rel="stylesheet" type="text/css" href="default.css"/>
- </head>
- <body>
- <div style="margin-left: auto; margin-right: auto; max-width: 1350px;">
- <div id="page">
-
- <div id="irc_info">
- </div>
-
- <div id="title">
- <a href="/"><h1><span>The Mana World</span></h1></a>
- </div>
-
- <div id="main_topleft">
- <div id="main_rightrepeat">
- <div id="main_topright">
- <div id="main_bottomright">
- <div id="main">
-
- <div style="clear: both;"></div>
-
- <div id="sidebar">
- <div class="section_topleft">
- <div class="section_bottomleft">
- <div class="section_topright">
- <div class="section_bottomright">
- <div class="section">
- <ul>
- <li><a href="registration.php">Create Account</a></li>
- <li><a href="downloads.php">Downloads</a></li>
- <li><a href="news-feed.php">News</a></li>
- <li><a href="about.php">About</a></li>
- <li><a href="https://webchat.freenode.net/?channels=#themanaworld">Support (IRC)</a></li>
- <li><a href="https://wiki.themanaworld.org/">Wiki</a></li>
- <li><a href="https://forums.themanaworld.org/">Forums</a></li>
- <li><a href="https://wiki.themanaworld.org/index.php/FAQ">FAQ</a></li>
- <li><a href="https://wiki.themanaworld.org/index.php/Servers">Servers</a></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="section_topleft">
- <div class="section_bottomleft">
- <div class="section_topright">
- <div class="section_bottomright">
- <div class="section banners">
- Server status
- <iframe src="https://server.themanaworld.org/status.php" width="130" height="30" frameborder="0" scrolling="no"></iframe>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="section_topleft">
- <div class="section_bottomleft">
- <div class="section_topright">
- <div class="section_bottomright">
- <div class="section" style="text-align: center;">
- <a href="http://wiki.themanaworld.org/index.php/Screenshots"><img src="images/screenshot-thumb.png" alt="Screenshots" style="border: 1px solid #784f3f;"/></a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="section_topleft">
- <div class="section_bottomleft">
- <div class="section_topright">
- <div class="section_bottomright">
- <div class="section">
- <ul>
- <li><a href="https://plus.google.com/114523926767095095371">Google+</a></li>
- <li><a href="https://www.facebook.com/themanaworld">Facebook</a></li>
- <li><a href="https://github.com/themanaworld">Github</a></li>
- <li><a href="http://www.spi-inc.org/projects/tmw/">SPI Associated Project</a></li>
- <li><a href="http://www.gnu.org/copyleft/gpl.html"><img src="images/gpl.png" alt="GPLed project"/></a></li>
- <li><a href="http://manaplus.org" target="_blank">ManaPlus</a></li>
- <li><a href="http://www.mapeditor.org/" target="_blank">Tiled</a></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- This empty div fixes a rendering issue with IE 7 -->
- <div></div>
- </div> <!-- /sidebar -->
- <div id="contents_leftrepeat">
- <div id="contents_topleft">
- <div id="contents_bottomleft">
- <div id="contents_rightrepeat">
- <div id="contents_topright">
- <div id="contents_bottomright">
- <div id="contents">
-
- <div class="main_title_topright">
- <div class="main_title_bottomright">
- <div class="main_title_topleft">
- <h2><?=$page_title?></h2>
- </div>
- </div>
- </div>
-<?php
-}
-
-function placeFooter()
-{
-?>
- <div style="clear: both"></div>
-
- </div> <!-- /contents -->
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </div> <!-- /main -->
- </div>
- </div>
- </div>
- </div>
-
- <div id="footer">
- &copy; 2004-2011 The Mana World Dev Team -
- [<a href="http://validator.w3.org/check?uri=referer">xhtml</a>] [<a href="http://jigsaw.w3.org/css-validator/check/referer">css</a>]
- </div>
- </div> <!-- /page -->
- </div>
-<!-- Google Tag Manager -->
-<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-5KTWGJ"
-height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
-<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
-new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
-j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
-'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
-})(window,document,'script','dataLayer','GTM-5KTWGJ');</script>
-<!-- End Google Tag Manager -->
- </body>
-</html>
-<?php
-}
-
-?>
diff --git a/includes/conf/mysql.conf.php.example b/includes/conf/mysql.conf.php.example
deleted file mode 100644
index d0122d5..0000000
--- a/includes/conf/mysql.conf.php.example
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-
- $conf['mysql_hostname'] = "localhost";
- $conf['mysql_database'] = "test";
- $conf['mysql_username'] = "test";
- $conf['mysql_password'] = "test123";
-
-?> \ No newline at end of file
diff --git a/includes/email.php b/includes/email.php
deleted file mode 100644
index 6184d56..0000000
--- a/includes/email.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-// Email Template Header
-// Image Mapped for Html Email
-// Base/Default Links
-function getEmailTemplate($emailText) {
- $boundary = uniqid('np');
- $headers .= "MIME-Version: 1.0\r\nContent-type: multipart/alternative;boundary=".$boundary."\r\n";
- $data = "This is a MIME encoded message.";
-
- $data .= "\r\n\r\n--" . $boundary . "\r\n";
- $data .= "Content-type: text/plain;charset=utf-8\r\n\r\n";
- $data .= "###############################################################\n";
- $data .= "# ___________.__ _____ #\n";
- $data .= "# \__ ___/| |__ ____ / \ ____ ____ ____ #\n";
- $data .= "# | | | | \_/ __ \ / \ / \ \__ \ / __ \ \__ \ #\n";
- $data .= "# | | | Y \ ___/ / Y \/ __ \| | \ \/ __ \_ #\n";
- $data .= "# |____| |___|__/\____> \____|____(______/__| \(______/ #\n";
- $data .= "# __ __ .__ .___ #\n";
- $data .= "# / \ / \___________| | __| _/ #\n";
- $data .= "# \ \/\/ / _ \_ __ \ | / __ | #\n";
- $data .= "# \ ( <_> ) | \/ |__/ /_/ | #\n";
- $data .= "# \__/\ / \____/|__| |____/\____ | #\n";
- $data .= "# \/ \/ #\n";
- $data .= "# #\n";
- $data .= "###############################################################\n";
- $data .= $emailText;
-
- $data .= "\r\n\r\n--" . $boundary . "\r\n";
- $data .= "Content-type: text/html;charset=utf-8\r\n\r\n";
-
- $data .= '<html><body>
-<img id="Image-Maps-Com-image-maps-2014-05-22-121954" src="https://www.themanaworld.org/images/TMW-email-temaplate-mailer.png" border="0" width="640" height="272" orgWidth="640" orgHeight="272" usemap="#image-maps-2014-05-22-121954" alt="" />
-<map name="image-maps-2014-05-22-121954" id="ImageMapsCom-image-maps-2014-05-22-121954">
-<area alt="Home Page" title="The Mana World" href="https://www.themanaworld.org/" shape="rect" coords="0,0,197,201" style="outline:none;" target="_self" />
-<area alt="Home Page" title="The Mana World" href="https://www.themanaworld.org/" shape="rect" coords="197,0,465,168" style="outline:none;" target="_self" />
-<area alt="Official Client Mana Plus" title="Official Client Mana Plus" href="http://manaplus.org" shape="rect" coords="465,0,640,168" style="outline:none;" target="_self" />
-<area alt="The Mana World News" title="The Mana World News" href="https://www.themanaworld.org/index.php" shape="rect" coords="196,168,275,201" style="outline:none;" target="_self" />
-<area alt="The Mana World Wiki" title="The Mana World Wiki" href="https://wiki.themanaworld.org/index.php/Main_Page" shape="rect" coords="274,168,375,201" style="outline:none;" target="_self" />
-<area alt="The Mana World Forums" title="The Mana World Forums" href="https://forums.themanaworld.org/" shape="rect" coords="372,168,490,201" style="outline:none;" target="_self" />
-<area alt="The Mana World Support (IRC)" title="The Mana World Support (IRC)" href="https://webchat.freenode.net/?channels=#themanaworld" shape="rect" coords="488,168,640,201" style="outline:none;" target="_self" />
-<area alt="About The Mana World" title="About The Mana World" href="https://www.themanaworld.org/about.php" shape="rect" coords="0,201,84,272" style="outline:none;" target="_self" />
-<area alt="Creative Commons" title="Creative Commons" href="http://creativecommons.org/" shape="rect" coords="84,201,121,272" style="outline:none;" target="_self" />
-<area alt="GNU General Public License" title="GNU General Public License " href="http://www.gnu.org/copyleft/gpl.html" shape="rect" coords="121,201,155,272" style="outline:none;" target="_self" />
-<area alt="Open Source Initiative" title="Open Source Initiative" href="http://opensource.org/" shape="rect" coords="155,202,189,272" style="outline:none;" target="_self" />
-<area alt="The Mana World on Facebook" title="The Mana World on Facebook" href="https://www.facebook.com/themanaworld" shape="rect" coords="191,204,308,272" style="outline:none;" target="_self" />
-<area alt="The Mana World on G+" title="The Mana World on G+" href="https://plus.google.com/+TheManaWorldOrg" shape="rect" coords="310,204,344,272" style="outline:none;" target="_self" />
-<area alt="The Mana World on Youtube" title="The Mana World on Youtube" href="https://www.youtube.com/user/TheManaWorld" shape="rect" coords="345,203,379,271" style="outline:none;" target="_self" />
-<area alt="Official Client Mana Plus" title="Official Client Mana Plus" href="http://manaplus.org" shape="rect" coords="382,203,501,272" style="outline:none;" target="_self" />
-<area alt="Mac OS Downloads" title="Mac OS Downloads" href="http://download.evolonline.org/manaplus/macosx/" shape="rect" coords="502,203,537,272" style="outline:none;" target="_self" />
-<area alt="Windows Installer" title="Windows Installer" href="http://manaplus.org/windowsinstaller" shape="rect" coords="537.8000001907349,202.8000030517578,572.8000001907349,271.8000030517578" style="outline:none;" target="_self" />
-<area alt="Linux Versions" title="Linux Versions" href="http://manaplus.org/" shape="rect" coords="575,203,640,272" style="outline:none;" target="_self" />
-<area shape="rect" coords="638,270,640,272" alt="Image Map" style="outline:none;" title="Image Map" href="http://www.image-maps.com/index.php?aff=mapped_users_0" />
-</map>
-'.nl2br($emailText).'
-<div style="font-size:10px;">
- &copy; 2004-2014 The Mana World
-</div>
-</body>
-</html>';
- $data .= "\r\n\r\n--" . $boundary . "--";
- return array($headers,$data);
-}
-?>
diff --git a/includes/fetch-news.sh b/includes/fetch-news.sh
deleted file mode 100755
index 5cc9ea5..0000000
--- a/includes/fetch-news.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# Fetches project news and saves it for local use.
-#
-
-/usr/bin/wget -q -O /home/tmw/public_html/www/includes/rss2_projnews.tmp 'http://sourceforge.net/export/rss2_projnews.php?group_id=106790&rss_fulltext=1' > /dev/null
-/bin/mv -f /home/tmw/public_html/www/includes/rss2_projnews.tmp \
- /home/tmw/public_html/www/includes/rss2_projnews.cache
diff --git a/includes/libs/libmysql.php b/includes/libs/libmysql.php
deleted file mode 100644
index 5a3a06c..0000000
--- a/includes/libs/libmysql.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
-require_once "includes/conf/mysql.conf.php";
-
-class Database
-{
- // implement singleton pattern
- static private $instance = null;
-
- private $conn;
-
- static public function getInstance()
- {
- if (null === self::$instance)
- {
- self::$instance = new self;
- }
- return self::$instance;
- }
-
- // ctor
- private function __construct()
- {
- global $conf;
- $this->conn = mysql_connect( $conf['mysql_hostname'],
- $conf['mysql_username'],
- $conf['mysql_password'] )
- or die ("Connection to database failed!" . mysql_error());
-
- mysql_select_db( $conf['mysql_database'], $this->conn )
- or die ("Selection of database failed! " . mysql_error());
- }
-
- private function checkConnect()
- {
- if (!isset($this->conn))
- {
- die("Not connected to database");
- }
- }
-
- // returns the value in the first row and column
- public function getValue( $sql )
- {
- $this->checkConnect();
-
- $res = mysql_query( $sql, $this->conn );
- if (!$res)
- {
- die('Error while calling database: ' . mysql_error());
- }
- $vals = mysql_fetch_row( $res );
- mysql_free_result( $res );
- return $vals[0];
- }
-
- // executes some sql and returns affected rows
- public function exec( $sql )
- {
- $this->checkConnect();
-
- $res = mysql_query( $sql, $this->conn );
- if (!$res)
- {
- die('Error while calling database: ' . mysql_error());
- }
- $numrows = mysql_affected_rows( $this->conn );
- return $numrows;
- }
-
- public function escape( $string )
- {
- $this->checkConnect();
-
- return mysql_real_escape_string( $string, $this->conn );
- }
-
- public function disconnect()
- {
- if ( mysql_ping( $this->conn ) )
- {
- mysql_close( $this->conn );
- }
- }
-
-}
-
-
-?> \ No newline at end of file
diff --git a/includes/libs/libstrutils.php b/includes/libs/libstrutils.php
deleted file mode 100644
index ee81c33..0000000
--- a/includes/libs/libstrutils.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
- define("BAD_STRING_DESC", "Only alphanumeric characters are allowed.");
-
- function check_chars($string)
- {
- return ctype_alnum($string) && (strpos($string, '"') === FALSE);
- }
-
-?>
diff --git a/includes/models/account.php b/includes/models/account.php
deleted file mode 100644
index ef253c6..0000000
--- a/includes/models/account.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-
-require_once "includes/libs/libstrutils.php";
-
-class TMWAccount
-{
- const ACCOUNT_TBL = "tmw_accounts";
-
- const GENDER_MALE = 1;
- const GENDER_FEMALE = 2;
-
- const STATE_PENDING = 0;
- const STATE_CREATED = 0;
- const STATE_FAILED = 0;
-
- private $id;
- private $username;
- private $password;
- private $email;
- private $gender;
- private $state;
- private $registration;
-
- public static function getAccountCount()
- {
- $db = Database::getInstance();
- $sql = "SELECT COUNT(*) FROM " . TMWAccount::ACCOUNT_TBL;
- return $db->getValue( $sql );
- }
-
- public static function existsUsername($str)
- {
- $db = Database::getInstance();
- $sql = sprintf("SELECT COUNT(*) FROM " . TMWAccount::ACCOUNT_TBL .
- " WHERE USERNAME = '%s'", $db->escape($str));
- return ($db->getValue($sql) == 1);
- }
-
- public function setUsername($name){ $this->username = $name; }
- public function setPassword($pwd){ $this->password = $pwd; }
- public function setEMail($email){ $this->email = $email; }
- public function setGender($gender){ $this->gender = $gender; }
-
- public function validate()
- {
- $errors = array();
-
- // check here for correct values..
- if (strlen($this->username) < 4)
- $errors[] = "Username is too short";
-
- if (strlen($this->username) >= 24)
- $errors[] = "Username is too long";
-
- if (strlen($this->password) < 4)
- $errors[] = "Password is too short";
-
- if (strlen($this->password) >= 24)
- $errors[] = "Password is too long";
-
- if (strlen($this->email) < 4)
- $errors[] = "EMail is too short";
-
- if (strlen($this->email) >= 40)
- $errors[] = "EMail is too long";
-
- if (!check_chars($this->username))
- $errors[] = 'Username contains invalid characters. ' . BAD_STRING_DESC;
-
- if (!check_chars($this->password))
- $errors[] = 'Password contains invalid characters. ' . BAD_STRING_DESC;
-
- if ($this->gender != TMWAccount::GENDER_MALE &&
- $this->gender != TMWAccount::GENDER_FEMALE )
- {
- $errors[] = 'Gender has to be Male or Female!';
- }
-
- if (!filter_var($this->email, FILTER_VALIDATE_EMAIL))
- {
- $errors[] = 'EMail has wrong format.';
- }
-
-
- // returns true if everything is fine ( test with === true)
- if (count($errors) == 0)
- {
- return true;
- }
- else
- {
- return $errors;
- }
- }
-
-
-
- public function storeAccount()
- {
- $db = Database::getInstance();
- $sql = sprintf( "INSERT INTO " . TMWAccount::ACCOUNT_TBL .
- " (USERNAME, PASSWORD, EMAIL, GENDER) " .
- "VALUES ('%s', '%s', '%s', %d) ",
- $db->escape($this->username),
- $db->escape($this->password),
- $db->escape($this->email),
- $this->gender);
-
- $rows = $db->exec( $sql );
- return ( $rows == 1 );
- }
-}
-
-?>
diff --git a/includes/news.php b/includes/news.php
deleted file mode 100644
index 791e3c4..0000000
--- a/includes/news.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-// Parses news.html
-// returns feed
-
-function printNews($num='all') {
- $count = 0;
- $content = "";
- $handle = @fopen("news.html", "r");
- if ($handle) {
- while (($buffer = fgets($handle, 4096)) !== false) {
- $content .= $buffer;
- if (preg_match('/<\/div>/',$buffer)) {
- $count++;
- }
- if ($count == $num && $num != 'all') {
- $content .= '<div class="read-more"><a class="more" href="/news-feed.php">More News >></a></div>';
- break 1;
- }
- }
- }
- fclose($handle);
- return $content;
-}
-?>