mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-30 03:09:22 +02:00
Code clean up + datatables (#64)
* Reformat Code Reformat Code - spaces + tabs * Code cleanup removed duplicated datatables code * Datatables replace spells, monsters tables with JavaScript Sortable Tables (DataTables?)
This commit is contained in:
parent
e3bcbc4da9
commit
876b1b988a
@ -1,43 +1,44 @@
|
|||||||
.slidecontainer {
|
.slidecontainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider {
|
.slider {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
outline: none;
|
outline: none;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
-webkit-transition: .2s;
|
-webkit-transition: .2s;
|
||||||
transition: opacity .2s;
|
transition: opacity .2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider:hover {
|
.slider:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider::-webkit-slider-thumb {
|
.slider::-webkit-slider-thumb {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
width: 15px;
|
width: 15px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
background: #3c8dbc;
|
background: #3c8dbc;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider::-moz-range-thumb {
|
.slider::-moz-range-thumb {
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
background: #3c8dbc;
|
background: #3c8dbc;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.details-control {
|
td.details-control {
|
||||||
text-align:center;
|
text-align: center;
|
||||||
color:forestgreen;
|
color: forestgreen;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.shown td.details-control {
|
tr.shown td.details-control {
|
||||||
text-align:center;
|
text-align: center;
|
||||||
color:red;
|
color: red;
|
||||||
}
|
}
|
@ -2,220 +2,221 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<?php echo template_header(true); ?>
|
<?php echo template_header(true); ?>
|
||||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/bootstrap.min.css">
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/AdminLTE.min.css">
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/AdminLTE.min.css">
|
||||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/skins/skin-blue.min.css">
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/skins/skin-blue.min.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/font-awesome.min.css">
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/font-awesome.min.css">
|
||||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/ionicons.min.css">
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/ionicons.min.css">
|
||||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/dataTables.bootstrap.min.css">
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/jquery.dataTables.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo $template_path; ?>style.css" />
|
<link rel="stylesheet" type="text/css" href="<?php echo $template_path; ?>style.css"/>
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||||
</head>
|
</head>
|
||||||
<body class="hold-transition skin-blue sidebar-mini">
|
<body class="hold-transition skin-blue sidebar-mini">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<?php if($page != 'tools'): ?>
|
<?php if ($page != 'tools'): ?>
|
||||||
<?php
|
<?php
|
||||||
if($logged && admin()) {
|
if ($logged && admin()) {
|
||||||
?>
|
?>
|
||||||
<header class="main-header">
|
<header class="main-header">
|
||||||
<a href="." class="logo">
|
<a href="." class="logo">
|
||||||
<span class="logo-mini"><b>M</b>A</span>
|
<span class="logo-mini"><b>M</b>A</span>
|
||||||
<span class="logo-lg"><b>My</b>ACC</span>
|
<span class="logo-lg"><b>My</b>AAC</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<nav class="navbar navbar-static-top" role="navigation">
|
<nav class="navbar navbar-static-top" role="navigation">
|
||||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||||
<span class="sr-only">Toggle navigation</span>
|
<span class="sr-only">Toggle navigation</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="navbar-custom-menu">
|
<div class="navbar-custom-menu">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li>
|
<li>
|
||||||
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
|
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<aside class="main-sidebar">
|
<aside class="main-sidebar">
|
||||||
<section class="sidebar">
|
<section class="sidebar">
|
||||||
<ul class="sidebar-menu" data-widget="tree">
|
<ul class="sidebar-menu" data-widget="tree">
|
||||||
<li class="header">MyAAC</li>
|
<li class="header">MyAAC</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$icons_a = array(
|
$icons_a = array(
|
||||||
'dashboard', 'envelope',
|
'dashboard', 'envelope',
|
||||||
'book', 'list',
|
'book', 'list',
|
||||||
'plug', 'user',
|
'plug', 'user',
|
||||||
'edit', 'gavel',
|
'edit', 'gavel',
|
||||||
'book', 'edit', 'book',
|
'book', 'edit', 'book',
|
||||||
);
|
);
|
||||||
|
|
||||||
$menus = array(
|
$menus = array(
|
||||||
'Dashboard' => 'dashboard',
|
'Dashboard' => 'dashboard',
|
||||||
'Mailer' => 'mailer',
|
'Mailer' => 'mailer',
|
||||||
'Pages' => 'pages',
|
'Pages' => 'pages',
|
||||||
'Menus' => 'menus',
|
'Menus' => 'menus',
|
||||||
'Plugins' => 'plugins',
|
'Plugins' => 'plugins',
|
||||||
'Visitors' => 'visitors',
|
'Visitors' => 'visitors',
|
||||||
'Editor' => array(
|
'Editor' => array(
|
||||||
'Accounts' => 'accounts',
|
'Accounts' => 'accounts',
|
||||||
'Players' => 'players',
|
'Players' => 'players',
|
||||||
),
|
),
|
||||||
'Items' => 'items',
|
'Items' => 'items',
|
||||||
'Tools' => array(
|
'Tools' => array(
|
||||||
'phpinfo' => 'phpinfo',
|
'phpinfo' => 'phpinfo',
|
||||||
),
|
),
|
||||||
'Notepad' => 'notepad',
|
'Notepad' => 'notepad',
|
||||||
'Logs' => 'logs'
|
'Logs' => 'logs'
|
||||||
);
|
);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($menus as $_name => $_page) {
|
foreach ($menus as $_name => $_page) {
|
||||||
$has_child = is_array($_page);
|
$has_child = is_array($_page);
|
||||||
if(!$has_child) {
|
if (!$has_child) {
|
||||||
echo '<li ';
|
echo '<li ';
|
||||||
if($page == $_page) echo ' class="active"';
|
if ($page == $_page) echo ' class="active"';
|
||||||
echo">";
|
echo ">";
|
||||||
echo '<a href="?p=' . $_page . '"><i class="fa fa-' . (isset($icons_a[$i]) ? $icons_a[$i] : 'link') . '"></i> <span>'. $_name .'</span></a></li>';
|
echo '<a href="?p=' . $_page . '"><i class="fa fa-' . (isset($icons_a[$i]) ? $icons_a[$i] : 'link') . '"></i> <span>' . $_name . '</span></a></li>';
|
||||||
}
|
|
||||||
|
|
||||||
if($has_child) {
|
|
||||||
$used_menu = "";
|
|
||||||
$nav_construct = '';
|
|
||||||
foreach($_page as $__name => $__page) {
|
|
||||||
$nav_construct = $nav_construct . '<li';
|
|
||||||
|
|
||||||
if ($page == $__page) {
|
|
||||||
$nav_construct = $nav_construct. ' class="active"';
|
|
||||||
$used_menu = true;
|
|
||||||
}
|
|
||||||
$nav_construct = $nav_construct. '><a href="?p=' . $__page . '"><i class="fa fa-circle-o"></i> ' . $__name . '</a></li>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<li class="treeview'. (($used_menu) ? ' menu-open': '') .'">
|
|
||||||
<a href="#"><i class="fa fa-'.(isset($icons_a[$i]) ? $icons_a[$i] : 'link').'"></i> <span>'.$_name.'</span>
|
|
||||||
<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
|
|
||||||
<ul class="treeview-menu" style="'. (($used_menu) ? ' display: block': ' display: none') .'">';
|
|
||||||
echo $nav_construct;
|
|
||||||
echo '</ul>
|
|
||||||
</li>';
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $db->query('SELECT `name`, `page`, `flags` FROM `' . TABLE_PREFIX . 'admin_menu` ORDER BY `ordering`');
|
if ($has_child) {
|
||||||
$menu_db = $query->fetchAll();
|
$used_menu = "";
|
||||||
foreach($menu_db as $item) {
|
$nav_construct = '';
|
||||||
if($item['flags'] == 0 || hasFlag($item['flags'])) {
|
foreach ($_page as $__name => $__page) {
|
||||||
echo '<li ';
|
$nav_construct = $nav_construct . '<li';
|
||||||
if($page == $item['page']) echo ' class="active"';
|
|
||||||
echo">";
|
|
||||||
echo '<a href="?p=' . $item['page'] . '"><i class="fa fa-link"></i> <span>'. $item['name'] .'</span></a></li>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<div class="content-wrapper">
|
if ($page == $__page) {
|
||||||
<section class="content-header">
|
$nav_construct = $nav_construct . ' class="active"';
|
||||||
<h1><?php echo (isset($title) ? $title : ''); ?><small> - Admin Panel</small>
|
$used_menu = true;
|
||||||
<div class="pull-right">
|
}
|
||||||
<span class="label label-<?php echo (($status['online']) ? 'success' : 'danger'); ?>"><?php echo $config['lua']['serverName'] ?></span>
|
$nav_construct = $nav_construct . '><a href="?p=' . $__page . '"><i class="fa fa-circle-o"></i> ' . $__name . '</a></li>';
|
||||||
</div>
|
}
|
||||||
</h1>
|
|
||||||
</section>
|
|
||||||
<section class="content">
|
|
||||||
<?php echo $content; ?>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
echo '<li class="treeview' . (($used_menu) ? ' menu-open' : '') . '">
|
||||||
|
<a href="#"><i class="fa fa-' . (isset($icons_a[$i]) ? $icons_a[$i] : 'link') . '"></i> <span>' . $_name . '</span>
|
||||||
|
<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
|
||||||
|
<ul class="treeview-menu" style="' . (($used_menu) ? ' display: block' : ' display: none') . '">';
|
||||||
|
echo $nav_construct;
|
||||||
|
echo '</ul>
|
||||||
|
</li>';
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
<footer class="main-footer">
|
$query = $db->query('SELECT `name`, `page`, `flags` FROM `' . TABLE_PREFIX . 'admin_menu` ORDER BY `ordering`');
|
||||||
|
$menu_db = $query->fetchAll();
|
||||||
|
foreach ($menu_db as $item) {
|
||||||
|
if ($item['flags'] == 0 || hasFlag($item['flags'])) {
|
||||||
|
echo '<li ';
|
||||||
|
if ($page == $item['page']) echo ' class="active"';
|
||||||
|
echo ">";
|
||||||
|
echo '<a href="?p=' . $item['page'] . '"><i class="fa fa-link"></i> <span>' . $item['name'] . '</span></a></li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</aside>
|
||||||
|
|
||||||
<div class="pull-right hidden-xs">
|
<div class="content-wrapper">
|
||||||
<div id="status">
|
<section class="content-header">
|
||||||
<?php if($status['online']): ?>
|
<h1><?php echo(isset($title) ? $title : ''); ?>
|
||||||
<p class="success" style="width: 120px; text-align: center;">Server Online</p>
|
<small> - Admin Panel</small>
|
||||||
<?php else: ?>
|
<div class="pull-right">
|
||||||
<p class="error" style="width: 120px; text-align: center;">Server Offline</p>
|
<span class="label label-<?php echo(($status['online']) ? 'success' : 'danger'); ?>"><?php echo $config['lua']['serverName'] ?></span>
|
||||||
<?php endif; ?>
|
</div>
|
||||||
</div>
|
</h1>
|
||||||
</div>
|
</section>
|
||||||
<?php echo base64_decode('UG93ZXJlZCBieSA8YSBocmVmPSJodHRwOi8vbXktYWFjLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPk15QUFDLjwvYT4='); ?>
|
<section class="content">
|
||||||
</footer>
|
<?php echo $content; ?>
|
||||||
|
</section>
|
||||||
|
|
||||||
<aside class="control-sidebar control-sidebar-dark">
|
</div>
|
||||||
<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
|
|
||||||
<li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
|
|
||||||
<li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="tab-content">
|
|
||||||
<div class="tab-pane active" id="control-sidebar-home-tab">
|
|
||||||
<h3 class="control-sidebar-heading">Account</h3>
|
|
||||||
<ul class="control-sidebar-menu">
|
|
||||||
<li>
|
|
||||||
<a href="?action=logout">
|
|
||||||
<i class="menu-icon fa fa-sign-out bg-red"></i>
|
|
||||||
<div class="menu-info">
|
|
||||||
<h4 class="control-sidebar-subheading">Log out</h4>
|
|
||||||
<p>This will log you out of <?php echo (USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()); ?></p>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h3 class="control-sidebar-heading">Site</h3>
|
|
||||||
<ul class="control-sidebar-menu">
|
|
||||||
<li>
|
|
||||||
<a href="<?php echo BASE_URL; ?>" target="_blank">
|
|
||||||
<i class="menu-icon fa fa-eye bg-blue"></i>
|
|
||||||
<div class="menu-info">
|
|
||||||
<h4 class="control-sidebar-subheading">Preview</h4>
|
|
||||||
<p>This will open a new tab</p>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane" id="control-sidebar-settings-tab">
|
|
||||||
<form method="post">
|
|
||||||
<h3 class="control-sidebar-heading">Version</h3>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<footer class="main-footer">
|
||||||
<label class="control-sidebar-subheading">
|
|
||||||
<?php echo MYAAC_VERSION; ?> (<a href="?p=version">Check for updates</a>)<br/>
|
|
||||||
</label>
|
|
||||||
<label class="control-sidebar-subheading">
|
|
||||||
<p><a href="https://github.com/slawkens/myaac" target="_blank">Github</a></p>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
||||||
<div class="control-sidebar-bg"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php } endif;
|
<div class="pull-right hidden-xs">
|
||||||
if(!$logged && !admin()) {
|
<div id="status">
|
||||||
echo $content;
|
<?php if ($status['online']): ?>
|
||||||
}
|
<p class="success" style="width: 120px; text-align: center;">Server Online</p>
|
||||||
?>
|
<?php else: ?>
|
||||||
|
<p class="error" style="width: 120px; text-align: center;">Server Offline</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php echo base64_decode('UG93ZXJlZCBieSA8YSBocmVmPSJodHRwOi8vbXktYWFjLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPk15QUFDLjwvYT4='); ?>
|
||||||
|
</footer>
|
||||||
|
|
||||||
<script src="<?php echo BASE_URL; ?>tools/js/bootstrap.min.js"></script>
|
<aside class="control-sidebar control-sidebar-dark">
|
||||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
|
||||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery-ui.min.js"></script>
|
<li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
|
||||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
<li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
|
||||||
<script src="<?php echo BASE_URL; ?>tools/js/dataTables.bootstrap.min.js"></script>
|
</ul>
|
||||||
<script src="<?php echo BASE_URL; ?>tools/js/adminlte.min.js"></script>
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="control-sidebar-home-tab">
|
||||||
|
<h3 class="control-sidebar-heading">Account</h3>
|
||||||
|
<ul class="control-sidebar-menu">
|
||||||
|
<li>
|
||||||
|
<a href="?action=logout">
|
||||||
|
<i class="menu-icon fa fa-sign-out bg-red"></i>
|
||||||
|
<div class="menu-info">
|
||||||
|
<h4 class="control-sidebar-subheading">Log out</h4>
|
||||||
|
<p>This will log you out
|
||||||
|
of <?php echo(USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()); ?></p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h3 class="control-sidebar-heading">Site</h3>
|
||||||
|
<ul class="control-sidebar-menu">
|
||||||
|
<li>
|
||||||
|
<a href="<?php echo BASE_URL; ?>" target="_blank">
|
||||||
|
<i class="menu-icon fa fa-eye bg-blue"></i>
|
||||||
|
<div class="menu-info">
|
||||||
|
<h4 class="control-sidebar-subheading">Preview</h4>
|
||||||
|
<p>This will open a new tab</p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="control-sidebar-settings-tab">
|
||||||
|
<form method="post">
|
||||||
|
<h3 class="control-sidebar-heading">Version</h3>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-sidebar-subheading">
|
||||||
|
<?php echo MYAAC_VERSION; ?> (<a href="?p=version">Check for updates</a>)<br/>
|
||||||
|
</label>
|
||||||
|
<label class="control-sidebar-subheading">
|
||||||
|
<p><a href="https://github.com/slawkens/myaac" target="_blank">Github</a></p>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
<div class="control-sidebar-bg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php } endif;
|
||||||
|
if (!$logged && !admin()) {
|
||||||
|
echo $content;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/bootstrap.min.js"></script>
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/jquery-ui.min.js"></script>
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/adminlte.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -14,24 +14,24 @@ $base = BASE_URL . 'admin/?p=accounts';
|
|||||||
|
|
||||||
function echo_success($message)
|
function echo_success($message)
|
||||||
{
|
{
|
||||||
echo '<p class="success">' . $message . '</p>';
|
echo '<p class="success">' . $message . '</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function echo_error($message)
|
function echo_error($message)
|
||||||
{
|
{
|
||||||
global $error;
|
global $error;
|
||||||
echo '<p class="error">' . $message . '</p>';
|
echo '<p class="error">' . $message . '</p>';
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function verify_number($number, $name, $max_length)
|
function verify_number($number, $name, $max_length)
|
||||||
{
|
{
|
||||||
if (!Validator::number($number))
|
if (!Validator::number($number))
|
||||||
echo_error($name . ' can contain only numbers.');
|
echo_error($name . ' can contain only numbers.');
|
||||||
|
|
||||||
$number_length = strlen($number);
|
$number_length = strlen($number);
|
||||||
if ($number_length <= 0 || $number_length > $max_length)
|
if ($number_length <= 0 || $number_length > $max_length)
|
||||||
echo_error($name . ' cannot be longer than ' . $max_length . ' digits.');
|
echo_error($name . ' cannot be longer than ' . $max_length . ' digits.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
||||||
@ -43,383 +43,385 @@ $hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
|||||||
<?php
|
<?php
|
||||||
$id = 0;
|
$id = 0;
|
||||||
if (isset($_REQUEST['id']))
|
if (isset($_REQUEST['id']))
|
||||||
$id = (int)$_REQUEST['id'];
|
$id = (int)$_REQUEST['id'];
|
||||||
else if (isset($_REQUEST['search_name'])) {
|
else if (isset($_REQUEST['search_name'])) {
|
||||||
if (strlen($_REQUEST['search_name']) < 3 && !Validator::number($_REQUEST['search_name'])) {
|
if (strlen($_REQUEST['search_name']) < 3 && !Validator::number($_REQUEST['search_name'])) {
|
||||||
echo 'Player name is too short.';
|
echo 'Player name is too short.';
|
||||||
} else {
|
} else {
|
||||||
if (Validator::number($_REQUEST['search_name']))
|
if (Validator::number($_REQUEST['search_name']))
|
||||||
$id = $_REQUEST['search_name'];
|
$id = $_REQUEST['search_name'];
|
||||||
else {
|
else {
|
||||||
$query = $db->query('SELECT `id` FROM `accounts` WHERE `name` = ' . $db->quote($_REQUEST['search_name']));
|
$query = $db->query('SELECT `id` FROM `accounts` WHERE `name` = ' . $db->quote($_REQUEST['search_name']));
|
||||||
if ($query->rowCount() == 1) {
|
if ($query->rowCount() == 1) {
|
||||||
$query = $query->fetch();
|
$query = $query->fetch();
|
||||||
$id = $query['id'];
|
$id = $query['id'];
|
||||||
} else {
|
} else {
|
||||||
$query = $db->query('SELECT `id`, `name` FROM `accounts` WHERE `name` LIKE ' . $db->quote('%' . $_REQUEST['search_name'] . '%'));
|
$query = $db->query('SELECT `id`, `name` FROM `accounts` WHERE `name` LIKE ' . $db->quote('%' . $_REQUEST['search_name'] . '%'));
|
||||||
if ($query->rowCount() > 0 && $query->rowCount() <= 10) {
|
if ($query->rowCount() > 0 && $query->rowCount() <= 10) {
|
||||||
echo 'Do you mean?<ul>';
|
echo 'Do you mean?<ul>';
|
||||||
foreach ($query as $row)
|
foreach ($query as $row)
|
||||||
echo '<li><a href="' . $base . '&id=' . $row['id'] . '">' . $row['name'] . '</a></li>';
|
echo '<li><a href="' . $base . '&id=' . $row['id'] . '">' . $row['name'] . '</a></li>';
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
} else if ($query->rowCount() > 10)
|
} else if ($query->rowCount() > 10)
|
||||||
echo 'Specified name resulted with too many accounts.';
|
echo 'Specified name resulted with too many accounts.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$account = new OTS_Account();
|
$account = new OTS_Account();
|
||||||
$account->load($id);
|
$account->load($id);
|
||||||
|
|
||||||
if (isset($account) && $account->isLoaded() && isset($_POST['save'])) {// we want to save
|
if (isset($account) && $account->isLoaded() && isset($_POST['save'])) {// we want to save
|
||||||
$error = false;
|
$error = false;
|
||||||
|
|
||||||
$name = $_POST['name'];
|
$name = $_POST['name'];
|
||||||
$_error = '';
|
$_error = '';
|
||||||
|
|
||||||
//if (!Validator::check_account_name($name))
|
//if (!Validator::check_account_name($name))
|
||||||
// echo_error(Validator::getLastError());
|
// echo_error(Validator::getLastError());
|
||||||
|
|
||||||
$account_db = new OTS_Account();
|
$account_db = new OTS_Account();
|
||||||
$account_db->find($name);
|
$account_db->find($name);
|
||||||
if ($account_db->isLoaded() && $account->getName() != $name)
|
if ($account_db->isLoaded() && $account->getName() != $name)
|
||||||
echo_error('This name is already used. Please choose another name!');
|
echo_error('This name is already used. Please choose another name!');
|
||||||
|
|
||||||
$account_db->load($id);
|
$account_db->load($id);
|
||||||
if (!$account_db->isLoaded())
|
if (!$account_db->isLoaded())
|
||||||
echo_error('Account with this id doesn\'t exist.');
|
echo_error('Account with this id doesn\'t exist.');
|
||||||
|
|
||||||
//type
|
//type
|
||||||
$group = $_POST['group'];
|
$group = $_POST['group'];
|
||||||
|
|
||||||
$password = ((!empty($_POST["pass"]) ? $_POST['pass'] : null));
|
$password = ((!empty($_POST["pass"]) ? $_POST['pass'] : null));
|
||||||
if(!Validator::password($password)) {
|
if (!Validator::password($password)) {
|
||||||
$errors['password'] = Validator::getLastError();
|
$errors['password'] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
//secret
|
//secret
|
||||||
$secret = $_POST['secret'];
|
$secret = $_POST['secret'];
|
||||||
//key
|
//key
|
||||||
$key = $_POST['key'];
|
$key = $_POST['key'];
|
||||||
|
|
||||||
$email = $_POST['email'];
|
$email = $_POST['email'];
|
||||||
if(!Validator::email($email))
|
if (!Validator::email($email))
|
||||||
$errors['email'] = Validator::getLastError();
|
$errors['email'] = Validator::getLastError();
|
||||||
|
|
||||||
// prem days
|
// prem days
|
||||||
$p_days = $_POST['p_days'];
|
$p_days = $_POST['p_days'];
|
||||||
verify_number($p_days, 'Prem days', 11);
|
verify_number($p_days, 'Prem days', 11);
|
||||||
|
|
||||||
//tibia coins
|
//tibia coins
|
||||||
if($hasCoinsColumn) {
|
if ($hasCoinsColumn) {
|
||||||
$t_coins = $_POST['t_coins'];
|
$t_coins = $_POST['t_coins'];
|
||||||
verify_number($t_coins, 'Tibia coins', 12);
|
verify_number($t_coins, 'Tibia coins', 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
//prem points
|
//prem points
|
||||||
$p_points = $_POST['p_points'];
|
$p_points = $_POST['p_points'];
|
||||||
verify_number($p_points, 'Prem Points', 11);
|
verify_number($p_points, 'Prem Points', 11);
|
||||||
|
|
||||||
//rl name
|
//rl name
|
||||||
$rl_name = $_POST['rl_name'];
|
$rl_name = $_POST['rl_name'];
|
||||||
|
|
||||||
//location
|
//location
|
||||||
$rl_loca = $_POST['rl_loca'];
|
$rl_loca = $_POST['rl_loca'];
|
||||||
|
|
||||||
//country
|
//country
|
||||||
$rl_country = $_POST['rl_country'];
|
$rl_country = $_POST['rl_country'];
|
||||||
|
|
||||||
//created
|
//created
|
||||||
$created = $_POST['created'];
|
$created = $_POST['created'];
|
||||||
verify_number($created, 'Created', 20);
|
verify_number($created, 'Created', 20);
|
||||||
|
|
||||||
//last login
|
//last login
|
||||||
$lastlogin = $_POST['lastlogin'];
|
$lastlogin = $_POST['lastlogin'];
|
||||||
verify_number($lastlogin, 'Last login', 20);
|
verify_number($lastlogin, 'Last login', 20);
|
||||||
|
|
||||||
//web last login
|
//web last login
|
||||||
$web_lastlogin = $_POST['web_lastlogin'];
|
$web_lastlogin = $_POST['web_lastlogin'];
|
||||||
verify_number($web_lastlogin, 'Web Last logout', 20);
|
verify_number($web_lastlogin, 'Web Last logout', 20);
|
||||||
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$account->setName($name);
|
$account->setName($name);
|
||||||
$account->setCustomField('type', $group);
|
$account->setCustomField('type', $group);
|
||||||
$account->setCustomField('secret', $secret);
|
$account->setCustomField('secret', $secret);
|
||||||
$account->setCustomField('key', $key);
|
$account->setCustomField('key', $key);
|
||||||
$account->setEMail($email);
|
$account->setEMail($email);
|
||||||
$account->setPremDays($p_days);
|
$account->setPremDays($p_days);
|
||||||
if($hasCoinsColumn) {
|
if ($hasCoinsColumn) {
|
||||||
$account->setCustomField('coins', $t_coins);
|
$account->setCustomField('coins', $t_coins);
|
||||||
}
|
}
|
||||||
|
|
||||||
$account->setRLName($rl_name);
|
$account->setRLName($rl_name);
|
||||||
$account->setLocation($rl_loca);
|
$account->setLocation($rl_loca);
|
||||||
$account->setCountry($rl_country);
|
$account->setCountry($rl_country);
|
||||||
|
|
||||||
if ($db->hasColumn('accounts', 'premium_points')){
|
if ($db->hasColumn('accounts', 'premium_points')) {
|
||||||
$account->setCustomField('premium_points', $p_points);}
|
$account->setCustomField('premium_points', $p_points);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($password)) {
|
if (isset($password)) {
|
||||||
$config_salt_enabled = $db->hasColumn('accounts', 'salt');
|
$config_salt_enabled = $db->hasColumn('accounts', 'salt');
|
||||||
if($config_salt_enabled)
|
if ($config_salt_enabled) {
|
||||||
{
|
$salt = generateRandomString(10, false, true, true);
|
||||||
$salt = generateRandomString(10, false, true, true);
|
$password = $salt . $password;
|
||||||
$password = $salt . $password;
|
$account_logged->setCustomField('salt', $salt);
|
||||||
$account_logged->setCustomField('salt', $salt);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$password = encrypt($password);
|
$password = encrypt($password);
|
||||||
$account->setPassword($password);
|
$account->setPassword($password);
|
||||||
|
|
||||||
if ($config_salt_enabled)
|
if ($config_salt_enabled)
|
||||||
$account->setCustomField('salt', $salt);
|
$account->setCustomField('salt', $salt);
|
||||||
}
|
}
|
||||||
|
|
||||||
$account->setEMail($email);
|
$account->setEMail($email);
|
||||||
|
|
||||||
//$account->setCustomField('created', time());
|
//$account->setCustomField('created', time());
|
||||||
|
|
||||||
$account->save();
|
$account->save();
|
||||||
echo_success('Account saved at: ' . date('G:i'));
|
echo_success('Account saved at: ' . date('G:i'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$search_name = '';
|
$search_name = '';
|
||||||
$search_account = '';
|
$search_account = '';
|
||||||
if (isset($_REQUEST['search_name']))
|
if (isset($_REQUEST['search_name']))
|
||||||
$search_name = $_REQUEST['search_name'];
|
$search_name = $_REQUEST['search_name'];
|
||||||
else if (isset($_REQUEST['search_account']))
|
else if (isset($_REQUEST['search_account']))
|
||||||
$search_account = $_REQUEST['search_account'];
|
$search_account = $_REQUEST['search_account'];
|
||||||
else if ($id > 0 && isset($account) && $account->isLoaded())
|
else if ($id > 0 && isset($account) && $account->isLoaded())
|
||||||
$search_name = $account->getName();
|
$search_name = $account->getName();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php
|
<?php
|
||||||
if (isset($account) && $account->isLoaded()) {
|
if (isset($account) && $account->isLoaded()) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php $acc_type = array("Normal", "Tutor", "Senior Tutor", "Gamemaster", "God"); ?>
|
<?php $acc_type = array("Normal", "Tutor", "Senior Tutor", "Gamemaster", "God"); ?>
|
||||||
<form action="<?php echo $base . ((isset($id) && $id > 0) ? '&id=' . $id : ''); ?>" method="post" class="form-horizontal">
|
<form action="<?php echo $base . ((isset($id) && $id > 0) ? '&id=' . $id : ''); ?>" method="post"
|
||||||
<div class="col-md-8">
|
class="form-horizontal">
|
||||||
<div class="box box-primary">
|
<div class="col-md-8">
|
||||||
<div class="box-body">
|
<div class="box box-primary">
|
||||||
<div class="row">
|
<div class="box-body">
|
||||||
<div class="col-xs-6">
|
<div class="row">
|
||||||
<label for="name" class="control-label">Account Name</label>
|
<div class="col-xs-6">
|
||||||
<input type="text" class="form-control" id="name" name="name"
|
<label for="name" class="control-label">Account Name</label>
|
||||||
autocomplete="off" style="cursor: auto;"
|
<input type="text" class="form-control" id="name" name="name"
|
||||||
value="<?php echo $account->getName(); ?>"/>
|
autocomplete="off" style="cursor: auto;"
|
||||||
</div>
|
value="<?php echo $account->getName(); ?>"/>
|
||||||
<div class="col-xs-6">
|
</div>
|
||||||
<label for="account_id" class="control-label">Account id:</label>
|
<div class="col-xs-6">
|
||||||
<input type="text" class="form-control" id="account_id" name="account_id"
|
<label for="account_id" class="control-label">Account id:</label>
|
||||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11" disabled
|
<input type="text" class="form-control" id="account_id" name="account_id"
|
||||||
value="<?php echo $account->getId(); ?>"/>
|
autocomplete="off" style="cursor: auto;" size="8" maxlength="11" disabled
|
||||||
</div>
|
value="<?php echo $account->getId(); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col-xs-6">
|
<div class="row">
|
||||||
<label for="group" class="control-label">Type</label>
|
<div class="col-xs-6">
|
||||||
<select name="group" id="group" class="form-control">
|
<label for="group" class="control-label">Type</label>
|
||||||
<?php foreach ($acc_type as $id => $a_type): ?>
|
<select name="group" id="group" class="form-control">
|
||||||
<option value="<?php echo($id + 1); ?>" <?php echo($account->getCustomField('type') == ($id + 1) ? 'selected' : ''); ?>><?php echo $a_type; ?></option>
|
<?php foreach ($acc_type as $id => $a_type): ?>
|
||||||
<?php endforeach; ?>
|
<option value="<?php echo($id + 1); ?>" <?php echo($account->getCustomField('type') == ($id + 1) ? 'selected' : ''); ?>><?php echo $a_type; ?></option>
|
||||||
</select>
|
<?php endforeach; ?>
|
||||||
</div>
|
</select>
|
||||||
<div class="col-xs-6">
|
</div>
|
||||||
<label for="c_pass" class="control-label">Password: (check to change)</label>
|
<div class="col-xs-6">
|
||||||
<div class="input-group">
|
<label for="c_pass" class="control-label">Password: (check to change)</label>
|
||||||
|
<div class="input-group">
|
||||||
|
|
||||||
<span class="input-group-addon">
|
<span class="input-group-addon">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
name="c_pass"
|
name="c_pass"
|
||||||
id="c_pass"
|
id="c_pass"
|
||||||
value="false"
|
value="false"
|
||||||
class="input_control"/>
|
class="input_control"/>
|
||||||
</span>
|
</span>
|
||||||
<input type="text" class="form-control" id="pass" name="pass"
|
<input type="text" class="form-control" id="pass" name="pass"
|
||||||
autocomplete="off" maxlength="20"
|
autocomplete="off" maxlength="20"
|
||||||
value=""/>
|
value=""/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="secret" class="control-label">Secret:</label>
|
<label for="secret" class="control-label">Secret:</label>
|
||||||
<input type="text" class="form-control" id="secret" name="secret"
|
<input type="text" class="form-control" id="secret" name="secret"
|
||||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
||||||
value="<?php echo $account->getCustomField('secret'); ?>"/>
|
value="<?php echo $account->getCustomField('secret'); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="key" class="control-label">Key:</label>
|
<label for="key" class="control-label">Key:</label>
|
||||||
<input type="text" class="form-control" id="key" name="key"
|
<input type="text" class="form-control" id="key" name="key"
|
||||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
||||||
value="<?php echo $account->getCustomField('key'); ?>"/>
|
value="<?php echo $account->getCustomField('key'); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="email" class="control-label">Email:</label>
|
<label for="email" class="control-label">Email:</label>
|
||||||
<input type="text" class="form-control" id="email" name="email"
|
<input type="text" class="form-control" id="email" name="email"
|
||||||
autocomplete="off" maxlength="20"
|
autocomplete="off" maxlength="20"
|
||||||
value="<?php echo $account->getEMail(); ?>"/>
|
value="<?php echo $account->getEMail(); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="p_days" class="control-label">Prem Days:</label>
|
<label for="p_days" class="control-label">Prem Days:</label>
|
||||||
<input type="text" class="form-control" id="p_days" name="p_days"
|
<input type="text" class="form-control" id="p_days" name="p_days"
|
||||||
autocomplete="off" maxlength="11"
|
autocomplete="off" maxlength="11"
|
||||||
value="<?php echo $account->getPremDays(); ?>"/>
|
value="<?php echo $account->getPremDays(); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<?php if($hasCoinsColumn): ?>
|
<?php if ($hasCoinsColumn): ?>
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="t_coins" class="control-label">Tibia Coins:</label>
|
<label for="t_coins" class="control-label">Tibia Coins:</label>
|
||||||
<input type="text" class="form-control" id="t_coins" name="t_coins"
|
<input type="text" class="form-control" id="t_coins" name="t_coins"
|
||||||
autocomplete="off" maxlength="8"
|
autocomplete="off" maxlength="8"
|
||||||
value="<?php echo $account->getCustomField('coins') ?>"/>
|
value="<?php echo $account->getCustomField('coins') ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($db->hasColumn('players', 'blessings')): ?>
|
<?php if ($db->hasColumn('players', 'blessings')): ?>
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="p_points" class="control-label">Prem Points:</label>
|
<label for="p_points" class="control-label">Prem Points:</label>
|
||||||
<input type="text" class="form-control" id="p_points" name="p_points"
|
<input type="text" class="form-control" id="p_points" name="p_points"
|
||||||
autocomplete="off" maxlength="8"
|
autocomplete="off" maxlength="8"
|
||||||
value="<?php echo $account->getCustomField('premium_points') ?>"/>
|
value="<?php echo $account->getCustomField('premium_points') ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<label for="rl_name" class="control-label">RL Name:</label>
|
<label for="rl_name" class="control-label">RL Name:</label>
|
||||||
<input type="text" class="form-control" id="rl_name" name="rl_name"
|
<input type="text" class="form-control" id="rl_name" name="rl_name"
|
||||||
autocomplete="off" maxlength="20"
|
autocomplete="off" maxlength="20"
|
||||||
value="<?php echo $account->getRLName(); ?>"/>
|
value="<?php echo $account->getRLName(); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<label for="rl_loca" class="control-label">Location:</label>
|
<label for="rl_loca" class="control-label">Location:</label>
|
||||||
<input type="text" class="form-control" id="rl_loca" name="rl_loca"
|
<input type="text" class="form-control" id="rl_loca" name="rl_loca"
|
||||||
autocomplete="off" maxlength="20"
|
autocomplete="off" maxlength="20"
|
||||||
value="<?php echo $account->getLocation(); ?>"/>
|
value="<?php echo $account->getLocation(); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<label for="rl_country" class="control-label">Country:</label>
|
<label for="rl_country" class="control-label">Country:</label>
|
||||||
<input type="text" class="form-control" id="rl_country" name="rl_country"
|
<input type="text" class="form-control" id="rl_country" name="rl_country"
|
||||||
autocomplete="off" maxlength="8"
|
autocomplete="off" maxlength="8"
|
||||||
value="<?php echo $account->getCountry(); ?>"/>
|
value="<?php echo $account->getCountry(); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<label for="created" class="control-label">Created:</label>
|
<label for="created" class="control-label">Created:</label>
|
||||||
<input type="text" class="form-control" id="created" name="created"
|
<input type="text" class="form-control" id="created" name="created"
|
||||||
autocomplete="off" maxlength="20"
|
autocomplete="off" maxlength="20"
|
||||||
value="<?php echo $account->getCustomField('created'); ?>"/>
|
value="<?php echo $account->getCustomField('created'); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<label for="lastlogin" class="control-label">Last Login:</label>
|
<label for="lastlogin" class="control-label">Last Login:</label>
|
||||||
<input type="text" class="form-control" id="lastlogin" name="lastlogin"
|
<input type="text" class="form-control" id="lastlogin" name="lastlogin"
|
||||||
autocomplete="off" maxlength="20"
|
autocomplete="off" maxlength="20"
|
||||||
value="<?php echo $account->getLastLogin(); ?>"/>
|
value="<?php echo $account->getLastLogin(); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<label for="web_lastlogin" class="control-label">Web Last Login:</label>
|
<label for="web_lastlogin" class="control-label">Web Last Login:</label>
|
||||||
<input type="text" class="form-control" id="web_lastlogin" name="web_lastlogin"
|
<input type="text" class="form-control" id="web_lastlogin" name="web_lastlogin"
|
||||||
autocomplete="off" maxlength="20"
|
autocomplete="off" maxlength="20"
|
||||||
value="<?php echo $account->getCustomField('web_lastlogin'); ?>"/>
|
value="<?php echo $account->getCustomField('web_lastlogin'); ?>"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="save" value="yes"/>
|
<input type="hidden" name="save" value="yes"/>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<a href="<?php echo ADMIN_URL; ?>?p=accounts"><span class="btn btn-danger">Cancel</span></a>
|
<a href="<?php echo ADMIN_URL; ?>?p=accounts"><span class="btn btn-danger">Cancel</span></a>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<input type="submit" class="btn btn-primary" value="Update">
|
<input type="submit" class="btn btn-primary" value="Update">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Search Account:</h3>
|
<h3 class="box-title">Search Account:</h3>
|
||||||
<div class="box-tools pull-right">
|
<div class="box-tools pull-right">
|
||||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<form action="<?php echo $base; ?>" method="post">
|
<form action="<?php echo $base; ?>" method="post">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input type="text" class="form-control" name="search_name" value="<?php echo $search_name; ?>"
|
<input type="text" class="form-control" name="search_name" value="<?php echo $search_name; ?>"
|
||||||
maxlength="32" size="32">
|
maxlength="32" size="32">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if (isset($account) && $account->isLoaded()) {
|
if (isset($account) && $account->isLoaded()) {
|
||||||
$account_players = array();
|
$account_players = array();
|
||||||
$query = $db->query('SELECT `name`,`level`,`vocation` FROM `players` WHERE `account_id` = ' . $account->getId() . ' ORDER BY `name`')->fetchAll();
|
$query = $db->query('SELECT `name`,`level`,`vocation` FROM `players` WHERE `account_id` = ' . $account->getId() . ' ORDER BY `name`')->fetchAll();
|
||||||
if (isset($query)) {
|
if (isset($query)) {
|
||||||
?>
|
?>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Character List:</h3>
|
<h3 class="box-title">Character List:</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body no-padding">
|
<div class="box-body no-padding">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<tbody><tr>
|
<tbody>
|
||||||
<th style="width: 10px">#</th>
|
<tr>
|
||||||
<th>Name</th>
|
<th style="width: 10px">#</th>
|
||||||
<th>Level</th>
|
<th>Name</th>
|
||||||
<th style="width: 40px">Edit</th>
|
<th>Level</th>
|
||||||
</tr>
|
<th style="width: 40px">Edit</th>
|
||||||
<?php
|
</tr>
|
||||||
$i = 1;
|
<?php
|
||||||
foreach ($query as $p) {
|
$i = 1;
|
||||||
$account_players[] = $p;
|
foreach ($query as $p) {
|
||||||
echo '<tr>
|
$account_players[] = $p;
|
||||||
<td>'.$i.'.</td>
|
echo '<tr>
|
||||||
<td>'.$p['name'] . '</td>
|
<td>' . $i . '.</td>
|
||||||
<td>'.$p['level'].'</td>
|
<td>' . $p['name'] . '</td>
|
||||||
|
<td>' . $p['level'] . '</td>
|
||||||
<td><a href="?p=players&search_name=' . $p['name'] . '"><span class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a></span></td>
|
<td><a href="?p=players&search_name=' . $p['name'] . '"><span class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a></span></td>
|
||||||
</tr>';
|
</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
} ?>
|
} ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('#lastlogin').datetimepicker({ format: 'unixtime' });
|
$('#lastlogin').datetimepicker({format: 'unixtime'});
|
||||||
$('#lastlogout').datetimepicker({ format: 'unixtime' });
|
$('#lastlogout').datetimepicker({format: 'unixtime'});
|
||||||
$('#created').datetimepicker({ format: 'unixtime' });
|
$('#created').datetimepicker({format: 'unixtime'});
|
||||||
$('#web_lastlogin').datetimepicker({ format: 'unixtime' });
|
$('#web_lastlogin').datetimepicker({format: 'unixtime'});
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.input_control').change(function () {
|
$('.input_control').change(function () {
|
||||||
$('input[name=pass]')[0].disabled = !this.checked;
|
$('input[name=pass]')[0].disabled = !this.checked;
|
||||||
$('input[name=pass]')[0].value = '';
|
$('input[name=pass]')[0].value = '';
|
||||||
}).change();
|
}).change();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
@ -10,7 +10,7 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'MyAAC Changelog';
|
$title = 'MyAAC Changelog';
|
||||||
|
|
||||||
if(!file_exists(BASE . 'CHANGELOG')) {
|
if (!file_exists(BASE . 'CHANGELOG')) {
|
||||||
echo 'File CHANGELOG doesn\'t exist.';
|
echo 'File CHANGELOG doesn\'t exist.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -12,39 +12,39 @@ $title = 'Dashboard';
|
|||||||
|
|
||||||
$cache = Cache::getInstance();
|
$cache = Cache::getInstance();
|
||||||
if ($cache->enabled()) {
|
if ($cache->enabled()) {
|
||||||
if (isset($_GET['clear_cache'])) {
|
if (isset($_GET['clear_cache'])) {
|
||||||
if (clearCache())
|
if (clearCache())
|
||||||
success('Cache cleared.');
|
success('Cache cleared.');
|
||||||
else
|
else
|
||||||
error('Error while clearing cache.');
|
error('Error while clearing cache.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($_GET['maintenance'])) {
|
if (isset($_GET['maintenance'])) {
|
||||||
$_status = (int)$_POST['status'];
|
$_status = (int)$_POST['status'];
|
||||||
$message = $_POST['message'];
|
$message = $_POST['message'];
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
error('Message cannot be empty.');
|
error('Message cannot be empty.');
|
||||||
} else if (strlen($message) > 255) {
|
} else if (strlen($message) > 255) {
|
||||||
error('Message is too long. Maximum length allowed is 255 chars.');
|
error('Message is too long. Maximum length allowed is 255 chars.');
|
||||||
} else {
|
} else {
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if (fetchDatabaseConfig('site_closed', $tmp))
|
if (fetchDatabaseConfig('site_closed', $tmp))
|
||||||
updateDatabaseConfig('site_closed', $_status);
|
updateDatabaseConfig('site_closed', $_status);
|
||||||
else
|
else
|
||||||
registerDatabaseConfig('site_closed', $_status);
|
registerDatabaseConfig('site_closed', $_status);
|
||||||
|
|
||||||
if (fetchDatabaseConfig('site_closed_message', $tmp))
|
if (fetchDatabaseConfig('site_closed_message', $tmp))
|
||||||
updateDatabaseConfig('site_closed_message', $message);
|
updateDatabaseConfig('site_closed_message', $message);
|
||||||
else
|
else
|
||||||
registerDatabaseConfig('site_closed_message', $message);
|
registerDatabaseConfig('site_closed_message', $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$is_closed = getDatabaseConfig('site_closed') == '1';
|
$is_closed = getDatabaseConfig('site_closed') == '1';
|
||||||
|
|
||||||
$closed_message = 'Server is under maintenance, please visit later.';
|
$closed_message = 'Server is under maintenance, please visit later.';
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if (fetchDatabaseConfig('site_closed_message', $tmp))
|
if (fetchDatabaseConfig('site_closed_message', $tmp))
|
||||||
$closed_message = $tmp;
|
$closed_message = $tmp;
|
||||||
|
|
||||||
$query = $db->query('SELECT count(*) as `how_much` FROM `accounts`;');
|
$query = $db->query('SELECT count(*) as `how_much` FROM `accounts`;');
|
||||||
$query = $query->fetch();
|
$query = $query->fetch();
|
||||||
@ -63,73 +63,73 @@ $query = $query->fetch();
|
|||||||
$total_houses = $query['how_much'];
|
$total_houses = $query['how_much'];
|
||||||
|
|
||||||
if ($db->hasColumn('accounts', 'premium_points')) {
|
if ($db->hasColumn('accounts', 'premium_points')) {
|
||||||
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||||
} else {
|
} else {
|
||||||
$points = 0;
|
$points = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($db->hasColumn('accounts', 'coins')) {
|
if ($db->hasColumn('accounts', 'coins')) {
|
||||||
$coins = $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `coins` DESC LIMIT 10;');
|
$coins = $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `coins` DESC LIMIT 10;');
|
||||||
} else {
|
} else {
|
||||||
$coins = 0;
|
$coins = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$twig->display('admin.statistics.html.twig', array(
|
$twig->display('admin.statistics.html.twig', array(
|
||||||
'total_accounts' => $total_accounts,
|
'total_accounts' => $total_accounts,
|
||||||
'total_players' => $total_players,
|
'total_players' => $total_players,
|
||||||
'total_guilds' => $total_guilds,
|
'total_guilds' => $total_guilds,
|
||||||
'total_houses' => $total_houses
|
'total_houses' => $total_houses
|
||||||
));
|
));
|
||||||
|
|
||||||
$twig->display('admin.dashboard.html.twig', array(
|
$twig->display('admin.dashboard.html.twig', array(
|
||||||
'is_closed' => $is_closed,
|
'is_closed' => $is_closed,
|
||||||
'closed_message' => $closed_message,
|
'closed_message' => $closed_message,
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
|
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
|
||||||
'points' => $points,
|
'points' => $points,
|
||||||
'coins' => $coins,
|
'coins' => $coins,
|
||||||
));
|
));
|
||||||
function clearCache()
|
function clearCache()
|
||||||
{
|
{
|
||||||
global $template_name;
|
global $template_name;
|
||||||
$cache = Cache::getInstance();
|
$cache = Cache::getInstance();
|
||||||
|
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if ($cache->fetch('status', $tmp))
|
if ($cache->fetch('status', $tmp))
|
||||||
$cache->delete('status');
|
$cache->delete('status');
|
||||||
|
|
||||||
if ($cache->fetch('templates', $tmp))
|
if ($cache->fetch('templates', $tmp))
|
||||||
$cache->delete('templates');
|
$cache->delete('templates');
|
||||||
|
|
||||||
if ($cache->fetch('config_lua', $tmp))
|
if ($cache->fetch('config_lua', $tmp))
|
||||||
$cache->delete('config_lua');
|
$cache->delete('config_lua');
|
||||||
|
|
||||||
if ($cache->fetch('vocations', $tmp))
|
if ($cache->fetch('vocations', $tmp))
|
||||||
$cache->delete('vocations');
|
$cache->delete('vocations');
|
||||||
|
|
||||||
if ($cache->fetch('towns', $tmp))
|
if ($cache->fetch('towns', $tmp))
|
||||||
$cache->delete('towns');
|
$cache->delete('towns');
|
||||||
|
|
||||||
if ($cache->fetch('groups', $tmp))
|
if ($cache->fetch('groups', $tmp))
|
||||||
$cache->delete('groups');
|
$cache->delete('groups');
|
||||||
|
|
||||||
if ($cache->fetch('visitors', $tmp))
|
if ($cache->fetch('visitors', $tmp))
|
||||||
$cache->delete('visitors');
|
$cache->delete('visitors');
|
||||||
|
|
||||||
if ($cache->fetch('views_counter', $tmp))
|
if ($cache->fetch('views_counter', $tmp))
|
||||||
$cache->delete('views_counter');
|
$cache->delete('views_counter');
|
||||||
|
|
||||||
if ($cache->fetch('failed_logins', $tmp))
|
if ($cache->fetch('failed_logins', $tmp))
|
||||||
$cache->delete('failed_logins');
|
$cache->delete('failed_logins');
|
||||||
|
|
||||||
if ($cache->fetch('news' . $template_name . '_' . NEWS, $tmp))
|
if ($cache->fetch('news' . $template_name . '_' . NEWS, $tmp))
|
||||||
$cache->delete('news' . $template_name . '_' . NEWS);
|
$cache->delete('news' . $template_name . '_' . NEWS);
|
||||||
|
|
||||||
if ($cache->fetch('news' . $template_name . '_' . TICKER, $tmp))
|
if ($cache->fetch('news' . $template_name . '_' . TICKER, $tmp))
|
||||||
$cache->delete('news' . $template_name . '_' . TICKER);
|
$cache->delete('news' . $template_name . '_' . TICKER);
|
||||||
|
|
||||||
if ($cache->fetch('template_ini' . $template_name, $tmp))
|
if ($cache->fetch('template_ini' . $template_name, $tmp))
|
||||||
$cache->delete('template_ini' . $template_name);
|
$cache->delete('template_ini' . $template_name);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
@ -16,13 +16,13 @@ require LIBS . 'weapons.php';
|
|||||||
$twig->display('admin.items.html.twig');
|
$twig->display('admin.items.html.twig');
|
||||||
|
|
||||||
$reload = isset($_REQUEST['reload']) && (int)$_REQUEST['reload'] == 1;
|
$reload = isset($_REQUEST['reload']) && (int)$_REQUEST['reload'] == 1;
|
||||||
if($reload) {
|
if ($reload) {
|
||||||
if(Items::loadFromXML(true))
|
if (Items::loadFromXML(true))
|
||||||
success('Successfully loaded items.');
|
success('Successfully loaded items.');
|
||||||
else
|
else
|
||||||
error(Items::getError());
|
error(Items::getError());
|
||||||
|
|
||||||
if(Weapons::loadFromXML(true))
|
if (Weapons::loadFromXML(true))
|
||||||
success('Successfully loaded weapons.');
|
success('Successfully loaded weapons.');
|
||||||
else
|
else
|
||||||
error(Weapons::getError());
|
error(Weapons::getError());
|
||||||
|
@ -10,23 +10,23 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Login';
|
$title = 'Login';
|
||||||
$logout = '';
|
$logout = '';
|
||||||
if($action == 'logout') {
|
if ($action == 'logout') {
|
||||||
$logout = "You have been logged out!";
|
$logout = "You have been logged out!";
|
||||||
}
|
}
|
||||||
|
|
||||||
$search_errors[] = 'Character <b></b> does not exist or has been deleted.';
|
$search_errors[] = 'Character <b></b> does not exist or has been deleted.';
|
||||||
|
|
||||||
|
|
||||||
if(isset($errors)) {
|
if (isset($errors)) {
|
||||||
foreach($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
error($error);
|
error($error);
|
||||||
$twig->display('admin.error.html.twig', array('errors' => $error));
|
$twig->display('admin.error.html.twig', array('errors' => $error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$twig->display('admin.login.html.twig', array(
|
$twig->display('admin.login.html.twig', array(
|
||||||
'errors' => $search_errors,
|
'errors' => $search_errors,
|
||||||
'logout' => $logout,
|
'logout' => $logout,
|
||||||
'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number',
|
'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number',
|
||||||
));
|
));
|
@ -12,113 +12,113 @@ $title = 'Logs viewer';
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Logs:</h3>
|
<h3 class="box-title">Logs:</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div id="logs_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
<div id="logs_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table id="logs" class="table table-bordered table-striped dataTable" role="grid"
|
<table id="logs" class="table table-bordered table-striped dataTable" role="grid"
|
||||||
aria-describedby="logs_info">
|
aria-describedby="logs_info">
|
||||||
<thead>
|
<thead>
|
||||||
<tr role="row">
|
<tr role="row">
|
||||||
<th class="sorting_asc" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
<th class="sorting_asc" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
||||||
aria-sort="ascending" aria-label="Log name: activate to sort column descending"
|
aria-sort="ascending" aria-label="Log name: activate to sort column descending"
|
||||||
style="width: 297px;">Log name
|
style="width: 297px;">Log name
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
||||||
aria-label="Last updated: activate to sort column ascending" style="width: 361px;">Last
|
aria-label="Last updated: activate to sort column ascending" style="width: 361px;">Last
|
||||||
updated
|
updated
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$files = array();
|
$files = array();
|
||||||
$aac_path_logs = BASE . 'system/logs/';
|
$aac_path_logs = BASE . 'system/logs/';
|
||||||
foreach (scandir($aac_path_logs) as $f) {
|
foreach (scandir($aac_path_logs) as $f) {
|
||||||
if ($f[0] == '.' || $f == '..' || is_dir($aac_path_logs . $f))
|
if ($f[0] == '.' || $f == '..' || is_dir($aac_path_logs . $f))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$files[] = array($f, $aac_path_logs);
|
$files[] = array($f, $aac_path_logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
$server_path_logs = $config['server_path'] . 'logs/';
|
$server_path_logs = $config['server_path'] . 'logs/';
|
||||||
if (!file_exists($server_path_logs)) {
|
if (!file_exists($server_path_logs)) {
|
||||||
$server_path_logs = $config['data_path'] . 'logs/';
|
$server_path_logs = $config['data_path'] . 'logs/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists($server_path_logs)) {
|
if (file_exists($server_path_logs)) {
|
||||||
foreach (scandir($server_path_logs) as $f) {
|
foreach (scandir($server_path_logs) as $f) {
|
||||||
if ($f[0] == '.' || $f == '..')
|
if ($f[0] == '.' || $f == '..')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (is_dir($server_path_logs . $f)) {
|
if (is_dir($server_path_logs . $f)) {
|
||||||
foreach (scandir($server_path_logs . $f) as $f2) {
|
foreach (scandir($server_path_logs . $f) as $f2) {
|
||||||
if ($f2[0] == '.' || $f2 == '..')
|
if ($f2[0] == '.' || $f2 == '..')
|
||||||
continue;
|
continue;
|
||||||
$files[] = array($f . '/' . $f2, $server_path_logs);
|
$files[] = array($f . '/' . $f2, $server_path_logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$files[] = array($f, $server_path_logs);
|
$files[] = array($f, $server_path_logs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($files as $f) {
|
foreach ($files as $f) {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?php echo ADMIN_URL . '?p=logs&file=' . $f[0]; ?>"><?php echo $f[0]; ?></a>
|
<a href="<?php echo ADMIN_URL . '?p=logs&file=' . $f[0]; ?>"><?php echo $f[0]; ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo date("Y-m-d H:i:s", filemtime($f[1] . $f[0])); ?></td>
|
<td><?php echo date("Y-m-d H:i:s", filemtime($f[1] . $f[0])); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<th>Log name</th>
|
<th>Log name</th>
|
||||||
<th>Last updated</th>
|
<th>Last updated</th>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$file = isset($_GET['file']) ? $_GET['file'] : NULL;
|
$file = isset($_GET['file']) ? $_GET['file'] : NULL;
|
||||||
if (!empty($file)) {
|
if (!empty($file)) {
|
||||||
if (!preg_match('/[^A-z0-9\' _\/\-\.]/', $file)) {
|
if (!preg_match('/[^A-z0-9\' _\/\-\.]/', $file)) {
|
||||||
if (file_exists($aac_path_logs . $file)) {
|
if (file_exists($aac_path_logs . $file)) {
|
||||||
echo '
|
echo '
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title"><b>' . $file . '</b></h3>
|
<h3 class="box-title"><b>' . $file . '</b></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">';
|
<div class="box-body">';
|
||||||
echo nl2br(file_get_contents($aac_path_logs . $file));
|
echo nl2br(file_get_contents($aac_path_logs . $file));
|
||||||
echo '</div>
|
echo '</div>
|
||||||
</div>';
|
</div>';
|
||||||
} else if (file_exists($server_path_logs . $file)) {
|
} else if (file_exists($server_path_logs . $file)) {
|
||||||
echo '<div class="box"><div class="box-header"><h3 class="box-title"><b>' . $file . '</b></h3></div><div class="box-body">';
|
echo '<div class="box"><div class="box-header"><h3 class="box-title"><b>' . $file . '</b></h3></div><div class="box-body">';
|
||||||
echo nl2br(file_get_contents($server_path_logs . $file));
|
echo nl2br(file_get_contents($server_path_logs . $file));
|
||||||
echo '</div></div>';
|
echo '</div></div>';
|
||||||
} else
|
} else
|
||||||
echo 'Specified file does not exist.';
|
echo 'Specified file does not exist.';
|
||||||
} else
|
} else
|
||||||
echo 'Invalid file name specified.';
|
echo 'Invalid file name specified.';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#logs').DataTable()
|
$('#logs').DataTable()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
@ -10,14 +10,12 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Mailer';
|
$title = 'Mailer';
|
||||||
|
|
||||||
if(!hasFlag(FLAG_CONTENT_MAILER) && !superAdmin())
|
if (!hasFlag(FLAG_CONTENT_MAILER) && !superAdmin()) {
|
||||||
{
|
|
||||||
echo 'Access denied.';
|
echo 'Access denied.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$config['mail_enabled'])
|
if (!$config['mail_enabled']) {
|
||||||
{
|
|
||||||
echo 'Mail support disabled.';
|
echo 'Mail support disabled.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -27,11 +25,11 @@ $mail_subject = isset($_POST['mail_subject']) ? stripslashes($_POST['mail_subjec
|
|||||||
$preview = isset($_REQUEST['preview']);
|
$preview = isset($_REQUEST['preview']);
|
||||||
|
|
||||||
$preview_done = false;
|
$preview_done = false;
|
||||||
if($preview) {
|
if ($preview) {
|
||||||
if(!empty($mail_content) && !empty($mail_subject)) {
|
if (!empty($mail_content) && !empty($mail_subject)) {
|
||||||
$preview_done = _mail($account_logged->getCustomField('email'), $mail_subject, $mail_content);
|
$preview_done = _mail($account_logged->getCustomField('email'), $mail_subject, $mail_content);
|
||||||
|
|
||||||
if(!$preview_done)
|
if (!$preview_done)
|
||||||
error('Error while sending preview mail: ' . $mailer->ErrorInfo);
|
error('Error while sending preview mail: ' . $mailer->ErrorInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,31 +41,29 @@ $twig->display('admin.mailer.html.twig', array(
|
|||||||
'preview_done' => $preview_done
|
'preview_done' => $preview_done
|
||||||
));
|
));
|
||||||
|
|
||||||
if(empty($mail_content) || empty($mail_subject) || $preview)
|
if (empty($mail_content) || empty($mail_subject) || $preview)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$success = 0;
|
$success = 0;
|
||||||
$failed = 0;
|
$failed = 0;
|
||||||
|
|
||||||
$add = '';
|
$add = '';
|
||||||
if($config['account_mail_verify']) {
|
if ($config['account_mail_verify']) {
|
||||||
note('Note: Sending only to users with verified E-Mail.');
|
note('Note: Sending only to users with verified E-Mail.');
|
||||||
$add = ' AND ' . $db->fieldName('email_verified') . ' = 1';
|
$add = ' AND ' . $db->fieldName('email_verified') . ' = 1';
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $db->query('SELECT ' . $db->fieldName('email') . ' FROM ' . $db->tableName('accounts') . ' WHERE ' . $db->fieldName('email') . ' != ""' . $add);
|
$query = $db->query('SELECT ' . $db->fieldName('email') . ' FROM ' . $db->tableName('accounts') . ' WHERE ' . $db->fieldName('email') . ' != ""' . $add);
|
||||||
foreach($query as $email)
|
foreach ($query as $email) {
|
||||||
{
|
if (_mail($email['email'], $mail_subject, $mail_content))
|
||||||
if(_mail($email['email'], $mail_subject, $mail_content))
|
|
||||||
$success++;
|
$success++;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$failed++;
|
$failed++;
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
error('An error occorred while sending email to <b>' . $email['email'] . '</b>. Error: ' . $mailer->ErrorInfo);
|
error('An error occorred while sending email to <b>' . $email['email'] . '</b>. Error: ' . $mailer->ErrorInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
success('Mailing finished.');
|
success('Mailing finished.');
|
||||||
success("$success emails delivered.");
|
success("$success emails delivered.");
|
||||||
warning("$failed emails failed.");
|
warning("$failed emails failed.");
|
||||||
|
@ -10,84 +10,81 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Menus';
|
$title = 'Menus';
|
||||||
|
|
||||||
if(!hasFlag(FLAG_CONTENT_MENUS) && !superAdmin())
|
if (!hasFlag(FLAG_CONTENT_MENUS) && !superAdmin()) {
|
||||||
{
|
echo 'Access denied.';
|
||||||
echo 'Access denied.';
|
return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_REQUEST['template'])) {
|
if (isset($_REQUEST['template'])) {
|
||||||
$template = $_REQUEST['template'];
|
$template = $_REQUEST['template'];
|
||||||
|
|
||||||
if(isset($_REQUEST['menu'])) {
|
if (isset($_REQUEST['menu'])) {
|
||||||
$post_menu = $_REQUEST['menu'];
|
$post_menu = $_REQUEST['menu'];
|
||||||
$post_menu_link = $_REQUEST['menu_link'];
|
$post_menu_link = $_REQUEST['menu_link'];
|
||||||
$post_menu_blank = $_REQUEST['menu_blank'];
|
$post_menu_blank = $_REQUEST['menu_blank'];
|
||||||
$post_menu_color = $_REQUEST['menu_color'];
|
$post_menu_color = $_REQUEST['menu_color'];
|
||||||
if(count($post_menu) != count($post_menu_link)) {
|
if (count($post_menu) != count($post_menu_link)) {
|
||||||
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query('DELETE FROM `' . TABLE_PREFIX . 'menu` WHERE `template` = ' . $db->quote($template));
|
$db->query('DELETE FROM `' . TABLE_PREFIX . 'menu` WHERE `template` = ' . $db->quote($template));
|
||||||
foreach($post_menu as $category => $menus) {
|
foreach ($post_menu as $category => $menus) {
|
||||||
foreach($menus as $i => $menu) {
|
foreach ($menus as $i => $menu) {
|
||||||
if(empty($menu)) // don't save empty menu item
|
if (empty($menu)) // don't save empty menu item
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$db->insert(TABLE_PREFIX . 'menu', array('template' => $template, 'name' => $menu, 'link' => $post_menu_link[$category][$i], 'blank' => $post_menu_blank[$category][$i] == 'on' ? 1 : 0, 'color' => str_replace('#', '', $post_menu_color[$category][$i]), 'category' => $category, 'ordering' => $i));
|
$db->insert(TABLE_PREFIX . 'menu', array('template' => $template, 'name' => $menu, 'link' => $post_menu_link[$category][$i], 'blank' => $post_menu_blank[$category][$i] == 'on' ? 1 : 0, 'color' => str_replace('#', '', $post_menu_color[$category][$i]), 'category' => $category, 'ordering' => $i));
|
||||||
}
|
} catch (PDOException $error) {
|
||||||
catch(PDOException $error) {
|
warning('Error while adding menu item (' . $menu . '): ' . $error->getMessage());
|
||||||
warning('Error while adding menu item (' . $menu . '): ' . $error->getMessage());
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
success('Saved at ' . date('H:i'));
|
success('Saved at ' . date('H:i'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = TEMPLATES . $template . '/config.php';
|
$file = TEMPLATES . $template . '/config.php';
|
||||||
if(file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
require_once $file;
|
require_once $file;
|
||||||
}
|
} else {
|
||||||
else {
|
echo 'Cannot find template config.php file.';
|
||||||
echo 'Cannot find template config.php file.';
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(!isset($config['menu_categories'])) {
|
if (!isset($config['menu_categories'])) {
|
||||||
echo "No menu categories set in template config.php.<br/>This template doesn't support dynamic menus.";
|
echo "No menu categories set in template config.php.<br/>This template doesn't support dynamic menus.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo 'Hint: You can drag menu items.<br/>
|
echo 'Hint: You can drag menu items.<br/>
|
||||||
Hint: Add links to external sites using: <b>http://</b> prefix.<br/>
|
Hint: Add links to external sites using: <b>http://</b> prefix.<br/>
|
||||||
Not all templates support blank and colorful links.<br/>
|
Not all templates support blank and colorful links.<br/>
|
||||||
<div class="row">';
|
<div class="row">';
|
||||||
$menus = array();
|
$menus = array();
|
||||||
$menus_db = $db->query('SELECT `name`, `link`, `blank`, `color`, `category`, `ordering` FROM `' . TABLE_PREFIX . 'menu` WHERE `enabled` = 1 AND `template` = ' . $db->quote($template) . ' ORDER BY `ordering` ASC;')->fetchAll();
|
$menus_db = $db->query('SELECT `name`, `link`, `blank`, `color`, `category`, `ordering` FROM `' . TABLE_PREFIX . 'menu` WHERE `enabled` = 1 AND `template` = ' . $db->quote($template) . ' ORDER BY `ordering` ASC;')->fetchAll();
|
||||||
foreach($menus_db as $menu) {
|
foreach ($menus_db as $menu) {
|
||||||
$menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link'], 'blank' => $menu['blank'], 'color' => $menu['color'], 'ordering' => $menu['ordering']);
|
$menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link'], 'blank' => $menu['blank'], 'color' => $menu['color'], 'ordering' => $menu['ordering']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_id = array();
|
$last_id = array();
|
||||||
echo '<form method="post" id="menus-form" action="?p=menus">';
|
echo '<form method="post" id="menus-form" action="?p=menus">';
|
||||||
echo '<input type="hidden" name="template" value="' . $template . '"/>';
|
echo '<input type="hidden" name="template" value="' . $template . '"/>';
|
||||||
foreach($config['menu_categories'] as $id => $cat) {
|
foreach ($config['menu_categories'] as $id => $cat) {
|
||||||
echo ' <div class="col-md-12 col-lg-6">
|
echo ' <div class="col-md-12 col-lg-6">
|
||||||
<div class="box box-danger">
|
<div class="box box-danger">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">'. $cat['name'] . ' <img class="add-button" id="add-button-' . $id . '" src="' . BASE_URL . 'images/plus.png" width="16" height="16"/></h3>
|
<h3 class="box-title">' . $cat['name'] . ' <img class="add-button" id="add-button-' . $id . '" src="' . BASE_URL . 'images/plus.png" width="16" height="16"/></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">';
|
<div class="box-body">';
|
||||||
|
|
||||||
|
|
||||||
echo '<ul class="sortable" id="sortable-' . $id . '">';
|
echo '<ul class="sortable" id="sortable-' . $id . '">';
|
||||||
if(isset($menus[$id])) {
|
if (isset($menus[$id])) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($menus[$id] as $menu) {
|
foreach ($menus[$id] as $menu) {
|
||||||
echo '<li class="ui-state-default" id="list-' . $id . '-' . $i . '"><input type="text" name="menu[' . $id . '][]" value="' . $menu['name'] . '"/>
|
echo '<li class="ui-state-default" id="list-' . $id . '-' . $i . '"><input type="text" name="menu[' . $id . '][]" value="' . $menu['name'] . '"/>
|
||||||
<input type="text" name="menu_link[' . $id . '][]" value="' . $menu['link'] . '"/>
|
<input type="text" name="menu_link[' . $id . '][]" value="' . $menu['link'] . '"/>
|
||||||
<input type="hidden" name="menu_blank[' . $id . '][]" value="0" />
|
<input type="hidden" name="menu_blank[' . $id . '][]" value="0" />
|
||||||
<label><input class="blank-checkbox" type="checkbox" ' . ($menu['blank'] == 1 ? 'checked' : '') . '/><span title="Open in New Window">Blank</span></label>
|
<label><input class="blank-checkbox" type="checkbox" ' . ($menu['blank'] == 1 ? 'checked' : '') . '/><span title="Open in New Window">Blank</span></label>
|
||||||
@ -96,41 +93,40 @@ if(isset($_REQUEST['template'])) {
|
|||||||
|
|
||||||
<a class="remove-button" id="remove-button-' . $id . '-' . $i . '"><img src="' . BASE_URL . 'images/del.png"/></a></li>';
|
<a class="remove-button" id="remove-button-' . $id . '-' . $i . '"><img src="' . BASE_URL . 'images/del.png"/></a></li>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$last_id[$id] = $i;
|
$last_id[$id] = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
echo ' </div>
|
echo ' </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
echo ' </div><div class="row"><div class="col-md-6">';
|
echo ' </div><div class="row"><div class="col-md-6">';
|
||||||
echo '<input type="submit" class="button" value="Update">';
|
echo '<input type="submit" class="button" value="Update">';
|
||||||
echo '<input type="button" class="button" value="Cancel" onclick="window.location = \'' . ADMIN_URL . '?p=menus&template=' . $template . '\';">';
|
echo '<input type="button" class="button" value="Cancel" onclick="window.location = \'' . ADMIN_URL . '?p=menus&template=' . $template . '\';">';
|
||||||
echo '</div></div>';
|
echo '</div></div>';
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
$twig->display('admin.menus.js.html.twig', array(
|
$twig->display('admin.menus.js.html.twig', array(
|
||||||
'menus' => $menus,
|
'menus' => $menus,
|
||||||
'last_id' => $last_id
|
'last_id' => $last_id
|
||||||
));
|
));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
} else {
|
||||||
else {
|
$templates = $db->query('SELECT `template` FROM `' . TABLE_PREFIX . 'menu` GROUP BY `template`;')->fetchAll();
|
||||||
$templates = $db->query('SELECT `template` FROM `' . TABLE_PREFIX . 'menu` GROUP BY `template`;')->fetchAll();
|
foreach ($templates as $key => $value) {
|
||||||
foreach($templates as $key => $value) {
|
$file = TEMPLATES . $value['template'] . '/config.php';
|
||||||
$file = TEMPLATES . $value['template'] . '/config.php';
|
if (!file_exists($file)) {
|
||||||
if(!file_exists($file)) {
|
unset($templates[$key]);
|
||||||
unset($templates[$key]);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
$twig->display('admin.menus.form.html.twig', array(
|
||||||
$twig->display('admin.menus.form.html.twig', array(
|
'templates' => $templates
|
||||||
'templates' => $templates
|
));
|
||||||
));
|
|
||||||
}
|
}
|
@ -11,19 +11,16 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
$title = 'Notepad';
|
$title = 'Notepad';
|
||||||
|
|
||||||
$notepad_content = Notepad::get($account_logged->getId());
|
$notepad_content = Notepad::get($account_logged->getId());
|
||||||
if(isset($_POST['content']))
|
if (isset($_POST['content'])) {
|
||||||
{
|
|
||||||
$_content = html_entity_decode(stripslashes($_POST['content']));
|
$_content = html_entity_decode(stripslashes($_POST['content']));
|
||||||
if(!$notepad_content)
|
if (!$notepad_content)
|
||||||
Notepad::create($account_logged->getId(), $_content);
|
Notepad::create($account_logged->getId(), $_content);
|
||||||
else
|
else
|
||||||
Notepad::update($account_logged->getId(), $_content);
|
Notepad::update($account_logged->getId(), $_content);
|
||||||
|
|
||||||
echo '<div class="success" style="text-align: center;">Saved at ' . date('H:i') . '</div>';
|
echo '<div class="success" style="text-align: center;">Saved at ' . date('H:i') . '</div>';
|
||||||
}
|
} else {
|
||||||
else
|
if ($notepad_content !== false)
|
||||||
{
|
|
||||||
if($notepad_content !== false)
|
|
||||||
$_content = $notepad_content;
|
$_content = $notepad_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +32,7 @@ class Notepad
|
|||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$query = $db->select(TABLE_PREFIX . 'notepad', array('account_id' => $account_id));
|
$query = $db->select(TABLE_PREFIX . 'notepad', array('account_id' => $account_id));
|
||||||
if($query !== false)
|
if ($query !== false)
|
||||||
return $query['content'];
|
return $query['content'];
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Pages';
|
$title = 'Pages';
|
||||||
|
|
||||||
if(!hasFlag(FLAG_CONTENT_PAGES) && !superAdmin())
|
if (!hasFlag(FLAG_CONTENT_PAGES) && !superAdmin()) {
|
||||||
{
|
|
||||||
echo 'Access denied.';
|
echo 'Access denied.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -24,66 +23,59 @@ $groups = new OTS_Groups_List();
|
|||||||
$php = false;
|
$php = false;
|
||||||
$access = 0;
|
$access = 0;
|
||||||
|
|
||||||
if(!empty($action))
|
if (!empty($action)) {
|
||||||
{
|
if ($action == 'delete' || $action == 'edit' || $action == 'hide')
|
||||||
if($action == 'delete' || $action == 'edit' || $action == 'hide')
|
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
|
|
||||||
if(isset($_REQUEST['name']))
|
if (isset($_REQUEST['name']))
|
||||||
$name = $_REQUEST['name'];
|
$name = $_REQUEST['name'];
|
||||||
|
|
||||||
if(isset($_REQUEST['title']))
|
if (isset($_REQUEST['title']))
|
||||||
$p_title = $_REQUEST['title'];
|
$p_title = $_REQUEST['title'];
|
||||||
|
|
||||||
$php = isset($_REQUEST['php']) && $_REQUEST['php'] == 1;
|
$php = isset($_REQUEST['php']) && $_REQUEST['php'] == 1;
|
||||||
if($php)
|
if ($php)
|
||||||
$body = $_REQUEST['body'];
|
$body = $_REQUEST['body'];
|
||||||
else if(isset($_REQUEST['body'])) {
|
else if (isset($_REQUEST['body'])) {
|
||||||
//$body = $_REQUEST['body'];
|
//$body = $_REQUEST['body'];
|
||||||
$body = html_entity_decode(stripslashes($_REQUEST['body']));
|
$body = html_entity_decode(stripslashes($_REQUEST['body']));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_REQUEST['access']))
|
if (isset($_REQUEST['access']))
|
||||||
$access = $_REQUEST['access'];
|
$access = $_REQUEST['access'];
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$player_id = 1;
|
$player_id = 1;
|
||||||
|
|
||||||
if($action == 'add') {
|
if ($action == 'add') {
|
||||||
if(Pages::add($name, $p_title, $body, $player_id, $php, $access, $errors))
|
if (Pages::add($name, $p_title, $body, $player_id, $php, $access, $errors)) {
|
||||||
{
|
|
||||||
$name = $p_title = $body = '';
|
$name = $p_title = $body = '';
|
||||||
$player_id = $access = 0;
|
$player_id = $access = 0;
|
||||||
$php = false;
|
$php = false;
|
||||||
}
|
}
|
||||||
}
|
} else if ($action == 'delete') {
|
||||||
else if($action == 'delete') {
|
if (Pages::delete($id, $errors))
|
||||||
if(Pages::delete($id, $errors))
|
|
||||||
success('Page with id ' . $id . ' has been deleted');
|
success('Page with id ' . $id . ' has been deleted');
|
||||||
}
|
} else if ($action == 'edit') {
|
||||||
else if($action == 'edit')
|
if (isset($id) && !isset($_REQUEST['name'])) {
|
||||||
{
|
|
||||||
if(isset($id) && !isset($_REQUEST['name'])) {
|
|
||||||
$_page = Pages::get($id);
|
$_page = Pages::get($id);
|
||||||
$name = $_page['name'];
|
$name = $_page['name'];
|
||||||
$p_title = $_page['title'];
|
$p_title = $_page['title'];
|
||||||
$body = $_page['body'];
|
$body = $_page['body'];
|
||||||
$php = $_page['php'] == '1';
|
$php = $_page['php'] == '1';
|
||||||
$access = $_page['access'];
|
$access = $_page['access'];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Pages::update($id, $name, $p_title, $body, $player_id, $php, $access);
|
Pages::update($id, $name, $p_title, $body, $player_id, $php, $access);
|
||||||
$action = $name = $p_title = $body = '';
|
$action = $name = $p_title = $body = '';
|
||||||
$player_id = 1;
|
$player_id = 1;
|
||||||
$access = 0;
|
$access = 0;
|
||||||
$php = false;
|
$php = false;
|
||||||
}
|
}
|
||||||
}
|
} else if ($action == 'hide') {
|
||||||
else if($action == 'hide') {
|
|
||||||
Pages::toggleHidden($id, $errors);
|
Pages::toggleHidden($id, $errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($errors))
|
if (!empty($errors))
|
||||||
$twig->display('admin.error.html.twig', array('errors' => $errors));
|
$twig->display('admin.error.html.twig', array('errors' => $errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +83,7 @@ $query =
|
|||||||
$db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'pages'));
|
$db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'pages'));
|
||||||
|
|
||||||
$pages = array();
|
$pages = array();
|
||||||
foreach($query as $_page) {
|
foreach ($query as $_page) {
|
||||||
$pages[] = array(
|
$pages[] = array(
|
||||||
'link' => getFullLink($_page['name'], $_page['name'], true),
|
'link' => getFullLink($_page['name'], $_page['name'], true),
|
||||||
'title' => substr($_page['title'], 0, 20),
|
'title' => substr($_page['title'], 0, 20),
|
||||||
@ -121,7 +113,7 @@ class Pages
|
|||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$query = $db->select(TABLE_PREFIX . 'pages', array('id' => $id));
|
$query = $db->select(TABLE_PREFIX . 'pages', array('id' => $id));
|
||||||
if($query !== false)
|
if ($query !== false)
|
||||||
return $query;
|
return $query;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -130,21 +122,20 @@ class Pages
|
|||||||
static public function add($name, $title, $body, $player_id, $php, $access, &$errors)
|
static public function add($name, $title, $body, $player_id, $php, $access, &$errors)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
if(isset($name[0]) && isset($title[0]) && isset($body[0]) && $player_id != 0)
|
if (isset($name[0]) && isset($title[0]) && isset($body[0]) && $player_id != 0) {
|
||||||
{
|
|
||||||
$query = $db->select(TABLE_PREFIX . 'pages', array('name' => $name));
|
$query = $db->select(TABLE_PREFIX . 'pages', array('name' => $name));
|
||||||
if($query === false)
|
if ($query === false)
|
||||||
$db->insert(TABLE_PREFIX . 'pages', array('name' => $name, 'title' => $title, 'body' => $body, 'player_id' => $player_id, 'php' => $php ? '1' : '0', 'access' => $access));
|
$db->insert(TABLE_PREFIX . 'pages', array('name' => $name, 'title' => $title, 'body' => $body, 'player_id' => $player_id, 'php' => $php ? '1' : '0', 'access' => $access));
|
||||||
else
|
else
|
||||||
$errors[] = 'Page with this link already exists.';
|
$errors[] = 'Page with this link already exists.';
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
$errors[] = 'Please fill all inputs.';
|
$errors[] = 'Please fill all inputs.';
|
||||||
|
|
||||||
return !count($errors);
|
return !count($errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function update($id, $name, $title, $body, $player_id, $php, $access) {
|
static public function update($id, $name, $title, $body, $player_id, $php, $access)
|
||||||
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$db->update(TABLE_PREFIX . 'pages', array('name' => $name, 'title' => $title, 'body' => $body, 'player_id' => $player_id, 'php' => $php ? '1' : '0', 'access' => $access), array('id' => $id));
|
$db->update(TABLE_PREFIX . 'pages', array('name' => $name, 'title' => $title, 'body' => $body, 'player_id' => $player_id, 'php' => $php ? '1' : '0', 'access' => $access), array('id' => $id));
|
||||||
}
|
}
|
||||||
@ -152,14 +143,12 @@ class Pages
|
|||||||
static public function delete($id, &$errors)
|
static public function delete($id, &$errors)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
if(isset($id))
|
if (isset($id)) {
|
||||||
{
|
if ($db->select(TABLE_PREFIX . 'pages', array('id' => $id)) !== false)
|
||||||
if($db->select(TABLE_PREFIX . 'pages', array('id' => $id)) !== false)
|
|
||||||
$db->delete(TABLE_PREFIX . 'pages', array('id' => $id));
|
$db->delete(TABLE_PREFIX . 'pages', array('id' => $id));
|
||||||
else
|
else
|
||||||
$errors[] = 'Page with id ' . $id . ' does not exists.';
|
$errors[] = 'Page with id ' . $id . ' does not exists.';
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
$errors[] = 'id not set';
|
$errors[] = 'id not set';
|
||||||
|
|
||||||
return !count($errors);
|
return !count($errors);
|
||||||
@ -168,18 +157,17 @@ class Pages
|
|||||||
static public function toggleHidden($id, &$errors)
|
static public function toggleHidden($id, &$errors)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
if(isset($id))
|
if (isset($id)) {
|
||||||
{
|
|
||||||
$query = $db->select(TABLE_PREFIX . 'pages', array('id' => $id));
|
$query = $db->select(TABLE_PREFIX . 'pages', array('id' => $id));
|
||||||
if($query !== false)
|
if ($query !== false)
|
||||||
$db->update(TABLE_PREFIX . 'pages', array('hidden' => ($query['hidden'] == 1 ? 0 : 1)), array('id' => $id));
|
$db->update(TABLE_PREFIX . 'pages', array('hidden' => ($query['hidden'] == 1 ? 0 : 1)), array('id' => $id));
|
||||||
else
|
else
|
||||||
$errors[] = 'Page with id ' . $id . ' does not exists.';
|
$errors[] = 'Page with id ' . $id . ' does not exists.';
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
$errors[] = 'id not set';
|
$errors[] = 'id not set';
|
||||||
|
|
||||||
return !count($errors);
|
return !count($errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -10,10 +10,10 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'PHP Info';
|
$title = 'PHP Info';
|
||||||
|
|
||||||
if(!function_exists('phpinfo')) { ?>
|
if (!function_exists('phpinfo')) { ?>
|
||||||
<b>phpinfo()</b> function is disabled in your webserver config.<br/>
|
<b>phpinfo()</b> function is disabled in your webserver config.<br/>
|
||||||
You can enable it by editing <b>php.ini</b> file.
|
You can enable it by editing <b>php.ini</b> file.
|
||||||
<?php return;
|
<?php return;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<iframe src="<?php echo BASE_URL; ?>admin/tools/phpinfo.php" width="1024" height="550" />
|
<iframe src="<?php echo BASE_URL; ?>admin/tools/phpinfo.php" width="1024" height="550"/>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -14,18 +14,15 @@ require LIBS . 'plugins.php';
|
|||||||
|
|
||||||
$twig->display('admin.plugins.form.html.twig');
|
$twig->display('admin.plugins.form.html.twig');
|
||||||
|
|
||||||
if(isset($_REQUEST['uninstall'])){
|
if (isset($_REQUEST['uninstall'])) {
|
||||||
$uninstall = $_REQUEST['uninstall'];
|
$uninstall = $_REQUEST['uninstall'];
|
||||||
|
|
||||||
if(Plugins::uninstall($uninstall)) {
|
if (Plugins::uninstall($uninstall)) {
|
||||||
success('Successfully uninstalled plugin ' . $uninstall);
|
success('Successfully uninstalled plugin ' . $uninstall);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
error('Error while uninstalling plugin ' . $uninstall . ': ' . Plugins::getError());
|
error('Error while uninstalling plugin ' . $uninstall . ': ' . Plugins::getError());
|
||||||
}
|
}
|
||||||
}
|
} else if (isset($_FILES["plugin"]["name"])) {
|
||||||
else if(isset($_FILES["plugin"]["name"]))
|
|
||||||
{
|
|
||||||
$file = $_FILES["plugin"];
|
$file = $_FILES["plugin"];
|
||||||
$filename = $file["name"];
|
$filename = $file["name"];
|
||||||
$tmp_name = $file["tmp_name"];
|
$tmp_name = $file["tmp_name"];
|
||||||
@ -34,15 +31,15 @@ else if(isset($_FILES["plugin"]["name"]))
|
|||||||
$name = explode(".", $filename);
|
$name = explode(".", $filename);
|
||||||
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed', 'application/octet-stream', 'application/zip-compressed');
|
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed', 'application/octet-stream', 'application/zip-compressed');
|
||||||
|
|
||||||
if(isset($file['error'])) {
|
if (isset($file['error'])) {
|
||||||
$error = 'Error uploading file';
|
$error = 'Error uploading file';
|
||||||
switch($file['error']) {
|
switch ($file['error']) {
|
||||||
case UPLOAD_ERR_OK:
|
case UPLOAD_ERR_OK:
|
||||||
$error = false;
|
$error = false;
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_INI_SIZE:
|
case UPLOAD_ERR_INI_SIZE:
|
||||||
case UPLOAD_ERR_FORM_SIZE:
|
case UPLOAD_ERR_FORM_SIZE:
|
||||||
$error .= ' - file too large (limit of '.ini_get('upload_max_filesize').' bytes).';
|
$error .= ' - file too large (limit of ' . ini_get('upload_max_filesize') . ' bytes).';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_PARTIAL:
|
case UPLOAD_ERR_PARTIAL:
|
||||||
$error .= ' - file upload was not completed.';
|
$error .= ' - file upload was not completed.';
|
||||||
@ -56,56 +53,49 @@ else if(isset($_FILES["plugin"]["name"]))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($error) && $error != false) {
|
if (isset($error) && $error != false) {
|
||||||
error($error);
|
error($error);
|
||||||
}
|
} else {
|
||||||
else {
|
if (is_uploaded_file($file['tmp_name'])) {
|
||||||
if(is_uploaded_file($file['tmp_name']) ) {
|
|
||||||
$filetype = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
$filetype = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||||
if($filetype == 'zip') // check if it is zipped/compressed file
|
if ($filetype == 'zip') // check if it is zipped/compressed file
|
||||||
{
|
{
|
||||||
$tmp_filename = pathinfo($filename, PATHINFO_FILENAME);
|
$tmp_filename = pathinfo($filename, PATHINFO_FILENAME);
|
||||||
$targetzip = BASE . 'plugins/' . $tmp_filename . '.zip';
|
$targetzip = BASE . 'plugins/' . $tmp_filename . '.zip';
|
||||||
|
|
||||||
if(move_uploaded_file($tmp_name, $targetzip)) { // move uploaded file
|
if (move_uploaded_file($tmp_name, $targetzip)) { // move uploaded file
|
||||||
if(Plugins::install($targetzip)) {
|
if (Plugins::install($targetzip)) {
|
||||||
foreach(Plugins::getWarnings() as $warning) {
|
foreach (Plugins::getWarnings() as $warning) {
|
||||||
warning($warning);
|
warning($warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
$info = Plugins::getPlugin();
|
$info = Plugins::getPlugin();
|
||||||
success((isset($info['name']) ? '<strong>' . $info['name'] . '</strong> p' : 'P') . 'lugin has been successfully installed.');
|
success((isset($info['name']) ? '<strong>' . $info['name'] . '</strong> p' : 'P') . 'lugin has been successfully installed.');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$error = Plugins::getError();
|
$error = Plugins::getError();
|
||||||
error(!empty($error) ? $error : 'Unexpected error happened while installing plugin. Please try again later.');
|
error(!empty($error) ? $error : 'Unexpected error happened while installing plugin. Please try again later.');
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink($targetzip); // delete the Zipped file
|
unlink($targetzip); // delete the Zipped file
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
error('There was a problem with the upload. Please try again.');
|
error('There was a problem with the upload. Please try again.');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
error('The file you are trying to upload is not a .zip file. Please try again.');
|
error('The file you are trying to upload is not a .zip file. Please try again.');
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
error('Error uploading file - unknown error.');
|
error('Error uploading file - unknown error.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$plugins = array();
|
$plugins = array();
|
||||||
foreach(get_plugins() as $plugin)
|
foreach (get_plugins() as $plugin) {
|
||||||
{
|
|
||||||
$string = file_get_contents(BASE . 'plugins/' . $plugin . '.json');
|
$string = file_get_contents(BASE . 'plugins/' . $plugin . '.json');
|
||||||
$string = Plugins::removeComments($string);
|
$string = Plugins::removeComments($string);
|
||||||
$plugin_info = json_decode($string, true);
|
$plugin_info = json_decode($string, true);
|
||||||
if($plugin_info == false) {
|
if ($plugin_info == false) {
|
||||||
warning('Cannot load plugin info ' . $plugin . '.json');
|
warning('Cannot load plugin info ' . $plugin . '.json');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$plugins[] = array(
|
$plugins[] = array(
|
||||||
'name' => isset($plugin_info['name']) ? $plugin_info['name'] : '',
|
'name' => isset($plugin_info['name']) ? $plugin_info['name'] : '',
|
||||||
'description' => isset($plugin_info['description']) ? $plugin_info['description'] : '',
|
'description' => isset($plugin_info['description']) ? $plugin_info['description'] : '',
|
||||||
|
@ -11,19 +11,17 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
$title = 'Tools';
|
$title = 'Tools';
|
||||||
|
|
||||||
$tool = $_GET['tool'];
|
$tool = $_GET['tool'];
|
||||||
if(!isset($tool))
|
if (!isset($tool)) {
|
||||||
{
|
|
||||||
echo 'Tool not set.';
|
echo 'Tool not set.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(preg_match("/[^A-z0-9_\-]/", $tool))
|
if (preg_match("/[^A-z0-9_\-]/", $tool)) {
|
||||||
{
|
|
||||||
echo 'Invalid tool.';
|
echo 'Invalid tool.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = BASE . 'admin/pages/tools/' . $tool . '.php';
|
$file = BASE . 'admin/pages/tools/' . $tool . '.php';
|
||||||
if(!@file_exists($file))
|
if (!@file_exists($file))
|
||||||
require $file;
|
require $file;
|
||||||
?>
|
?>
|
||||||
|
@ -14,7 +14,7 @@ $title = 'Version check';
|
|||||||
//$file = @fopen('http://my-aac.org/VERSION', 'r') or die('Error while fetching version.');
|
//$file = @fopen('http://my-aac.org/VERSION', 'r') or die('Error while fetching version.');
|
||||||
//$myaac_version = fgets($file);
|
//$myaac_version = fgets($file);
|
||||||
$myaac_version = @file_get_contents('http://my-aac.org/VERSION');
|
$myaac_version = @file_get_contents('http://my-aac.org/VERSION');
|
||||||
if(!$myaac_version) {
|
if (!$myaac_version) {
|
||||||
warning('Error while fetching version info from http://my-aac.org<br/>
|
warning('Error while fetching version info from http://my-aac.org<br/>
|
||||||
Please try again later.');
|
Please try again later.');
|
||||||
return;
|
return;
|
||||||
@ -22,15 +22,13 @@ if(!$myaac_version) {
|
|||||||
|
|
||||||
// compare them
|
// compare them
|
||||||
$version_compare = version_compare($myaac_version, MYAAC_VERSION);
|
$version_compare = version_compare($myaac_version, MYAAC_VERSION);
|
||||||
if($version_compare == 0) {
|
if ($version_compare == 0) {
|
||||||
success('MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.
|
success('MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.
|
||||||
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
||||||
}
|
} else if ($version_compare < 0) {
|
||||||
else if($version_compare < 0) {
|
|
||||||
echo success('Woah, seems you\'re using newer version as latest released one! MyAAC latest released version is ' . $myaac_version . ', and you\'re using version ' . MYAAC_VERSION . '.
|
echo success('Woah, seems you\'re using newer version as latest released one! MyAAC latest released version is ' . $myaac_version . ', and you\'re using version ' . MYAAC_VERSION . '.
|
||||||
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
warning('You\'re using outdated version.<br/>
|
warning('You\'re using outdated version.<br/>
|
||||||
Your version: <b>' . MYAAC_VERSION . '</b><br/>
|
Your version: <b>' . MYAAC_VERSION . '</b><br/>
|
||||||
Latest version: <b>' . $myaac_version . '</b><br/>
|
Latest version: <b>' . $myaac_version . '</b><br/>
|
||||||
|
@ -10,18 +10,19 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Visitors';
|
$title = 'Visitors';
|
||||||
|
|
||||||
if(!$config['visitors_counter']): ?>
|
if (!$config['visitors_counter']): ?>
|
||||||
Visitors counter is disabled.<br/>
|
Visitors counter is disabled.<br/>
|
||||||
You can enable it by editing this configurable in <b>config.local.php</b> file:<br/>
|
You can enable it by editing this configurable in <b>config.local.php</b> file:<br/>
|
||||||
<p style="margin-left: 3em;"><b>$config['visitors_counter'] = true;</b></p>
|
<p style="margin-left: 3em;"><b>$config['visitors_counter'] = true;</b></p>
|
||||||
<?php
|
<?php
|
||||||
return;
|
return;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
require SYSTEM . 'libs/visitors.php';
|
require SYSTEM . 'libs/visitors.php';
|
||||||
$visitors = new Visitors($config['visitors_counter_ttl']);
|
$visitors = new Visitors($config['visitors_counter_ttl']);
|
||||||
|
|
||||||
function compare($a, $b) {
|
function compare($a, $b)
|
||||||
|
{
|
||||||
return $a['lastvisit'] > $b['lastvisit'] ? -1 : 1;
|
return $a['lastvisit'] > $b['lastvisit'] ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,229 +14,161 @@ $title = "Creatures";
|
|||||||
?>
|
?>
|
||||||
<script type="text/javascript" src="tools/js/tipped.js"></script>
|
<script type="text/javascript" src="tools/js/tipped.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="tools/css/tipped.css"/>
|
<link rel="stylesheet" type="text/css" href="tools/css/tipped.css"/>
|
||||||
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/jquery.dataTables.min.css">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
Tipped.create('.tooltip');
|
Tipped.create('.tooltip');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$canEdit = hasFlag(FLAG_CONTENT_MONSTERS) || admin();
|
$canEdit = hasFlag(FLAG_CONTENT_MONSTERS) || admin();
|
||||||
if(isset($_POST['reload_monsters']) && $canEdit)
|
if (isset($_POST['reload_monsters']) && $canEdit) {
|
||||||
{
|
|
||||||
require LIBS . 'creatures.php';
|
require LIBS . 'creatures.php';
|
||||||
if(Creatures::loadFromXML(true)) {
|
if (Creatures::loadFromXML(true)) {
|
||||||
if (Creatures::getMonstersList()->hasErrors())
|
if (Creatures::getMonstersList()->hasErrors())
|
||||||
error('There were some problems loading your monsters.xml file. Please check system/logs/error.log for more info.');
|
error('There were some problems loading your monsters.xml file. Please check system/logs/error.log for more info.');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
error(Creatures::getLastError());
|
error(Creatures::getLastError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($canEdit)
|
if ($canEdit) {
|
||||||
{
|
?>
|
||||||
?>
|
|
||||||
<form method="post" action="<?php echo getLink('creatures'); ?>">
|
<form method="post" action="<?php echo getLink('creatures'); ?>">
|
||||||
<input type="hidden" name="reload_monsters" value="yes"/>
|
<input type="hidden" name="reload_monsters" value="yes"/>
|
||||||
<input type="submit" value="(admin) Reload monsters"/>
|
<input type="submit" value="(admin) Reload monsters"/>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($_REQUEST['creature']))
|
if (empty($_REQUEST['creature'])) {
|
||||||
{
|
|
||||||
$allowed_order_by = array('name', 'exp', 'health', 'summonable', 'convinceable', 'race');
|
|
||||||
$order = isset($_REQUEST['order']) ? $_REQUEST['order'] : 'name';
|
|
||||||
//generate sql query
|
|
||||||
$desc = '';
|
|
||||||
if(isset($_REQUEST['desc']) && $_REQUEST['desc'] == 1) {
|
|
||||||
$desc = " DESC";
|
|
||||||
}
|
|
||||||
if($order == 'name') {
|
|
||||||
$whereandorder = ' ORDER BY name'.$desc;
|
|
||||||
}
|
|
||||||
elseif($order == 'exp') {
|
|
||||||
$whereandorder = ' ORDER BY exp'.$desc.', name';
|
|
||||||
}
|
|
||||||
elseif($order == 'health') {
|
|
||||||
$whereandorder = ' ORDER BY health'.$desc.', name';
|
|
||||||
}
|
|
||||||
elseif($order == 'summonable') {
|
|
||||||
$whereandorder = ' AND summonable = 1 ORDER BY mana'.$desc;
|
|
||||||
}
|
|
||||||
elseif($order == 'convinceable') {
|
|
||||||
$whereandorder = ' AND convinceable = 1 ORDER BY mana'.$desc;
|
|
||||||
}
|
|
||||||
elseif($order == 'race') {
|
|
||||||
$whereandorder = ' ORDER BY race'.$desc.', name';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$whereandorder = ' ORDER BY name';
|
|
||||||
}
|
|
||||||
//send query to database
|
//send query to database
|
||||||
$monsters = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1'.$whereandorder);
|
$monsters = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 ORDER BY name asc');
|
||||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'>';
|
echo '<table id="creaturestb" class=""><thead>
|
||||||
if($order == 'name' && !isset($_REQUEST['desc'])) {
|
<tr role="row"><th>Name</th><th>Health</th><th>Experience</th>
|
||||||
echo '<TD class="white" width="200"><B><a href="?subtopic=creatures&order=name&desc=1"><span class="white">Name DESC</span></a></B></TD>';
|
<th>Summonable Mana</th><th>Convinceable Mana</th><th>Race</th></tr>
|
||||||
} else {
|
</thead><tbody>';
|
||||||
echo '<TD class="white" width="200"><B><a href="?subtopic=creatures&order=name"><span class="white">Name</span></a></B></TD>';
|
|
||||||
}
|
|
||||||
if($order == 'health' && !isset($_REQUEST['desc'])) {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=health&desc=1"><span class="white">Health<br/>DESC</span></a></B></TD>';
|
|
||||||
} else {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=health"><span class="white">Health</span></a></B></TD>';
|
|
||||||
}
|
|
||||||
if($order == 'exp' && !isset($_REQUEST['desc'])) {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=exp&desc=1"><span class="white">Experience<br/>DESC</span></a></B></TD>';
|
|
||||||
} else {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=exp"><span class="white">Experience</span></a></B></TD>';
|
|
||||||
}
|
|
||||||
if($order == 'summonable' && !isset($_REQUEST['desc'])) {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=summonable&desc=1"><span class="white">Summonable<br/>Mana DESC</span></a></B></TD>';
|
|
||||||
} else {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=summonable"><span class="white">Summonable<br/>Mana</span></a></B></TD>';
|
|
||||||
}
|
|
||||||
if($order == 'convinceable' && !isset($_REQUEST['desc'])) {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=convinceable&desc=1"><span class="white">Convinceable<br/>Mana DESC</span></a></B></TD>';
|
|
||||||
} else {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=convinceable"><span class="white">Convinceable<br/>Mana</span></a></B></TD>';
|
|
||||||
}
|
|
||||||
if($order == 'race' && !isset($_REQUEST['desc'])) {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=race&desc=1"><span class="white">Race<br/>DESC</span></a></B></TD></TR>';
|
|
||||||
} else {
|
|
||||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=race"><span class="white">Race</span></a></B></TD></TR>';
|
|
||||||
}
|
|
||||||
$number_of_rows = 0;
|
|
||||||
foreach($monsters as $monster) {
|
|
||||||
echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><TD><a href="?subtopic=creatures&creature='.urlencode($monster['name']).'">'.$monster['name'].'</a></TD><TD>'.$monster['health'].'</TD><TD>'.$monster['exp'].'</TD>';
|
|
||||||
|
|
||||||
if($monster['summonable']) {
|
foreach ($monsters as $monster) {
|
||||||
echo '<TD>'.$monster['mana'].'</TD>';
|
echo '<tr><td><a href="?subtopic=creatures&creature=' . urlencode($monster['name']) . '">' . $monster['name'] . '</a></td>
|
||||||
}
|
<td>' . $monster['health'] . '</td>
|
||||||
else {
|
<td>' . $monster['exp'] . '</td>
|
||||||
echo '<TD>---</TD>';
|
<td>' . ($monster['summonable'] ? $monster['mana'] : "---") . '</td>
|
||||||
|
<td>' . ($monster['convinceable'] ? $monster['mana'] : "---") . '</td>
|
||||||
|
<td>' . ucwords($monster['race']) . '</td></tr>';
|
||||||
}
|
}
|
||||||
|
echo '</tbody></table>';
|
||||||
|
|
||||||
if($monster['convinceable']) {
|
} else {
|
||||||
echo '<TD>'.$monster['mana'].'</TD>';
|
$monster_name = stripslashes(trim(ucwords($_REQUEST['creature'])));
|
||||||
}
|
$monster = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 AND `name` = ' . $db->quote($monster_name) . ';')->fetch();
|
||||||
else {
|
if (isset($monster['name'])) {
|
||||||
echo '<TD>---</TD>';
|
$title = $monster['name'] . " - Creatures";
|
||||||
}
|
|
||||||
|
|
||||||
echo '<td>'.ucwords($monster['race']).'</td></tr>';
|
echo '<div style="text-align:center"><h2>' . $monster['name'] . '</h2></div>';
|
||||||
}
|
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td>
|
||||||
|
|
||||||
echo '</table>';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$monster_name = stripslashes(trim(ucwords($_REQUEST['creature'])));
|
|
||||||
$monster = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 AND `name` = '.$db->quote($monster_name).';')->fetch();
|
|
||||||
if(isset($monster['name']))
|
|
||||||
{
|
|
||||||
$title = $monster['name'] . " - Creatures";
|
|
||||||
|
|
||||||
echo '<div style="text-align:center"><h2>'.$monster['name'].'</h2></div>';
|
|
||||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td>
|
|
||||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=60%>';
|
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=60%>';
|
||||||
$number_of_rows = 0;
|
$number_of_rows = 0;
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Health: </b></td><td>'.$monster['health'].'</td></tr>';
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Health: </b></td><td>' . $monster['health'] . '</td></tr>';
|
||||||
$number_of_rows++;
|
$number_of_rows++;
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Experience: </b></td><td>'.$monster['exp'].'</td></tr>';
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Experience: </b></td><td>' . $monster['exp'] . '</td></tr>';
|
||||||
$number_of_rows++;
|
$number_of_rows++;
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Speed like: </b></td><td>'.$monster['speed_lvl'].' level';
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Speed like: </b></td><td>' . $monster['speed_lvl'] . ' level';
|
||||||
$number_of_rows++;
|
$number_of_rows++;
|
||||||
if($monster['use_haste'])
|
if ($monster['use_haste'])
|
||||||
echo ' (Can use haste)';
|
echo ' (Can use haste)';
|
||||||
|
|
||||||
echo '</td></tr>';
|
echo '</td></tr>';
|
||||||
|
|
||||||
$number_of_rows++;
|
$number_of_rows++;
|
||||||
if($monster['summonable'] == 1)
|
if ($monster['summonable'] == 1)
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Summon: </b></td><td>'.$monster['mana'].' mana</td></tr>';
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Summon: </b></td><td>' . $monster['mana'] . ' mana</td></tr>';
|
||||||
else {
|
else {
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Summon: </b></td><td>Impossible</td></tr>';
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Summon: </b></td><td>Impossible</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$number_of_rows++;
|
$number_of_rows++;
|
||||||
if($monster['convinceable'] == 1)
|
if ($monster['convinceable'] == 1)
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Convince: </b></td><td>'.$monster['mana'].' mana</td></tr>';
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Convince: </b></td><td>' . $monster['mana'] . ' mana</td></tr>';
|
||||||
else
|
else
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Convince: </b></td><td>Impossible</td></tr>';
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Convince: </b></td><td>Impossible</td></tr>';
|
||||||
|
|
||||||
echo '</TABLE></td><td align=left>
|
echo '</TABLE></td><td align=left>
|
||||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=40%>
|
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=40%>
|
||||||
<tr><td align=left>';
|
<tr><td align=left>';
|
||||||
$monster['gfx_name'] = trim(strtolower($monster['name'])).".gif";
|
$monster['gfx_name'] = trim(strtolower($monster['name'])) . ".gif";
|
||||||
if(!file_exists('images/monsters/'.$monster['gfx_name'])) {
|
if (!file_exists('images/monsters/' . $monster['gfx_name'])) {
|
||||||
$gfx_name = str_replace(" ", "", $monster['gfx_name']);
|
$gfx_name = str_replace(" ", "", $monster['gfx_name']);
|
||||||
if(file_exists('images/monsters/' . $gfx_name))
|
if (file_exists('images/monsters/' . $gfx_name))
|
||||||
echo '<img src="images/monsters/'.$gfx_name.'" height="128" width="128">';
|
echo '<img src="images/monsters/' . $gfx_name . '" height="128" width="128">';
|
||||||
else
|
else
|
||||||
echo '<img src="images/monsters/nophoto.png" height="128" width="128">';
|
echo '<img src="images/monsters/nophoto.png" height="128" width="128">';
|
||||||
}
|
} else
|
||||||
else
|
echo '<img src="images/monsters/' . $monster['gfx_name'] . '" height="128" width="128">';
|
||||||
echo '<img src="images/monsters/' . $monster['gfx_name'] . '" height="128" width="128">';
|
|
||||||
|
|
||||||
echo '</td></tr>
|
echo '</td></tr>
|
||||||
</TABLE></td></tr><tr><td>
|
</TABLE></td></tr><tr><td>
|
||||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>';
|
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>';
|
||||||
$immunities = json_decode($monster['immunities'], true);
|
$immunities = json_decode($monster['immunities'], true);
|
||||||
if(count($immunities) > 0)
|
if (count($immunities) > 0) {
|
||||||
{
|
$number_of_rows++;
|
||||||
$number_of_rows++;
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Immunities: </b></td><td width="100%">' . implode(', ', $immunities) . '</td></tr>';
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Immunities: </b></td><td width="100%">'.implode(', ', $immunities).'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$voices = json_decode($monster['voices'], true);
|
|
||||||
if(count($voices) > 0)
|
|
||||||
{
|
|
||||||
foreach($voices as &$voice) {
|
|
||||||
$voice = '"' . $voice . '"';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$number_of_rows++;
|
$voices = json_decode($monster['voices'], true);
|
||||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Voices: </b></td><td width="100%">'.implode(', ', $voices).'</td></tr>';
|
if (count($voices) > 0) {
|
||||||
}
|
foreach ($voices as &$voice) {
|
||||||
echo '</TABLE></td></tr>';
|
$voice = '"' . $voice . '"';
|
||||||
|
|
||||||
$loot = json_decode($monster['loot'], true);
|
|
||||||
if($loot)
|
|
||||||
{
|
|
||||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td style="display: block;">';
|
|
||||||
function sort_by_chance($a, $b)
|
|
||||||
{
|
|
||||||
if($a['chance'] == $b['chance']) {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
return ($a['chance'] > $b['chance']) ? -1 : 1;
|
|
||||||
|
$number_of_rows++;
|
||||||
|
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Voices: </b></td><td width="100%">' . implode(', ', $voices) . '</td></tr>';
|
||||||
|
}
|
||||||
|
echo '</TABLE></td></tr>';
|
||||||
|
|
||||||
|
$loot = json_decode($monster['loot'], true);
|
||||||
|
if ($loot) {
|
||||||
|
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td style="display: block;">';
|
||||||
|
function sort_by_chance($a, $b)
|
||||||
|
{
|
||||||
|
if ($a['chance'] == $b['chance']) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return ($a['chance'] > $b['chance']) ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
usort($loot, 'sort_by_chance');
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
foreach ($loot as $item) {
|
||||||
|
$name = getItemNameById($item['id']);
|
||||||
|
$tooltip = $name . '<br/>Chance: ' . round($item['chance'] / 1000, 2) . '%<br/>Max count: ' . $item['count'];
|
||||||
|
|
||||||
|
echo '<img src="' . $config['item_images_url'] . $item['id'] . '.gif" class="tooltip" title="' . $tooltip . '" width="32" height="32" border="0" alt=" ' . $name . '" />';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</td></tr></TABLE>';
|
||||||
}
|
}
|
||||||
|
|
||||||
usort($loot, 'sort_by_chance');
|
echo '</td></tr>';
|
||||||
|
echo '</TABLE>';
|
||||||
$i = 0;
|
} else {
|
||||||
foreach($loot as $item) {
|
echo "Monster with name <b>" . $monster_name . "</b> doesn't exist.";
|
||||||
$name = getItemNameById($item['id']);
|
|
||||||
$tooltip = $name . '<br/>Chance: ' . round($item['chance'] / 1000, 2) . '%<br/>Max count: ' . $item['count'];
|
|
||||||
|
|
||||||
echo '<img src="' . $config['item_images_url'] . $item['id'] . '.gif" class="tooltip" title="' . $tooltip . '" width="32" height="32" border="0" alt=" ' .$name . '" />';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</td></tr></TABLE>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</td></tr>';
|
|
||||||
echo '</TABLE>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo "Monster with name <b>" . $monster_name . "</b> doesn't exist.";
|
|
||||||
}
|
|
||||||
|
|
||||||
//back button
|
//back button
|
||||||
$twig->display('creatures.back_button.html.twig');
|
$twig->display('creatures.back_button.html.twig');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#creaturestb').DataTable();
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
@ -41,15 +41,8 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = 'words';
|
|
||||||
if(isset($_REQUEST['order']))
|
|
||||||
$order = $_REQUEST['order'];
|
|
||||||
|
|
||||||
if(!in_array($order, array('words', 'type', 'mana', 'level', 'maglevel', 'soul')))
|
|
||||||
$order = 'level';
|
|
||||||
|
|
||||||
$spells = array();
|
$spells = array();
|
||||||
$spells_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'spells` WHERE `hidden` != 1 AND `type` < 3 ORDER BY ' . $order . ', level');
|
$spells_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'spells` WHERE `hidden` != 1 AND `type` < 3 ORDER BY name, level');
|
||||||
|
|
||||||
if((string)$vocation_id != 'all') {
|
if((string)$vocation_id != 'all') {
|
||||||
foreach($spells_db->fetchAll() as $spell) {
|
foreach($spells_db->fetchAll() as $spell) {
|
||||||
@ -76,11 +69,23 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/jquery.dataTables.min.css">
|
||||||
|
<?php
|
||||||
$twig->display('spells.html.twig', array(
|
$twig->display('spells.html.twig', array(
|
||||||
'canEdit' => $canEdit,
|
'canEdit' => $canEdit,
|
||||||
'post_vocation_id' => $vocation_id,
|
'post_vocation_id' => $vocation_id,
|
||||||
'post_vocation' => $vocation,
|
'post_vocation' => $vocation,
|
||||||
'post_order' => $order,
|
|
||||||
'spells' => $spells,
|
'spells' => $spells,
|
||||||
));
|
));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready( function () {
|
||||||
|
$('#spellstb').DataTable();
|
||||||
|
} );
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
||||||
|
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
@ -1,102 +1,102 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="box box-warning">
|
<div class="box box-warning">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Maintenance</h3>
|
<h3 class="box-title">Maintenance</h3>
|
||||||
<div class="box-tools pull-right">
|
<div class="box-tools pull-right">
|
||||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<form action="?p=dashboard&maintenance" method="post" class="form-horizontal">
|
<form action="?p=dashboard&maintenance" method="post" class="form-horizontal">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="status" class="col-sm-2 control-label">Website:</label>
|
<label for="status" class="col-sm-2 control-label">Website:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select class="form-control" id="status" name="status">
|
<select class="form-control" id="status" name="status">
|
||||||
<option value="0"{% if not is_closed %} selected{% endif %}>Open</option>
|
<option value="0"{% if not is_closed %} selected{% endif %}>Open</option>
|
||||||
<option value="1"{% if is_closed %} selected{% endif %}>Closed</option>
|
<option value="1"{% if is_closed %} selected{% endif %}>Closed</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="message" class="col-sm-2 control-label">Message:<br>
|
<label for="message" class="col-sm-2 control-label">Message:<br>
|
||||||
<small>(only if closed)</small>
|
<small>(only if closed)</small>
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<textarea name="message" cols="40" class="form-control" rows="5" maxlength="255"
|
<textarea name="message" cols="40" class="form-control" rows="5" maxlength="255"
|
||||||
placeholder="Enter ...">{{ closed_message }}</textarea>
|
placeholder="Enter ...">{{ closed_message }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<a href="?p=dashboard&clear_cache" onclick="return confirm('Are you sure?');"><span
|
<a href="?p=dashboard&clear_cache" onclick="return confirm('Are you sure?');"><span
|
||||||
class="btn btn-danger">Clear cache</span></a>
|
class="btn btn-danger">Clear cache</span></a>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<input type="submit" class="btn btn-primary" value="Update"/>
|
<input type="submit" class="btn btn-primary" value="Update"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if points is iterable %}
|
{% if points is iterable %}
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Top 10 - Most premium points</h3>
|
<h3 class="box-title">Top 10 - Most premium points</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body no-padding">
|
<div class="box-body no-padding">
|
||||||
<table class="table table-condensed">
|
<table class="table table-condensed">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Account {{ account_type }}</th>
|
<th>Account {{ account_type }}</th>
|
||||||
<th>Premium points</th>
|
<th>Premium points</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for result in points %}
|
{% for result in points %}
|
||||||
{% set i = i + 1 %}
|
{% set i = i + 1 %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ i }}</td>
|
<td>{{ i }}</td>
|
||||||
<td>{{ result.name }}</td>
|
<td>{{ result.name }}</td>
|
||||||
<td>{{ result.premium_points }}</td>
|
<td>{{ result.premium_points }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if coins is iterable %}
|
{% if coins is iterable %}
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Top 10 - Most coins</h3>
|
<h3 class="box-title">Top 10 - Most coins</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body no-padding">
|
<div class="box-body no-padding">
|
||||||
<table class="table table-condensed">
|
<table class="table table-condensed">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Account {{ account_type }}</th>
|
<th>Account {{ account_type }}</th>
|
||||||
<th>Tibia coins</th>
|
<th>Tibia coins</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for result in coins %}
|
{% for result in coins %}
|
||||||
{% set i = i + 1 %}
|
{% set i = i + 1 %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ i }}</td>
|
<td>{{ i }}</td>
|
||||||
<td>{{ result.name }}</td>
|
<td>{{ result.name }}</td>
|
||||||
<td>{{ result.coins }}</td>
|
<td>{{ result.coins }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
@ -1,4 +1,4 @@
|
|||||||
<form method="post" action="{{ constant('ADMIN_URL') }}?p=items">
|
<form method="post" action="{{ constant('ADMIN_URL') }}?p=items">
|
||||||
<input type="hidden" name="reload" value="1" />
|
<input type="hidden" name="reload" value="1"/>
|
||||||
<input type="submit" value="Reload items and weapons (it may take some time to finish)" />
|
<input type="submit" value="Reload items and weapons (it may take some time to finish)"/>
|
||||||
</form>
|
</form>
|
@ -1,38 +1,38 @@
|
|||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
{% if logout %}
|
{% if logout %}
|
||||||
<div class="alert alert-success alert-dismissible">
|
<div class="alert alert-success alert-dismissible">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<h4><i class="icon fa fa-check"></i> Status</h4>
|
<h4><i class="icon fa fa-check"></i> Status</h4>
|
||||||
{{ logout }}
|
{{ logout }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="box box-info">
|
<div class="box box-info">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Please login.</h3>
|
<h3 class="box-title">Please login.</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-group input-group">
|
<div class="form-group input-group">
|
||||||
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
||||||
<input type="password" class="form-control" id="account-name-input" name="account_login"
|
<input type="password" class="form-control" id="account-name-input" name="account_login"
|
||||||
placeholder="Account {{ account }}" required autofocus>
|
placeholder="Account {{ account }}" required autofocus>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group input-group">
|
<div class="form-group input-group">
|
||||||
<span class="input-group-addon"><i class="fa fa-key"></i></span>
|
<span class="input-group-addon"><i class="fa fa-key"></i></span>
|
||||||
<input type="password" class="form-control" placeholder="Password" name="password_login"
|
<input type="password" class="form-control" placeholder="Password" name="password_login"
|
||||||
placeholder="Password" required>
|
placeholder="Password" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="remember_me" name="remember_me" value="true"> Remember me
|
<input type="checkbox" id="remember_me" name="remember_me" value="true"> Remember me
|
||||||
</label>
|
</label>
|
||||||
<input type="hidden" name="admin" value="1"/>
|
<input type="hidden" name="admin" value="1"/>
|
||||||
<button type="submit" class="btn btn-info pull-right">Sign in</button>
|
<button type="submit" class="btn btn-info pull-right">Sign in</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,47 +1,47 @@
|
|||||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
tinymce.init({
|
tinymce.init({
|
||||||
selector: "textarea",
|
selector: "textarea",
|
||||||
theme: "modern",
|
theme: "modern",
|
||||||
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
|
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
|
||||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
||||||
image_advtab: true,
|
image_advtab: true,
|
||||||
relative_urls: false,
|
relative_urls: false,
|
||||||
remove_script_host: false,
|
remove_script_host: false,
|
||||||
document_base_url: "{{ constant('BASE_URL') }}"
|
document_base_url: "{{ constant('BASE_URL') }}"
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="box box-danger">
|
<div class="box box-danger">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Mailer</h3>
|
<h3 class="box-title">Mailer</h3>
|
||||||
</div>
|
</div>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div align="center" class="row"><p class="note note-image" style="width: 80%;">Sending mails may
|
<div align="center" class="row"><p class="note note-image" style="width: 80%;">Sending mails may
|
||||||
take some time if there are many users in db.</p></div>
|
take some time if there are many users in db.</p></div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 ">
|
<div class="col-xs-12 ">
|
||||||
<label for="mail_subject" class="control-label">Subject:</label>
|
<label for="mail_subject" class="control-label">Subject:</label>
|
||||||
<input class="form-control" type="text" id="mail_subject" name="mail_subject"
|
<input class="form-control" type="text" id="mail_subject" name="mail_subject"
|
||||||
value="{{ mail_subject }}" size="30" maxlength="30"/>
|
value="{{ mail_subject }}" size="30" maxlength="30"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<label for="mail_content" class="control-label">Content:</label>
|
<label for="mail_content" class="control-label">Content:</label>
|
||||||
<textarea id="mail_content" name="mail_content" style="width: 100%"
|
<textarea id="mail_content" name="mail_content" style="width: 100%"
|
||||||
class="tinymce">{{ mail_content }}</textarea>
|
class="tinymce">{{ mail_content }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<input type="checkbox" name="preview" id="preview" value="1"/><label for="preview">Just send test
|
<input type="checkbox" name="preview" id="preview" value="1"/><label for="preview">Just send test
|
||||||
email to me (preview)</label>{% if preview_done %} - <b>Done.</b>{% endif %}<br/>
|
email to me (preview)</label>{% if preview_done %} - <b>Done.</b>{% endif %}<br/>
|
||||||
<button type="submit" name="submit" value="Send" class="btn btn-primary">Send</button>
|
<button type="submit" name="submit" value="Send" class="btn btn-primary">Send</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,28 +1,28 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Templates</h3>
|
<h3 class="box-title">Templates</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<form method="post" action="?p=menus">
|
<form method="post" action="?p=menus">
|
||||||
<p>Please choose template in which you want to edit menu items.</p>
|
<p>Please choose template in which you want to edit menu items.</p>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<select id="template" name="template" class="form-control">
|
<select id="template" name="template" class="form-control">
|
||||||
{% for template in templates %}
|
{% for template in templates %}
|
||||||
<option value="{{ template.template }}">{{ template.template }}</option>
|
<option value="{{ template.template }}">{{ template.template }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button type="submit" type="button" class="btn btn-primary btn-flat">Edit</button>
|
<button type="submit" type="button" class="btn btn-primary btn-flat">Edit</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -5,33 +5,33 @@
|
|||||||
{% for cat, menu in menus %}
|
{% for cat, menu in menus %}
|
||||||
last_id[{{ cat }}] = {{ last_id[cat] }};
|
last_id[{{ cat }}] = {{ last_id[cat] }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
$( function() {
|
$(function () {
|
||||||
$(".sortable").sortable();
|
$(".sortable").sortable();
|
||||||
$(".sortable").disableSelection();
|
$(".sortable").disableSelection();
|
||||||
|
|
||||||
$(".remove-button").click(function() {
|
$(".remove-button").click(function () {
|
||||||
var id = $(this).attr("id");
|
var id = $(this).attr("id");
|
||||||
$('#list-' + id.replace('remove-button-', '')).remove();
|
$('#list-' + id.replace('remove-button-', '')).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".add-button").click(function() {
|
$(".add-button").click(function () {
|
||||||
var cat = $(this).attr("id").replace('add-button-', '');
|
var cat = $(this).attr("id").replace('add-button-', '');
|
||||||
var id = last_id[cat];
|
var id = last_id[cat];
|
||||||
last_id[cat]++;
|
last_id[cat]++;
|
||||||
$('#sortable-' + cat).append('<li class="ui-state-default" id="list-' + cat + '-' + id + '"><input type="text" name="menu[' + cat + '][]" value=""/> <input type="text" name="menu_link[' + cat + '][]" value=""/><input type="hidden" name="menu_blank[' + cat + '][]" value="0" /> <label><input class="blank-checkbox" type="checkbox"/><span title="Open in New Window">Blank</span></label> <input class="color-picker" type="text" name="menu_color[' + cat + '][]" value="#ffffff" /><a class="remove-button" id="remove-button-' + cat + '-' + id + '"><img src="{{ constant('BASE_URL') }}images/del.png"/></a></li>'); //add input bo
|
$('#sortable-' + cat).append('<li class="ui-state-default" id="list-' + cat + '-' + id + '"><input type="text" name="menu[' + cat + '][]" value=""/> <input type="text" name="menu_link[' + cat + '][]" value=""/><input type="hidden" name="menu_blank[' + cat + '][]" value="0" /> <label><input class="blank-checkbox" type="checkbox"/><span title="Open in New Window">Blank</span></label> <input class="color-picker" type="text" name="menu_color[' + cat + '][]" value="#ffffff" /><a class="remove-button" id="remove-button-' + cat + '-' + id + '"><img src="{{ constant('BASE_URL') }}images/del.png"/></a></li>'); //add input bo
|
||||||
$('#remove-button-' + cat + '-' + id).click(function() {
|
$('#remove-button-' + cat + '-' + id).click(function () {
|
||||||
$('#list-' + $(this).attr("id").replace('remove-button-', '')).remove();
|
$('#list-' + $(this).attr("id").replace('remove-button-', '')).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
initialiceSpectrum();
|
initialiceSpectrum();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#menus-form").submit(function(e) {
|
$("#menus-form").submit(function (e) {
|
||||||
$('.blank-checkbox:not(:checked)').each(function(i, obj) {
|
$('.blank-checkbox:not(:checked)').each(function (i, obj) {
|
||||||
$(obj).parent().prev().val("off");
|
$(obj).parent().prev().val("off");
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.blank-checkbox:checked').each(function(i, obj) {
|
$('.blank-checkbox:checked').each(function (i, obj) {
|
||||||
$(obj).parent().prev().val("on");
|
$(obj).parent().prev().val("on");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -39,25 +39,32 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; }
|
.sortable {
|
||||||
|
list-style-type: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.remove-button, .add-button {
|
.remove-button, .add-button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/spectrum.js"></script>
|
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/spectrum.js"></script>
|
||||||
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css" />
|
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css"/>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
initialiceSpectrum();
|
initialiceSpectrum();
|
||||||
function initialiceSpectrum() {
|
|
||||||
$(".color-picker").spectrum({
|
function initialiceSpectrum() {
|
||||||
preferredFormat: "hex",
|
$(".color-picker").spectrum({
|
||||||
showInput: true,
|
preferredFormat: "hex",
|
||||||
showPalette: true,
|
showInput: true,
|
||||||
palette: [
|
showPalette: true,
|
||||||
['black', 'white', 'blanchedalmond',
|
palette: [
|
||||||
'rgb(255, 128, 0);', 'hsv 100 70 50'],
|
['black', 'white', 'blanchedalmond',
|
||||||
['red', 'yellow', 'green', 'blue', 'violet']
|
'rgb(255, 128, 0);', 'hsv 100 70 50'],
|
||||||
]
|
['red', 'yellow', 'green', 'blue', 'violet']
|
||||||
});
|
]
|
||||||
}
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
@ -1,24 +1,24 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="box box-danger">
|
<div class="box box-danger">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Notepad</h3>
|
<h3 class="box-title">Notepad</h3>
|
||||||
</div>
|
</div>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>This is your personal notepad. Be sure to save it each time you modify something.</label>
|
<label>This is your personal notepad. Be sure to save it each time you modify something.</label>
|
||||||
<textarea class="form-control" style="text-align: left;" name="content" cols="50" rows="15"
|
<textarea class="form-control" style="text-align: left;" name="content" cols="50" rows="15"
|
||||||
onchange="notepad_onchange(this);">{% if content is not null %}{{ content }}{% endif %}</textarea>
|
onchange="notepad_onchange(this);">{% if content is not null %}{{ content }}{% endif %}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<button name="submit" onclick="notepad_save(this);" value="Save" class="btn btn-primary">Save
|
<button name="submit" onclick="notepad_save(this);" value="Save" class="btn btn-primary">Save
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# <?php echo isset($_content) ? htmlentities($_content, ENT_COMPAT, 'UTF-8') : ''; ?> #}
|
{# <?php echo isset($_content) ? htmlentities($_content, ENT_COMPAT, 'UTF-8') : ''; ?> #}
|
||||||
@ -26,31 +26,31 @@
|
|||||||
{# confirm leaving current page if content of the notepad has been modified #}
|
{# confirm leaving current page if content of the notepad has been modified #}
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var original_value = document.getElementsByName("content")[0].value;
|
var original_value = document.getElementsByName("content")[0].value;
|
||||||
|
|
||||||
function confirm_exit(e) {
|
function confirm_exit(e) {
|
||||||
var e = e || window.event;
|
var e = e || window.event;
|
||||||
var message = 'Are you sure you want to quit? Remaining changes will be unsaved.';
|
var message = 'Are you sure you want to quit? Remaining changes will be unsaved.';
|
||||||
|
|
||||||
// for IE and Firefox prior to version 4
|
// for IE and Firefox prior to version 4
|
||||||
if (e) {
|
if (e) {
|
||||||
e.returnValue = message;
|
e.returnValue = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for Safari
|
// for Safari
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
function notepad_onchange(e) {
|
function notepad_onchange(e) {
|
||||||
if (original_value != e.value) {
|
if (original_value != e.value) {
|
||||||
window.onbeforeunload = confirm_exit;
|
window.onbeforeunload = confirm_exit;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function notepad_save(e) {
|
function notepad_save(e) {
|
||||||
window.onbeforeunload = function (e) {
|
window.onbeforeunload = function (e) {
|
||||||
};
|
};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -1,111 +1,111 @@
|
|||||||
{% if action %}
|
{% if action %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form class="form-horizontal" method="post"
|
<form class="form-horizontal" method="post"
|
||||||
action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
|
action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
|
||||||
{% if action == 'edit' %}
|
{% if action == 'edit' %}
|
||||||
<input type="hidden" name="id" value="{{ id }}"/>
|
<input type="hidden" name="id" value="{{ id }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="col-md-8" id="page-edit-table">
|
<div class="col-md-8" id="page-edit-table">
|
||||||
<div class="box box-info">
|
<div class="box box-info">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h3>
|
<h3 class="box-title">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="name" class="col-sm-2 control-label">Link/name</label>
|
<label for="name" class="col-sm-2 control-label">Link/name</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
|
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
|
||||||
maxlength="29"
|
maxlength="29"
|
||||||
style="cursor: auto;" value="{{ name }}">
|
style="cursor: auto;" value="{{ name }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="title" class="col-sm-2 control-label">Title</label>
|
<label for="title" class="col-sm-2 control-label">Title</label>
|
||||||
|
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
|
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
|
||||||
maxlength="29"
|
maxlength="29"
|
||||||
style="cursor: auto;" value="{{ title }}">
|
style="cursor: auto;" value="{{ title }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="php" class="col-sm-2 control-label">PHP</label>
|
<label for="php" class="col-sm-2 control-label">PHP</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="checkbox" id="php" name="php"
|
<input type="checkbox" id="php" name="php"
|
||||||
title="Check if page should be executed as PHP"
|
title="Check if page should be executed as PHP"
|
||||||
value="1"{% if php %} checked="true"{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
|
value="1"{% if php %} checked="true"{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
|
||||||
{% if action == 'edit' %}
|
{% if action == 'edit' %}
|
||||||
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
|
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="body" class="col-sm-2 control-label">Content</label>
|
<label for="body" class="col-sm-2 control-label">Content</label>
|
||||||
<div class="col-sm-10" id="body-parent">
|
<div class="col-sm-10" id="body-parent">
|
||||||
<textarea class="form-control" id="body" name="body" maxlength="65000" cols="50"
|
<textarea class="form-control" id="body" name="body" maxlength="65000" cols="50"
|
||||||
rows="5">{{ body|raw }}</textarea>
|
rows="5">{{ body|raw }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="access" class="col-sm-2 control-label">Access</label>
|
<label for="access" class="col-sm-2 control-label">Access</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select class="form-control" id="access" name="access">
|
<select class="form-control" id="access" name="access">
|
||||||
{% for id, group in groups %}
|
{% for id, group in groups %}
|
||||||
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
|
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<td align="right"><input type="submit" class="btn btn-info pull-right" value="Save"/></td>
|
<td align="right"><input type="submit" class="btn btn-info pull-right" value="Save"/></td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
<input type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';"
|
<input type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';"
|
||||||
class="btn btn-default" value="Cancel"/>
|
class="btn btn-default" value="Cancel"/>
|
||||||
</td>
|
</td>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#php').on('change', function (e) {
|
$('#php').on('change', function (e) {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
tinymce.remove('#body');
|
tinymce.remove('#body');
|
||||||
} else {
|
} else {
|
||||||
if (tinymce.editors.length > 0) {
|
if (tinymce.editors.length > 0) {
|
||||||
tinymce.activeEditor.show();
|
tinymce.activeEditor.show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
init_tinymce();
|
init_tinymce();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if not php %}
|
{% if not php %}
|
||||||
init_tinymce();
|
init_tinymce();
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
function init_tinymce() {
|
function init_tinymce() {
|
||||||
tinymce.init({
|
tinymce.init({
|
||||||
selector: "#body",
|
selector: "#body",
|
||||||
theme: "modern",
|
theme: "modern",
|
||||||
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
|
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
|
||||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
||||||
image_advtab: true,
|
image_advtab: true,
|
||||||
relative_urls: false,
|
relative_urls: false,
|
||||||
remove_script_host: false,
|
remove_script_host: false,
|
||||||
document_base_url: "{{ constant('BASE_URL') }}"
|
document_base_url: "{{ constant('BASE_URL') }}"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function decodeHtml(html) {
|
function decodeHtml(html) {
|
||||||
var txt = document.createElement("textarea");
|
var txt = document.createElement("textarea");
|
||||||
txt.innerHTML = html;
|
txt.innerHTML = html;
|
||||||
return txt.value;
|
return txt.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script> {% endif %}
|
</script> {% endif %}
|
@ -1,66 +1,69 @@
|
|||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Pages:</h3>
|
<h3 class="box-title">Pages:</h3>
|
||||||
<div class="box-tools pull-right">
|
<div class="box-tools pull-right">
|
||||||
<a href="?p=pages&action=new"><span class="btn btn-success">New</span></a>
|
<a href="?p=pages&action=new"><span class="btn btn-success">New</span></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div id="tb_pages_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
<div id="tb_pages_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table id="tb_pages" class="table table-bordered table-striped dataTable" role="grid"
|
<table id="tb_pages" class="table table-bordered table-striped dataTable" role="grid"
|
||||||
aria-describedby="tb_pages_info">
|
aria-describedby="tb_pages_info">
|
||||||
<thead>
|
<thead>
|
||||||
<tr role="row">
|
<tr role="row">
|
||||||
<th class="sorting_asc" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
<th class="sorting_asc" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||||
aria-sort="ascending" aria-label="Name: activate to sort column descending">Name
|
aria-sort="ascending" aria-label="Name: activate to sort column descending">Name
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||||
aria-sort="ascending" aria-label="Title: activate to sort column descending">Title
|
aria-sort="ascending" aria-label="Title: activate to sort column descending">Title
|
||||||
</th>
|
</th>
|
||||||
<th class="" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1" style="width: 150px;">Options
|
<th class="" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||||
</th>
|
style="width: 150px;">Options
|
||||||
</tr>
|
</th>
|
||||||
</thead>
|
</tr>
|
||||||
<tbody>
|
</thead>
|
||||||
{% for page in pages %}
|
<tbody>
|
||||||
<tr>
|
{% for page in pages %}
|
||||||
<td>{{ page.link|raw }}</td>
|
<tr>
|
||||||
<td><i>{{ page.title }}</i></td>
|
<td>{{ page.link|raw }}</td>
|
||||||
<td>
|
<td><i>{{ page.title }}</i></td>
|
||||||
<a href="?p=pages&action=edit&id={{ page.id }}" class="ico" title="Edit"><span
|
<td>
|
||||||
class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a>
|
<a href="?p=pages&action=edit&id={{ page.id }}" class="ico" title="Edit"><span
|
||||||
<a href="?p=pages&action=delete&id={{ page.id }}" class="ico"
|
class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a>
|
||||||
onclick="return confirm('Are you sure?');" title="Delete"><span
|
<a href="?p=pages&action=delete&id={{ page.id }}" class="ico"
|
||||||
class="btn btn-danger btn-sm delete btn-flat"><i
|
onclick="return confirm('Are you sure?');" title="Delete"><span
|
||||||
class="fa fa-trash"></i></span></a>
|
class="btn btn-danger btn-sm delete btn-flat"><i
|
||||||
<a href="?p=pages&action=hide&id={{ page.id }}" class="ico"
|
class="fa fa-trash"></i></span></a>
|
||||||
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
<a href="?p=pages&action=hide&id={{ page.id }}" class="ico"
|
||||||
{% if page.hidden != 1 %}
|
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||||
<span class="btn btn-primary btn-sm btn-flat"><i class="fa fa-eye"></i></span>
|
{% if page.hidden != 1 %}
|
||||||
{% else %}
|
<span class="btn btn-primary btn-sm btn-flat"><i
|
||||||
<span class="btn btn-default btn-sm btn-flat"><i class="fa fa-eye-slash"></i></span>
|
class="fa fa-eye"></i></span>
|
||||||
{% endif %}
|
{% else %}
|
||||||
</a>
|
<span class="btn btn-default btn-sm btn-flat"><i
|
||||||
</td>
|
class="fa fa-eye-slash"></i></span>
|
||||||
</tr>
|
{% endif %}
|
||||||
{% endfor %}
|
</a>
|
||||||
</tbody>
|
</td>
|
||||||
<tfoot>
|
</tr>
|
||||||
<tr>
|
{% endfor %}
|
||||||
<th>Name</th>
|
</tbody>
|
||||||
<th>Title</th>
|
<tfoot>
|
||||||
<th>Options</th>
|
<tr>
|
||||||
</tfoot>
|
<th>Name</th>
|
||||||
</table>
|
<th>Title</th>
|
||||||
</div>
|
<th>Options</th>
|
||||||
</div>
|
</tfoot>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#tb_pages').DataTable()
|
$('#tb_pages').DataTable()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
@ -2,10 +2,12 @@
|
|||||||
<a href="admin/?p=pages&action=edit&id={{ page.id }}" title="Edit in Admin Panel" target="_blank">
|
<a href="admin/?p=pages&action=edit&id={{ page.id }}" title="Edit in Admin Panel" target="_blank">
|
||||||
<img src="images/edit.png"/>Edit
|
<img src="images/edit.png"/>Edit
|
||||||
</a>
|
</a>
|
||||||
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');" title="Delete in Admin Panel" target="_blank">
|
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');"
|
||||||
|
title="Delete in Admin Panel" target="_blank">
|
||||||
<img src="images/del.png"/>Delete
|
<img src="images/del.png"/>Delete
|
||||||
</a>
|
</a>
|
||||||
<a href="admin/?p=pages&action=hide&id={{ page.id }}" title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
|
<a href="admin/?p=pages&action=hide&id={{ page.id }}"
|
||||||
|
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
|
||||||
<img src="images/{% if page.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}
|
<img src="images/{% if page.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||||
</a>
|
</a>
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Install plugin:</h3>
|
<h3 class="box-title">Install plugin:</h3>
|
||||||
<div class="box-tools pull-right">
|
<div class="box-tools pull-right">
|
||||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
|
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
|
||||||
<input type="hidden" name="upload_plugin"/>
|
<input type="hidden" name="upload_plugin"/>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="exampleInputFile">File input</label>
|
<label for="exampleInputFile">File input</label>
|
||||||
<input type="file" name="plugin">
|
<input type="file" name="plugin">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<button type="submit" class="btn btn-primary">Upload</button>
|
<button type="submit" class="btn btn-primary">Upload</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,67 +1,67 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Installed plugins:</h3>
|
<h3 class="box-title">Installed plugins:</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div id="plugins_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
<div id="plugins_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table id="plugins" class="table table-bordered table-striped dataTable" role="grid"
|
<table id="plugins" class="table table-bordered table-striped dataTable" role="grid"
|
||||||
aria-describedby="plugins_info">
|
aria-describedby="plugins_info">
|
||||||
<thead>
|
<thead>
|
||||||
<tr role="row">
|
<tr role="row">
|
||||||
<th class="sorting_asc" tabindex="0" aria-controls="plugins" rowspan="1"
|
<th class="sorting_asc" tabindex="0" aria-controls="plugins" rowspan="1"
|
||||||
colspan="1" aria-sort="ascending"
|
colspan="1" aria-sort="ascending"
|
||||||
aria-label="Name: activate to sort column descending">Name
|
aria-label="Name: activate to sort column descending">Name
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||||
aria-label="Description: activate to sort column ascending">Description
|
aria-label="Description: activate to sort column ascending">Description
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||||
aria-label="Author: activate to sort column ascending">Author
|
aria-label="Author: activate to sort column ascending">Author
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||||
aria-label="Filename: activate to sort column ascending">Filename
|
aria-label="Filename: activate to sort column ascending">Filename
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||||
aria-label="Options: activate to sort column ascending"
|
aria-label="Options: activate to sort column ascending"
|
||||||
style="width: 55px;">Options
|
style="width: 55px;">Options
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for plugin in plugins %}
|
{% for plugin in plugins %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>{{ plugin.name }}</b><br>
|
<td><b>{{ plugin.name }}</b><br>
|
||||||
<small>{{ plugin.description }}</small>
|
<small>{{ plugin.description }}</small>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ plugin.version }}</td>
|
<td>{{ plugin.version }}</td>
|
||||||
<td><b>{{ plugin.author }}</b><br>
|
<td><b>{{ plugin.author }}</b><br>
|
||||||
<small>{{ plugin.contact }}</small>
|
<small>{{ plugin.contact }}</small>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ plugin.file }}.json</td>
|
<td>{{ plugin.file }}.json</td>
|
||||||
<td>
|
<td>
|
||||||
{% if plugin.uninstall %}
|
{% if plugin.uninstall %}
|
||||||
<a href="?p=plugins&uninstall={{ plugin.file }}" title="Uninstall"
|
<a href="?p=plugins&uninstall={{ plugin.file }}" title="Uninstall"
|
||||||
onclick="return confirm('Are you sure?');"><span
|
onclick="return confirm('Are you sure?');"><span
|
||||||
class="btn btn-danger btn-sm delete btn-flat"><i
|
class="btn btn-danger btn-sm delete btn-flat"><i
|
||||||
class="fa fa-trash"></i></span></a>
|
class="fa fa-trash"></i></span></a>
|
||||||
{% endif %}</td>
|
{% endif %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#plugins').DataTable()
|
$('#plugins').DataTable()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
@ -1,39 +1,39 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<span class="info-box-icon bg-aqua"><i class="ion ion-person-add"></i></span>
|
<span class="info-box-icon bg-aqua"><i class="ion ion-person-add"></i></span>
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<span class="info-box-text">Total accounts:</span>
|
<span class="info-box-text">Total accounts:</span>
|
||||||
<span class="info-box-number">{{ total_accounts }}</span>
|
<span class="info-box-number">{{ total_accounts }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<span class="info-box-icon bg-red"><i class="fa fa-male"></i></span>
|
<span class="info-box-icon bg-red"><i class="fa fa-male"></i></span>
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<span class="info-box-text">Total players:</span>
|
<span class="info-box-text">Total players:</span>
|
||||||
<span class="info-box-number">{{ total_players }}</span>
|
<span class="info-box-number">{{ total_players }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix visible-sm-block"></div>
|
<div class="clearfix visible-sm-block"></div>
|
||||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<span class="info-box-icon bg-green"><i class="ion ion-pie-graph"></i></span>
|
<span class="info-box-icon bg-green"><i class="ion ion-pie-graph"></i></span>
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<span class="info-box-text">Total guilds:</span>
|
<span class="info-box-text">Total guilds:</span>
|
||||||
<span class="info-box-number">{{ total_guilds }}</span>
|
<span class="info-box-number">{{ total_guilds }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<span class="info-box-icon bg-yellow"><i class="fa fa-home"></i></span>
|
<span class="info-box-icon bg-yellow"><i class="fa fa-home"></i></span>
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<span class="info-box-text">Total houses:</span>
|
<span class="info-box-text">Total houses:</span>
|
||||||
<span class="info-box-number">{{ total_houses }}</span>
|
<span class="info-box-number">{{ total_houses }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,56 +1,56 @@
|
|||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
|
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
|
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
|
||||||
aria-describedby="visitors_info">
|
aria-describedby="visitors_info">
|
||||||
<thead>
|
<thead>
|
||||||
<tr role="row">
|
<tr role="row">
|
||||||
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||||
aria-sort="ascending" aria-label="IP: activate to sort column descending"
|
aria-sort="ascending" aria-label="IP: activate to sort column descending"
|
||||||
style="width: 297px;">IP
|
style="width: 297px;">IP
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||||
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
|
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
|
||||||
visit
|
visit
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||||
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
|
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for visitor in visitors %}
|
{% for visitor in visitors %}
|
||||||
{% set i = i + 1 %}
|
{% set i = i + 1 %}
|
||||||
<tr role="row" class="odd">
|
<tr role="row" class="odd">
|
||||||
<td>{{ visitor.ip }}</td>
|
<td>{{ visitor.ip }}</td>
|
||||||
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
|
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
|
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th>IP</th>
|
<th>IP</th>
|
||||||
<th>Last visit</th>
|
<th>Last visit</th>
|
||||||
<th>Page</th>
|
<th>Page</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#visitors').DataTable()
|
$('#visitors').DataTable()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
{% if canEdit %}
|
{% if canEdit %}
|
||||||
<form method="post" action="{{ getLink('spells') }}">
|
<form method="post" action="{{ getLink('spells') }}">
|
||||||
<input type="hidden" name="reload_spells" value="yes"/>
|
<input type="hidden" name="reload_spells" value="yes"/>
|
||||||
@ -20,7 +21,6 @@
|
|||||||
<option value="{{ id }}"{% if id == post_vocation_id and post_vocation_id != "all" and post_vocation_id != '' %} selected{% endif %}>{{ vocation }}</option>
|
<option value="{{ id }}"{% if id == post_vocation_id and post_vocation_id != "all" and post_vocation_id != '' %} selected{% endif %}>{{ vocation }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<input type="hidden" name="order" value="{{ post_order }}">
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ include('buttons.submit.html.twig') }}
|
{{ include('buttons.submit.html.twig') }}
|
||||||
@ -32,40 +32,14 @@
|
|||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<br/>
|
<br/>
|
||||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
<table id="spellstb" class=""><thead>
|
||||||
<tr bgcolor="{{ config.vdarkborder }}">
|
<tr role="row"><th>Name</th><th>Words</th><th>Type<br/>(count)</th>
|
||||||
<td class="white">
|
<th>Mana</th><th>Level</th><th>Magic Level</th><th>Soul</th><th>Premium</th><th>Vocations</th></tr>
|
||||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/spell' }}"><span class="white">Name</span></a></b>
|
</thead><tbody>
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/words' }}"><span class="white">Words</span></a></b>
|
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/type' }}"><span class="white">Type<br/>(count)</span></a></b>
|
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/mana' }}"><span class="white">Mana</span></a></b>
|
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/level' }}"><span class="white">Level</span></a></b>
|
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/maglevel' }}"><span class="white">Magic<br/>Level</span></a></b>
|
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/soul' }}"><span class="white">Soul</span></a></b>
|
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b>Premium</b>
|
|
||||||
</td>
|
|
||||||
<td class="white">
|
|
||||||
<b>Vocations:</b>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for spell in spells %}
|
{% for spell in spells %}
|
||||||
{% set i = i + 1 %}
|
{% set i = i + 1 %}
|
||||||
<tr bgcolor="{{ getStyle(i) }}">
|
<tr>
|
||||||
<td>{{ spell.name }}</td>
|
<td>{{ spell.name }}</td>
|
||||||
<td>{{ spell.words }}</td>
|
<td>{{ spell.words }}</td>
|
||||||
<td>
|
<td>
|
||||||
@ -93,4 +67,4 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</tbody></table>
|
1
tools/css/dataTables.bootstrap.min.css
vendored
1
tools/css/dataTables.bootstrap.min.css
vendored
@ -1 +0,0 @@
|
|||||||
table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important;border-collapse:separate !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:8px;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th:active,table.dataTable thead>tr>td:active{outline:none}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;position:relative}table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{position:absolute;bottom:8px;right:8px;display:block;font-family:'Glyphicons Halflings';opacity:0.5}table.dataTable thead .sorting:after{opacity:0.2;content:"\e150"}table.dataTable thead .sorting_asc:after{content:"\e155"}table.dataTable thead .sorting_desc:after{content:"\e156"}table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{color:#eee}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.table-condensed>thead>tr>th{padding-right:20px}table.dataTable.table-condensed .sorting:after,table.dataTable.table-condensed .sorting_asc:after,table.dataTable.table-condensed .sorting_desc:after{top:6px;right:6px}table.table-bordered.dataTable th,table.table-bordered.dataTable td{border-left-width:0}table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable td:last-child,table.table-bordered.dataTable td:last-child{border-right-width:0}table.table-bordered.dataTable tbody th,table.table-bordered.dataTable tbody td{border-bottom-width:0}div.dataTables_scrollHead table.table-bordered{border-bottom-width:0}div.table-responsive>div.dataTables_wrapper>div.row{margin:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:first-child{padding-left:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:last-child{padding-right:0}
|
|
1
tools/css/jquery.dataTables.min.css
vendored
Normal file
1
tools/css/jquery.dataTables.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
8
tools/js/dataTables.bootstrap.min.js
vendored
8
tools/js/dataTables.bootstrap.min.js
vendored
@ -1,8 +0,0 @@
|
|||||||
/*!
|
|
||||||
DataTables Bootstrap 3 integration
|
|
||||||
©2011-2015 SpryMedia Ltd - datatables.net/license
|
|
||||||
*/
|
|
||||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d,m){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(f.ext.classes,
|
|
||||||
{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,s,j,n){var o=new f.Api(a),t=a.oClasses,k=a.oLanguage.oPaginate,u=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};
|
|
||||||
l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="…";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>",{"class":t.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#",
|
|
||||||
"aria-controls":a.sTableId,"aria-label":u[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(v){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),s);i!==m&&b(h).find("[data-dt-idx="+i+"]").focus()};return f});
|
|
Loading…
x
Reference in New Issue
Block a user