Commit 2cae662a by pupi1985

Fix many phpcs complaints

parent 40f15d44
...@@ -66,13 +66,13 @@ ...@@ -66,13 +66,13 @@
/* /*
If you wish, you can define QA_MYSQL_USERS_PREFIX separately from QA_MYSQL_TABLE_PREFIX. If you wish, you can define QA_MYSQL_USERS_PREFIX separately from QA_MYSQL_TABLE_PREFIX.
If so, tables containing information about user accounts (not including users' activity and points) If so, tables containing information about user accounts (not including users' activity and points)
get the prefix of QA_MYSQL_TABLE_PREFIX. This allows multiple Q2A sites to have shared logins get the prefix of QA_MYSQL_TABLE_PREFIX. This allows multiple Q2A sites to have shared logins
and users, but separate posts and activity. and users, but separate posts and activity.
If you have installed question2answer with default "qa_" prefix and want to setup a second If you have installed question2answer with default "qa_" prefix and want to setup a second
installation, you define the QA_MYSQL_USERS_PREFIX as "qa_" so this new installation installation, you define the QA_MYSQL_USERS_PREFIX as "qa_" so this new installation
can access the same database as the first installation. can access the same database as the first installation.
define('QA_MYSQL_USERS_PREFIX', 'sharedusers_'); define('QA_MYSQL_USERS_PREFIX', 'sharedusers_');
*/ */
...@@ -143,8 +143,8 @@ ...@@ -143,8 +143,8 @@
/* /*
Out-of-the-box Joomla! 3.x integration - to integrate with your Joomla! site, define Out-of-the-box Joomla! 3.x integration - to integrate with your Joomla! site, define
QA_JOOMLA_INTEGRATE_PATH. as the full path to the Joomla! directory. If your Q2A QA_JOOMLA_INTEGRATE_PATH. as the full path to the Joomla! directory. If your Q2A
site is a subdirectory of your main Joomla site (recommended), you can specify site is a subdirectory of your main Joomla site (recommended), you can specify
dirname(__DIR__) rather than the full path. dirname(__DIR__) rather than the full path.
With this set, you do not need to set the QA_MYSQL_* constants above since these With this set, you do not need to set the QA_MYSQL_* constants above since these
will be taken from Joomla automatically. See online documentation for more details. will be taken from Joomla automatically. See online documentation for more details.
......
...@@ -109,7 +109,7 @@ class Q2A_Util_Usage ...@@ -109,7 +109,7 @@ class Q2A_Util_Usage
$totaldelta = $this->delta($this->startUsage, $this->getCurrent()); $totaldelta = $this->delta($this->startUsage, $this->getCurrent());
$stages = $this->stages; $stages = $this->stages;
$stages['total'] = $totaldelta; $stages['total'] = $totaldelta;
?> ?>
<style> <style>
.debug-table { border-collapse: collapse; width: auto; margin: 20px auto; } .debug-table { border-collapse: collapse; width: auto; margin: 20px auto; }
.debug-table th, .debug-table td { border: 1px solid #aaa; background-color: #ddd; padding: 5px 10px; } .debug-table th, .debug-table td { border: 1px solid #aaa; background-color: #ddd; padding: 5px 10px; }
...@@ -155,7 +155,7 @@ class Q2A_Util_Usage ...@@ -155,7 +155,7 @@ class Q2A_Util_Usage
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($stages as $stage => $stagedelta) : ?> <?php foreach ($stages as $stage => $stagedelta) : ?>
<tr> <tr>
<td class="row-heading"><?php echo ucfirst($stage); ?></td> <td class="row-heading"><?php echo ucfirst($stage); ?></td>
<td><?php echo sprintf('%.1f', $stagedelta['clock'] * 1000); ?></td> <td><?php echo sprintf('%.1f', $stagedelta['clock'] * 1000); ?></td>
...@@ -171,7 +171,7 @@ class Q2A_Util_Usage ...@@ -171,7 +171,7 @@ class Q2A_Util_Usage
<td><?php echo sprintf('%dk', $stagedelta['ram'] / 1024); ?></td> <td><?php echo sprintf('%dk', $stagedelta['ram'] / 1024); ?></td>
<td><?php echo sprintf('%d%%', $stagedelta['ram'] ? ($stagedelta['ram'] * 100 / $totaldelta['ram']) : 0); ?></td> <td><?php echo sprintf('%d%%', $stagedelta['ram'] ? ($stagedelta['ram'] * 100 / $totaldelta['ram']) : 0); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
...@@ -190,7 +190,7 @@ class Q2A_Util_Usage ...@@ -190,7 +190,7 @@ class Q2A_Util_Usage
</tr> </tr>
</tbody> </tbody>
</table> </table>
<?php <?php
} }
......
...@@ -100,7 +100,6 @@ elseif (qa_clicked('dosavefield')) { ...@@ -100,7 +100,6 @@ elseif (qa_clicked('dosavefield')) {
} }
} elseif (empty($errors)) { // creating a new user field } elseif (empty($errors)) { // creating a new user field
for ($attempt = 0; $attempt < 1000; $attempt++) { for ($attempt = 0; $attempt < 1000; $attempt++) {
$suffix = $attempt ? ('-' . (1 + $attempt)) : ''; $suffix = $attempt ? ('-' . (1 + $attempt)) : '';
$newtag = qa_substr(implode('-', qa_string_to_words($inname)), 0, QA_DB_MAX_PROFILE_TITLE_LENGTH - strlen($suffix)) . $suffix; $newtag = qa_substr(implode('-', qa_string_to_words($inname)), 0, QA_DB_MAX_PROFILE_TITLE_LENGTH - strlen($suffix)) . $suffix;
......
...@@ -809,7 +809,6 @@ function qa_page_q_edit_a_submit($answer, $question, $answers, $commentsfollows, ...@@ -809,7 +809,6 @@ function qa_page_q_edit_a_submit($answer, $question, $answers, $commentsfollows,
(($in['commenton'] != $answerid) && @$answers[$in['commenton']]['commentable']) (($in['commenton'] != $answerid) && @$answers[$in['commenton']]['commentable'])
) )
) { // convert to a comment ) { // convert to a comment
if (qa_user_limits_remaining(QA_LIMIT_COMMENTS)) { // already checked 'permit_post_c' if (qa_user_limits_remaining(QA_LIMIT_COMMENTS)) { // already checked 'permit_post_c'
qa_answer_to_comment($answer, $in['commenton'], $in['content'], $in['format'], $in['text'], $setnotify, qa_answer_to_comment($answer, $in['commenton'], $in['content'], $in['format'], $in['text'], $setnotify,
$userid, $handle, $cookieid, $question, $answers, $commentsfollows, @$in['name'], $in['queued'], $in['silent']); $userid, $handle, $cookieid, $question, $answers, $commentsfollows, @$in['name'], $in['queued'], $in['silent']);
......
...@@ -89,7 +89,6 @@ if (!QA_FINAL_EXTERNAL_USERS) { // if we're using integrated user management, we ...@@ -89,7 +89,6 @@ if (!QA_FINAL_EXTERNAL_USERS) { // if we're using integrated user management, we
($loginlevel >= QA_USER_LEVEL_SUPER || $loginlevel > $maxuserlevel) && ($loginlevel >= QA_USER_LEVEL_SUPER || $loginlevel > $maxuserlevel) &&
!qa_user_permit_error() !qa_user_permit_error()
) { // can't change self - or someone on your level (or higher, obviously) unless you're a super admin ) { // can't change self - or someone on your level (or higher, obviously) unless you're a super admin
if ($loginlevel >= QA_USER_LEVEL_SUPER) if ($loginlevel >= QA_USER_LEVEL_SUPER)
$maxlevelassign = QA_USER_LEVEL_SUPER; $maxlevelassign = QA_USER_LEVEL_SUPER;
elseif ($loginlevel >= QA_USER_LEVEL_ADMIN) elseif ($loginlevel >= QA_USER_LEVEL_ADMIN)
......
...@@ -42,7 +42,7 @@ class qa_ask_box ...@@ -42,7 +42,7 @@ class qa_ask_box
else else
$params = null; $params = null;
?> ?>
<div class="qa-ask-box"> <div class="qa-ask-box">
<form method="post" action="<?php echo qa_path_html('ask', $params); ?>"> <form method="post" action="<?php echo qa_path_html('ask', $params); ?>">
<table class="qa-form-tall-table" style="width:100%"> <table class="qa-form-tall-table" style="width:100%">
...@@ -50,10 +50,10 @@ class qa_ask_box ...@@ -50,10 +50,10 @@ class qa_ask_box
<td class="qa-form-tall-label" style="width: 1px; padding:8px; white-space:nowrap; <?php echo ($region=='side') ? 'padding-bottom:0;' : 'text-align:right;'?>"> <td class="qa-form-tall-label" style="width: 1px; padding:8px; white-space:nowrap; <?php echo ($region=='side') ? 'padding-bottom:0;' : 'text-align:right;'?>">
<?php echo strtr(qa_lang_html('question/ask_title'), array(' ' => '&nbsp;'))?>: <?php echo strtr(qa_lang_html('question/ask_title'), array(' ' => '&nbsp;'))?>:
</td> </td>
<?php if ($region=='side') : ?> <?php if ($region=='side') : ?>
</tr> </tr>
<tr> <tr>
<?php endif; ?> <?php endif; ?>
<td class="qa-form-tall-data" style="padding:8px;"> <td class="qa-form-tall-data" style="padding:8px;">
<input name="title" type="text" class="qa-form-tall-text" style="width:95%;"> <input name="title" type="text" class="qa-form-tall-text" style="width:95%;">
</td> </td>
...@@ -62,6 +62,6 @@ class qa_ask_box ...@@ -62,6 +62,6 @@ class qa_ask_box
<input type="hidden" name="doask1" value="1"> <input type="hidden" name="doask1" value="1">
</form> </form>
</div> </div>
<?php <?php
} }
} }
...@@ -57,7 +57,7 @@ class qa_facebook_login ...@@ -57,7 +57,7 @@ class qa_facebook_login
else else
$size = 'medium'; $size = 'medium';
?> ?>
<span id="fb-root" style="display:inline;"></span> <span id="fb-root" style="display:inline;"></span>
<script> <script>
window.fbAsyncInit = function() { window.fbAsyncInit = function() {
...@@ -82,7 +82,7 @@ class qa_facebook_login ...@@ -82,7 +82,7 @@ class qa_facebook_login
</script> </script>
<span class="fb-login-button" style="display:inline; vertical-align:middle;" size="<?php echo $size?>" <?php echo $logout ? 'autologoutlink="true"' : 'scope="email,user_about_me,user_location,user_website"'?>> <span class="fb-login-button" style="display:inline; vertical-align:middle;" size="<?php echo $size?>" <?php echo $logout ? 'autologoutlink="true"' : 'scope="email,user_about_me,user_location,user_website"'?>>
</span> </span>
<?php <?php
} }
......
...@@ -25,7 +25,6 @@ class qa_html_theme_layer extends qa_html_theme_base ...@@ -25,7 +25,6 @@ class qa_html_theme_layer extends qa_html_theme_base
public function q_list($q_list) public function q_list($q_list)
{ {
if (!empty($q_list['qs']) && qa_opt('mouseover_content_on')) { // first check it is not an empty list and the feature is turned on if (!empty($q_list['qs']) && qa_opt('mouseover_content_on')) { // first check it is not an empty list and the feature is turned on
// Collect the question ids of all items in the question list (so we can do this in one DB query) // Collect the question ids of all items in the question list (so we can do this in one DB query)
$postids = array(); $postids = array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment