* changed mb_strtolower functions to strtolower() - was useless in this
case
* attemp to fix some bug with PHPMailer not finding its language file
This commit is contained in:
slawkens1 2018-01-26 08:04:28 +01:00
parent 7e2be69749
commit 51acb739e9
4 changed files with 19 additions and 18 deletions

View File

@ -799,6 +799,7 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
{ {
require(SYSTEM . 'libs/phpmailer/PHPMailerAutoload.php'); require(SYSTEM . 'libs/phpmailer/PHPMailerAutoload.php');
$mailer = new PHPMailer(); $mailer = new PHPMailer();
$mailer->setLanguage('en', LIBS . 'phpmailer/language/');
} }
$signature_html = ''; $signature_html = '';

View File

@ -110,21 +110,21 @@ if(empty($_REQUEST['creature']))
$number_of_rows = 0; $number_of_rows = 0;
foreach($monsters as $monster) { 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>'; 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']) { if($monster['summonable']) {
echo '<TD>'.$monster['mana'].'</TD>'; echo '<TD>'.$monster['mana'].'</TD>';
} }
else { else {
echo '<TD>---</TD>'; echo '<TD>---</TD>';
} }
if($monster['convinceable']) { if($monster['convinceable']) {
echo '<TD>'.$monster['mana'].'</TD>'; echo '<TD>'.$monster['mana'].'</TD>';
} }
else { else {
echo '<TD>---</TD>'; echo '<TD>---</TD>';
} }
echo '<td>'.ucwords($monster['race']).'</td></tr>'; echo '<td>'.ucwords($monster['race']).'</td></tr>';
} }
@ -170,13 +170,13 @@ if(isset($monster['name']))
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(mb_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">';
@ -190,19 +190,19 @@ if(isset($monster['name']))
$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); $voices = json_decode($monster['voices'], true);
if(count($voices) > 0) if(count($voices) > 0)
{ {
foreach($voices as &$voice) { foreach($voices as &$voice) {
$voice = '"' . $voice . '"'; $voice = '"' . $voice . '"';
} }
$number_of_rows++; $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 '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Voices: </b></td><td width="100%">'.implode(', ', $voices).'</td></tr>';
} }
echo '</TABLE></td></tr>'; echo '</TABLE></td></tr>';
$loot = json_decode($monster['loot'], true); $loot = json_decode($monster['loot'], true);
if($loot) if($loot)
{ {
@ -214,18 +214,18 @@ if(isset($monster['name']))
} }
return ($a['chance'] > $b['chance']) ? -1 : 1; return ($a['chance'] > $b['chance']) ? -1 : 1;
} }
usort($loot, 'sort_by_chance'); usort($loot, 'sort_by_chance');
$i = 0; $i = 0;
foreach($loot as $item) { foreach($loot as $item) {
$name = getItemNameById($item['id']); $name = getItemNameById($item['id']);
$tooltip = $name . '<br/>Chance: ' . round($item['chance'] / 1000, 2) . '%<br/>Max count: ' . $item['count']; $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 . '" />'; echo '<img src="' . $config['item_images_url'] . $item['id'] . '.gif" class="tooltip" title="' . $tooltip . '" width="32" height="32" border="0" alt=" ' .$name . '" />';
$i++; $i++;
} }
echo '</td></tr></TABLE>'; echo '</td></tr></TABLE>';
} }

View File

@ -14,7 +14,7 @@
{% set players_count = players|length %} {% set players_count = players|length %}
{% set afk = players_count - status.players %} {% set afk = players_count - status.players %}
{% if afk < 0 %} {% if afk < 0 %}
{% set players = players + afk|abs %} {% set players_count = players_count + afk|abs %}
{% set afk = 0 %} {% set afk = 0 %}
{% endif %} {% endif %}
Currently there are <b>{{ status.players }}</b> active and <b>{{ afk }}</b> AFK players.<br/> Currently there are <b>{{ status.players }}</b> active and <b>{{ afk }}</b> AFK players.<br/>

View File

@ -46,7 +46,7 @@ if(isset($config['boxes']))
var activeSubmenuItem="<?php echo $tmp; ?>"; var activeSubmenuItem="<?php echo $tmp; ?>";
var IMAGES="<?php echo $template_path; ?>/images"; var IMAGES="<?php echo $template_path; ?>/images";
var LINK_ACCOUNT="<?php echo BASE_URL; ?>"; var LINK_ACCOUNT="<?php echo BASE_URL; ?>";
function rowOverEffect(object) { function rowOverEffect(object) {
if (object.className == 'moduleRow') object.className = 'moduleRowOver'; if (object.className == 'moduleRow') object.className = 'moduleRowOver';
} }
@ -54,7 +54,7 @@ if(isset($config['boxes']))
function rowOutEffect(object) { function rowOutEffect(object) {
if (object.className == 'moduleRowOver') object.className = 'moduleRow'; if (object.className == 'moduleRowOver') object.className = 'moduleRow';
} }
function InitializePage() { function InitializePage() {
LoadLoginBox(); LoadLoginBox();
LoadMenu(); LoadMenu();
@ -341,7 +341,7 @@ foreach($config['menu_categories'] as $id => $cat) {
<div id='<?php echo $cat['id']; ?>_Submenu' class='Submenu'> <div id='<?php echo $cat['id']; ?>_Submenu' class='Submenu'>
<?php <?php
$default_menu_color = "ffffff"; $default_menu_color = "ffffff";
foreach($menus[$id] as $category => $menu) { foreach($menus[$id] as $category => $menu) {
$link_color = '#' . (strlen($menu['color']) == 0 ? $default_menu_color : $menu['color']); $link_color = '#' . (strlen($menu['color']) == 0 ? $default_menu_color : $menu['color']);
?> ?>
@ -444,6 +444,6 @@ foreach($config['menu_categories'] as $id => $cat) {
function logo_monster() function logo_monster()
{ {
global $config; global $config;
return str_replace(" ", "", trim(mb_strtolower($config['logo_monster']))); return str_replace(" ", "", trim(strtolower($config['logo_monster'])));
} }
?> ?>