mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
* moved some more pages to twig
* moved online, movies, google_analytics code, faq, experience_table, downloads to twig * added new global variabl to twig (status) * removed some unused page (custom.php) * automatically append trailing slash at config.item_images_url * moved downloads from clients.halfaway.net to tibia-clients.com * show some more info on monster loot (currently only on TFS 0.3 and those that use item.id in monster files instead of item name) * some more unimportant fixes
This commit is contained in:
parent
e94b9006e6
commit
b6ccde075d
@ -26,6 +26,7 @@ require(SYSTEM . 'login.php');
|
||||
require(ADMIN . 'includes/functions.php');
|
||||
|
||||
$twig->addGlobal('config', $config);
|
||||
$twig->addGlobal('status', $status);
|
||||
|
||||
// if we're not logged in - show login box
|
||||
if(!$logged || !admin()) {
|
||||
|
@ -65,7 +65,7 @@ $config = array(
|
||||
'database_password' => '',
|
||||
'database_name' => '',
|
||||
|
||||
// multiworld system
|
||||
// multiworld system (only TFS 0.3)
|
||||
'multiworld' => false, // use multiworld system?
|
||||
'worlds' => array( // list of worlds
|
||||
//'1' => 'Your World Name',
|
||||
@ -201,10 +201,10 @@ $config = array(
|
||||
),
|
||||
|
||||
// news page
|
||||
'news_limit' => 5, // limit of news on latest news page
|
||||
'news_limit' => 5, // limit of news on the latest news page
|
||||
'news_ticker_limit' => 5, // limit of news in tickers (mini news) (0 to disable)
|
||||
'news_date_format' => 'j.n.Y', // check php manual date() function for more info about this
|
||||
'news_author' => true,
|
||||
'news_author' => true, // show author of the news
|
||||
|
||||
// gifts/shop system
|
||||
'gifts_system' => false,
|
||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
@ -56,6 +56,7 @@ require_once(SYSTEM . 'status.php');
|
||||
require_once(SYSTEM . 'template.php');
|
||||
|
||||
$twig->addGlobal('config', $config);
|
||||
$twig->addGlobal('status', $status);
|
||||
|
||||
// database migrations
|
||||
$tmp = '';
|
||||
|
@ -230,9 +230,9 @@ if(!$error) {
|
||||
$error = true;
|
||||
}
|
||||
|
||||
$content .= '$config[\'client_download\'] = \'http://clients.halfaway.net/windows.php?tibia=\'. $config[\'client\'];';
|
||||
$content .= '$config[\'client_download\'] = \'http://tibia-clients.com/clients/download/\'. $config[\'client\'] . \'/exe/windows\';';
|
||||
$content .= PHP_EOL;
|
||||
$content .= '$config[\'client_download_linux\'] = \'http://clients.halfaway.net/linux.php?tibia=\'. $config[\'client\'];';
|
||||
$content .= '$config[\'client_download_linux\'] = \'http://tibia-clients.com/clients/download/\'. $config[\'client\'] . \'/tar/linux\';';
|
||||
$content .= PHP_EOL;
|
||||
$content .= '// place for your configuration directives, so you can later easily update myaac';
|
||||
$content .= PHP_EOL;
|
||||
|
@ -802,11 +802,7 @@ function template_header($is_admin = false)
|
||||
Please turn it on, or be aware that some features on this website will not work correctly.</div>
|
||||
</noscript>
|
||||
';
|
||||
if(admin())
|
||||
$ret .= '<!--script type="text/javascript" src="' . BASE_URL . 'tools/tiny_mce/tiny_mce.js"></script>
|
||||
<script type="text/javascript" src="' . BASE_URL . 'tools/jquery.qtip.js" ></script>
|
||||
<script type="text/javascript" src="' . BASE_URL . 'tools/admin.js"></script-->
|
||||
';
|
||||
|
||||
if($config['recaptcha_enabled'])
|
||||
$ret .= "<script src='https://www.google.com/recaptcha/api.js'></script>";
|
||||
return $ret;
|
||||
@ -817,13 +813,14 @@ function template_header($is_admin = false)
|
||||
*/
|
||||
function template_footer()
|
||||
{
|
||||
global $visitors, $config, $views_counter;
|
||||
global $config, $views_counter;
|
||||
$ret = '';
|
||||
if(admin())
|
||||
$ret .= generateLink(ADMIN_URL, 'Admin Panel', true);
|
||||
|
||||
if($config['visitors_counter'])
|
||||
{
|
||||
global $visitors;
|
||||
$amount = $visitors->getAmountVisitors();
|
||||
$ret .= '<br/>Currently there ' . ($amount > 1 ? 'are' : 'is') . ' ' . $amount . ' visitor' . ($amount > 1 ? 's' : '') . '.';
|
||||
}
|
||||
@ -843,21 +840,11 @@ function template_footer()
|
||||
|
||||
function template_ga_code()
|
||||
{
|
||||
global $config;
|
||||
global $config, $twig;
|
||||
if(!isset($config['google_analytics_id'][0]))
|
||||
return '';
|
||||
|
||||
return "
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '" . $config['google_analytics_id'] . "', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>";
|
||||
return $twig->render('google_analytics.html.twig');
|
||||
}
|
||||
|
||||
function template_form()
|
||||
@ -899,6 +886,8 @@ function getCreatureName($killer, $showStatus = false, $extendedInfo = false)
|
||||
{
|
||||
global $vowels, $ots, $config;
|
||||
$str = "";
|
||||
$players_rows = '';
|
||||
|
||||
if(is_numeric($killer))
|
||||
{
|
||||
$player = $ots->createObject('Player');
|
||||
@ -1104,12 +1093,9 @@ function get_templates()
|
||||
function getWorldName($id)
|
||||
{
|
||||
global $config;
|
||||
foreach($config['worlds'] as $_id => $details)
|
||||
{
|
||||
if($id == $_id)
|
||||
return $details['name'];
|
||||
}
|
||||
|
||||
if(isset($config['worlds'][$id]))
|
||||
return $config['worlds'][$id];
|
||||
|
||||
return $config['lua']['serverName'];
|
||||
}
|
||||
|
||||
|
@ -87,10 +87,12 @@ unset($tmp);
|
||||
if(isset($config['lua']['servername']))
|
||||
$config['lua']['serverName'] = $config['lua']['servername'];
|
||||
|
||||
|
||||
if(isset($config['lua']['houserentperiod']))
|
||||
$config['lua']['houseRentPeriod'] = $config['lua']['houserentperiod'];
|
||||
|
||||
if($config['item_images_url'][strlen($config['item_images_url']) - 1] != '/')
|
||||
$config['item_images_url'] .= '/';
|
||||
|
||||
// localize data/ directory
|
||||
if(isset($config['lua']['dataDirectory'][0]))
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ $name = str_replace('/', '', $name);
|
||||
|
||||
$oldName = '';
|
||||
|
||||
$player = $ots->createObject('Player');
|
||||
$player = new OTS_Player();
|
||||
$player->find($name);
|
||||
if(!$player->isLoaded())
|
||||
{
|
||||
|
@ -43,15 +43,16 @@ function printLoot($level, $itemid, $count, $chance)
|
||||
$chance *= $lootRate;
|
||||
}
|
||||
|
||||
foreach($rarity as $lootRarity => $percent){
|
||||
if($chance >= $percent)
|
||||
{
|
||||
//echo str_repeat("... ", $level) . '<u>' . ($count ? $count : 1) . '</u> <span style="color: #7878FF; font-weight: bold;">' . $itemList[(int)$itemid] . '</span> ' . $itemid . ' <span style="color: #C45; font-weight: bold;">' . $lootRarity . '</span> (<span style="color: #FF9A9A;">' . $chance . '%</span>)<br />';
|
||||
foreach($rarity as $lootRarity => $percent) {
|
||||
if($chance >= $percent) {
|
||||
if(isset($itemid))
|
||||
echo str_repeat("... ", $level) . '<u>' . ($count ? $count : 1) . '</u> <span style="color: #7878FF; font-weight: bold;">' . $itemList[(int)$itemid] . '</span> ' . $itemid . ' <span style="color: #C45; font-weight: bold;">' . $lootRarity . '</span> (<span style="color: #FF9A9A;">' . $chance . '%</span>)<br />';
|
||||
|
||||
if($i % 6 == 0)
|
||||
{
|
||||
if($i != 0)
|
||||
echo '</td></tr>';
|
||||
echo '<tr BGCOLOR="'.getStyle(0).'"><td width="100">';
|
||||
echo '<tr bgcolor="'.getStyle(0).'"><td width="100">';
|
||||
}
|
||||
echo getItemImage($itemid);
|
||||
$i++;
|
||||
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Custom pages loader
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.4.2
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$query = $db->query('SELECT `title`, `body`, `php` FROM `' . TABLE_PREFIX . 'pages` WHERE `name` LIKE ' . $db->quote($page) . ' AND `hidden` != 1');
|
||||
if($query->rowCount() > 0) // found page
|
||||
{
|
||||
$query = $query->fetch();
|
||||
$title = $query['title'];
|
||||
|
||||
if($query['php'] == '1') // execute it as php code
|
||||
eval($query['body']);
|
||||
else
|
||||
echo $query['body']; // plain html
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
?>
|
@ -3,21 +3,12 @@
|
||||
* Downloads
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.4.2
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
$title = 'Downloads';
|
||||
?>
|
||||
<br/><br/>
|
||||
<center>
|
||||
We're using official Tibia Client <strong><?php echo $config['client'] / 100; ?></strong><br/>
|
||||
<p>Download Tibia client <?php echo ($config['client'] / 100); ?> for windows <a href="<?php echo $config['client_download']; ?>">HERE</a>.</p>
|
||||
<p>Download Tibia client <?php echo ($config['client'] / 100); ?> for linux <a href="<?php echo $config['client_download_linux']; ?>">HERE</a>.</p>
|
||||
|
||||
<h2>IP Changer:</h2>
|
||||
|
||||
<a href="https://static.otland.net/ipchanger.exe" target="_blank">HERE</a>
|
||||
</center>
|
||||
echo $twig->render('downloads.html.twig');
|
||||
?>
|
@ -3,7 +3,6 @@
|
||||
* Experience table
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.4.2
|
||||
@ -11,42 +10,16 @@
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Experience Table';
|
||||
?>
|
||||
|
||||
This is a list of the experience points that are required to advance to the various levels.
|
||||
Remember you can also check the respective skill bar in your skill window of the client to check your progress towards the next level.<br/><br/>
|
||||
|
||||
<table bgcolor="<?php echo $config['darkborder']; ?>" border="0" cellpadding="4" cellspacing="1" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white" colspan="5"><b>Experience Table</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$columns = $config['experiencetable_columns'];
|
||||
for($i = 0; $i < $columns; $i++)
|
||||
{
|
||||
?>
|
||||
<td>
|
||||
<table border="0" cellpadding="2" cellspacing="1" width="100%">
|
||||
<tr bgcolor="<?php echo $config['lightborder']; ?>">
|
||||
<td><b>Level</b></td>
|
||||
<td><b>Experience</b></td>
|
||||
</tr>
|
||||
<?php
|
||||
for($level = $i * $config['experiencetable_rows'] + 1; $level < $i * $config['experiencetable_rows'] + ($config['experiencetable_rows'] + 1); $level++)
|
||||
{
|
||||
?>
|
||||
<tr bgcolor="<?php echo $config['lightborder']; ?>">
|
||||
<td><?php echo $level; ?></td>
|
||||
<td><?php echo OTS_Toolbox::experienceForLevel($level); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
<?php
|
||||
$experience = array();
|
||||
$columns = $config['experiencetable_columns'];
|
||||
for($i = 0; $i < $columns; $i++) {
|
||||
for($level = $i * $config['experiencetable_rows'] + 1; $level < $i * $config['experiencetable_rows'] + ($config['experiencetable_rows'] + 1); $level++) {
|
||||
$experience[$level] = OTS_Toolbox::experienceForLevel($level);
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('experience_table.html.twig', array(
|
||||
'experience' => $experience
|
||||
));
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -20,47 +20,10 @@ if(!$faqs->rowCount())
|
||||
There are no questions added yet.
|
||||
<?php
|
||||
if(admin())
|
||||
echo ' You can add new faq questions in phpmyadmin under ' . TABLE_PREFIX . 'faq table.';
|
||||
echo ' You can add new faq questions in phpmyadmin under <b>' . TABLE_PREFIX . 'faq</b> table.';
|
||||
}
|
||||
|
||||
echo $twig->render('faq.html.twig', array(
|
||||
'faqs' => $faqs
|
||||
));
|
||||
?>
|
||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white">
|
||||
<b>FAQ</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a href="#" onclick="toggleAll(); return false;">Toggle all</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach($faqs as $faq): ?>
|
||||
<tr bgcolor="<?php echo getStyle(++$i); ?>">
|
||||
<td colspan="2" style="cursor: pointer;" onclick="toggleVisibility('faq_<?php echo $i; ?>'); return false;">
|
||||
<b><?php echo $faq['question']; ?></b>
|
||||
<div id="faq_<?php echo $i; ?>" style="display: none;"><?php echo $faq['answer']; ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var expanded = false;
|
||||
|
||||
function toggleVisibility(id)
|
||||
{
|
||||
var tmp = document.getElementById(id);
|
||||
if(tmp)
|
||||
tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
|
||||
}
|
||||
|
||||
function toggleAll()
|
||||
{
|
||||
for(i = 1; i < <?php echo $i + 1; ?>; i++)
|
||||
{
|
||||
document.getElementById('faq_' + i).style.display = expanded ? 'none' : '';
|
||||
}
|
||||
|
||||
expanded = !expanded;
|
||||
}
|
||||
</script>
|
||||
|
@ -21,11 +21,8 @@ There are no movies added yet.
|
||||
echo ' You can add new movies in phpmyadmin under ' . TABLE_PREFIX . 'movies table.';
|
||||
return;
|
||||
}
|
||||
|
||||
echo $twig->render('movies.html.twig', array(
|
||||
'movies' => $movies
|
||||
));
|
||||
?>
|
||||
<div style="text-align: center;">
|
||||
<?php foreach($movies as $movie): ?>
|
||||
<?php echo $movie['title']; ?><br/>
|
||||
Author: <?php echo $movie['author']; ?><br/>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo $movie['youtube_id']; ?>" frameborder="0" allowfullscreen></iframe><br/><br/>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
@ -14,13 +14,7 @@ $title = 'Who is online?';
|
||||
|
||||
if($config['account_country'])
|
||||
require(SYSTEM . 'countries.conf.php');
|
||||
?>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white"><b>Server Status</b></td>
|
||||
</tr>
|
||||
<?php
|
||||
$promotion = '';
|
||||
if(fieldExist('promotion', 'players'))
|
||||
$promotion = '`promotion`,';
|
||||
@ -63,6 +57,7 @@ if(tableExist('players_online')) // tfs 1.0
|
||||
else
|
||||
$playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `level`, `vocation`' . $outfit . ', ' . $promotion . ' `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players` WHERE `players`.`online` > 0 AND `accounts`.`id` = `players`.`account_id` ORDER BY ' . $order);
|
||||
|
||||
$players_data = array();
|
||||
$players = 0;
|
||||
$data = '';
|
||||
foreach($playersOnline as $player)
|
||||
@ -70,202 +65,91 @@ foreach($playersOnline as $player)
|
||||
$skull = '';
|
||||
if($config['online_skulls'])
|
||||
{
|
||||
if($player['skulltime'] > 0 && $player['skull'] == 3)
|
||||
$skull = ' <img style="border: 0;" src="images/white_skull.gif"/>';
|
||||
elseif($player['skulltime'] > 0 && $player['skull'] == 4)
|
||||
$skull = ' <img style="border: 0;" src="images/red_skull.gif"/>';
|
||||
elseif($player['skulltime'] > 0 && $player['skull'] == 5)
|
||||
$skull = ' <img style="border: 0;" src="images/black_skull.gif"/>';
|
||||
if($player['skulltime'] > 0)
|
||||
{
|
||||
if($player['skull'] == 3)
|
||||
$skull = ' <img style="border: 0;" src="images/white_skull.gif"/>';
|
||||
elseif($player['skull'] == 4)
|
||||
$skull = ' <img style="border: 0;" src="images/red_skull.gif"/>';
|
||||
elseif($player['skull'] == 5)
|
||||
$skull = ' <img style="border: 0;" src="images/black_skull.gif"/>';
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($player['promotion'])) {
|
||||
if((int)$player['promotion'] > 0)
|
||||
$player['vocation'] += ($player['promotion'] * $config['vocations_amount']);
|
||||
}
|
||||
|
||||
$data .= '<tr bgcolor="' . getStyle(++$players) . '">';
|
||||
if($config['account_country'])
|
||||
$data .= '<td>' . getFlagImage($player['country']) . '</td>';
|
||||
|
||||
if($config['online_outfit'])
|
||||
$data .= '<TD WIDTH=5%><img style="position:absolute;margin-top:' . (in_array($player['looktype'], array(75, 266, 302)) ? '-20px;margin-left:-0px;' : '-45px;margin-left:-25px;') . '" src="' . $config['outfit_images_url'] . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td>';
|
||||
|
||||
$data .= '<td>' . getPlayerLink($player['name']) . $skull . '</td>
|
||||
<td>'.$player['level'].'</td>
|
||||
<td>'.$config['vocations'][$player['vocation']].'</td>
|
||||
</tr>';
|
||||
|
||||
|
||||
$players_data[] = array(
|
||||
'name' => getPlayerLink($player['name']),
|
||||
'player' => $player,
|
||||
'level' => $player['level'],
|
||||
'vocation' => $config['vocations'][$player['vocation']],
|
||||
'country_image' => $config['account_country'] ? getFlagImage($player['country']) : null,
|
||||
'outfit' => $config['online_outfit'] ? $config['outfit_images_url'] . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] : null
|
||||
);
|
||||
|
||||
if($config['online_vocations'])
|
||||
$vocs[($player['vocation'] > $config['vocations_amount'] ? $player['vocation'] - $config['vocations_amount'] : $player['vocation'])]++;
|
||||
}
|
||||
|
||||
if(!$players): ?>
|
||||
<tr bgcolor="<?php echo $config['darkborder']; ?>"><td>Currently no one is playing on <?php echo $config['lua']['serverName']; ?>.</td></tr></table>
|
||||
<?php else:
|
||||
?>
|
||||
<tr bgcolor="<?php echo $config['darkborder']; ?>">
|
||||
<td>
|
||||
<?php
|
||||
if(!$status['online'])
|
||||
echo 'Server is offline.<br/>';
|
||||
else
|
||||
{
|
||||
if($config['online_afk'])
|
||||
{
|
||||
$afk = $players - $status['players'];
|
||||
if($afk < 0) {
|
||||
$players += abs($afk);
|
||||
$afk = 0;
|
||||
}
|
||||
?>
|
||||
Currently there are <b><?php echo $status['players']; ?></b> active and <b><?php echo $afk ?></b> AFK players.<br/>
|
||||
Total number of players: <b><?php echo $players; ?></b>.<br/>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
echo 'Currently ' . $players . ' players are online.<br/>';
|
||||
}
|
||||
|
||||
if($config['online_record'])
|
||||
{
|
||||
$timestamp = false;
|
||||
if(tableExist('server_record')) {
|
||||
$record = '';
|
||||
if($players > 0)
|
||||
{
|
||||
if($config['online_record'])
|
||||
{
|
||||
$timestamp = false;
|
||||
if(tableExist('server_record')) {
|
||||
$query =
|
||||
$db->query(
|
||||
'SELECT ' . $db->fieldName('record') . ', ' . $db->fieldName('timestamp') .
|
||||
' FROM ' . $db->tableName('server_record') .
|
||||
' WHERE ' . $db->fieldName('world_id') . ' = ' . (int)$config['lua']['worldId'] .
|
||||
' ORDER BY ' . $db->fieldName('record') . ' DESC LIMIT 1');
|
||||
$timestamp = true;
|
||||
}
|
||||
else if(tableExist('server_config')) { // tfs 1.0
|
||||
$query = $db->query('SELECT `value` as `record` FROM `server_config` WHERE `config` = ' . $db->quote('players_record'));
|
||||
}
|
||||
else
|
||||
$query = NULL;
|
||||
|
||||
if(isset($query) && $query->rowCount() > 0)
|
||||
{
|
||||
$result = $query->fetch();
|
||||
echo 'The maximum on this game world was ' . $result['record'] . ' players' . ($timestamp ? ' on ' . date("M d Y, H:i:s", $result['timestamp']) . '.' : '.');
|
||||
}
|
||||
'SELECT `record`, `timestamp` FROM `server_record` WHERE `world_id` = ' . (int)$config['lua']['worldId'] .
|
||||
' ORDER BY `record` DESC LIMIT 1');
|
||||
$timestamp = true;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
else if(tableExist('server_config')) { // tfs 1.0
|
||||
$query = $db->query('SELECT `value` as `record` FROM `server_config` WHERE `config` = ' . $db->quote('players_record'));
|
||||
}
|
||||
else
|
||||
$query = NULL;
|
||||
|
||||
if(isset($query) && $query->rowCount() > 0)
|
||||
{
|
||||
$result = $query->fetch();
|
||||
$record = 'The maximum on this game world was ' . $result['record'] . ' players' . ($timestamp ? ' on ' . date("M d Y, H:i:s", $result['timestamp']) . '.' : '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
// vocation statistics
|
||||
if($config['online_vocations']): ?>
|
||||
<br/>
|
||||
<?php if($config['online_vocations_images']): ?>
|
||||
<table width="200" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr bgcolor="<?php echo $config['darkborder']; ?>">
|
||||
<td><img src="images/sorcerer.png" /></td>
|
||||
<td><img src="images/druid.png" /></td>
|
||||
<td><img src="images/palladin.png" /></td>
|
||||
<td><img src="images/knight.png" /></td>
|
||||
</tr>
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white" style="text-align: center;"><strong>Sorcerers<br /></strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Druids</strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Paladins</strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Knights</strong></td>
|
||||
</tr>
|
||||
<tr bgcolor="<?php echo $config['lightborder']; ?>">
|
||||
<td style="text-align: center;"><?php echo $vocs[1]; ?></td>
|
||||
<td style="text-align: center;"><?php echo $vocs[2]; ?></td>
|
||||
<td style="text-align: center;"><?php echo $vocs[3]; ?></td>
|
||||
<td style="text-align: center;"><?php echo $vocs[4]; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="text-align: center;"> </div>
|
||||
<?php else: ?>
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white" colspan="2"><b>Vocation statistics</b></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
for($i = 1; $i <= $config['vocations_amount']; $i++)
|
||||
echo '<tr bgcolor="' . getStyle($i) . '">
|
||||
<td width="25%">' . $config['vocations'][$i] . '</td>
|
||||
<td width="75%">' . $vocs[$i] . '</td>
|
||||
</tr>';
|
||||
?>
|
||||
</table><br/>
|
||||
<?php endif;
|
||||
endif;
|
||||
|
||||
// frags counter
|
||||
if($config['online_skulls']): ?>
|
||||
<table width="100%" cellspacing="1">
|
||||
<tr>
|
||||
<td style="background: <?php echo $config['darkborder']; ?>;" align="center">
|
||||
<img src="images/white_skull.gif"/> - 1 - 6 Frags<br/>
|
||||
<img src="images/red_skull.gif"/> - 6+ Frags or Red Skull<br/>
|
||||
<img src="images/black_skull.gif"/> - 10+ Frags or Black Skull
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<?php if($config['account_country']): ?>
|
||||
<td width="11px"><a href="?subtopic=online&order=country" class="white">#</A></td>
|
||||
<?php endif; ?>
|
||||
<?php if($config['online_outfit']): ?>
|
||||
<td class="white"><b>Outfit</b></td>
|
||||
<?php endif; ?>
|
||||
<td width="60%"><a href="?subtopic=online&order=name" class="white">Name</A></td>
|
||||
<td width="20%"><a href="?subtopic=online&order=level" class="white">Level</A></td>
|
||||
<td width="20%"><a href="?subtopic=online&order=vocation" class="white">Vocation</td>
|
||||
</tr>
|
||||
<?php echo $data; ?>
|
||||
</table>
|
||||
<?php
|
||||
endif;
|
||||
echo $twig->render('online.html.twig', array(
|
||||
'players' => $players_data,
|
||||
'record' => $record
|
||||
));
|
||||
|
||||
//search bar
|
||||
echo '<br/>
|
||||
<FORM ACTION="?subtopic=characters" METHOD=post>
|
||||
<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
|
||||
<TR>
|
||||
<TD BGCOLOR="'.$config['vdarkborder'].'" class="white">
|
||||
<B>Search Character</B>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD BGCOLOR="'.$config['darkborder'].'">
|
||||
<TABLE BORDER=0 CELLPADDING=1>
|
||||
<TR>
|
||||
<TD>Name:</TD>
|
||||
<TD>
|
||||
<INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29>
|
||||
</TD>
|
||||
<TD>
|
||||
<INPUT TYPE=image NAME="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</FORM>';
|
||||
|
||||
/* temporary disable it - shows server offline
|
||||
// update online players counter
|
||||
if($players > 0)
|
||||
{
|
||||
$status['players'] = $players;
|
||||
if($cache->enabled())
|
||||
$cache->set('status', serialize($status));
|
||||
else
|
||||
{
|
||||
foreach($status as $key => $value)
|
||||
updateDatabaseConfig('serverStatus_' . $key, $value);
|
||||
}
|
||||
}*/
|
||||
<form action="?subtopic=characters" method=post>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<td bgcolor="'.$config['vdarkborder'].'" class="white">
|
||||
<b>Search Character</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="'.$config['darkborder'].'">
|
||||
<table border=0 cellpadding=1>
|
||||
<tr>
|
||||
<td>Name:</td>
|
||||
<td>
|
||||
<input name="name" value=""size=29 maxlength=29>
|
||||
</td>
|
||||
<td>
|
||||
<input type="image" name="Submit" src="'.$template_path.'/images/buttons/sbutton_submit.gif" border="0" width="120" height="18">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>';
|
||||
?>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<td>
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
{% if config.characters.outfit %}
|
||||
<div style="width:64px;height:64px;border:2px solid #F1E0C6; border-radius:50px; padding:13px; margin-top:38px;margin-left:376px;position:absolute;"><img style="margin-left:{% if player.getLookType() in [75, 266, 302] %}-0px;margin-top:-0px;width:64px;height:64px;{% else %}-60px;margin-top:-60px;width:128px;height:128px;{% endif %}" src="{{ outfit }}"></div>
|
||||
<div style="width:64px;height:64px;border:2px solid #F1E0C6; border-radius:50px; padding:13px; margin-top:38px;margin-left:376px;position:absolute;"><img style="margin-left:{% if player.getLookType() in [75, 266, 302] %}-0px;margin-top:-0px;width:64px;height:64px;{% else %}-60px;margin-top:-60px;width:128px;height:128px;{% endif %}" src="{{ outfit }}" alt="player outfit"/></div>
|
||||
{% endif %}
|
||||
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
|
10
system/templates/downloads.html.twig
Normal file
10
system/templates/downloads.html.twig
Normal file
@ -0,0 +1,10 @@
|
||||
<br/><br/>
|
||||
<center>
|
||||
We're using official Tibia Client <strong>{{ config.client / 100 }}</strong><br/>
|
||||
<p>Download Tibia client {{ config.client / 100 }} for windows <a href="{{ config.client_download }}">HERE</a>.</p>
|
||||
<p>Download Tibia client {{ config.client / 100 }} for linux <a href="{{ config.client_download_linux }}">HERE</a>.</p>
|
||||
|
||||
<h2>IP Changer:</h2>
|
||||
|
||||
<a href="https://static.otland.net/ipchanger.exe" target="_blank">HERE</a>
|
||||
</center>
|
26
system/templates/experience_table.html.twig
Normal file
26
system/templates/experience_table.html.twig
Normal file
@ -0,0 +1,26 @@
|
||||
This is a list of the experience points that are required to advance to the various levels.
|
||||
Remember you can also check the respective skill bar in your skill window of the client to check your progress towards the next level.<br/><br/>
|
||||
|
||||
<table bgcolor="{{ config.darkborder }}" border="0" cellpadding="4" cellspacing="1" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
<td class="white" colspan="5"><b>Experience Table</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
{% for i in 0..config.experiencetable_columns-1 %}
|
||||
<td>
|
||||
<table border="0" cellpadding="2" cellspacing="1" width="100%">
|
||||
<tr bgcolor="{{ config.lightborder }}">
|
||||
<td><b>Level</b></td>
|
||||
<td><b>Experience</b></td>
|
||||
</tr>
|
||||
{% for level in i * config.experiencetable_rows + 1..i * config.experiencetable_rows + (config.experiencetable_rows + 1) - 1 %}
|
||||
<tr bgcolor="{{ config.lightborder }}">
|
||||
<td>{{ level }}</td>
|
||||
<td>{{ experience[level] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</table>
|
41
system/templates/faq.html.twig
Normal file
41
system/templates/faq.html.twig
Normal file
@ -0,0 +1,41 @@
|
||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
<td class="white">
|
||||
<b>FAQ</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a href="#" onclick="toggleAll(); return false;">Toggle all</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% set i = 0 %}
|
||||
{% for faq in faqs %}
|
||||
{% set i = i + 1 %}
|
||||
<tr bgcolor="{{ getStyle(i) }}">
|
||||
<td colspan="2" style="cursor: pointer;" onclick="toggleVisibility('faq_{{ i }}'); return false;">
|
||||
<b>{{ faq.question }}</b>
|
||||
<div id="faq_{{ i }}" style="display: none;">{{ faq.answer }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var expanded = false;
|
||||
|
||||
function toggleVisibility(id)
|
||||
{
|
||||
var tmp = document.getElementById(id);
|
||||
if(tmp)
|
||||
tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
|
||||
}
|
||||
|
||||
function toggleAll()
|
||||
{
|
||||
for(i = 1; i < {{ i + 1 }}; i++)
|
||||
{
|
||||
document.getElementById('faq_' + i).style.display = expanded ? 'none' : '';
|
||||
}
|
||||
|
||||
expanded = !expanded;
|
||||
}
|
||||
</script>
|
9
system/templates/google_analytics.html.twig
Normal file
9
system/templates/google_analytics.html.twig
Normal file
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '{{ config.google_analytics_id }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
7
system/templates/movies.html.twig
Normal file
7
system/templates/movies.html.twig
Normal file
@ -0,0 +1,7 @@
|
||||
<div style="text-align: center;">
|
||||
{% for movie in movies %}
|
||||
<h2>{{ movie.title }}</h2>
|
||||
Author: {{ movie.author }}<br/>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{ movie.youtube_id }}" frameborder="0" allowfullscreen></iframe><br/><br/>
|
||||
{% endfor %}
|
||||
</div>
|
@ -1,7 +1,7 @@
|
||||
<div class="NewsHeadline">
|
||||
<div class="NewsHeadlineBackground" style="background-image:url({{ template_path }}/images/news/newsheadline_background.gif)">
|
||||
<img src="{{ template_path }}/images/news/icon_{{ icon }}.gif" class="NewsHeadlineIcon" />
|
||||
<div class="NewsHeadlineDate">{{ date|date(news_date_format) }} - </div>
|
||||
<div class="NewsHeadlineDate">{{ date|date(config.news_date_format) }} - </div>
|
||||
<div class="NewsHeadlineText">{{ title }}</div>
|
||||
{% if author is not empty %}
|
||||
<div class="NewsHeadlineAuthor"><b>Author: </b><i>{{ author }}</i></div>
|
||||
|
112
system/templates/online.html.twig
Normal file
112
system/templates/online.html.twig
Normal file
@ -0,0 +1,112 @@
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
<td class="white"><b>Server Status</b></td>
|
||||
</tr>
|
||||
{% if players|length == 0 %}
|
||||
<tr bgcolor="{{ config.darkborder }}"><td>Currently no one is playing on {{ config.lua.serverName }}.</td></tr></table>
|
||||
{% else %}
|
||||
<tr bgcolor="{{ config.darkborder }}">
|
||||
<td>
|
||||
{% if not status.online %}
|
||||
Server is offline.<br/>
|
||||
{% else %}
|
||||
{% if config.online_afk %}
|
||||
{% set players_count = players|length %}
|
||||
{% set afk = players_count - status.players %}
|
||||
{% if afk < 0 %}
|
||||
{% set players = players + afk|abs %}
|
||||
{% set afk = 0 %}
|
||||
{% endif %}
|
||||
Currently there are <b>{{ status.players }}</b> active and <b>{{ afk }}</b> AFK players.<br/>
|
||||
Total number of players: <b>{{ players_count }}</b>.<br/>
|
||||
{% else %}
|
||||
Currently {{ players|length }} players are online.<br/>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{# vocation statistics #}
|
||||
{% if config.online_vocations %}
|
||||
<br/>
|
||||
{% if config.online_vocations_images %}
|
||||
<table width="200" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr bgcolor="{{ config.darkborder }}">
|
||||
<td><img src="images/sorcerer.png" /></td>
|
||||
<td><img src="images/druid.png" /></td>
|
||||
<td><img src="images/paladin.png" /></td>
|
||||
<td><img src="images/knight.png" /></td>
|
||||
</tr>
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
<td class="white" style="text-align: center;"><strong>Sorcerers</strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Druids</strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Paladins</strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Knights</strong></td>
|
||||
</tr>
|
||||
<tr bgcolor="{{ config.lightborder }}">
|
||||
<td style="text-align: center;">{{ vocs[1] }}</td>
|
||||
<td style="text-align: center;">{{ vocs[2] }}</td>
|
||||
<td style="text-align: center;">{{ vocs[3] }}</td>
|
||||
<td style="text-align: center;">{{ vocs[4] }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="text-align: center;"> </div>
|
||||
{% else %}
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
<td class="white" colspan="2"><b>Vocation statistics</b></td>
|
||||
</tr>
|
||||
|
||||
{% for i in 1..config.vocations_amount %}
|
||||
<tr bgcolor="{{ getStyle(i) }}">
|
||||
<td width="25%">{{ config.vocations[i] }}</td>
|
||||
<td width="75%">{{ vocs[i] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{# show skulls #}
|
||||
{% if config.online_skulls %}
|
||||
<table width="100%" cellspacing="1">
|
||||
<tr>
|
||||
<td style="background: {{ config.darkborder }};" align="center">
|
||||
<img src="images/white_skull.gif"/> - 1 - 6 Frags<br/>
|
||||
<img src="images/red_skull.gif"/> - 6+ Frags or Red Skull<br/>
|
||||
<img src="images/black_skull.gif"/> - 10+ Frags or Black Skull
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
{% if config.account_country %}
|
||||
<td width="11px"><a href="?subtopic=online&order=country" class="white">#</A></td>
|
||||
{% endif %}
|
||||
{% if config.online_outfit %}
|
||||
<td class="white"><b>Outfit</b></td>
|
||||
{% endif %}
|
||||
<td width="60%"><a href="?subtopic=online&order=name" class="white">Name</A></td>
|
||||
<td width="20%"><a href="?subtopic=online&order=level" class="white">Level</A></td>
|
||||
<td width="20%"><a href="?subtopic=online&order=vocation" class="white">Vocation</td>
|
||||
</tr>
|
||||
{% set i = 0 %}
|
||||
{% for player in players %}
|
||||
{% set i = i + 1 %}
|
||||
<tr bgcolor="{{ getStyle(i) }}">
|
||||
{% if config.account_country %}
|
||||
<td>{{ player.country_image|raw }}</td>
|
||||
{% endif %}
|
||||
{% if config.online_outfit %}
|
||||
<td width="5%"><img style="position:absolute;margin-top:{% if player.looktype in [75, 266, 302] %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ player.outfit }}" alt="player outfit"/></td>
|
||||
{% endif %}
|
||||
<td>{{ player.name|raw }}{{ player.skull }}</td>
|
||||
<td>{{ player.level }}</td>
|
||||
<td>{{ player.vocation }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
@ -2,7 +2,7 @@
|
||||
<div class="NewsHeadline">
|
||||
<div class="NewsHeadlineBackground" style="background-image:url({{template_path }}/images/news/newsheadline_background.gif)">
|
||||
<img src="{{ template_path }}/images/news/icon_{{ icon }}.gif" class="NewsHeadlineIcon" />
|
||||
<div class="NewsHeadlineDate">{{ date|date(news_date_format) }} - </div>
|
||||
<div class="NewsHeadlineDate">{{ date|date(config.news_date_format) }} - </div>
|
||||
<div class="NewsHeadlineText">{{ title }}</div>
|
||||
{% if author is not empty %}
|
||||
<div class="NewsHeadlineAuthor"><b>Author: </b><i>{{ author }}</i></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user