Ternary operator could be simplified.

This commit is contained in:
Yuriy Pikhtarev 2017-05-05 00:56:01 +03:00
parent 72f9ddd620
commit 57f0cd7614
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
4 changed files with 5 additions and 5 deletions

View file

@ -76,7 +76,7 @@ if ($view === 'username') {
}
// Pagination ?
$do_pagination = ($view !== 'stats' && $view !== 'search') ? true : false;
$do_pagination = ($view !== 'stats' && $view !== 'search');
// Set Order
$order_by = '';
@ -319,7 +319,7 @@ if ($view === 'username') {
// Attachments
if ($view === 'attachments') {
$user_based = ($uid) ? true : false;
$search_based = (isset($_POST['search']) && $_POST['search']) ? true : false;
$search_based = (isset($_POST['search']) && $_POST['search']);
$hidden_fields = '';

View file

@ -211,7 +211,7 @@ foreach ($cat_forums as $cid => $c) {
));
$template->assign_vars(array(
'H_C_AL_MESS' => ($hide_cat_opt && !$showhide) ? true : false,
'H_C_AL_MESS' => ($hide_cat_opt && !$showhide),
));
if (!$showhide && isset($hide_cat_user[$cid]) && !$viewcat) {

View file

@ -259,7 +259,7 @@ function physical_filename_already_stored($filename)
$num_rows = DB()->num_rows($result);
DB()->sql_freeresult($result);
return ($num_rows == 0) ? false : true;
return $num_rows != 0;
}
/**

View file

@ -774,7 +774,7 @@ class template
if (!$count_if) {
$keyword_type = XS_TAG_IF;
}
$str = $this->compile_tag_if($params_str, $keyword_type == XS_TAG_IF ? false : true);
$str = $this->compile_tag_if($params_str, $keyword_type != XS_TAG_IF);
if ($str) {
$compiled[] = '<?php ' . $str . ' ?>';
if ($keyword_type == XS_TAG_IF) {