Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[UBEREMU] System Config editor [UBERCMS]

Status
Not open for further replies.
Skilled Illusionist
Joined
Apr 27, 2008
Messages
330
Reaction score
370
manage/pages/configs.php

Code:
<?php
/*=======================================================================
| UberCMS - Advanced Website and Content Management System for uberEmu
| #######################################################################
| Copyright (c) 2010, Roy 'Meth0d' and updates by Matthew 'MDK'
| http://www.meth0d.org & http://www.sulake.biz
| #######################################################################
| This program 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 3 of the License, or
| (at your option) any later version.
| #######################################################################
| This program 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.
\======================================================================*/

if (!defined('IN_HK') || !IN_HK)
{
    exit;
}

if (!HK_LOGGED_IN || !$users->hasFuse(USER_ID, 'fuse_admin'))
{
    exit;
}

if (isset($_POST['edit-no']))
{
    dbquery("UPDATE config SET variable_name = '" . filter($_POST['key']) . "', value = '" . filter($_POST['value'])    . "' WHERE variable_name = '" . filter($_POST['edit-no']) . "' LIMIT 1");
}

if (isset($_POST['newkey']))
{
    dbquery("INSERT INTO config (variable_name,value) VALUES ('" . filter($_POST['newkey']) . "','" . filter($_POST['newval']) . "')");
}

if (isset($_GET['doDel']))
{
    dbquery("DELETE FROM config WHERE variable_name = '" . filter($_GET['doDel']) . "' LIMIT 1");
    fMessage('ok', 'Key removed.');
    header("Location: index.php?_cmd=configs");
    exit;
}

require_once "top.php";

echo '<h1>System Configs</h1>';
echo '<p>This tool is config editor.</p><br />';


echo '<table border="1" width="100%">';
echo '<thead>';
echo '<tr>';
echo '<td>Key</td>';
echo '<td>Value</td>';
echo '<td>Controls</td>';
echo '</tr>';

$get = dbquery("SELECT * FROM config");

while ($text = mysql_fetch_assoc($get))
{
    echo '<tr><form method="post">';
    echo '<input type="hidden" name="edit-no" value="' . clean($text['variable_name']) . '">';
    echo '<td><input type="text" style="width: 100%; padding: 10px; font-size: 115%;" name="key" value="' . clean($text['variable_name']) . '"></td>';
    echo '<td><textarea style="width: 100%; height: 100%;" name="value">' . clean($text['value']) . '</textarea></td>';
    echo '<td><center><input type="submit" value="Update"> <input type="button" value="Delete" onclick="window.location = \'index.php?_cmd=configs&doDel=' . $text['variable_name'] . '\';"></center></td>';
    echo '</form></tr>';
}

echo '<tr><form method="post">';
echo '<td><input type="text" style="width: 100%; padding: 10px; font-size: 115%;" name="newkey"></td>';
echo '<td><textarea name="newval" style="width: 100%; height: 100%;"></textarea>';
echo '<td><center><input type="submit" value="Add">';
echo '</form></tr>';

echo '</thead>';
echo '</table>';

require_once "bottom.php";

?>

manage/top.php
add:
Code:
<li><a href="index.php?_cmd=configs">System Configs</a></li>

SQL:
Code:
CREATE TABLE `config` (
  `variable_name` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 

Attachments

You must be registered for see attachments list
Last edited:
Elite Diviner
Joined
Sep 19, 2009
Messages
420
Reaction score
61
It's a housekeeping page that allows you to enable/disable the welcome message, change it & change how many rooms max. users are allowed..

--

However, for half of those to work you need the other releases.. :s
 
Status
Not open for further replies.
Back
Top