public function renderSidebar()
 {
     global $event, $signups, $db;
     if (!Session::hasPriv('FORCE_SIGNUPS')) {
         return;
     }
     if (!isset($event) || empty($signups)) {
         return;
     }
     $sql = 'SELECT u.id, u.username FROM plugin_regulars r INNER JOIN users u ON r.user = u.id WHERE r.user NOT IN (SELECT s.user FROM signups s WHERE s.event = :eventId) ';
     $stmt = $db->prepare($sql);
     $stmt->bindValue(':eventId', $event['id']);
     $stmt->execute();
     $regularUsers = $stmt->fetchAll();
     startBox();
     if (count($regularUsers) > 0) {
         echo '<p>The following regulars are not signed up:</p> ';
         echo '<ul>';
         foreach ($regularUsers as $user) {
             echo '<li><a href = "profile.php?id=' . $user['id'] . '">' . $user['username'] . '</a> (<span class = "dummyLink" onclick = "document.getElementById(\'username\').value = \'' . $user['username'] . '\'" >force</span>)</li>';
         }
         echo '</ul>';
     } else {
         echo 'All the regulars are signed up to this event!';
     }
     echo '<p><a href = "plugins.php">Plugin admin</a></p>';
     stopBox('Regulars');
 }
Beispiel #2
0
        $title = "Add shop item";
        require_once "includes/widgets/header.php";
        message(TYPE_ERROR, "Invalid turns field.");
    }
    if ($_GET['type'] == "SLAVE") {
        $sql = "INSERT INTO `slaves` (`name`, `gold` ) VALUES ('" . $_GET['name'] . "', '" . $_GET['gold'] . "')";
    } else {
        $sql = "INSERT INTO `shop` (`type`, `name`, `gold`, `turns`, `description`) VALUES ('" . $_GET['type'] . "', '" . $_GET['name'] . "', '" . $_GET['gold'] . "', '" . $_GET['turns'] . "', '" . $_GET['type'] . "' )";
    }
    $stmt = DatabaseFactory::getInstance()->prepare($sql);
    $stmt->execute();
    $core->redirect('admin.php', "Item added successfully.");
}
$title = "Add shop item";
require_once "includes/widgets/header.php";
startBox($title, BOX_GREEN);
?>

<form action = "adminShopAddItem.php">
<label>Type <select name = "type">
	<option>BUSINESS</option>
	<option>SLAVE</option>
	<option>ACCESSORY</option>
</select></label><br /><br />
<label>Name <input name = "name" /></label><br /><br />
<label>Gold <input name = "gold" /></label><br /><br />
<label>Turns <input name = "turns" /></label><br /><br />
<label>Description<br /><textarea name = "description"></textarea></label><br /><br />
<input type = "submit" name = "submit" value = "add" />
</form>
Beispiel #3
0
$title = "index";
require_once "includes/widgets/header.php";
$sql = "SELECT `id`, `username`, `registered`, `gold` FROM `users`";
$result = $db->query($sql);
while ($currentUser = $result->fetchRow()) {
    $turns = getTurns($currentUser['username']);
    $ranking = intval($turns['total'] * $currentUser['gold'] / 10000);
    $currentUser['ranking'] = $ranking;
    $leader_array[] = $currentUser;
}
$ranking = array();
foreach ($leader_array as $key => $row) {
    $ranking[$key] = $row['ranking'];
}
array_multisort($ranking, SORT_DESC, $leader_array);
startBox("About the leaderboard", BOX_YELLOW);
echo "This is a list of the current 30 best players, ordered by ";
popup("ranking", "help.php?topic=rankings");
echo ". There are proberbly lots of other players, but they dont qualify for the leaderboard, yet.";
echo "<br /><br />";
stopBox(BOX_YELLOW);
?>

<table class = "normal">
<tr>
	<th style = 'width: 10%;'>ranking</th>
	<th>username</th>
	<th style = 'width: 20%;'>gold</th>
	<th style = 'width: 20%;'>registerd</th>
