diff --git a/install/steps/1-welcome.php b/install/steps/1-welcome.php
index c50d00e9..d54ff220 100644
--- a/install/steps/1-welcome.php
+++ b/install/steps/1-welcome.php
@@ -18,7 +18,7 @@ else {
$locales[] = array('id' => $tmp_locale, 'name' => $locale['name']);
}
}
- echo $twig->render('install.welcome.html.twig', array(
+ $twig->display('install.welcome.html.twig', array(
'locales' => $locales,
'locale' => $locale,
'buttons' => next_buttons(false, true)
diff --git a/install/steps/2-license.php b/install/steps/2-license.php
index 3181f866..e84ce0e6 100644
--- a/install/steps/2-license.php
+++ b/install/steps/2-license.php
@@ -1,7 +1,7 @@
render('install.license.html.twig', array(
+$twig->display('install.license.html.twig', array(
'license' => file_get_contents(BASE . 'LICENSE'),
'buttons' => next_buttons()
));
diff --git a/install/steps/4-config.php b/install/steps/4-config.php
index 201ca089..b1555201 100644
--- a/install/steps/4-config.php
+++ b/install/steps/4-config.php
@@ -6,11 +6,11 @@ foreach($config['clients'] as $client) {
$client_version = (string)($client / 100);
if(strpos($client_version, '.') == false)
$client_version .= '.0';
-
+
$clients[$client] = $client_version;
}
-echo $twig->render('install.config.html.twig', array(
+$twig->display('install.config.html.twig', array(
'clients' => $clients,
'timezones' => DateTimeZone::listIdentifiers(),
'locale' => $locale,
diff --git a/install/steps/5-database.php b/install/steps/5-database.php
index 790e23ea..3c163702 100644
--- a/install/steps/5-database.php
+++ b/install/steps/5-database.php
@@ -51,7 +51,7 @@ if(!$error) {
error($database_error);
}
else {
- echo $twig->render('install.installer.html.twig', array(
+ $twig->display('install.installer.html.twig', array(
'url' => 'tools/5-database.php',
'message' => $locale['loading_spinner']
));
diff --git a/install/steps/6-admin.php b/install/steps/6-admin.php
index 3dfdbb8f..290e0561 100644
--- a/install/steps/6-admin.php
+++ b/install/steps/6-admin.php
@@ -9,7 +9,7 @@ if(!$error) {
error($database_error);
}
- echo $twig->render('install.admin.html.twig', array(
+ $twig->display('install.admin.html.twig', array(
'locale' => $locale,
'session' => $_SESSION,
'errors' => isset($errors) ? $errors : null,
diff --git a/install/steps/7-finish.php b/install/steps/7-finish.php
index 96b42e68..953d8556 100644
--- a/install/steps/7-finish.php
+++ b/install/steps/7-finish.php
@@ -115,7 +115,7 @@ else {
}
}
- echo $twig->render('install.installer.html.twig', array(
+ $twig->display('install.installer.html.twig', array(
'url' => 'tools/7-finish.php',
'message' => $locale['importing_spinner']
));
diff --git a/system/pages/account/change_comment.php b/system/pages/account/change_comment.php
index a70020b6..e1f36531 100644
--- a/system/pages/account/change_comment.php
+++ b/system/pages/account/change_comment.php
@@ -25,7 +25,7 @@ if($player_name != null) {
$player->setCustomField("hidden", $new_hideacc);
$player->setCustomField("comment", $new_comment);
$account_logged->logAction('Changed comment for character ' . $player->getName() . ' .');
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Character Information Changed',
'description' => 'The character information has been changed.'
));
@@ -47,11 +47,11 @@ else {
if($show_form) {
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
-
+
if(isset($player)) {
- echo $twig->render('account.change_comment.html.twig', array(
+ $twig->display('account.change_comment.html.twig', array(
'player' => $player
));
}
diff --git a/system/pages/account/change_email.php b/system/pages/account/change_email.php
index ba6eb338..25624b6b 100644
--- a/system/pages/account/change_email.php
+++ b/system/pages/account/change_email.php
@@ -20,11 +20,11 @@ if($email_new_time < 10) {
if(isset($_POST['changeemailsave']) && $_POST['changeemailsave'] == 1) {
$email_new = $_POST['new_email'];
$post_password = $_POST['password'];
-
+
if(!Validator::email($email_new)) {
$errors[] = Validator::getLastError();
}
-
+
if(empty($post_password)) {
$errors[] = 'Please enter password to your account.';
}
@@ -34,12 +34,12 @@ if($email_new_time < 10) {
$errors[] = 'Wrong password to account.';
}
}
-
+
if(empty($errors)) {
$email_new_time = time() + $config['account_mail_change'] * 24 * 3600;
$account_logged->setCustomField("email_new", $email_new);
$account_logged->setCustomField("email_new_time", $email_new_time);
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'New Email Address Requested',
'description' => 'You have requested to change your email address to ' . $email_new . ' . The actual change will take place after ' . date("j F Y, G:i:s", $email_new_time) . ' , during which you can cancel the request at any time.'
));
@@ -47,21 +47,21 @@ if($email_new_time < 10) {
else
{
//show errors
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
//show form
- echo $twig->render('account.change_mail.html.twig', array(
+ $twig->display('account.change_mail.html.twig', array(
'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null
));
}
}
else
{
- echo $twig->render('account.change_mail.html.twig', array(
+ $twig->display('account.change_mail.html.twig', array(
'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null
));
}
-
+
}
else
{
@@ -72,8 +72,8 @@ else
$account_logged->setEmail($email_new);
$account_logged->save();
$account_logged->logAction('Account email changed to ' . $email_new . ' ');
-
- echo $twig->render('success.html.twig', array(
+
+ $twig->display('success.html.twig', array(
'title' => 'Email Address Change Accepted',
'description' => 'You have accepted ' . $account_logged->getEmail() . ' as your new email adress.'
));
@@ -103,7 +103,7 @@ else
';
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Email Address Change Accepted',
'description' => 'Do you accept '.$email_new.' as your new email adress?',
'custom_buttons' => $custom_buttons
@@ -140,7 +140,7 @@ else
';
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Change of Email Address',
'description' => 'A request has been submitted to change the email address of this account to '.$email_new.' . The actual change will take place on '.date("j F Y, G:i:s", $email_new_time).' . If you do not want to change your email address, please click on "Cancel".',
'custom_buttons' => $custom_buttons
@@ -150,10 +150,10 @@ else
if(isset($_POST['emailchangecancel']) && $_POST['emailchangecancel'] == 1) {
$account_logged->setCustomField("email_new", "");
$account_logged->setCustomField("email_new_time", 0);
-
+
$custom_buttons = ' ';
-
- echo $twig->render('success.html.twig', array(
+
+ $twig->display('success.html.twig', array(
'title' => 'Email Address Change Cancelled',
'description' => 'Your request to change the email address of your account has been cancelled. The email address will not be changed.',
'custom_buttons' => $custom_buttons
diff --git a/system/pages/account/change_info.php b/system/pages/account/change_info.php
index e92f6a8b..e9b89c00 100644
--- a/system/pages/account/change_info.php
+++ b/system/pages/account/change_info.php
@@ -17,21 +17,21 @@ $new_country = isset($_POST['info_country']) ? htmlspecialchars(stripslashes($_P
if(isset($_POST['changeinfosave']) && $_POST['changeinfosave'] == 1) {
if(!isset($config['countries'][$new_country]))
$errors[] = 'Country is not correct.';
-
+
if(empty($errors)) {
//save data from form
$account_logged->setCustomField("rlname", $new_rlname);
$account_logged->setCustomField("location", $new_location);
$account_logged->setCustomField("country", $new_country);
$account_logged->logAction('Changed Real Name to ' . $new_rlname . ' , Location to ' . $new_location . ' and Country to ' . $config['countries'][$new_country] . ' .');
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Public Information Changed',
'description' => 'Your public information has been changed.'
));
$show_form = false;
}
else {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
}
@@ -41,17 +41,17 @@ if($show_form) {
$account_location = $account_logged->getCustomField("location");
if ($config['account_country'])
$account_country = $account_logged->getCustomField("country");
-
+
$countries = array();
foreach (array('pl', 'se', 'br', 'us', 'gb',) as $country)
$countries[$country] = $config['countries'][$country];
-
+
$countries['--'] = '----------';
-
+
foreach ($config['countries'] as $code => $country)
$countries[$code] = $country;
-
- echo $twig->render('account.change_info.html.twig', array(
+
+ $twig->display('account.change_info.html.twig', array(
'countries' => $countries,
'account_rlname' => $account_rlname,
'account_location' => $account_location,
diff --git a/system/pages/account/change_name.php b/system/pages/account/change_name.php
index 5d523677..4836301d 100644
--- a/system/pages/account/change_name.php
+++ b/system/pages/account/change_name.php
@@ -22,7 +22,7 @@ else
if(isset($_POST['changenamesave']) && $_POST['changenamesave'] == 1) {
if($points < $config['account_change_character_name_points'])
$errors[] = 'You need ' . $config['account_change_character_name_points'] . ' premium points to change name. You have '.$points.' premium points.';
-
+
if(empty($errors) && empty($name))
$errors[] = 'Please enter a new name for your character!';
else if(strlen($name) > 25)
@@ -36,13 +36,13 @@ else
$errors[] = 'Character with this name already exist.';
}
}
-
+
if(empty($errors))
{
if(!admin() && !Validator::newCharacterName($name))
$errors[] = Validator::getLastError();
}
-
+
if(empty($errors)) {
$player = new OTS_Player();
$player->load($player_id);
@@ -52,7 +52,7 @@ else
if($player->isOnline()) {
$errors[] = 'This character is online.';
}
-
+
if(empty($errors)) {
$show_form = false;
$old_name = $player->getName();
@@ -60,7 +60,7 @@ else
$player->save();
$account_logged->setCustomField("premium_points", $points - $config['account_change_character_name_points']);
$account_logged->logAction('Changed name from ' . $old_name . ' to ' . $player->getName() . ' .');
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Character Name Changed',
'description' => 'The character '.$old_name.' name has been changed to ' . $player->getName() . ' .'
));
@@ -75,13 +75,13 @@ else
}
}
}
-
+
if($show_form) {
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
-
- echo $twig->render('account.change_name.html.twig', array(
+
+ $twig->display('account.change_name.html.twig', array(
'points' => $points,
'errors' => $errors
//'account_players' => $account_logged->getPlayersList()
diff --git a/system/pages/account/change_password.php b/system/pages/account/change_password.php
index 04fa2562..2ef2ce2c 100644
--- a/system/pages/account/change_password.php
+++ b/system/pages/account/change_password.php
@@ -14,7 +14,7 @@ $new_password = isset($_POST['newpassword']) ? $_POST['newpassword'] : NULL;
$new_password2 = isset($_POST['newpassword2']) ? $_POST['newpassword2'] : NULL;
$old_password = isset($_POST['oldpassword']) ? $_POST['oldpassword'] : NULL;
if(empty($new_password) && empty($new_password2) && empty($old_password)) {
- echo $twig->render('account.change_password.html.twig');
+ $twig->display('account.change_password.html.twig');
}
else
{
@@ -25,12 +25,12 @@ else
if($new_password != $new_password2) {
$errors[] = "The new passwords do not match!";
}
-
+
if(empty($errors)) {
if(!Validator::password($new_password)) {
$errors[] = Validator::getLastError();
}
-
+
$old_password = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $old_password);
if($old_password != $account_logged->getPassword()) {
$errors[] = "Current password is incorrect!";
@@ -38,41 +38,41 @@ else
}
if(!empty($errors)){
//show errors
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
//show form
- echo $twig->render('account.change_password.html.twig');
+ $twig->display('account.change_password.html.twig');
}
else
{
$org_pass = $new_password;
-
+
if($config_salt_enabled)
{
$salt = generateRandomString(10, false, true, true);
$new_password = $salt . $new_password;
$account_logged->setCustomField('salt', $salt);
}
-
+
$new_password = encrypt($new_password);
$account_logged->setPassword($new_password);
$account_logged->save();
$account_logged->logAction('Account password changed.');
-
+
$message = '';
if($config['mail_enabled'] && $config['send_mail_when_change_password'])
{
$mailBody = $twig->render('mail.password_changed.html.twig', array(
'new_password' => $org_pass
));
-
+
if(_mail($account_logged->getEMail(), $config['lua']['serverName']." - Changed password", $mailBody))
$message = 'Your new password were send on email address '.$account_logged->getEMail().' . ';
else
$message = ' An error occorred while sending email with password: ' . $mailer->ErrorInfo . '
';
}
-
- echo $twig->render('success.html.twig', array(
+
+ $twig->display('success.html.twig', array(
'title' => 'Password Changed',
'description' => 'Your password has been changed.' . $message
));
diff --git a/system/pages/account/change_sex.php b/system/pages/account/change_sex.php
index 4b5da7f3..58a9f90f 100644
--- a/system/pages/account/change_sex.php
+++ b/system/pages/account/change_sex.php
@@ -21,43 +21,43 @@ else
if(isset($_POST['changesexsave']) && $_POST['changesexsave'] == 1) {
if($points < $config['account_change_character_sex_points'])
$errors[] = 'You need ' . $config['account_change_character_sex_points'] . ' premium points to change sex. You have '.$points.' premium points.';
-
+
if(empty($errors) && !isset($config['genders'][$new_sex])) {
$errors[] = 'This sex is invalid.';
}
-
+
if(empty($errors)) {
$player = new OTS_Player();
$player->load($player_id);
-
+
if($player->isLoaded()) {
$player_account = $player->getAccount();
-
+
if($account_logged->getId() == $player_account->getId()) {
if($player->isOnline()) {
$errors[] = 'This character is online.';
}
-
+
if(empty($errors) && $player->getSex() == $new_sex)
$errors[] = 'Sex cannot be same';
-
+
if(empty($errors)) {
$sex_changed = true;
$old_sex = $player->getSex();
$player->setSex($new_sex);
-
+
$old_sex_str = 'Unknown';
if(isset($config['genders'][$old_sex]))
$old_sex_str = $config['genders'][$old_sex];
-
+
$new_sex_str = 'Unknown';
if(isset($config['genders'][$new_sex]))
$new_sex_str = $config['genders'][$new_sex];
-
+
$player->save();
$account_logged->setCustomField("premium_points", $points - $config['account_change_character_name_points']);
$account_logged->logAction('Changed sex on character ' . $player->getName() . ' from ' . $old_sex_str . ' to ' . $new_sex_str . ' .');
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Character Sex Changed',
'description' => 'The character ' . $player->getName() . ' sex has been changed to ' . $new_sex_str . ' .'
));
@@ -72,12 +72,12 @@ else
}
}
}
-
+
if(!$sex_changed) {
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
- echo $twig->render('account.change_sex.html.twig', array(
+ $twig->display('account.change_sex.html.twig', array(
'players' => $account_logged->getPlayersList(),
'player_sex' => isset($player) ? $player->getSex() : -1,
'points' => $points
diff --git a/system/pages/account/create_character.php b/system/pages/account/create_character.php
index 59135ee4..cf6f1647 100644
--- a/system/pages/account/create_character.php
+++ b/system/pages/account/create_character.php
@@ -183,7 +183,7 @@ if($save) {
foreach($loaded_items_to_copy as $save_item)
$db->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Character Created',
'description' => 'The character ' . $newchar_name . ' has been created.
Please select the outfit when you log in for the first time.
@@ -199,11 +199,11 @@ if($save) {
}
if(count($errors) > 0) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
if(!$newchar_created) {
- echo $twig->render('account.create_character.html.twig', array(
+ $twig->display('account.create_character.html.twig', array(
'name' => $newchar_name,
'sex' => $newchar_sex,
'vocation' => $newchar_vocation,
diff --git a/system/pages/account/delete_character.php b/system/pages/account/delete_character.php
index d47ad8ff..da1144fb 100644
--- a/system/pages/account/delete_character.php
+++ b/system/pages/account/delete_character.php
@@ -32,7 +32,7 @@ if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
else
$player->setCustomField('deleted', 1);
$account_logged->logAction('Deleted character ' . $player->getName() . ' .');
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Character Deleted',
'description' => 'The character ' . $player_name . ' has been deleted.'
));
@@ -62,8 +62,8 @@ if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
}
if($show_form) {
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
- echo $twig->render('account.delete_character.html.twig');
+ $twig->display('account.delete_character.html.twig');
}
?>
\ No newline at end of file
diff --git a/system/pages/account/register.php b/system/pages/account/register.php
index af1dcdd3..56d8918d 100644
--- a/system/pages/account/register.php
+++ b/system/pages/account/register.php
@@ -19,10 +19,10 @@ if(isset($_POST['registeraccountsave']) && $_POST['registeraccountsave'] == "1")
if(empty($old_key)) {
$show_form = false;
$new_rec_key = generateRandomString(10, false, true, true);
-
+
$account_logged->setCustomField("key", $new_rec_key);
$account_logged->logAction('Generated recovery key.');
-
+
if($config['mail_enabled'] && $config['send_mail_when_generate_reckey'])
{
$mailBody = $twig->render('mail.account.register.html.twig', array(
@@ -33,7 +33,7 @@ if(isset($_POST['registeraccountsave']) && $_POST['registeraccountsave'] == "1")
else
$message = 'An error occorred while sending email with recovery key! You will not receive e-mail with this key. Error: ' . $mailer->ErrorInfo . '
';
}
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Account Registered',
'description' => 'Thank you for registering your account! You can now recover your account if you have lost access to the assigned email address by using the following Recovery Key: '.$new_rec_key.' Important: Write down this recovery key carefully. Store it at a safe place! ' . $message . ' '
));
@@ -48,11 +48,11 @@ if(isset($_POST['registeraccountsave']) && $_POST['registeraccountsave'] == "1")
if($show_form) {
if(!empty($errors)) {
//show errors
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
-
+
//show form
- echo $twig->render('account.generate_recovery_key.html.twig');
+ $twig->display('account.generate_recovery_key.html.twig');
}
?>
\ No newline at end of file
diff --git a/system/pages/account/register_new.php b/system/pages/account/register_new.php
index a8db81fe..5c874aab 100644
--- a/system/pages/account/register_new.php
+++ b/system/pages/account/register_new.php
@@ -27,11 +27,11 @@ else
{
$show_form = false;
$new_rec_key = generateRandomString(10, false, true, true);
-
+
$mailBody = $twig->render('mail.account.register.html.twig', array(
'recovery_key' => $new_rec_key
));
-
+
if(_mail($account_logged->getEMail(), $config['lua']['serverName']." - new recovery key", $mailBody))
{
$account_logged->setCustomField("key", $new_rec_key);
@@ -41,8 +41,8 @@ else
}
else
$message = 'An error occorred while sending email ( '.$account_logged->getEMail().' ) with recovery key! Recovery key not changed. Try again. Error: ' . $mailer->ErrorInfo . '
';
-
- echo $twig->render('success.html.twig', array(
+
+ $twig->display('success.html.twig', array(
'title' => 'Account Registered',
'description' => ''
));
@@ -53,16 +53,16 @@ else
else
$errors[] = 'Wrong password to account.';
}
-
+
//show errors if not empty
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
-
+
if($show_form)
{
//show form
- echo $twig->render('account.generate_new_recovery_key.html.twig', array(
+ $twig->display('account.generate_new_recovery_key.html.twig', array(
'points' => $points
));
}
diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php
index 3fd4c94c..b38d8d1c 100644
--- a/system/pages/accountmanagement.php
+++ b/system/pages/accountmanagement.php
@@ -21,7 +21,7 @@ $config_salt_enabled = $db->hasColumn('accounts', 'salt');
if(ACTION == "logout" && !isset($_REQUEST['account_login'])) {
if(!defined('HOOK_LOGOUT_DISPLAY') || HOOK_LOGOUT_DISPLAY) { // plugin will take care of this message
- echo $twig->render('account.logout.html.twig');
+ $twig->display('account.logout.html.twig');
}
return;
@@ -35,9 +35,9 @@ if(!$logged)
}
if(!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
- echo $twig->render('account.login.html.twig', array(
+ $twig->display('account.login.html.twig', array(
'redirect' => isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : null,
'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number',
'error' => isset($errors[0]) ? $errors[0] : null
@@ -52,7 +52,7 @@ $errors = array();
{
$redirect = urldecode($_REQUEST['redirect']);
- echo $twig->render('account.redirect.html.twig', array(
+ $twig->display('account.redirect.html.twig', array(
'redirect' => $redirect
));
return;
@@ -114,7 +114,7 @@ $errors = array();
$account_players = $account_logged->getPlayersList();
$account_players->orderBy('id');
- echo $twig->render('account.management.html.twig', array(
+ $twig->display('account.management.html.twig', array(
'welcome_message' => $welcome_message,
'recovery_key' => $recovery_key,
'email_change' => $email_change,
diff --git a/system/pages/admin/dashboard.php b/system/pages/admin/dashboard.php
index 82608257..82631487 100644
--- a/system/pages/admin/dashboard.php
+++ b/system/pages/admin/dashboard.php
@@ -47,7 +47,7 @@ $tmp = '';
if(fetchDatabaseConfig('site_closed_message', $tmp))
$closed_message = $tmp;
-echo $twig->render('admin.dashboard.html.twig', array(
+$twig->display('admin.dashboard.html.twig', array(
'is_closed' => $is_closed,
'closed_message' => $closed_message,
'status' => $status
@@ -60,7 +60,7 @@ function clearCache()
$tmp = '';
if($cache->fetch('status', $tmp))
$cache->delete('status');
-
+
if($cache->fetch('templates', $tmp))
$cache->delete('templates');
@@ -90,7 +90,7 @@ function clearCache()
if($cache->fetch('news' . $template_name . '_' . TICKER, $tmp))
$cache->delete('news' . $template_name . '_' . TICKER);
-
+
if($cache->fetch('template_ini' . $template_name, $tmp))
$cache->delete('template_ini' . $template_name);
diff --git a/system/pages/admin/items.php b/system/pages/admin/items.php
index 9c2c1b7b..906ee60e 100644
--- a/system/pages/admin/items.php
+++ b/system/pages/admin/items.php
@@ -13,7 +13,7 @@ $title = 'Load items.xml';
require LIBS . 'items.php';
require LIBS . 'weapons.php';
-echo $twig->render('admin.items.html.twig');
+$twig->display('admin.items.html.twig');
$reload = isset($_REQUEST['reload']) && (int)$_REQUEST['reload'] == 1;
if($reload) {
diff --git a/system/pages/admin/login.php b/system/pages/admin/login.php
index 25cab960..cad7f52f 100644
--- a/system/pages/admin/login.php
+++ b/system/pages/admin/login.php
@@ -19,5 +19,5 @@ if(isset($errors)) {
}
}
-echo $twig->render('admin.login.html.twig');
+$twig->display('admin.login.html.twig');
?>
\ No newline at end of file
diff --git a/system/pages/admin/mailer.php b/system/pages/admin/mailer.php
index 8cf13246..45b0bcc7 100644
--- a/system/pages/admin/mailer.php
+++ b/system/pages/admin/mailer.php
@@ -30,14 +30,14 @@ $preview_done = false;
if($preview) {
if(!empty($mail_content) && !empty($mail_subject)) {
$preview_done = _mail($account_logged->getCustomField('email'), $mail_subject, $mail_content);
-
+
if(!$preview_done)
error('Error while sending preview mail: ' . $mailer->ErrorInfo);
}
}
-echo $twig->render('admin.mailer.html.twig', array(
+$twig->display('admin.mailer.html.twig', array(
'mail_subject' => $mail_subject,
'mail_content' => $mail_content,
'preview_done' => $preview_done
diff --git a/system/pages/admin/menus.php b/system/pages/admin/menus.php
index 6b9209d0..d1656482 100644
--- a/system/pages/admin/menus.php
+++ b/system/pages/admin/menus.php
@@ -101,7 +101,7 @@ if(isset($_REQUEST['template'])) {
echo ' ';
echo '';
- echo $twig->render('admin.menus.js.html.twig', array(
+ $twig->display('admin.menus.js.html.twig', array(
'menus' => $menus,
'last_id' => $last_id
));
@@ -115,7 +115,7 @@ else {
}
}
- echo $twig->render('admin.menus.form.html.twig', array(
+ $twig->display('admin.menus.form.html.twig', array(
'templates' => $templates
));
}
diff --git a/system/pages/admin/notepad.php b/system/pages/admin/notepad.php
index 9ccf9295..1daaeadb 100644
--- a/system/pages/admin/notepad.php
+++ b/system/pages/admin/notepad.php
@@ -27,7 +27,7 @@ else
$_content = $notepad_content;
}
-echo $twig->render('admin.notepad.html.twig', array('content' => isset($_content) ? $_content : null));
+$twig->display('admin.notepad.html.twig', array('content' => isset($_content) ? $_content : null));
class Notepad
{
diff --git a/system/pages/admin/pages.php b/system/pages/admin/pages.php
index 3aa5f728..66af09bf 100644
--- a/system/pages/admin/pages.php
+++ b/system/pages/admin/pages.php
@@ -84,7 +84,7 @@ if(!empty($action))
}
if(!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
$query =
@@ -100,7 +100,7 @@ foreach($query as $_page) {
);
}
-echo $twig->render('admin.pages.form.html.twig', array(
+$twig->display('admin.pages.form.html.twig', array(
'action' => $action,
'id' => $action == 'edit' ? $id : null,
'name' => $name,
@@ -111,7 +111,7 @@ echo $twig->render('admin.pages.form.html.twig', array(
'access' => $access
));
-echo $twig->render('admin.pages.html.twig', array(
+$twig->display('admin.pages.html.twig', array(
'pages' => $pages
));
diff --git a/system/pages/admin/plugins.php b/system/pages/admin/plugins.php
index 2422ab3e..3a79c0c6 100644
--- a/system/pages/admin/plugins.php
+++ b/system/pages/admin/plugins.php
@@ -12,7 +12,7 @@ $title = 'Plugin manager';
require LIBS . 'plugins.php';
-echo $twig->render('admin.plugins.form.html.twig');
+$twig->display('admin.plugins.form.html.twig');
if(isset($_REQUEST['uninstall'])){
$uninstall = $_REQUEST['uninstall'];
@@ -118,7 +118,7 @@ foreach(get_plugins() as $plugin)
}
}
-echo $twig->render('admin.plugins.html.twig', array(
+$twig->display('admin.plugins.html.twig', array(
'plugins' => $plugins
));
?>
\ No newline at end of file
diff --git a/system/pages/admin/statistics.php b/system/pages/admin/statistics.php
index 9e214258..2136af9a 100644
--- a/system/pages/admin/statistics.php
+++ b/system/pages/admin/statistics.php
@@ -28,7 +28,7 @@ $total_houses = $query['how_much'];
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
-echo $twig->render('admin.statistics.html.twig', array(
+$twig->display('admin.statistics.html.twig', array(
'total_accounts' => $total_accounts,
'total_players' => $total_players,
'total_guilds' => $total_guilds,
diff --git a/system/pages/admin/visitors.php b/system/pages/admin/visitors.php
index ca3c739a..2faf09df 100644
--- a/system/pages/admin/visitors.php
+++ b/system/pages/admin/visitors.php
@@ -28,7 +28,7 @@ function compare($a, $b) {
$tmp = $visitors->getVisitors();
usort($tmp, 'compare');
-echo $twig->render('admin.visitors.html.twig', array(
+$twig->display('admin.visitors.html.twig', array(
'config_visitors_counter_ttl' => $config['visitors_counter_ttl'],
'visitors' => $tmp
));
diff --git a/system/pages/changelog.php b/system/pages/changelog.php
index 7b1a5c6c..e3aeb0d6 100644
--- a/system/pages/changelog.php
+++ b/system/pages/changelog.php
@@ -31,11 +31,11 @@ foreach($changelogs as $key => &$log)
if ($i >= $limit)
$next_page = true;
-
+
$i++;
}
-echo $twig->render('changelog.html.twig', array(
+$twig->display('changelog.html.twig', array(
'changelogs' => $changelogs,
'page' => $_page,
'next_page' => $next_page,
diff --git a/system/pages/characters.php b/system/pages/characters.php
index 8e462f65..70e46bdf 100644
--- a/system/pages/characters.php
+++ b/system/pages/characters.php
@@ -377,7 +377,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
}
}
- echo $twig->render('characters.html.twig', array(
+ $twig->display('characters.html.twig', array(
'outfit' => isset($outfit) ? $outfit : null,
'player' => $player,
'account' => $account,
@@ -421,7 +421,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
else
{
$search_errors[] = 'Character ' . $name . ' does not exist or has been deleted.';
- echo $twig->render('error_box.html.twig', array('errors' => $search_errors));
+ $twig->display('error_box.html.twig', array('errors' => $search_errors));
$search_errors = array();
$promotion = '';
@@ -450,4 +450,4 @@ else
}
if(!empty($search_errors))
- echo $twig->render('error_box.html.twig', array('errors' => $search_errors));
\ No newline at end of file
+ $twig->display('error_box.html.twig', array('errors' => $search_errors));
\ No newline at end of file
diff --git a/system/pages/commands.php b/system/pages/commands.php
index 5db2c0b8..98c79c27 100644
--- a/system/pages/commands.php
+++ b/system/pages/commands.php
@@ -32,7 +32,7 @@ if($canEdit)
if(isset($_REQUEST['words']))
$words = $_REQUEST['words'];
-
+
if(isset($_REQUEST['description']))
$description = stripslashes($_REQUEST['description']);
@@ -68,10 +68,10 @@ if($canEdit)
}
if(!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
-
- echo $twig->render('commands.form.html.twig', array(
+
+ $twig->display('commands.form.html.twig', array(
'link' => getLink('commands/' . ($action == 'edit' ? 'edit' : 'add')),
'action' => $action,
'id' => isset($id) ? $id : null,
@@ -88,7 +88,7 @@ $commands =
' ORDER BY `ordering`;');
$last = $commands->rowCount();
-echo $twig->render('commands.html.twig', array(
+$twig->display('commands.html.twig', array(
'commands' => $commands,
'last' => $last,
'canEdit' => $canEdit
diff --git a/system/pages/createaccount.php b/system/pages/createaccount.php
index 4f5d320e..d11804fb 100644
--- a/system/pages/createaccount.php
+++ b/system/pages/createaccount.php
@@ -171,7 +171,7 @@ if($save)
if(_mail($email, 'New account on ' . $config['lua']['serverName'], $body_html))
{
- echo $twig->render('account.created.verify.html.twig', array(
+ $twig->display('account.created.verify.html.twig', array(
'account' => $tmp_account
));
}
@@ -184,7 +184,7 @@ if($save)
}
else
{
- echo $twig->render('account.created.html.twig', array(
+ $twig->display('account.created.html.twig', array(
'account' => $tmp_account
));
@@ -223,7 +223,7 @@ if($config['account_country_recognize']) {
}
if(!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
if($config['account_country']) {
$countries = array();
@@ -235,8 +235,8 @@ if($config['account_country']) {
$countries[$code] = $c;
}
-echo $twig->render('account.create.js.html.twig');
-echo $twig->render('account.create.html.twig', array(
+$twig->display('account.create.js.html.twig');
+$twig->display('account.create.html.twig', array(
'account' => isset($_POST['account']) ? $_POST['account'] : '',
'email' => isset($_POST['email']) ? $_POST['email'] : '',
'countries' => isset($countries) ? $countries : null,
diff --git a/system/pages/creatures.php b/system/pages/creatures.php
index 3ed99096..1a9ea5b6 100644
--- a/system/pages/creatures.php
+++ b/system/pages/creatures.php
@@ -238,5 +238,5 @@ else
}
//back button
-echo $twig->render('creatures.back_button.html.twig');
+$twig->display('creatures.back_button.html.twig');
?>
diff --git a/system/pages/downloads.php b/system/pages/downloads.php
index 0674388c..62dee42d 100644
--- a/system/pages/downloads.php
+++ b/system/pages/downloads.php
@@ -9,5 +9,5 @@
*/
$title = 'Downloads';
-echo $twig->render('downloads.html.twig');
+$twig->display('downloads.html.twig');
?>
\ No newline at end of file
diff --git a/system/pages/experiencetable.php b/system/pages/experiencetable.php
index d1f6105a..e8960266 100644
--- a/system/pages/experiencetable.php
+++ b/system/pages/experiencetable.php
@@ -18,7 +18,7 @@ for($i = 0; $i < $columns; $i++) {
}
}
-echo $twig->render('experience_table.html.twig', array(
+$twig->display('experience_table.html.twig', array(
'experience' => $experience
));
?>
diff --git a/system/pages/faq.php b/system/pages/faq.php
index 4e1963cf..2b7bbaa6 100644
--- a/system/pages/faq.php
+++ b/system/pages/faq.php
@@ -17,15 +17,15 @@ if($canEdit)
{
if($action == 'delete' || $action == 'edit' || $action == 'hide' || $action == 'moveup' || $action == 'movedown')
$id = $_REQUEST['id'];
-
+
if(isset($_REQUEST['question']))
$question = $_REQUEST['question'];
-
+
if(isset($_REQUEST['answer']))
$answer = stripslashes($_REQUEST['answer']);
-
+
$errors = array();
-
+
if($action == 'add') {
if(FAQ::add($question, $answer, $errors))
$question = $answer = '';
@@ -54,12 +54,12 @@ if($canEdit)
else if($action == 'movedown') {
FAQ::move($id, 1, $errors);
}
-
+
if(!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
-
- echo $twig->render('faq.form.html.twig', array(
+
+ $twig->display('faq.form.html.twig', array(
'link' => getLink('faq/' . ($action == 'edit' ? 'edit' : 'add')),
'action' => $action,
'id' => isset($id) ? $id : null,
@@ -83,7 +83,7 @@ if(!$faqs->rowCount())
}
$last = $faqs->rowCount();
-echo $twig->render('faq.html.twig', array(
+$twig->display('faq.html.twig', array(
'faqs' => $faqs,
'last' => $last,
'canEdit' => $canEdit
@@ -97,7 +97,7 @@ class FAQ
if(isset($question[0]) && isset($answer[0]))
{
$query = $db->select(TABLE_PREFIX . 'faq', array('question' => $question));
-
+
if($query === false)
{
$query =
@@ -106,7 +106,7 @@ class FAQ
' FROM ' . $db->tableName(TABLE_PREFIX . 'faq') .
' ORDER BY ' . $db->fieldName('ordering') . ' DESC LIMIT 1'
);
-
+
$ordering = 0;
if($query->rowCount() > 0) {
$query = $query->fetch();
@@ -119,20 +119,20 @@ class FAQ
}
else
$errors[] = 'Please fill all inputs.';
-
+
return !count($errors);
}
-
+
static public function get($id) {
global $db;
return $db->select(TABLE_PREFIX . 'faq', array('id' => $id));
}
-
+
static public function update($id, $question, $answer) {
global $db;
$db->update(TABLE_PREFIX . 'faq', array('question' => $question, 'answer' => $answer), array('id' => $id));
}
-
+
static public function delete($id, &$errors)
{
global $db;
@@ -145,10 +145,10 @@ class FAQ
}
else
$errors[] = 'id not set';
-
+
return !count($errors);
}
-
+
static public function toggleHidden($id, &$errors)
{
global $db;
@@ -162,10 +162,10 @@ class FAQ
}
else
$errors[] = 'id not set';
-
+
return !count($errors);
}
-
+
static public function move($id, $i, &$errors)
{
global $db;
@@ -176,12 +176,12 @@ class FAQ
$old_record = $db->select(TABLE_PREFIX . 'faq', array('ordering' => $ordering));
if($old_record !== false)
$db->update(TABLE_PREFIX . 'faq', array('ordering' => $query['ordering']), array('ordering' => $ordering));
-
+
$db->update(TABLE_PREFIX . 'faq', array('ordering' => $ordering), array('id' => $id));
}
else
$errors[] = 'FAQ with id ' . $id . ' does not exists.';
-
+
return !count($errors);
}
}
diff --git a/system/pages/forum.php b/system/pages/forum.php
index c1802e1c..2917cb61 100644
--- a/system/pages/forum.php
+++ b/system/pages/forum.php
@@ -89,14 +89,14 @@ if($canEdit)
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
$action = '';
}
}
if(empty($action) || $action == 'edit_board') {
$guilds = $db->query('SELECT `id`, `name` FROM `guilds`')->fetchAll();
- echo $twig->render('forum.add_board.html.twig', array(
+ $twig->display('forum.add_board.html.twig', array(
'link' => getLink('forum', ($action == 'edit_board' ? 'edit_board' : 'add_board')),
'action' => $action,
'id' => isset($id) ? $id : null,
@@ -163,7 +163,7 @@ if(empty($action))
}
}
- echo $twig->render('forum.boards.html.twig', array(
+ $twig->display('forum.boards.html.twig', array(
'boards' => $boards,
'canEdit' => $canEdit,
'last' => count($sections)
diff --git a/system/pages/forum/edit_post.php b/system/pages/forum/edit_post.php
index 03e9f6dc..c43b3e67 100644
--- a/system/pages/forum/edit_post.php
+++ b/system/pages/forum/edit_post.php
@@ -17,7 +17,7 @@ if(Forum::canPost($account_logged))
echo 'Please enter post id.';
return;
}
-
+
$thread = $db->query("SELECT `author_guid`, `author_aid`, `first_post`, `post_topic`, `post_date`, `post_text`, `post_smile`, `post_html`, `id`, `section` FROM `" . TABLE_PREFIX . "forum` WHERE `id` = ".$post_id." LIMIT 1")->fetch();
if(isset($thread['id']))
{
@@ -55,9 +55,9 @@ if(Forum::canPost($account_logged))
$errors[] = 'Please select a character.';
if(empty($post_topic) && $thread['id'] == $thread['first_post'])
$errors[] = 'Thread topic can\'t be empty.';
-
+
$player_on_account = false;
-
+
if(count($errors) == 0)
{
foreach($players_from_account as $player)
@@ -66,7 +66,7 @@ if(Forum::canPost($account_logged))
if(!$player_on_account)
$errors[] = 'Player with selected ID '.$char_id.' doesn\'t exist or isn\'t on your account';
}
-
+
if(count($errors) == 0) {
$saved = true;
if($account_logged->getId() != $thread['author_aid'])
@@ -85,13 +85,13 @@ if(Forum::canPost($account_logged))
$smile = (int) $thread['post_smile'];
$html = (int) $thread['post_html'];
}
-
+
if(!$saved)
{
if(!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('forum.edit_post.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('forum.edit_post.html.twig', array(
'post_id' => $post_id,
'players' => $players_from_account,
'player_id' => $char_id,
diff --git a/system/pages/forum/move_thread.php b/system/pages/forum/move_thread.php
index 6666b77d..5288ba0e 100644
--- a/system/pages/forum/move_thread.php
+++ b/system/pages/forum/move_thread.php
@@ -38,17 +38,17 @@ else {
$post_id = (int)$_REQUEST['id'];
$post = $db->query("SELECT `id`, `section`, `first_post`, `post_topic`, `author_guid` FROM `" . TABLE_PREFIX . "forum` WHERE `id` = " . $post_id . " LIMIT 1")->fetch();
$name = $db->query("SELECT `name` FROM `players` WHERE `id` = " . $post['author_guid'] . " ")->fetch();
-
+
$sections_allowed = array();
foreach($sections as $id => $section) {
if(Forum::hasAccess($id)) {
$sections_allowed[$id] = $section;
}
}
-
+
if ($post['id'] == $post_id) {
if ($post['id'] == $post['first_post']) {
- echo $twig->render('forum.move_thread.html.twig', array(
+ $twig->display('forum.move_thread.html.twig', array(
'thread' => $post['post_topic'],
'author' => $name['name'],
'board' => $sections[$post['section']]['name'],
diff --git a/system/pages/forum/new_post.php b/system/pages/forum/new_post.php
index 3c8cc199..e09d4411 100644
--- a/system/pages/forum/new_post.php
+++ b/system/pages/forum/new_post.php
@@ -18,7 +18,7 @@ if(Forum::canPost($account_logged))
echo "Thread with this id doesn't exist.";
return;
}
-
+
$thread = $db->query("SELECT `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`id`, `" . TABLE_PREFIX . "forum`.`section` FROM `" . TABLE_PREFIX . "forum` WHERE `" . TABLE_PREFIX . "forum`.`id` = ".(int) $thread_id." AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." LIMIT 1")->fetch();
echo 'Boards >> '.$sections[$thread['section']]['name'].' >> '.$thread['post_topic'].' >> Post new reply '.$thread['post_topic'].' ';
if(isset($thread['id']) && Forum::hasAccess($thread['section']))
@@ -48,7 +48,7 @@ if(Forum::canPost($account_logged))
$errors[] = 'Too short or too long post (short: '.$lenght.' long: '.strlen($text).' letters). Minimum 1 letter, maximum 15000 letters.';
if($char_id == 0)
$errors[] = 'Please select a character.';
-
+
$player_on_account = false;
if(count($errors) == 0)
{
@@ -81,12 +81,12 @@ if(Forum::canPost($account_logged))
echo ' Thank you for posting.GO BACK TO LAST THREAD ';
}
}
-
+
if(!$saved)
{
if(!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
$threads = $db->query("SELECT `players`.`name`, `" . TABLE_PREFIX . "forum`.`post_text`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`post_smile`, `" . TABLE_PREFIX . "forum`.`post_html`, `" . TABLE_PREFIX . "forum`.`author_aid` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." ORDER BY `" . TABLE_PREFIX . "forum`.`post_date` DESC LIMIT 5")->fetchAll();
foreach($threads as &$thread) {
$player_account = new OTS_Account();
@@ -95,8 +95,8 @@ if(Forum::canPost($account_logged))
$thread['post'] = Forum::showPost(($thread['post_html'] > 0 ? $thread['post_topic'] : htmlspecialchars($thread['post_topic'])), ($thread['post_html'] > 0 ? $thread['post_text'] : htmlspecialchars($thread['post_text'])), $thread['post_smile'] == 0, $thread['post_html'] > 0);
}
}
-
- echo $twig->render('forum.new_post.html.twig', array(
+
+ $twig->display('forum.new_post.html.twig', array(
'thread_id' => $thread_id,
'post_player_id' => $char_id,
'players' => $players_from_account,
@@ -116,4 +116,4 @@ if(Forum::canPost($account_logged))
else
echo "Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post.";
-echo $twig->render('forum.fullscreen.html.twig');
\ No newline at end of file
+$twig->display('forum.fullscreen.html.twig');
\ No newline at end of file
diff --git a/system/pages/forum/new_thread.php b/system/pages/forum/new_thread.php
index cb0d70cb..bc5641f5 100644
--- a/system/pages/forum/new_thread.php
+++ b/system/pages/forum/new_thread.php
@@ -19,7 +19,7 @@ if(Forum::canPost($account_logged))
if(isset($sections[$section_id]['name']) && Forum::hasAccess($section_id)) {
if ($sections[$section_id]['closed'] && !Forum::isModerator())
$errors[] = 'You cannot create topic on this board.';
-
+
$quote = (int)(isset($_REQUEST['quote']) ? $_REQUEST['quote'] : 0);
$text = isset($_REQUEST['text']) ? stripslashes($_REQUEST['text']) : '';
$char_id = (int)(isset($_REQUEST['char_id']) ? $_REQUEST['char_id'] : 0);
@@ -29,7 +29,7 @@ if(Forum::canPost($account_logged))
$saved = false;
if (isset($_REQUEST['save'])) {
$errors = array();
-
+
$lenght = 0;
for ($i = 0; $i < strlen($post_topic); $i++) {
if (ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126)
@@ -44,11 +44,11 @@ if(Forum::canPost($account_logged))
}
if ($lenght < 1 || strlen($text) > 15000)
$errors[] = 'Too short or too long post (short: ' . $lenght . ' long: ' . strlen($text) . ' letters). Minimum 1 letter, maximum 15000 letters.';
-
+
if ($char_id == 0)
$errors[] = 'Please select a character.';
$player_on_account = false;
-
+
if (count($errors) == 0) {
foreach ($players_from_account as $player)
if ($char_id == $player['id'])
@@ -56,7 +56,7 @@ if(Forum::canPost($account_logged))
if (!$player_on_account)
$errors[] = 'Player with selected ID ' . $char_id . ' doesn\'t exist or isn\'t on your account';
}
-
+
if (count($errors) == 0) {
$last_post = 0;
$query = $db->query('SELECT `post_date` FROM `' . TABLE_PREFIX . 'forum` ORDER BY `post_date` DESC LIMIT 1');
@@ -76,12 +76,12 @@ if(Forum::canPost($account_logged))
echo ' Thank you for posting.GO BACK TO LAST THREAD ';
}
}
-
+
if (!$saved) {
if (!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('forum.new_thread.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('forum.new_thread.html.twig', array(
'section_id' => $section_id,
'players' => $players_from_account,
'post_player_id' => $char_id,
diff --git a/system/pages/forum/show_thread.php b/system/pages/forum/show_thread.php
index 4591c682..274557c5 100644
--- a/system/pages/forum/show_thread.php
+++ b/system/pages/forum/show_thread.php
@@ -49,7 +49,7 @@ foreach($posts as &$post)
error('Forum error: Player not loaded.');
die();
}
-
+
if($config['characters']['outfit']) {
$post['outfit'] = $config['outfit_images_url'] . '?id=' . $player->getLookType() . ($lookaddons ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet();
}
@@ -59,7 +59,7 @@ foreach($posts as &$post)
if($group->isLoaded()) {
$groupName = $group->getName();
}
-
+
$post['group'] = $groupName;
$post['player_link'] = getPlayerLink($player->getName());
@@ -75,7 +75,7 @@ foreach($posts as &$post)
$player_account = $player->getAccount();
$post['content'] = Forum::showPost(($post['post_html'] > 0 ? $post['post_topic'] : htmlspecialchars($post['post_topic'])), ($post['post_html'] > 0 ? $post['post_text'] : htmlspecialchars($post['post_text'])), $post['post_smile'] == 0, $post['post_html'] > 0);
-
+
$query = $db->query("SELECT COUNT(`id`) AS 'posts' FROM `" . TABLE_PREFIX . "forum` WHERE `author_aid`=".(int) $player_account->getId())->fetch();
$post['author_posts_count'] = (int)$query['posts'];
@@ -90,7 +90,7 @@ foreach($posts as &$post)
}
}
-echo $twig->render('forum.show_thread.html.twig', array(
+$twig->display('forum.show_thread.html.twig', array(
'thread_id' => $thread_id,
'posts' => $posts,
'links_to_pages' => $links_to_pages,
@@ -100,4 +100,4 @@ echo $twig->render('forum.show_thread.html.twig', array(
'is_moderator' => Forum::isModerator()
));
-echo $twig->render('forum.fullscreen.html.twig');
+$twig->display('forum.fullscreen.html.twig');
diff --git a/system/pages/gallery.php b/system/pages/gallery.php
index 90609274..72d3de05 100644
--- a/system/pages/gallery.php
+++ b/system/pages/gallery.php
@@ -16,18 +16,18 @@ if($canEdit) {
if (!empty($action)) {
if ($action == 'delete' || $action == 'edit' || $action == 'hide' || $action == 'moveup' || $action == 'movedown')
$id = $_REQUEST['id'];
-
+
if (isset($_REQUEST['comment']))
$comment = stripslashes($_REQUEST['comment']);
-
+
if (isset($_REQUEST['image']))
$image = $_REQUEST['image'];
-
+
if (isset($_REQUEST['author']))
$author = $_REQUEST['author'];
-
+
$errors = array();
-
+
if ($action == 'add') {
if (Gallery::add($comment, $image, $author, $errors))
$comment = $image = $author = '';
@@ -50,13 +50,13 @@ if($canEdit) {
} else if ($action == 'movedown') {
Gallery::move($id, 1, $errors);
}
-
+
if (!empty($errors))
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
-
+
if(!isset($_GET['image'])) {
- echo $twig->render('gallery.form.html.twig', array(
+ $twig->display('gallery.form.html.twig', array(
'link' => getLink('gallery/' . ($action == 'edit' ? 'edit' : 'add')),
'action' => $action,
'id' => isset($id) ? $id : null,
@@ -92,8 +92,8 @@ if(isset($_GET['image']))
$next_image = $next_image->fetch();
else
$next_image = NULL;
-
- echo $twig->render('gallery.get.html.twig', array(
+
+ $twig->display('gallery.get.html.twig', array(
'previous' => $previous_image ? $previous_image['id'] : null,
'next' => $next_image ? $next_image['id'] : null,
'image' => $image
@@ -117,7 +117,7 @@ if(!$last)
return;
}
-echo $twig->render('gallery.html.twig', array(
+$twig->display('gallery.html.twig', array(
'images' => $images,
'last' => $last,
'canEdit' => $canEdit
@@ -136,13 +136,13 @@ class Gallery
' FROM `' . TABLE_PREFIX . 'gallery`' .
' ORDER BY `ordering`' . ' DESC LIMIT 1'
);
-
+
$ordering = 0;
if($query->rowCount() > 0) {
$query = $query->fetch();
$ordering = $query['ordering'] + 1;
}
-
+
$pathinfo = pathinfo($image);
$extension = strtolower($pathinfo['extension']);
$thumb_filename = 'images/gallery/' . $pathinfo['filename'] . '_thumb.' . $extension;
@@ -158,22 +158,22 @@ class Gallery
}
else
$errors[] = 'Please fill all inputs.';
-
+
return !count($errors);
}
-
+
static public function get($id) {
global $db;
return $db->select(TABLE_PREFIX . 'gallery', array('id' => $id));
}
-
+
static public function update($id, $comment, $image, $author) {
global $db;
-
+
$pathinfo = pathinfo($image);
$extension = strtolower($pathinfo['extension']);
$filename = 'images/gallery/' . $pathinfo['filename'] . '.' . $extension;
-
+
if($db->update(TABLE_PREFIX . 'gallery', array(
'comment' => $comment,
'image' => $filename, 'author' => $author),
@@ -183,7 +183,7 @@ class Gallery
self::resize($image, 650, 500, $filename, $errors);
}
}
-
+
static public function delete($id, &$errors)
{
global $db;
@@ -196,10 +196,10 @@ class Gallery
}
else
$errors[] = 'id not set';
-
+
return !count($errors);
}
-
+
static public function toggleHidden($id, &$errors)
{
global $db;
@@ -213,10 +213,10 @@ class Gallery
}
else
$errors[] = 'id not set';
-
+
return !count($errors);
}
-
+
static public function move($id, $i, &$errors)
{
global $db;
@@ -227,20 +227,20 @@ class Gallery
$old_record = $db->select(TABLE_PREFIX . 'gallery', array('ordering' => $ordering));
if($old_record !== false)
$db->update(TABLE_PREFIX . 'gallery', array('ordering' => $query['ordering']), array('ordering' => $ordering));
-
+
$db->update(TABLE_PREFIX . 'gallery', array('ordering' => $ordering), array('id' => $id));
}
else
$errors[] = 'Image with id ' . $id . ' does not exists.';
-
+
return !count($errors);
}
-
+
static public function resize($file, $new_width, $new_height, $new_file, &$errors)
{
$pathinfo = pathinfo($file);
$extension = strtolower($pathinfo['extension']);
-
+
switch ($extension)
{
case 'gif': // GIF
@@ -257,45 +257,45 @@ class Gallery
$errors[] = 'Unsupported file format.';
return false;
}
-
+
$width = imagesx($image);
$height = imagesy($image);
-
+
// create a new temporary image
$tmp_img = imagecreatetruecolor($new_width, $new_height);
-
+
// copy and resize old image into new image
imagecopyresized($tmp_img, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
-
+
// save thumbnail into a file
switch($extension)
{
case 'gif':
imagegif($tmp_img, $new_file);
break;
-
+
case 'jpg':
case 'jpeg':
imagejpeg($tmp_img, $new_file);
break;
-
+
case 'png':
imagepng($tmp_img, $new_file);
break;
}
-
+
return true;
}
-
+
static public function generateThumb($id, $file, &$errors)
{
$pathinfo = pathinfo($file);
$extension = strtolower($pathinfo['extension']);
$thumb_filename = 'images/gallery/' . $pathinfo['filename'] . '_thumb.' . $extension;
-
+
if(!self::resize($file, 170, 110, $thumb_filename, $errors))
return false;
-
+
global $db;
if(isset($id))
{
@@ -307,7 +307,7 @@ class Gallery
}
else
$errors[] = 'id not set';
-
+
return !count($errors);
}
}
diff --git a/system/pages/guilds/accept_invite.php b/system/pages/guilds/accept_invite.php
index 2633d1e4..b463eb8b 100644
--- a/system/pages/guilds/accept_invite.php
+++ b/system/pages/guilds/accept_invite.php
@@ -33,7 +33,7 @@ if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
if(!Validator::characterName($name)) {
$errors[] = 'Invalid name format.';
}
-
+
if(empty($errors)) {
$player = new OTS_Player();
$player->find($name);
@@ -63,7 +63,7 @@ if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
}
}
}
-
+
if(!$is_invited) {
$errors[] = 'Character '.$player->getName.' isn\'t invited to guild '.$guild->getName().' .';
}
@@ -77,7 +77,7 @@ else
include(SYSTEM . 'libs/pot/InvitesDriver.php');
new InvitesDriver($guild);
$invited_list = $guild->listInvites();
-
+
if(count($invited_list) > 0) {
foreach($invited_list as $invited) {
foreach($account_players as $player_from_acc) {
@@ -96,16 +96,16 @@ else
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
}
else {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$guild->acceptInvite($player);
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Accept invitation',
'description' => 'Player with name '.$player->getName().' has been added to guild '.$guild->getName() . ' .',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(
@@ -116,8 +116,8 @@ else {
else
{
sort($list_of_invited_players);
-
- echo $twig->render('guilds.accept_invite.html.twig', array(
+
+ $twig->display('guilds.accept_invite.html.twig', array(
'guild_name' => $guild_name,
'invited_players' => $list_of_invited_players
));
diff --git a/system/pages/guilds/add_rank.php b/system/pages/guilds/add_rank.php
index 603b4d3e..27335151 100644
--- a/system/pages/guilds/add_rank.php
+++ b/system/pages/guilds/add_rank.php
@@ -55,9 +55,9 @@ if(empty($errors)) {
}
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds&guild='.$guild_name.'&action=show'
));
@@ -66,9 +66,9 @@ if(empty($errors)) {
else
{
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true
));
}
diff --git a/system/pages/guilds/change_description.php b/system/pages/guilds/change_description.php
index 77a5bdbb..89292dec 100644
--- a/system/pages/guilds/change_description.php
+++ b/system/pages/guilds/change_description.php
@@ -37,7 +37,7 @@ if(empty($errors)) {
$level_in_guild = 3;
}
}
-
+
$saved = false;
if($guild_leader) {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
@@ -45,12 +45,12 @@ if(empty($errors)) {
$guild->setCustomField('description', $description);
$saved = true;
}
-
+
if($saved) {
success('Changes has been saved');
}
-
- echo $twig->render('guilds.change_description.html.twig', array(
+
+ $twig->display('guilds.change_description.html.twig', array(
'guild' => $guild,
'rows' => bcsub($config['guild_description_lines_limit'],1)
));
@@ -64,9 +64,9 @@ if(empty($errors)) {
}
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
diff --git a/system/pages/guilds/change_logo.php b/system/pages/guilds/change_logo.php
index 1945782d..5eb093a8 100644
--- a/system/pages/guilds/change_logo.php
+++ b/system/pages/guilds/change_logo.php
@@ -18,7 +18,7 @@ if(!Validator::guildName($guild_name)) {
if(empty($errors)) {
$guild = new OTS_Guild();
$guild->find($guild_name);
-
+
if(!$guild->isLoaded()) {
$errors[] = 'Guild with name '.$guild_name.' doesn\'t exist.';
}
@@ -29,7 +29,7 @@ if(empty($errors)) {
$guild_leader_char = $guild->getOwner();
$guild_leader = false;
$account_players = $account_logged->getPlayers();
-
+
foreach($account_players as $player) {
if($guild_leader_char->getId() == $player->getId()) {
$guild_vice = true;
@@ -37,7 +37,7 @@ if(empty($errors)) {
$level_in_guild = 3;
}
}
-
+
if($guild_leader)
{
$max_image_size_b = $config['guild_image_size_kb'] * 1024;
@@ -53,7 +53,7 @@ if(empty($errors)) {
if($file['size'] > $max_image_size_b) {
$upload_errors[] = 'Uploaded image is too big. Size: '.$file['size'].' bytes , Max. size: '.$max_image_size_b.' bytes .';
}
-
+
$type = strtolower($file['type']);
if(!in_array($type, $allowed_ext)) {
$upload_errors[] = 'Your file type isn\' allowed. Allowed: gif, jpg, bmp, png . Your file type: '.$type.' If it\'s valid image contact with admin.';
@@ -62,14 +62,14 @@ if(empty($errors)) {
else {
$upload_errors[] = 'You didn\'t send file or file is too big. Limit: '.$config['guild_image_size_kb'].' KB .';
}
-
+
if(empty($upload_errors)) {
$extension = $ext_name[$type];
if(!move_uploaded_file($file['tmp_name'], $save_path.'.'.$extension)) {
$upload_errors[] = "Sorry! Can't save your image.";
}
}
-
+
if(empty($upload_errors))
{
$guild_logo = $guild->getCustomField('logo_name');
@@ -77,33 +77,33 @@ if(empty($errors)) {
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) {
$guild_logo = "default.gif";
}
-
+
if($guild_logo != "default.gif" && $guild_logo != $save_file_name.'.'.$extension) {
unlink('images/guilds/' . $guild_logo);
}
}
-
+
//show errors or save file
if(!empty($upload_errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $upload_errors));
+ $twig->display('error_box.html.twig', array('errors' => $upload_errors));
}
else {
success('Logo has been changed.');
$guild->setCustomField('logo_name', $save_file_name.'.'.$extension);
}
}
-
+
$guild_logo = $guild->getCustomField('logo_name');
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) {
$guild_logo = "default.gif";
}
-
- echo $twig->render('guilds.change_logo.html.twig', array(
+
+ $twig->display('guilds.change_logo.html.twig', array(
'guild_logo' => $guild_logo,
'guild' => $guild,
'max_image_size_b' => $max_image_size_b
));
-
+
}
else {
$errors[] = 'You are not a leader of guild!';
@@ -115,9 +115,9 @@ if(empty($errors)) {
}
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
diff --git a/system/pages/guilds/change_motd.php b/system/pages/guilds/change_motd.php
index af01b28c..2f1d2bf2 100644
--- a/system/pages/guilds/change_motd.php
+++ b/system/pages/guilds/change_motd.php
@@ -40,7 +40,7 @@ if(empty($errors)) {
$level_in_guild = 3;
}
}
-
+
$saved = false;
if($guild_leader) {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
@@ -48,12 +48,12 @@ if(empty($errors)) {
$guild->setCustomField('motd', $motd);
$saved = true;
}
-
+
if($saved) {
success('Changes has been saved');
}
-
- echo $twig->render('guilds.change_motd.html.twig', array(
+
+ $twig->display('guilds.change_motd.html.twig', array(
'guild' => $guild
));
}
@@ -66,9 +66,9 @@ if(empty($errors)) {
}
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
diff --git a/system/pages/guilds/change_nick.php b/system/pages/guilds/change_nick.php
index a05334fd..65175c00 100644
--- a/system/pages/guilds/change_nick.php
+++ b/system/pages/guilds/change_nick.php
@@ -12,7 +12,7 @@ defined('MYAAC') or die('Direct access not allowed!');
if(!$logged) {
echo 'You are not logged.';
- echo $twig->render('guilds.back_button.html.twig');
+ $twig->display('guilds.back_button.html.twig');
return;
}
@@ -62,5 +62,5 @@ if(strlen($new_nick) <= 40)
else
echo 'Too long guild nick. Max. 40 chars, your length: '.strlen($new_nick);
-echo $twig->render('guilds.back_button.html.twig');
+$twig->display('guilds.back_button.html.twig');
?>
\ No newline at end of file
diff --git a/system/pages/guilds/change_rank.php b/system/pages/guilds/change_rank.php
index 94ce50a5..6e924443 100644
--- a/system/pages/guilds/change_rank.php
+++ b/system/pages/guilds/change_rank.php
@@ -29,9 +29,9 @@ if(empty($errors))
if(!empty($errors))
{
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
- echo $twig->render('guilds.back_button.html.twig');
-
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+ $twig->display('guilds.back_button.html.twig');
+
return;
}
@@ -74,23 +74,23 @@ if($guild_vice)
$ranks[$rid]['0'] = $rank->getId();
$ranks[$rid]['1'] = $rank->getName();
$rid++;
-
+
if($db->hasColumn('players', 'rank_id'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
else
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
-
+
$players_with_rank_number = $players_with_rank->rowCount();
if(count($players_with_rank) > 0)
{
-
+
foreach($players_with_rank as $result)
{
$player = new OTS_Player();
$player->load($result['id']);
if(!$player->isLoaded())
continue;
-
+
if($guild->getOwner()->getId() != $player->getId() || $guild_leader)
{
$players_with_lower_rank[$sid][0] = $player->getName();
@@ -141,16 +141,16 @@ if($guild_vice)
if(!$player_has_lower_rank)
$change_errors[] = 'This player has higher rank in guild than you. You can\'t change his/her rank.';
}
-
+
if(empty($change_errors))
{
$player_to_change->setRank($rank);
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Rank Changed',
'description' => 'Rank of player '.$player_to_change->getName().' has been changed to '.$rank->getName().' .',
'custom_buttons' => ''
));
-
+
unset($players_with_lower_rank);
unset($ranks);
$rid = 0;
@@ -162,12 +162,12 @@ if($guild_vice)
$ranks[$rid]['0'] = $rank->getId();
$ranks[$rid]['1'] = $rank->getName();
$rid++;
-
+
if($db->hasColumn('players', 'rank_id'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
else
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
-
+
$players_with_rank_number = $players_with_rank->rowCount();
if(count($players_with_rank) > 0)
{
@@ -177,7 +177,7 @@ if($guild_vice)
$player->load($result['id']);
if(!$player->isLoaded())
continue;
-
+
if($guild->getOwner()->getId() != $player->getId() || $guild_leader)
{
$players_with_lower_rank[$sid][0] = $player->getName();
@@ -191,10 +191,10 @@ if($guild_vice)
}
else
{
- echo $twig->render('error_box.html.twig', array('errors' => $change_errors));
+ $twig->display('error_box.html.twig', array('errors' => $change_errors));
}
}
- echo $twig->render('guilds.change_rank.html.twig', array(
+ $twig->display('guilds.change_rank.html.twig', array(
'players' => $players_with_lower_rank,
'guild_name' => $guild->getName(),
'ranks' => $ranks
@@ -202,7 +202,7 @@ if($guild_vice)
}
else {
echo 'Error. You are not a leader or vice leader in guild ' . $guild->getName();
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => getLink('guilds') . '/' . $guild->getName()
));
diff --git a/system/pages/guilds/cleanup_guilds.php b/system/pages/guilds/cleanup_guilds.php
index c52b8ab5..d98dc3f5 100644
--- a/system/pages/guilds/cleanup_guilds.php
+++ b/system/pages/guilds/cleanup_guilds.php
@@ -13,7 +13,7 @@ defined('MYAAC') or die('Direct access not allowed!');
if(!$logged)
{
echo "You are not logged in.";
- echo $twig->render('guilds.back_button.html.twig');
+ $twig->display('guilds.back_button.html.twig');
return;
}
@@ -63,5 +63,5 @@ if(count($guilds_list) > 0)
else
echo "0 guilds found.";
-echo $twig->render('guilds.back_button.html.twig');
+$twig->display('guilds.back_button.html.twig');
?>
\ No newline at end of file
diff --git a/system/pages/guilds/cleanup_players.php b/system/pages/guilds/cleanup_players.php
index 6127d269..329791cd 100644
--- a/system/pages/guilds/cleanup_players.php
+++ b/system/pages/guilds/cleanup_players.php
@@ -13,7 +13,7 @@ defined('MYAAC') or die('Direct access not allowed!');
if(!$logged)
{
echo "You are not logged in.";
- echo $twig->render('guilds.back_button.html.twig');
+ $twig->display('guilds.back_button.html.twig');
return;
}
@@ -50,7 +50,7 @@ if(count($players_list) > 0)
$player->setGuildNick('');
$changed_ranks_of[] = $player->getName();
}
-
+
}
}
echo "Deleted ranks (this ranks guilds doesn't exist [bug fix]): ";
@@ -64,6 +64,6 @@ if(count($players_list) > 0)
}
else
echo "0 players found.";
-
-echo $twig->render('guilds.back_button.html.twig');
+
+$twig->display('guilds.back_button.html.twig');
?>
\ No newline at end of file
diff --git a/system/pages/guilds/create.php b/system/pages/guilds/create.php
index d835d593..e33ff3de 100644
--- a/system/pages/guilds/create.php
+++ b/system/pages/guilds/create.php
@@ -47,12 +47,12 @@ if($todo == 'save')
$guild_errors[] = Validator::getLastError();
$guild_name = '';
}
-
+
if(!Validator::characterName($name)) {
$guild_errors[] = 'Invalid character name format.';
$name = '';
}
-
+
if(empty($guild_errors)) {
$player = new OTS_Player();
$player->find($name);
@@ -60,8 +60,8 @@ if($todo == 'save')
$guild_errors[] = 'Character '.$name.' doesn\'t exist.';
}
}
-
-
+
+
if(empty($guild_errors))
{
$guild = new OTS_Guild();
@@ -70,7 +70,7 @@ if($todo == 'save')
$guild_errors[] = 'Guild '.$guild_name.' already exist. Select other name.';
}
}
-
+
if(empty($guild_errors))
{
$bad_char = true;
@@ -83,7 +83,7 @@ if($todo == 'save')
$guild_errors[] = 'Character '.$name.' isn\'t on your account or is already in guild.';
}
}
-
+
if(empty($guild_errors)) {
if($player->getLevel() < $config['guild_need_level']) {
$guild_errors[] = 'Character '.$name.' has too low level. To create guild you need character with level '.$config['guild_need_level'].' .';
@@ -95,7 +95,7 @@ if($todo == 'save')
}
if(!empty($guild_errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
+ $twig->display('error_box.html.twig', array('errors' => $guild_errors));
unset($todo);
}
@@ -115,18 +115,18 @@ if(isset($todo) && $todo == 'save')
$player->setRank($rank);
}
}
- echo $twig->render('guilds.create.success.html.twig', array(
+ $twig->display('guilds.create.success.html.twig', array(
'guild_name' => $guild_name,
'leader_name' => $player->getName()
));
-
+
/*$db->query('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "the Leader", 3)');
$db->query('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "a Vice-Leader", 2)');
$db->query('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "a Member", 1)');*/
}
else {
sort($array_of_player_nig);
- echo $twig->render('guilds.create.html.twig', array(
+ $twig->display('guilds.create.html.twig', array(
'players' => $array_of_player_nig
));
}
diff --git a/system/pages/guilds/delete_by_admin.php b/system/pages/guilds/delete_by_admin.php
index 51e67720..0eea6ff7 100644
--- a/system/pages/guilds/delete_by_admin.php
+++ b/system/pages/guilds/delete_by_admin.php
@@ -31,16 +31,16 @@ if(empty($errors)) {
delete_guild($guild->getId());
$saved = true;
}
-
+
if($saved) {
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Guild Deleted',
'description' => 'Guild with name ' . $guild_name . ' has been deleted.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig')
));
}
else {
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Delete Guild',
'description' => 'Are you sure you want delete guild ' . $guild_name . ' ?
',
@@ -57,9 +57,9 @@ if(empty($errors)) {
}
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
diff --git a/system/pages/guilds/delete_guild.php b/system/pages/guilds/delete_guild.php
index cadb4438..f03893d4 100644
--- a/system/pages/guilds/delete_guild.php
+++ b/system/pages/guilds/delete_guild.php
@@ -30,7 +30,7 @@ if(empty($errors)) {
$rank_list->orderBy('level', POT::ORDER_DESC);
$guild_leader = false;
$account_players = $account_logged->getPlayers();
-
+
foreach($account_players as $player) {
if($guild->getOwner()->getId() == $player->getId()) {
$guild_vice = true;
@@ -38,24 +38,24 @@ if(empty($errors)) {
$level_in_guild = 3;
}
}
-
+
if($guild_leader) {
$saved = false;
-
+
if(isset($_POST['todo']) && $_POST['todo'] == 'save') {
delete_guild($guild->getId());
$saved = true;
}
-
+
if($saved) {
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Guild Deleted',
'description' => 'Guild with name '.$guild_name.' has been deleted.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig')
));
}
else {
- echo $twig->render('guilds.delete_guild.html.twig', array(
+ $twig->display('guilds.delete_guild.html.twig', array(
'guild' => $guild
));
}
@@ -70,9 +70,9 @@ if(empty($errors)) {
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true
));
}
diff --git a/system/pages/guilds/delete_invite.php b/system/pages/guilds/delete_invite.php
index df2d8bcb..322a10ba 100644
--- a/system/pages/guilds/delete_invite.php
+++ b/system/pages/guilds/delete_invite.php
@@ -61,7 +61,7 @@ if(empty($errors))
}
}
}
-
+
if(!$guild_vice)
$errors[] = 'You are not a leader or vice leader of guild ' . $guild_name . ' .';
}
@@ -92,23 +92,23 @@ if(empty($errors))
}
if(!empty($errors))
{
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig', array('action' => '?subtopic=guilds&action=show&guild=' . $guild_name));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig', array('action' => '?subtopic=guilds&action=show&guild=' . $guild_name));
}
else
{
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save')
{
$guild->deleteInvite($player);
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Deleted player invitation',
'description' => 'Player with name ' . $player->getName() . ' has been deleted from invites list.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array('action' => '?subtopic=guilds&action=show&guild=' . $guild_name))
));
}
else {
- echo $twig->render('guilds.delete_invite.html.twig', array(
+ $twig->display('guilds.delete_invite.html.twig', array(
'player_name' => $player->getName(),
'guild_name' => $guild->getName()
));
diff --git a/system/pages/guilds/delete_rank.php b/system/pages/guilds/delete_rank.php
index aab94dce..a97f24e3 100644
--- a/system/pages/guilds/delete_rank.php
+++ b/system/pages/guilds/delete_rank.php
@@ -59,7 +59,7 @@ if(empty($guild_errors)) {
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
else
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
-
+
$players_with_rank_number = $players_with_rank->rowCount();
if($players_with_rank_number > 0) {
foreach($rank_list as $checkrank) {
@@ -69,7 +69,7 @@ if(empty($guild_errors)) {
}
}
}
-
+
if(empty($new_rank)) {
$new_rank = new OTS_GuildRank();
$new_rank->setGuild($guild);
@@ -87,16 +87,16 @@ if(empty($guild_errors)) {
}
}
if($saved) {
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Rank Deleted',
'description' => 'Rank '.$rank->getName().' has been deleted. Players with this rank has now other rank.',
'custom_buttons' => ''
));
} else {
- echo $twig->render('error_box.html.twig', array('errors' => $guild_errors2));
+ $twig->display('error_box.html.twig', array('errors' => $guild_errors2));
}
-
- echo $twig->render('guilds.back_button.html.twig', array(
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds&guild='.$guild->getName().'&action=manager'
));
@@ -112,9 +112,9 @@ if(empty($guild_errors)) {
}
}
if(!empty($guild_errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
-
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $guild_errors));
+
+ $twig->display('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
diff --git a/system/pages/guilds/invite.php b/system/pages/guilds/invite.php
index 23d3fdcf..da05919f 100644
--- a/system/pages/guilds/invite.php
+++ b/system/pages/guilds/invite.php
@@ -45,7 +45,7 @@ if(empty($errors)) {
$guild_vice = true;
$level_in_guild = $player_rank->getLevel();
}
-
+
if($guild->getOwner()->getId() == $player->getId()) {
$guild_vice = true;
$guild_leader = true;
@@ -64,7 +64,7 @@ if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
if(!Validator::characterName($name)) {
$errors[] = 'Invalid name format.';
}
-
+
if(empty($errors)) {
$player = new OTS_Player();
$player->find($name);
@@ -95,23 +95,23 @@ if(empty($errors)) {
$show = true;
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
else {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$guild->invite($player);
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Invite player',
'description' => 'Player with name ' . $player->getName() . ' has been invited to your guild.',
'custom_buttons' => ''
));
-
+
$show = false;
}
}
if($show) {
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Invite player',
'description' => $twig->render('guilds.invite.html.twig', array(
'guild_name' => $guild->getName()
@@ -120,6 +120,6 @@ if($show) {
));
}
-echo $twig->render('guilds.back_button.html.twig', array(
+$twig->display('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
\ No newline at end of file
diff --git a/system/pages/guilds/kick_player.php b/system/pages/guilds/kick_player.php
index 986656f1..eddf881c 100644
--- a/system/pages/guilds/kick_player.php
+++ b/system/pages/guilds/kick_player.php
@@ -93,8 +93,8 @@ if(empty($errors)) {
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+ $twig->display('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
}
@@ -102,8 +102,8 @@ else
{
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$player->setRank();
-
- echo $twig->render('success.html.twig', array(
+
+ $twig->display('success.html.twig', array(
'title' => 'Kick player',
'description' => 'Player with name '.$player->getName().' has been kicked from your guild.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(
@@ -112,7 +112,7 @@ else
));
}
else {
- echo $twig->render('guilds.kick_player.html.twig', array(
+ $twig->display('guilds.kick_player.html.twig', array(
'player_name' => $player->getName(),
'guild_name' => $guild->getName()
));
diff --git a/system/pages/guilds/leave_guild.php b/system/pages/guilds/leave_guild.php
index 26782433..d951d461 100644
--- a/system/pages/guilds/leave_guild.php
+++ b/system/pages/guilds/leave_guild.php
@@ -36,7 +36,7 @@ if(empty($errors)) {
if(!Validator::characterName($name)) {
$errors[] = 'Invalid name format.';
}
-
+
if(empty($errors)) {
$player = new OTS_Player();
$player->find($name);
@@ -49,7 +49,7 @@ if(empty($errors)) {
}
}
}
-
+
if(empty($errors)) {
$player_loaded_rank = $player->getRank();
if($player_loaded_rank->isLoaded()) {
@@ -61,7 +61,7 @@ if(empty($errors)) {
$errors[] = "Character " . $name . " isn't in any guild.";
}
}
-
+
if(empty($errors)) {
if($guild_owner_name == $player->getName()) {
$errors[] = "You can't leave guild. You are an owner of guild.";
@@ -85,8 +85,8 @@ if(empty($errors)) {
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
- echo $twig->render('guilds.back_button.html.twig', array(
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+ $twig->display('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
}
@@ -94,7 +94,7 @@ else
{
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$player->setRank();
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Leave guild',
'description' => 'Player with name '.$player->getName().' leaved guild '.$guild->getName().' .',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(
@@ -105,8 +105,8 @@ else
else
{
sort($array_of_player_ig);
-
- echo $twig->render('guilds.leave_guild.html.twig', array(
+
+ $twig->display('guilds.leave_guild.html.twig', array(
'players' => $array_of_player_ig,
'guild_name' => $guild_name
));
diff --git a/system/pages/guilds/manager.php b/system/pages/guilds/manager.php
index 73e294e3..8293b566 100644
--- a/system/pages/guilds/manager.php
+++ b/system/pages/guilds/manager.php
@@ -38,7 +38,7 @@ if(empty($errors)) {
}
}
if($guild_leader) {
- echo $twig->render('guilds.manager.html.twig', array(
+ $twig->display('guilds.manager.html.twig', array(
'guild' => $guild,
'rank_list' => $rank_list
));
@@ -54,7 +54,7 @@ if(empty($errors)) {
}
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
?>
\ No newline at end of file
diff --git a/system/pages/guilds/pass_leadership.php b/system/pages/guilds/pass_leadership.php
index c7819112..9470b048 100644
--- a/system/pages/guilds/pass_leadership.php
+++ b/system/pages/guilds/pass_leadership.php
@@ -28,14 +28,14 @@ if(empty($guild_errors)) {
if(!Validator::characterName($pass_to)) {
$guild_errors2[] = 'Invalid player name format.';
}
-
+
if(empty($guild_errors2)) {
$to_player = new OTS_Player();
$to_player->find($pass_to);
if(!$to_player->isLoaded()) {
$guild_errors2[] = 'Player with name '.$pass_to.' doesn\'t exist.';
}
-
+
if(empty($guild_errors2)) {
$to_player_rank = $to_player->getRank();
if($to_player_rank->isLoaded()) {
@@ -63,7 +63,7 @@ if(empty($guild_errors) && empty($guild_errors2)) {
$level_in_guild = 3;
}
}
-
+
$saved = false;
if($guild_leader) {
if(isset($_POST['todo']) && $_POST['todo'] == 'save') {
@@ -71,25 +71,25 @@ if(empty($guild_errors) && empty($guild_errors2)) {
if($query) {
$guild_leader_char->setRankId($query['id'], $guild->getId());
}
-
+
$query = $db->query('SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild->getId() . ' ORDER BY `level` DESC LIMIT 1')->fetch();
if($query) {
$to_player->setRankId($query['id'], $guild->getId());
}
-
+
$guild->setOwner($to_player);
$guild->save();
$saved = true;
}
if($saved) {
- echo $twig->render('success.html.twig', array(
+ $twig->display('success.html.twig', array(
'title' => 'Leadership passed',
'description' => ''.$to_player->getName().' is now a Leader of '.$guild_name.' .',
'custom_buttons' => ' '
));
}
else {
- echo $twig->render('guilds.pass_leadership.html.twig', array(
+ $twig->display('guilds.pass_leadership.html.twig', array(
'guild' => $guild
));
}
@@ -103,16 +103,16 @@ if(empty($guild_errors) && empty($guild_errors2)) {
}
}
if(empty($guild_errors) && !empty($guild_errors2)) {
- echo $twig->render('error_box.html.twig', array('errors' => $guild_errors2));
-
+ $twig->display('error_box.html.twig', array('errors' => $guild_errors2));
+
echo ' ';
}
if(!empty($guild_errors)) {
if(!empty($guild_errors2)) {
$guild_errors = array_merge($guild_errors, $guild_errors2);
}
- echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
-
+ $twig->display('error_box.html.twig', array('errors' => $guild_errors));
+
echo ' ';
}
diff --git a/system/pages/guilds/save_ranks.php b/system/pages/guilds/save_ranks.php
index 92a88426..2b238651 100644
--- a/system/pages/guilds/save_ranks.php
+++ b/system/pages/guilds/save_ranks.php
@@ -30,7 +30,7 @@ if(empty($errors)) {
$rank_list->orderBy('level', POT::ORDER_DESC);
$guild_leader = false;
$account_players = $account_logged->getPlayers();
-
+
foreach($account_players as $player) {
if($guild_leader_char->getId() == $player->getId()) {
$guild_vice = true;
@@ -38,7 +38,7 @@ if(empty($errors)) {
$level_in_guild = 3;
}
}
-
+
if($guild_leader) {
foreach($rank_list as $rank) {
$rank_id = $rank->getId();
@@ -56,12 +56,12 @@ if(empty($errors)) {
else {
$errors[] = 'Invalid rank level. Contact with admin. Rank ID '.$rank_id.' .';
}
-
+
$rank->save();
}
//show errors or redirect
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
else
{
@@ -79,7 +79,7 @@ if(empty($errors)) {
}
}
if(!empty($errors)) {
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
+ $twig->display('error_box.html.twig', array('errors' => $errors));
}
?>
\ No newline at end of file
diff --git a/system/pages/guilds/show.php b/system/pages/guilds/show.php
index da5cbeb0..10cec30f 100644
--- a/system/pages/guilds/show.php
+++ b/system/pages/guilds/show.php
@@ -25,9 +25,9 @@ if(empty($errors))
if(!empty($errors))
{
- echo $twig->render('error_box.html.twig', array('errors' => $errors));
-
- echo $twig->render('guilds.back_button.html.twig');
+ $twig->display('error_box.html.twig', array('errors' => $errors));
+
+ $twig->display('guilds.back_button.html.twig');
}
else
{
@@ -102,13 +102,13 @@ else
Rank
Name, title, level & status
';
-
+
//Slaw stats values
//$s_total_members = 0;
//$s_members_online = 0;
//$s_total_level = 0;
//End Slaw stats values
-
+
$showed_players = 1;
foreach($rank_list as $rank)
{
@@ -116,7 +116,7 @@ else
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
else if($db->hasColumn('players', 'rank_id'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
-
+
$players_with_rank_number = $players_with_rank->rowCount();
if($players_with_rank_number > 0)
{
@@ -133,7 +133,7 @@ else
$player->load($result['id']);
if(!$player->isLoaded())
continue;
-
+
//$s_total_members++;
//$s_total_level += $player->getLevel();
echo '' . getPlayerLink($player->getName()) . ' '.$player->getLevel().' Online' : 'red">Offline').' ';
}
echo '';
@@ -207,7 +207,7 @@ else
echo '';
*/
//End statistics
-
+
//Lets update some stuff in database
//$db->query('UPDATE `guilds` SET `total_members` = '.$s_total_members.', `members_online` = '.$s_members_online.', `total_level` = '.$s_total_level.', `average_level` = '.ceil($s_total_level/$s_total_members).' WHERE `id` = '.$guild->getId());
include(SYSTEM . 'libs/pot/InvitesDriver.php');
diff --git a/system/pages/lostaccount.php b/system/pages/lostaccount.php
index 4a0e9e44..003504d1 100644
--- a/system/pages/lostaccount.php
+++ b/system/pages/lostaccount.php
@@ -21,10 +21,10 @@ $config_salt_enabled = $db->hasColumn('accounts', 'salt');
$action_type = isset($_REQUEST['action_type']) ? $_REQUEST['action_type'] : '';
if($action == '')
{
- echo $twig->render('account.lost.form.html.twig');
+ $twig->display('account.lost.form.html.twig');
}
else if($action == 'step1' && $action_type == '') {
- echo $twig->render('account.lost.noaction.html.twig');
+ $twig->display('account.lost.noaction.html.twig');
}
elseif($action == 'step1' && $action_type == 'email')
{
@@ -36,7 +36,7 @@ elseif($action == 'step1' && $action_type == 'email')
$player->find($nick);
if($player->isLoaded())
$account = $player->getAccount();
-
+
if($account->isLoaded())
{
if($account->getCustomField('email_next') < time())
@@ -83,7 +83,7 @@ elseif($action == 'sendcode')
$player->find($nick);
if($player->isLoaded())
$account = $player->getAccount();
-
+
if($account->isLoaded())
{
if($account->getCustomField('email_next') < time())
@@ -290,20 +290,20 @@ elseif($action == 'step3')
if(Validator::email($new_email))
{
$account->setEMail($new_email);
-
+
$tmp_new_pass = $new_pass;
if($config_salt_enabled)
{
$salt = generateRandomString(10, false, true, true);
$tmp_new_pass = $salt . $new_pass;
}
-
+
$account->setPassword(encrypt($tmp_new_pass));
$account->save();
-
+
if($config_salt_enabled)
$account->setCustomField('salt', $salt);
-
+
echo 'Your account name, new password and new e-mail.