Commit 802f6879 by Scott

Coding style (more minor typos/spacing issues)

parent 59ad6e0a
......@@ -685,5 +685,4 @@ class Q2A_Util_String
return false;
}
}
......@@ -177,5 +177,4 @@ class Q2A_Util_Usage
$usage['ram'] ? ($usage['ram'] * 100 / $totalusage['ram']) : 0
);
}
}
......@@ -127,7 +127,7 @@
if (isset($metadata['display_name']))
$options[$code] = $metadata['display_name'];
// otherwise use an entry from above
else if (isset($codetolanguage[$code]))
elseif (isset($codetolanguage[$code]))
$options[$code] = $codetolanguage[$code];
}
......@@ -139,7 +139,8 @@
/**
* Return a sorted array of available themes, [theme name] => [theme name]
*/
function qa_admin_theme_options() {
function qa_admin_theme_options()
{
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
$metadataUtil = new Q2A_Util_Metadata();
......
......@@ -281,8 +281,9 @@
if ($isquestion && isset($post['closedbyid']))
$fields['classes']=ltrim($fields['classes'].' qa-q-closed');
if ($microformats)
if ($microformats) {
$fields['classes'].=' hentry '.($isquestion ? 'question' : ($isanswer ? ($isselected ? 'answer answer-selected' : 'answer') : 'comment'));
}
// Question-specific stuff (title, URL, tags, answer count, category)
......@@ -503,7 +504,7 @@
$fields['meta_order']=qa_lang_html('main/meta_order'); // sets ordering of meta elements which can be language-specific
if (@$options['whatview'] ) {
if (@$options['whatview']) {
$fields['what']=qa_lang_html($isquestion ? 'main/asked' : ($isanswer ? 'main/answered' : 'main/commented'));
if (@$options['whatlink'] && strlen(@$options['q_request']))
......
......@@ -92,7 +92,7 @@
qa_db_flaggedcount_update();
}
else if ($oldquestion['type'] == 'Q') { // not hidden or queued
elseif ($oldquestion['type'] == 'Q') { // not hidden or queued
qa_post_index($oldquestion['postid'], 'Q', $oldquestion['postid'], $oldquestion['parentid'], $title, $content, $format, $text, $tagstring, $oldquestion['categoryid']);
}
......
......@@ -33,17 +33,19 @@
{
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
$mindb=16777215; // from MEDIUMBLOB column type
$mindb = 16777215; // from MEDIUMBLOB column type
$minphp=trim(ini_get('upload_max_filesize'));
$minphp = trim(ini_get('upload_max_filesize'));
switch (strtolower(substr($minphp, -1))) {
case 'g':
$minphp*=1024;
$minphp *= 1024;
// fall-through
case 'm':
$minphp*=1024;
$minphp *= 1024;
// fall-through
case 'k':
$minphp*=1024;
$minphp *= 1024;
}
return min($mindb, $minphp);
......
......@@ -1103,7 +1103,7 @@ in a category for which they have elevated privileges).
if (!isset($value))
$silentproblems[]='code missing';
else if (!strlen($value))
elseif (!strlen($value))
$silentproblems[]='code empty';
else {
......@@ -1135,7 +1135,7 @@ in a category for which they have elevated privileges).
$silentproblems[]='key cookie missing';
elseif (!strlen($key))
$silentproblems[]='key cookie empty';
else if (strlen($key)!=QA_FORM_KEY_LENGTH)
elseif (strlen($key)!=QA_FORM_KEY_LENGTH)
$reportproblems[]='key cookie '.$key.' invalid';
}
}
......
......@@ -39,7 +39,7 @@
$req = qa_request_part(1);
if ($req === null)
$showOutbox = false;
else if ($req === 'sent')
elseif ($req === 'sent')
$showOutbox = true;
else
return include QA_INCLUDE_DIR.'qa-page-not-found.php';
......
......@@ -128,7 +128,7 @@
$pageerror=@$qerrors['page']; // for security code failure
}
} else if (($pagestate==('edit-'.$questionid)) && qa_page_q_permit_edit($question, 'permit_edit_q', $pageerror, 'permit_retag_cat'))
} elseif (($pagestate==('edit-'.$questionid)) && qa_page_q_permit_edit($question, 'permit_edit_q', $pageerror, 'permit_retag_cat'))
$formtype='q_edit';
if ($formtype=='q_edit') { // get tags for auto-completion
......
......@@ -358,7 +358,7 @@
$commentsall=$answerid;
}
} else if (($formtype=='c_edit') && (@$commentsfollows[$formpostid]['parentid']==$answerid)) { // ...being edited
} elseif (($formtype=='c_edit') && (@$commentsfollows[$formpostid]['parentid']==$answerid)) { // ...being edited
$a_view['c_form']=qa_page_q_edit_c_form($qa_content, 'c'.$formpostid, $commentsfollows[$formpostid],
@$ceditin[$formpostid], @$cediterrors[$formpostid]);
......
......@@ -1048,8 +1048,10 @@
switch (strtoupper($unit)) { // Gets an integer value that can be compared against the size of the HTTP request
case 'G':
$postmaxsize *= 1024;
// fall-through
case 'M':
$postmaxsize *= 1024;
// fall-through
case 'K':
$postmaxsize *= 1024;
}
......
......@@ -236,7 +236,7 @@
$result = implode(',', $parts);
}
else if (isset($argument)) {
elseif (isset($argument)) {
if ($alwaysquote || !is_numeric($argument))
$result = "'".qa_db_escape_string($argument)."'";
else
......
......@@ -249,7 +249,7 @@
$qa_content['navigation'][$navtype][$navprefix]['selected'] = true;
}
}
else if ($requestlower === $navprefix || $requestlower.'$' === $navprefix)
elseif ($requestlower === $navprefix || $requestlower.'$' === $navprefix)
$qa_content['navigation'][$navtype][$navprefix]['selected'] = true;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -73,6 +73,7 @@ class qa_basic_adsense
switch ($region) {
case 'full': // Leaderboard
$divstyle='width:728px; margin:0 auto;';
// fall-through
case 'main': // Leaderboard
$width=728;
......
......@@ -154,5 +154,4 @@ class UtilStringTest extends PHPUnit_Framework_TestCase
$this->assertTrue( qa_string_matches_one($this->strBasic, $matches) );
$this->assertFalse( qa_string_matches_one($this->strBasic, $nonMatches) );
}
}
......@@ -159,5 +159,4 @@ class qa_html_theme extends qa_html_theme_base
qa_html_theme_base::attribution();
}
}
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