Commit cd3bee1d by Scott

Coding style

parent 41939057
...@@ -66,7 +66,7 @@ function qa_category_nav_to_browse(&$navigation, $categories, $categoryid, $favo ...@@ -66,7 +66,7 @@ function qa_category_nav_to_browse(&$navigation, $categories, $categoryid, $favo
} }
$navigation[$key]['note'] = $navigation[$key]['note'] =
' - <a href="'.qa_path_html('questions/'.implode('/', array_reverse(explode('/', $category['backpath'])))).'">'.( ($category['qcount']==1) ' - <a href="'.qa_path_html('questions/'.implode('/', array_reverse(explode('/', $category['backpath'])))).'">'.( ($category['qcount'] == 1)
? qa_lang_html_sub('main/1_question', '1', '1') ? qa_lang_html_sub('main/1_question', '1', '1')
: qa_lang_html_sub('main/x_questions', number_format($category['qcount'])) : qa_lang_html_sub('main/x_questions', number_format($category['qcount']))
).'</a>'; ).'</a>';
......
...@@ -47,10 +47,10 @@ class qa_ask_box ...@@ -47,10 +47,10 @@ 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%">
<tr style="vertical-align:middle;"> <tr style="vertical-align:middle;">
<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; ?>
......
...@@ -23,7 +23,7 @@ return array( ...@@ -23,7 +23,7 @@ return array(
'biggest_font_size' => 'Biggest font size:', 'biggest_font_size' => 'Biggest font size:',
'font_size_popularity' => 'Font size represents tag popularity', 'font_size_popularity' => 'Font size represents tag popularity',
'max_tags' => 'Maximum tags to show:', 'max_tags' => 'Maximum tags to show:',
'pixels'=> 'pixels', 'pixels' => 'pixels',
'smallest_font_size' => 'Smallest allowed font size:', 'smallest_font_size' => 'Smallest allowed font size:',
'tags' => 'tags', 'tags' => 'tags',
); );
...@@ -48,7 +48,7 @@ class qa_wysiwyg_editor ...@@ -48,7 +48,7 @@ class qa_wysiwyg_editor
if (qa_clicked('wysiwyg_editor_save_button')) { if (qa_clicked('wysiwyg_editor_save_button')) {
qa_opt('wysiwyg_editor_upload_images', (int)qa_post_text('wysiwyg_editor_upload_images_field')); qa_opt('wysiwyg_editor_upload_images', (int)qa_post_text('wysiwyg_editor_upload_images_field'));
qa_opt('wysiwyg_editor_upload_all', (int)qa_post_text('wysiwyg_editor_upload_all_field')); qa_opt('wysiwyg_editor_upload_all', (int)qa_post_text('wysiwyg_editor_upload_all_field'));
qa_opt('wysiwyg_editor_upload_max_size', min(qa_get_max_upload_size(), 1048576*(float)qa_post_text('wysiwyg_editor_upload_max_size_field'))); qa_opt('wysiwyg_editor_upload_max_size', min(qa_get_max_upload_size(), 1048576 * (float)qa_post_text('wysiwyg_editor_upload_max_size_field')));
$saved = true; $saved = true;
} }
......
...@@ -224,9 +224,9 @@ class Categories extends BaseController ...@@ -224,9 +224,9 @@ class Categories extends BaseController
qa_report_event('cat_edit', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array( qa_report_event('cat_edit', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array(
'categoryid' => $editcategory['categoryid'], 'categoryid' => $editcategory['categoryid'],
'parentid' => isset($inparentid)?$inparentid:null, 'parentid' => isset($inparentid) ? $inparentid : null,
'content' => isset($incontent)?$incontent:null, 'content' => isset($incontent) ? $incontent : null,
'position' => isset($inposition)?$inposition:null, 'position' => isset($inposition) ? $inposition : null,
'name' => $inname, 'name' => $inname,
'slug' => $inslug, 'slug' => $inslug,
)); ));
...@@ -243,8 +243,8 @@ class Categories extends BaseController ...@@ -243,8 +243,8 @@ class Categories extends BaseController
qa_report_event('cat_new', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array( qa_report_event('cat_new', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array(
'categoryid' => $categoryid, 'categoryid' => $categoryid,
'parentid' => $inparentid, 'parentid' => $inparentid,
'content' => isset($incontent)?$incontent:null, 'content' => isset($incontent) ? $incontent : null,
'position' => isset($inposition)?$inposition:null, 'position' => isset($inposition) ? $inposition : null,
'name' => $inname, 'name' => $inname,
'slug' => $inslug, 'slug' => $inslug,
)); ));
......
...@@ -506,7 +506,7 @@ class UserProfile extends BaseController ...@@ -506,7 +506,7 @@ class UserProfile extends BaseController
foreach ($userlevels as $userlevel) { foreach ($userlevels as $userlevel) {
if ($userlevel['entitytype'] == QA_ENTITY_CATEGORY) { if ($userlevel['entitytype'] == QA_ENTITY_CATEGORY) {
$index++; $index++;
$id = 'ls_' . +$index; $id = 'ls_' . (+$index);
$qa_content['form_profile']['fields']['uc_' . $index . '_level'] = array( $qa_content['form_profile']['fields']['uc_' . $index . '_level'] = array(
'label' => qa_lang_html('users/category_level_label'), 'label' => qa_lang_html('users/category_level_label'),
......
...@@ -35,7 +35,7 @@ class Usage ...@@ -35,7 +35,7 @@ class Usage
public function __construct() public function __construct()
{ {
$this->stages = array(); $this->stages = array();
$this->databaseUsage = array('queries'=>0, 'clock'=>0); $this->databaseUsage = array('queries' => 0, 'clock' => 0);
$this->databaseQueryLog = ''; $this->databaseQueryLog = '';
$this->prevUsage = $this->startUsage = $this->getCurrent(); $this->prevUsage = $this->startUsage = $this->getCurrent();
...@@ -99,7 +99,7 @@ class Usage ...@@ -99,7 +99,7 @@ class Usage
$rowcolstring .= ' - ' . $gotcolumns . ($gotcolumns == 1 ? ' column' : ' columns'); $rowcolstring .= ' - ' . $gotcolumns . ($gotcolumns == 1 ? ' column' : ' columns');
} }
$this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime*1000) . $rowcolstring . "\n\n"; $this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime * 1000) . $rowcolstring . "\n\n";
} }
$this->databaseUsage['queries']++; $this->databaseUsage['queries']++;
...@@ -210,7 +210,7 @@ class Usage ...@@ -210,7 +210,7 @@ class Usage
$delta = array(); $delta = array();
foreach ($newusage as $key => $value) { foreach ($newusage as $key => $value) {
$delta[$key] = max(0, $value-@$oldusage[$key]); $delta[$key] = max(0, $value - @$oldusage[$key]);
} }
return $delta; return $delta;
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
</properties> </properties>
</rule> </rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Not part of normal usage, but kept for testing (default severity = 5) --> <!-- Not part of normal usage, but kept for testing (default severity = 5) -->
<rule ref="Squiz.Commenting.FunctionComment"> <rule ref="Squiz.Commenting.FunctionComment">
<severity>0</severity> <severity>0</severity>
......
...@@ -51,9 +51,9 @@ class qa_html_theme extends qa_html_theme_base ...@@ -51,9 +51,9 @@ class qa_html_theme extends qa_html_theme_base
qa_html_theme_base::logged_in(); qa_html_theme_base::logged_in();
if (qa_is_logged_in()) { // adds points count after logged in username if (qa_is_logged_in()) { // adds points count after logged in username
$userpoints=qa_get_logged_in_points(); $userpoints = qa_get_logged_in_points();
$pointshtml=($userpoints==1) $pointshtml = ($userpoints == 1)
? qa_lang_html_sub('main/1_point', '1', '1') ? qa_lang_html_sub('main/1_point', '1', '1')
: qa_lang_html_sub('main/x_points', qa_html(qa_format_number($userpoints))); : qa_lang_html_sub('main/x_points', qa_html(qa_format_number($userpoints)));
...@@ -102,7 +102,7 @@ class qa_html_theme extends qa_html_theme_base ...@@ -102,7 +102,7 @@ class qa_html_theme extends qa_html_theme_base
// removes sidebar for user profile pages // removes sidebar for user profile pages
public function sidepanel() public function sidepanel()
{ {
if ($this->template!='user') if ($this->template != 'user')
qa_html_theme_base::sidepanel(); qa_html_theme_base::sidepanel();
} }
...@@ -140,7 +140,7 @@ class qa_html_theme extends qa_html_theme_base ...@@ -140,7 +140,7 @@ class qa_html_theme extends qa_html_theme_base
// prevent display of view count in the usual place // prevent display of view count in the usual place
public function view_count($q_item) public function view_count($q_item)
{ {
if ($this->template=='question') if ($this->template == 'question')
qa_html_theme_base::view_count($q_item); qa_html_theme_base::view_count($q_item);
} }
......
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