</tr>
Beispiel #4
0
    $sql = "UPDATE `users` SET `gold` = (`gold` + '" . $_GET['transfur'] . "' ) WHERE `username` = '" . $_GET['user'] . "' ";
    $result = db_query($sql);
    $sql = "UPDATE `users` SET `gold` = (`gold` - '" . $_GET['transfur'] . "' ) WHERE `username` = '" . $_SESSION['username'] . "' ";
    $result = db_query($sql);
    echo mysql_error();
    redirect("Money transfured", "viewuser.php?user="******"index";
require_once "includes/widgets/header.php";
$sql = 'SELECT * FROM `users` WHERE `id` = "' . $_REQUEST['user'] . '" LIMIT 1';
$result = $db->query($sql);
if ($result->numRows() == 0) {
    $tpl->error("User not found.");
}
while ($row = $result->fetchRow()) {
    startBox($row['username'], BOX_GREEN);
    echo "<strong>Gold:</strong> " . $row['gold'] . "<br />";
    $temp = get_turns($row['username']);
    $total_turns = intval($temp['total_turns']);
    echo "<strong>Total Turns</strong>: {$total_turns} <br/>";
    echo "<strong>Slaves owned</strong>";
    $result2 = $db->query("SELECT * FROM slaves WHERE user = '******'username'] . "'");
    echo "<ul>";
    if ($result2->numRows() == 0) {
        echo "<li>No slaves owned.</li>";
    } else {
        while ($row2 = mysql_fetch_array($result2)) {
            popup("<li>" . $row2['name'] . "</li>", "view_slave.php?slave= " . $row2['name']);
        }
    }
    echo "</ul>";
function redirect($url, $reason, $showRedirectionPage = true, $karma = 0)
{
    define('REDIRECT', $url);
    if (!$showRedirectionPage) {
        SessionBasedNotifications::getInstance()->add($reason, $karma);
        define('REDIRECT_TIMEOUT', 0);
    } else {
        define('REDIRECT_TIMEOUT', 3);
    }
    require_once 'includes/widgets/header.minimal.php';
    echo '<br />';
    startBox();
    echo '<p>You are being redirected to <a href = "' . $url . '">here</a>.</p>';
    stopBox('Redirecting: ' . $reason);
    require_once 'includes/widgets/footer.minimal.php';
}
Beispiel #6
0
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with pFrog; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*******************************************************************************/
require_once 'includes/common.php';
$title = "index";
require_once "includes/widgets/header.php";
use libAllure\Session;
if (Session::isLoggedIn()) {
    startBox("Hello again!", BOX_GREEN);
    echo "Welcome back, " . Session::getUser()->getUsername() . ".";
    stopBox(BOX_GREEN);
    $sql = "SELECT * FROM `hints` ORDER BY rand() LIMIT 1 ";
    $result = $db->query($sql);
    $hint = $result->fetchRow();
    startBox("Random Game Hint #" . $hint['id'], BOX_YELLOW);
    echo $hint['content'];
    stopBox(BOX_YELLOW);
} else {
    echo "tycoonism is a free online role playing game, ( rpg for short ). The objectives of the game are as follows: ";
    echo "<ul>";
    echo "<li>Try to become the richest player in the game.</li>";
    echo "<li>The richer you become, within the smallest time as possible will give you good rankings.</li>";
    echo "<li>You play as a 'tycoon'. Earn lots of money while you get one up on your fellow players.</li>";
    echo "</ul>";
}
require_once "includes/widgets/footer.php";
Beispiel #7
0
        break;
    case 'delete':
        if (!Session::hasPriv('NEWS_DELETE')) {
            throw new PermissionException();
        }
        $id = intval($_REQUEST['id']);
        $sql = 'DELETE FROM news WHERE id = :id ';
        $stmt = $db->prepare($sql);
        $stmt->bindValue(':id', $id);
        $stmt->execute();
        logAndRedirect('news.php', 'News deleted: ' . $id);
        break;
    default:
        require_once 'includes/widgets/header.php';
        require_once 'includes/widgets/sidebar.php';
        $news = new News();
        $news->setCount(10);
        while ($article = $news->getNext()) {
            startBox();
            echo '<p><span class = "subtle">Posted on ' . formatDt(new DateTime($article['date'])) . ' by <a href = "profile.php?id=' . $article['author'] . '">' . $article['username'] . '</a>.</span></p>';
            echo htmlify($article['content']);
            if (Session::hasPriv('NEWS_DELETE')) {
                echo '<dl class = "subtle">';
                echo '<dt><a href = "news.php?action=delete&amp;id=' . $article['id'] . '">Delete</a></dt>';
                echo '<dt><a href = "news.php?action=edit&amp;id=' . $article['id'] . '">Edit</a></dt>';
                echo '</dl>';
            }
            stopBox(htmlify($article['title'], false));
        }
}
require_once 'includes/widgets/footer.php';
Beispiel #8
0
$bankgold = $bankgold_original / 100;
$percent = $bankgold * 10;
$bankgold = $bankgold_original + $percent;
echo $bankgold;
echo "</strong> gold in the bank";
stopBox(BOX_YELLOW);
?>
<table class = "normal">
<tr>
	<th>deposit</th>
	<th>withdraw</th>
</tr>
<tr>
	<td>
	How much would you like to deposit?
	<form><input name = "amount">&nbsp;<input type = "submit" name = "submit" value = "deposit"></form>
	</td>

	<td>
	How much would you like to withdraw?
	<form><input name = "amount" />&nbsp;<input type = "submit" name = "submit" value = "withdraw"></form>
	</td>
</tr>
</table>
<?php 
if ($user->getData('gold') <= 0) {
    startBox('Uh oh...', BOX_RED);
    echo "You are a bankrupt tycoon.";
    stopBox(BOX_RED);
}
require_once "includes/widgets/footer.php";
Beispiel #9
0
  You should have received a copy of the GNU General Public License
  along with pFrog; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*******************************************************************************/
require_once "includes/common.php";
$title = "slaves";
require_once "includes/widgets/header.php";
$sql = "SELECT * FROM slaves WHERE `user` = '" . \libAllure\Session::getUser()->getUsername() . "'";
$result = $db->query($sql);
$slaves = $result->numRows();
startBox("Slaves", BOX_GREEN);
echo "You currently have <strong>" . $slaves . "</strong> slaves.";
echo "<ul>";
while ($row = $result->fetchRow()) {
    popup("<li>" . $row['name'] . "</li>", "view_slave.php?slave=" . $row['name']);
}
echo "</ul>";
stopBox(BOX_GREEN);
$sql = 'SELECT * FROM slaves WHERE user = ""';
$result = $db->query($sql);
if ($result->numRows() == 0) {
    startBox("Slave Shop", BOX_RED);
    echo "There are are not any slaves for sale.";
} else {
    startBox("Slave Shop", BOX_GREEN);
    echo "There are <strong>" . count_rows($result) . "</strong> slaves for sale. <a href = shop.php?mode=slaves>buy some</a>.";
}
stopBox(BOX_NULL);
require_once "includes/widgets/footer.php";
Beispiel #10
0
    $result = db_query($sql);
    $clan = mysql_fetch_array($result);
    if ($clan['password'] == md5($_GET['password'])) {
        $sql = "UPDATE `tycoonism_users` SET `clan` = '" . $clan['name'] . "' WHERE `username` = '" . $_SESSION['username'] . "'";
        $result = db_query($sql);
        redirect("Clan Joined.", "clans.php");
    } else {
        redirect("Password incorrect.", "clans.php");
    }
}
$title = "clans";
require_once "includes/widgets/header.php";
startBox("About Clans", BOX_YELLOW);
echo "Clans are groups of players that play the game together. It makes\nfor strong forces. Most clans have certain requirements that you must\nmeet before you can join. You can only be in one clan at a time.";
stopBox(BOX_YELLOW);
startBox("Join a clan", BOX_GREEN);
$sql = "SELECT * FROM `clans`";
$result = $db->query($sql);
if (mysql_error() || $result->numRows() == 0) {
    echo "No clans found.";
} else {
    echo "<form action = \"clans.php\">";
    echo "<label>Clan <select name = \"clan\">";
    while ($clan = mysql_fetch_array($result)) {
        echo "\t<option>" . $clan['name'] . "</option>\n";
    }
    echo "</select></label><br /><br />";
    echo "<label>password <input name = \"password\" type = \"password\"/></label><br /><br />";
    echo "<input type = \"submit\" value = \"join\" />";
    echo "</form>";
}
Beispiel #11
0
        while ($row = $result->fetchRow()) {
            echo "<tr>";
            echo "<td>";
            popup($row['name'], "view_slave.php?slave=" . $row['name']);
            echo "</td><td>";
            echo $row['gold'];
            echo "</td>";
            echo "</tr>";
        }
    }
    echo "</table>\n";
    stopBox(BOX_GREEN);
}
if ($display['accessorys']) {
    $sql = "SELECT * FROM pfrog_shop WHERE type = 'ACCESSORY'";
    $result = $db->query($sql);
    if ($result->numRows() == 0) {
        startBox("Accessorys", BOX_RED);
        echo "<ul>\n";
        echo "\t<li>Sorry, no accessorys for someone such as yourself are avalible.</li>\n";
    } else {
        startBox("Accessorys", BOX_GREEN);
        echo "<ul>\n";
        while ($row = mysql_fetch_array($result)) {
            popup("\t<li>" . $row['name'] . "</li>\n", "shop_item.php?item=" . $row['name']);
        }
    }
    echo "</ul>\n";
    stopBox(BOX_GREEN);
}
require_once "includes/widgets/footer.php";
Beispiel #12
0
  This file is part of pFrog.

  pFrog is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  pFrog is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with pFrog; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*******************************************************************************/
