From 75e3e43a5f491536f64d86fed9a1c2a6b5a4fd93 Mon Sep 17 00:00:00 2001 From: PioDer Date: Sun, 4 Feb 2018 13:36:19 +0100 Subject: [PATCH] PHP 7.0 compatibility (short tags replaced by normal) --- config.php | 2 +- inc/controllers/AdminController.class.php | 2 +- inc/misc_functions.php | 2 +- inc/models/UsersModel.class.php | 4 +- templates/admin/ban_form.tpl.php | 16 ++++---- templates/admin/banlist.tpl.php | 6 +-- templates/admin/cat_form.tpl.php | 16 ++++---- templates/admin/config.tpl.php | 16 ++++---- templates/admin/forum_form.tpl.php | 22 +++++------ templates/admin/forums.tpl.php | 8 ++-- templates/admin/main.tpl.php | 18 ++++----- templates/admin/overall_header.tpl.php | 14 +++---- templates/admin/userlist.tpl.php | 24 ++++++------ templates/confirm_action.tpl.php | 8 ++-- templates/edprofile.tpl.php | 48 +++++++++++------------ templates/forum_message.tpl.php | 12 +++--- templates/login_form.tpl.php | 14 +++---- templates/main.tpl.php | 16 ++++---- templates/move_topic.tpl.php | 12 +++--- templates/overall_header.tpl.php | 28 ++++++------- templates/posting.tpl.php | 26 ++++++------ templates/register_form.tpl.php | 16 ++++---- templates/userlist.tpl.php | 24 ++++++------ templates/viewforum.tpl.php | 26 ++++++------ templates/viewprofile.tpl.php | 34 ++++++++-------- templates/viewtopic.tpl.php | 36 ++++++++--------- 26 files changed, 225 insertions(+), 225 deletions(-) diff --git a/config.php b/config.php index e23c2d5..a185c74 100644 --- a/config.php +++ b/config.php @@ -6,7 +6,7 @@ ini_set('display_errors', '1'); define('DB_HOST','localhost'); define('DB_USER','root'); -define('DB_PASSWD',''); +define('DB_PASSWD','qwerty'); define('DB_NAME','uf2'); define('DB_PREFIX','uf_'); define('VERSION','2.0.0'); diff --git a/inc/controllers/AdminController.class.php b/inc/controllers/AdminController.class.php index 4059827..c49761b 100644 --- a/inc/controllers/AdminController.class.php +++ b/inc/controllers/AdminController.class.php @@ -26,7 +26,7 @@ class AdminController extends Controller $this->getView('MainView')->putExistingModel('ConfigModel', $this->getModel('ConfigModel')); if ($_SERVER['REQUEST_SCHEME'] == 'http') - $this->forward(buildURL($_SERVER['REQUEST_URI'])); + $this->forward(buildURL($_SERVER['REQUEST_URI'], true)); if (!$this->getModel('SessionModel')->isLogged()) { diff --git a/inc/misc_functions.php b/inc/misc_functions.php index da1b964..b43be9e 100644 --- a/inc/misc_functions.php +++ b/inc/misc_functions.php @@ -50,7 +50,7 @@ function input_clean(&$input, &$dbobj, $opts = null) $input = $dbobj->real_escape_string($input); } -function post_clean($key, &$dbobj, $opts) +function post_clean($key, &$dbobj, $opts = null) { input_clean($_POST[$key], $dbobj, $opts); } diff --git a/inc/models/UsersModel.class.php b/inc/models/UsersModel.class.php index 9f5e987..482e7f0 100644 --- a/inc/models/UsersModel.class.php +++ b/inc/models/UsersModel.class.php @@ -35,7 +35,7 @@ class UsersModel extends Model return array(); } - public function getUserInformation($user_id, $passwd = false) + public function getUserInformation($user, $passwd = false) { if ($this->user_info == null) { @@ -50,7 +50,7 @@ class UsersModel extends Model LEFT JOIN '.USERS_INFO_TABLE.' ui on ui.user_id = u.user_id LEFT JOIN '.USERS_PC_VIEW.' pc on pc.user_id = u.user_id LEFT JOIN '.LOGGED_USERS_VIEW.' lu on lu.user_id = u.user_id - WHERE u.user_id = \''.$user_id.'\''; + WHERE u.user_id = \''.$user.'\' OR u.nick = \''.$user.'\''; $out = $this->select_query($query); if (count($out) > 0) diff --git a/templates/admin/ban_form.tpl.php b/templates/admin/ban_form.tpl.php index d059211..f44a9db 100755 --- a/templates/admin/ban_form.tpl.php +++ b/templates/admin/ban_form.tpl.php @@ -1,4 +1,4 @@ -
- TPL['error_msg'] != '') { ?> + TPL['error_msg'] != '') { ?>
- TPL['error_msg']; ?> + TPL['error_msg']; ?>
- -
+ +
-
TPL['forum_form_name']; ?>
+
TPL['forum_form_name']; ?>
 
@@ -38,7 +38,7 @@ else Reason:
- +
@@ -53,4 +53,4 @@ else
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/admin/banlist.tpl.php b/templates/admin/banlist.tpl.php index 4ca9f89..2d36cd6 100755 --- a/templates/admin/banlist.tpl.php +++ b/templates/admin/banlist.tpl.php @@ -1,4 +1,4 @@ - +
Add ban
@@ -13,7 +13,7 @@
Reason
- TPL['bans_list']); $i++) { echo '
'."\n"; @@ -33,4 +33,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/admin/cat_form.tpl.php b/templates/admin/cat_form.tpl.php index f18b28a..3c5e320 100755 --- a/templates/admin/cat_form.tpl.php +++ b/templates/admin/cat_form.tpl.php @@ -1,4 +1,4 @@ -
- TPL['error_msg'] != '') { ?> + TPL['error_msg'] != '') { ?>
- TPL['error_msg']; ?> + TPL['error_msg']; ?>
- -
+ +
-
TPL['cat_form_name']; ?>
+
TPL['cat_form_name']; ?>
 
@@ -23,7 +23,7 @@ else Category name:
- +
@@ -38,4 +38,4 @@ else
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/admin/config.tpl.php b/templates/admin/config.tpl.php index 19e66de..f6fd80b 100755 --- a/templates/admin/config.tpl.php +++ b/templates/admin/config.tpl.php @@ -1,4 +1,4 @@ -
- TPL['error_msg'] != '') { ?> + TPL['error_msg'] != '') { ?>
- TPL['error_msg']; ?> + TPL['error_msg']; ?>
- -
+ +
Overall configuration
@@ -23,7 +23,7 @@ else Forum name:
- +
@@ -31,7 +31,7 @@ else Forum description:
- +
@@ -46,4 +46,4 @@ else
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/admin/forum_form.tpl.php b/templates/admin/forum_form.tpl.php index 2e3aeb6..e025793 100755 --- a/templates/admin/forum_form.tpl.php +++ b/templates/admin/forum_form.tpl.php @@ -1,4 +1,4 @@ -
- TPL['error_msg'] != '') { ?> + TPL['error_msg'] != '') { ?>
- TPL['error_msg']; ?> + TPL['error_msg']; ?>
- -
+ +
-
TPL['forum_form_name']; ?>
+
TPL['forum_form_name']; ?>
 
@@ -23,7 +23,7 @@ else Forum name:
- +
@@ -31,7 +31,7 @@ else Forum description:
- +
@@ -55,9 +55,9 @@ else Forum locked:
- TPL['lock_selected']; ?>> + TPL['lock_selected']; ?>> Yes   - TPL['unlock_selected']; ?>> + TPL['unlock_selected']; ?>> No
@@ -73,4 +73,4 @@ else - \ No newline at end of file + \ No newline at end of file diff --git a/templates/admin/forums.tpl.php b/templates/admin/forums.tpl.php index 1606d00..aeac75b 100755 --- a/templates/admin/forums.tpl.php +++ b/templates/admin/forums.tpl.php @@ -1,10 +1,10 @@ - +

New Category New Forum
 
- TPL['forums_list']); $i++) { if ($i > 0) @@ -62,8 +62,8 @@ } } ?> - TPL['forums_list']) > 0) echo '
'; ?> + TPL['forums_list']) > 0) echo ''; ?>
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/admin/main.tpl.php b/templates/admin/main.tpl.php index cc34b50..e85629d 100755 --- a/templates/admin/main.tpl.php +++ b/templates/admin/main.tpl.php @@ -1,4 +1,4 @@ - +
- TPL['error_msg'] != '') { ?> + TPL['error_msg'] != '') { ?>
- TPL['error_msg']; ?> + TPL['error_msg']; ?>
- -
+ +
Basic informations
@@ -43,15 +43,15 @@ function checkForm() Nick:
- TPL['is_admin']) {?> - - - TPL['nick']; ?> - - + TPL['is_admin']) {?> + + + TPL['nick']; ?> + +
- TPL['is_admin']) {?> + TPL['is_admin']) {?>
Old password: @@ -60,7 +60,7 @@ function checkForm() (type only if you want to change password or email.)
- +
New password: @@ -82,7 +82,7 @@ function checkForm() Email address:
- +
@@ -106,7 +106,7 @@ function checkForm() Location:
- +
@@ -114,7 +114,7 @@ function checkForm() Signature:
- +
@@ -123,8 +123,8 @@ function checkForm()
Current avatar:
- user avatar
- TPL['avatar'] != null) { ?> Delete avatar
+ user avatar
+ TPL['avatar'] != null) { ?> Delete avatar
@@ -138,7 +138,7 @@ function checkForm() - TPL['is_admin']) {?> + TPL['is_admin']) {?>
@@ -150,11 +150,11 @@ function checkForm() User rank:
- TPL['user_selected']; ?> > + TPL['user_selected']; ?> > User   - TPL['mod_selected']; ?>> + TPL['mod_selected']; ?>> Mod   - TPL['admin_selected']; ?>> + TPL['admin_selected']; ?>> Admin
@@ -167,9 +167,9 @@ function checkForm() - + - \ No newline at end of file + \ No newline at end of file diff --git a/templates/forum_message.tpl.php b/templates/forum_message.tpl.php index f13fb24..de7c69e 100755 --- a/templates/forum_message.tpl.php +++ b/templates/forum_message.tpl.php @@ -1,13 +1,13 @@ - -TPL['url'] != '') { ?> - - +TPL['url'] != '') { ?> + +

@@ -18,11 +18,11 @@ else
- TPL['message']; ?> + TPL['message']; ?>
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/login_form.tpl.php b/templates/login_form.tpl.php index d386f32..f00f886 100755 --- a/templates/login_form.tpl.php +++ b/templates/login_form.tpl.php @@ -1,4 +1,4 @@ - +

You must enable cookies if you want log in

- TPL['error_msg'] != '') { ?> + TPL['error_msg'] != '') { ?>
- TPL['error_msg']; ?> + TPL['error_msg']; ?>
- -
+ +
Log in
@@ -24,7 +24,7 @@ Nick:
- +
@@ -51,4 +51,4 @@ erase_cookie("checkcookie"); - \ No newline at end of file + \ No newline at end of file diff --git a/templates/main.tpl.php b/templates/main.tpl.php index 0ff4744..9b72af0 100755 --- a/templates/main.tpl.php +++ b/templates/main.tpl.php @@ -1,4 +1,4 @@ - +
- TPL['forums_list']); $i++) { @@ -97,12 +97,12 @@ function confirm_action(c_name, url)
- Our users have written TPL['posts_count']; ?> posts.
- We have TPL['users_count']; ?> unique users.
- Last registered user: TPL['last_user']['nick']; ?>
+ Our users have written TPL['posts_count']; ?> posts.
+ We have TPL['users_count']; ?> unique users.
+ Last registered user: TPL['last_user']['nick']; ?>
Users ranks: AdminMod • User
- This forum is browsing by TPL['logged_users_count']; ?> logged users(list):
- TPL['logged_users_count']; ?> logged users(list):
+ TPL['logged_users_count'] == 0) echo 'none.'; else for ($i=0; $iTPL['logged_users']); $i++) @@ -120,4 +120,4 @@ function confirm_action(c_name, url)
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/move_topic.tpl.php b/templates/move_topic.tpl.php index f3dca35..3f232dd 100755 --- a/templates/move_topic.tpl.php +++ b/templates/move_topic.tpl.php @@ -1,6 +1,6 @@ - + - +

@@ -14,7 +14,7 @@ Topic title:
- TPL['topic_info']['topic_title']; ?> + TPL['topic_info']['topic_title']; ?>
@@ -25,7 +25,7 @@ Topic is in forum:
- TPL['topic_info']['forum_name']; ?> + TPL['topic_info']['forum_name']; ?>
@@ -37,7 +37,7 @@
+

- +
Post information
@@ -101,7 +101,7 @@
- +
@@ -123,4 +123,4 @@ document.getElementById('bbcode_buttons').style.display = 'block'; document.getElementById('emoticons_buttons').style.display = 'block'; - \ No newline at end of file + \ No newline at end of file diff --git a/templates/register_form.tpl.php b/templates/register_form.tpl.php index b42d338..b825e67 100755 --- a/templates/register_form.tpl.php +++ b/templates/register_form.tpl.php @@ -1,4 +1,4 @@ - +
- TPL['error_msg'] != '') { ?> + TPL['error_msg'] != '') { ?>
- TPL['error_msg']; ?> + TPL['error_msg']; ?>
- -
+ +
Register
@@ -39,7 +39,7 @@ function checkForm() Nick:
- +
@@ -65,7 +65,7 @@ function checkForm() Email address:
- +
@@ -80,4 +80,4 @@ function checkForm()
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/userlist.tpl.php b/templates/userlist.tpl.php index 3edefd5..f867f9a 100755 --- a/templates/userlist.tpl.php +++ b/templates/userlist.tpl.php @@ -1,4 +1,4 @@ - +

@@ -14,7 +14,7 @@
Last visit
Posts
- TPL['users_list']); $i++) { echo '
'."\n"; @@ -39,27 +39,27 @@
-
+ Sort users by:     - TPL['desc_checked']; ?> />Descending + TPL['desc_checked']; ?> />Descending       
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/viewforum.tpl.php b/templates/viewforum.tpl.php index b84e8c7..55e22ec 100755 --- a/templates/viewforum.tpl.php +++ b/templates/viewforum.tpl.php @@ -1,16 +1,16 @@ - +
- TPL['forum_info']['locked'] == false) { ?> - New Topic - + TPL['forum_info']['locked'] == false) { ?> + New Topic +
Locked
- +
-
TPL['f_name']; ?>
+
TPL['f_name']; ?>
 
 
 
@@ -21,7 +21,7 @@
Replies
Last Post
- TPL['topics_list']); $i++) { echo '
'."\n"; @@ -55,7 +55,7 @@ ?> - TPL['topics_list']) == 0) { echo '
No topics in this forum.
'; @@ -63,13 +63,13 @@ ?>

- TPL['forum_info']['locked'] == false) { ?> - New Topic - + TPL['forum_info']['locked'] == false) { ?> + New Topic +
Locked
- +
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/viewprofile.tpl.php b/templates/viewprofile.tpl.php index f182b6b..206a198 100755 --- a/templates/viewprofile.tpl.php +++ b/templates/viewprofile.tpl.php @@ -1,20 +1,20 @@ - +

-
TPL['user_info']['nick']; ?>
+
TPL['user_info']['nick']; ?>
- TPL['logged_id']) {?> + TPL['logged_id']) {?> Edit my profile » -   +  
- TPL['user_info']['avatar'] != null) echo 'user avatar'; else @@ -23,19 +23,19 @@
-Joined: TPL['user_info']['regdate']; ?>
-Last visit: TPL['user_info']['lastvisit']!= null) ? $this->TPL['user_info']['lastvisit'] : 'Never') ?>
-Posts: TPL['user_info']['post_count']; ?>; TPL['post_ratio']; ?>% of total.
-Location: TPL['user_info']['location']; ?>
+Joined: TPL['user_info']['regdate']; ?>
+Last visit: TPL['user_info']['lastvisit']!= null) ? $this->TPL['user_info']['lastvisit'] : 'Never') ?>
+Posts: TPL['user_info']['post_count']; ?>; TPL['post_ratio']; ?>% of total.
+Location: TPL['user_info']['location']; ?>
- Email + Email
- Status: user status
- Rank: getRankLevel($this->TPL['user_info']['rank']); ?> + Status: user status
+ Rank: getRankLevel($this->TPL['user_info']['rank']); ?>
@@ -43,23 +43,23 @@ Location: TPL['user_info']['location'

- TPL['user_info']['signature'] != null) { ?> + TPL['user_info']['signature'] != null) { ?>
-
TPL['user_info']['nick']; ?>'s signature
+
TPL['user_info']['nick']; ?>'s signature
- TPL['user_info']['signature']); ?> + TPL['user_info']['signature']); ?>
- +
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/viewtopic.tpl.php b/templates/viewtopic.tpl.php index c98cf36..b42ae6d 100755 --- a/templates/viewtopic.tpl.php +++ b/templates/viewtopic.tpl.php @@ -1,12 +1,12 @@ - +
- TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> - Reply - + TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> + Reply +
Locked
- +
- TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> - Reply - + TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> + Reply +
Locked
- + - TPL['my_rank'] >= RANK_MOD) { ?> + TPL['my_rank'] >= RANK_MOD) { ?> - +
 
- \ No newline at end of file + \ No newline at end of file