require_once "includes/common.php";
$title = "slaves";
require_once "includes/widgets/header.php";
$sql = "SELECT * FROM activitys";
$result = $db->query($sql);
startBox("Activities", BOX_GREEN);
echo "<ul>";
while ($activity = $result->fetchRow()) {
    popup("<li>" . $activity['name'] . "</li>", "do_activity.php?activity=" . $activity['name']);
}
echo "</ul>";
stopBox(BOX_GREEN);
require_once "includes/widgets/footer.php";
Beispiel #13
0
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with pFrog; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*******************************************************************************/
require_once "includes/common.php";
$title = "index";
require_once "includes/widgets/header.php";
startBox("Advisors", BOX_GREEN);
echo "<ul>";
popup("<li>Financial</li>", "advisors.php?advisor=financial");
popup("<li>Business</li>", "advisors.php?advisor=business");
popup("<li>Rankings</li>", "advisors.php?advisor=rankings");
popup("<li>Slaves</li>", "advisors.php?advisor=slaves");
echo "</ul>";
stopBox(BOX_GREEN);
startBox("Other Players...", BOX_GREEN);
$sql = "SELECT * FROM users";
$result = $db->query($sql);
echo "<ul>";
while ($row = $result->fetchRow()) {
    echo "<li><a href = viewuser.php?user="******">" . $row['username'] . "</a></li>";
}
echo "</ul>";
stopBox(BOX_GREEN);
//echo "Checkout the <a href = leaderboard.php>leaderboard</a>?";
require_once "includes/widgets/footer.php";
Beispiel #14
0
require_once "includes/widgets/header.php";
if (!\libAllure\Session::hasPriv('VIEW_ADMIN')) {
    redirect('index.php', 'You do not have the privileges to see this.');
}
if (isset($_GET['toggle'])) {
    if (inAdminMode()) {
        $_SESSION['admin_mode'] = false;
    } else {
        $_SESSION['admin_mode'] = true;
    }
}
startBox("Toggle admin mode", BOX_RED);
echo "If you are an admin, and want to play the game via this account, admin mode might get in the way. You can turn it off to make playing the game\neasier. <br /><br />";
echo "<form action = \"admin.php\">";
if (inAdminMode()) {
    echo "<input type = \"hidden\" name = \"toggle\" value = \"off\" />";
    echo "<input type = \"submit\" value = \"Turn admin mode off\" />";
} else {
    echo "<input type = \"hidden\" name = \"toggle\" value = \"on\" />";
    echo "<input type = \"submit\" value = \"Turn admin mode on\" />";
}
echo "</form>";
stopBox(BOX_GREEN);
if (inAdminMode()) {
    startBox("Shop Admin", BOX_BLUE);
    echo "<ul>";
    echo "<li><a href = \"adminShopAddItem.php\">Add item</a>";
    echo "</ul>";
    stopBox(BOX_BLUE);
}
require_once "includes/widgets/footer.php";
Beispiel #15
0
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  pFrog is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with pFrog; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*******************************************************************************/
require_once "includes/common.php";
$title = "index";
require_once "includes/widgets/header.php";
$sql = "SELECT * FROM inventory WHERE `type` = 'BUSINESS'";
$result = $db->query($sql);
if ($result->numRows() == 0) {
    startBox('Business', BOX_RED);
    echo "You dont have any businesses.";
    stopBox(BOX_RED);
} else {
    echo "<ul>";
    while ($row = $result->fetchRow()) {
        echo "<li>" . $row['item'] . "</li>";
    }
    echo "</ul>";
}
require_once "includes/widgets/footer.php";