Commit cf6aef69 by Scott

Coding style (fix more CodeSniffer errors)

parent ac84dde7
...@@ -46,8 +46,7 @@ list($comment, $question, $parent, $children) = qa_db_select_with_pending( ...@@ -46,8 +46,7 @@ list($comment, $question, $parent, $children) = qa_db_select_with_pending(
// Check if there was an operation that succeeded // Check if there was an operation that succeeded
if ( if (@$comment['basetype'] == 'C' && @$question['basetype'] == 'Q' &&
@$comment['basetype'] == 'C' && @$question['basetype'] == 'Q' &&
(@$parent['basetype'] == 'Q' || @$parent['basetype'] == 'A') (@$parent['basetype'] == 'Q' || @$parent['basetype'] == 'A')
) { ) {
$comment = $comment + qa_page_q_post_rules($comment, $parent, $children, null); // array union $comment = $comment + qa_page_q_post_rules($comment, $parent, $children, null); // array union
......
...@@ -40,8 +40,7 @@ list($question, $parent, $children) = qa_db_select_with_pending( ...@@ -40,8 +40,7 @@ list($question, $parent, $children) = qa_db_select_with_pending(
// Check if the question and parent exist, and whether the user has permission to do this // Check if the question and parent exist, and whether the user has permission to do this
if ( if (@$question['basetype'] == 'Q' && (@$parent['basetype'] == 'Q' || @$parent['basetype'] == 'A') &&
@$question['basetype'] == 'Q' && (@$parent['basetype'] == 'Q' || @$parent['basetype'] == 'A') &&
!qa_user_post_permit_error('permit_post_c', $parent, QA_LIMIT_COMMENTS) !qa_user_post_permit_error('permit_post_c', $parent, QA_LIMIT_COMMENTS)
) { ) {
require_once QA_INCLUDE_DIR . 'app/captcha.php'; require_once QA_INCLUDE_DIR . 'app/captcha.php';
......
...@@ -25,7 +25,6 @@ require_once QA_INCLUDE_DIR . 'app/recalc.php'; ...@@ -25,7 +25,6 @@ require_once QA_INCLUDE_DIR . 'app/recalc.php';
if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) { if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) {
if (!qa_check_form_security_code('admin/recalc', qa_post_text('code'))) { if (!qa_check_form_security_code('admin/recalc', qa_post_text('code'))) {
$state = ''; $state = '';
$message = qa_lang('misc/form_security_reload'); $message = qa_lang('misc/form_security_reload');
......
...@@ -602,9 +602,8 @@ function qa_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt ...@@ -602,9 +602,8 @@ function qa_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt
// Updated when and by whom // Updated when and by whom
if ( if (@$options['updateview'] && isset($post['updated']) &&
@$options['updateview'] && isset($post['updated']) && ($post['updatetype'] != QA_UPDATE_SELECTED || $isselected) && // only show selected change if it's still selected
(($post['updatetype'] != QA_UPDATE_SELECTED) || $isselected) && // only show selected change if it's still selected
( // otherwise check if one of these conditions is fulfilled... ( // otherwise check if one of these conditions is fulfilled...
(!isset($post['created'])) || // ... we didn't show the created time (should never happen in practice) (!isset($post['created'])) || // ... we didn't show the created time (should never happen in practice)
($post['hidden'] && ($post['updatetype'] == QA_UPDATE_VISIBLE)) || // ... the post was hidden as the last action ($post['hidden'] && ($post['updatetype'] == QA_UPDATE_VISIBLE)) || // ... the post was hidden as the last action
...@@ -1567,9 +1566,7 @@ function qa_custom_page_url($page) ...@@ -1567,9 +1566,7 @@ function qa_custom_page_url($page)
*/ */
function qa_navigation_add_page(&$navigation, $page) function qa_navigation_add_page(&$navigation, $page)
{ {
if ( if (!isset($page['permit']) || !qa_permit_value_error($page['permit'], qa_get_logged_in_userid(), qa_get_logged_in_level(), qa_get_logged_in_flags())) {
!isset($page['permit']) || !qa_permit_value_error($page['permit'], qa_get_logged_in_userid(), qa_get_logged_in_level(), qa_get_logged_in_flags())
) {
$url = qa_custom_page_url($page); $url = qa_custom_page_url($page);
$navigation[($page['flags'] & QA_PAGE_FLAGS_EXTERNAL) ? ('custom-' . $page['pageid']) : ($page['tags'] . '$')] = array( $navigation[($page['flags'] & QA_PAGE_FLAGS_EXTERNAL) ? ('custom-' . $page['pageid']) : ($page['tags'] . '$')] = array(
...@@ -2201,8 +2198,7 @@ function qa_get_post_content($editorfield, $contentfield, &$ineditor, &$inconten ...@@ -2201,8 +2198,7 @@ function qa_get_post_content($editorfield, $contentfield, &$ineditor, &$inconten
*/ */
function qa_update_post_text(&$fields, $oldfields) function qa_update_post_text(&$fields, $oldfields)
{ {
if ( if (strcmp($oldfields['content'], $fields['content']) ||
strcmp($oldfields['content'], $fields['content']) ||
strcmp($oldfields['format'], $fields['format']) || strcmp($oldfields['format'], $fields['format']) ||
strcmp($oldfields['text'], $fields['text']) strcmp($oldfields['text'], $fields['text'])
) { ) {
......
...@@ -187,8 +187,7 @@ function qa_block_ips_explode($blockipstring) ...@@ -187,8 +187,7 @@ function qa_block_ips_explode($blockipstring)
function qa_block_ip_match($ip, $blockipclause) function qa_block_ip_match($ip, $blockipclause)
{ {
// check if the input parameters use the same IP version // check if the input parameters use the same IP version
if ( if ((strpos($ip, ".") !== false && strpos($blockipclause, ".") === false) ||
(strpos($ip, ".") !== false && strpos($blockipclause, ".") === false) ||
(strpos($ip, ".") === false && strpos($blockipclause, ".") !== false) (strpos($ip, ".") === false && strpos($blockipclause, ".") !== false)
) { ) {
return false; return false;
......
...@@ -642,11 +642,8 @@ function qa_content_prepare($voting = false, $categoryids = null) ...@@ -642,11 +642,8 @@ function qa_content_prepare($voting = false, $categoryids = null)
} }
if ( if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN || !qa_user_maximum_permit_error('permit_moderate') ||
qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN || !qa_user_maximum_permit_error('permit_hide_show') || !qa_user_maximum_permit_error('permit_delete_hidden')
!qa_user_maximum_permit_error('permit_moderate') ||
!qa_user_maximum_permit_error('permit_hide_show') ||
!qa_user_maximum_permit_error('permit_delete_hidden')
) { ) {
$qa_content['navigation']['main']['admin'] = array( $qa_content['navigation']['main']['admin'] = array(
'url' => qa_path_html('admin'), 'url' => qa_path_html('admin'),
...@@ -696,13 +693,11 @@ function qa_content_prepare($voting = false, $categoryids = null) ...@@ -696,13 +693,11 @@ function qa_content_prepare($voting = false, $categoryids = null)
if (isset($region) && isset($place)) { if (isset($region) && isset($place)) {
// region/place codes recognized // region/place codes recognized
$module = qa_load_module('widget', $widget['title']); $module = qa_load_module('widget', $widget['title']);
$allowTmpl = (substr($qa_template, 0, 7) == 'custom-') ? 'custom' : $qa_template;
if ( if (isset($module) &&
isset($module) && method_exists($module, 'allow_template') && $module->allow_template($allowTmpl) &&
method_exists($module, 'allow_template') && method_exists($module, 'allow_region') && $module->allow_region($region) &&
$module->allow_template((substr($qa_template, 0, 7) == 'custom-') ? 'custom' : $qa_template) &&
method_exists($module, 'allow_region') &&
$module->allow_region($region) &&
method_exists($module, 'output_widget') method_exists($module, 'output_widget')
) { ) {
// if module loaded and happy to be displayed here, tell theme about it // if module loaded and happy to be displayed here, tell theme about it
......
...@@ -277,7 +277,6 @@ function qa_recalc_perform_step(&$state) ...@@ -277,7 +277,6 @@ function qa_recalc_perform_step(&$state)
$lastquestionid = max($questionids); $lastquestionid = max($questionids);
foreach ($questionids as $questionid) { foreach ($questionids as $questionid) {
// Retrieve all posts relating to this question // Retrieve all posts relating to this question
list($question, $childposts, $achildposts) = qa_db_select_with_pending( list($question, $childposts, $achildposts) = qa_db_select_with_pending(
......
...@@ -53,7 +53,6 @@ define('QA_FIELD_FLAGS_ON_REGISTER', 4); ...@@ -53,7 +53,6 @@ define('QA_FIELD_FLAGS_ON_REGISTER', 4);
if (QA_FINAL_EXTERNAL_USERS) { if (QA_FINAL_EXTERNAL_USERS) {
// If we're using single sign-on integration (WordPress or otherwise), load PHP file for that // If we're using single sign-on integration (WordPress or otherwise), load PHP file for that
if (defined('QA_FINAL_WORDPRESS_INTEGRATE_PATH')) { if (defined('QA_FINAL_WORDPRESS_INTEGRATE_PATH')) {
...@@ -1134,20 +1133,16 @@ function qa_permit_value_error($permit, $userid, $userlevel, $userflags) ...@@ -1134,20 +1133,16 @@ function qa_permit_value_error($permit, $userid, $userlevel, $userflags)
if ($permit >= QA_PERMIT_CONFIRMED) { if ($permit >= QA_PERMIT_CONFIRMED) {
$confirmed = ($userflags & QA_USER_FLAGS_EMAIL_CONFIRMED); $confirmed = ($userflags & QA_USER_FLAGS_EMAIL_CONFIRMED);
if ( // not currently supported by single sign-on integration; approved users and above don't need confirmation
!QA_FINAL_EXTERNAL_USERS && // not currently supported by single sign-on integration if (!QA_FINAL_EXTERNAL_USERS && qa_opt('confirm_user_emails') && $userlevel < QA_USER_LEVEL_APPROVED && !$confirmed) {
qa_opt('confirm_user_emails') && // if this option off, we can't ask it of the user
$userlevel < QA_USER_LEVEL_APPROVED && // if user approved or assigned to a higher level, no need
!$confirmed // actual confirmation
)
return 'confirm'; return 'confirm';
}
} elseif ($permit >= QA_PERMIT_APPROVED) { } elseif ($permit >= QA_PERMIT_APPROVED) {
if ( // check user is approved, only if we require it
qa_opt('moderate_users') && // if this option off, we can't ask it of the user if (qa_opt('moderate_users') && $userlevel < QA_USER_LEVEL_APPROVED) {
$userlevel < QA_USER_LEVEL_APPROVED // user has not been approved
)
return 'approve'; return 'approve';
} }
}
return false; return false;
} }
...@@ -1225,10 +1220,8 @@ function qa_user_moderation_reason($userlevel = null) ...@@ -1225,10 +1220,8 @@ function qa_user_moderation_reason($userlevel = null)
if (!isset($userlevel)) if (!isset($userlevel))
$userlevel = qa_get_logged_in_level(); $userlevel = qa_get_logged_in_level();
if ( if ($userlevel < QA_USER_LEVEL_EXPERT && qa_user_permit_error('permit_moderate')) {
($userlevel < QA_USER_LEVEL_EXPERT) && // experts and above aren't moderated // experts and above aren't moderated; if the user can approve posts, no point in moderating theirs
qa_user_permit_error('permit_moderate') // if the user can approve posts, no point in moderating theirs
) {
$userid = qa_get_logged_in_userid(); $userid = qa_get_logged_in_userid();
if (isset($userid)) { if (isset($userid)) {
......
...@@ -45,9 +45,7 @@ function qa_vote_error_html($post, $vote, $userid, $topage) ...@@ -45,9 +45,7 @@ function qa_vote_error_html($post, $vote, $userid, $topage)
require_once QA_INCLUDE_DIR . 'app/users.php'; require_once QA_INCLUDE_DIR . 'app/users.php';
require_once QA_INCLUDE_DIR . 'app/limits.php'; require_once QA_INCLUDE_DIR . 'app/limits.php';
if ( if (is_array($post) && ($post['basetype'] == 'Q' || $post['basetype'] == 'A') &&
is_array($post) &&
($post['basetype'] == 'Q' || $post['basetype'] == 'A') &&
qa_opt(($post['basetype'] == 'Q') ? 'voting_on_qs' : 'voting_on_as') && qa_opt(($post['basetype'] == 'Q') ? 'voting_on_qs' : 'voting_on_as') &&
(!isset($post['userid']) || !isset($userid) || $post['userid'] != $userid) (!isset($post['userid']) || !isset($userid) || $post['userid'] != $userid)
) { ) {
...@@ -167,12 +165,9 @@ function qa_flag_error_html($post, $userid, $topage) ...@@ -167,12 +165,9 @@ function qa_flag_error_html($post, $userid, $topage)
require_once QA_INCLUDE_DIR . 'app/users.php'; require_once QA_INCLUDE_DIR . 'app/users.php';
require_once QA_INCLUDE_DIR . 'app/limits.php'; require_once QA_INCLUDE_DIR . 'app/limits.php';
if ( if (is_array($post) && qa_opt('flagging_of_posts') &&
is_array($post) &&
qa_opt('flagging_of_posts') &&
(!isset($post['userid']) || !isset($userid) || $post['userid'] != $userid) (!isset($post['userid']) || !isset($userid) || $post['userid'] != $userid)
) { ) {
switch (qa_user_post_permit_error('permit_flag', $post, QA_LIMIT_FLAGS)) { switch (qa_user_post_permit_error('permit_flag', $post, QA_LIMIT_FLAGS)) {
case 'login': case 'login':
return qa_insert_login_links(qa_lang_html('question/flag_must_login'), $topage); return qa_insert_login_links(qa_lang_html('question/flag_must_login'), $topage);
......
...@@ -98,9 +98,7 @@ function qa_db_event_create_for_entity($entitytype, $entityid, $questionid, $las ...@@ -98,9 +98,7 @@ function qa_db_event_create_for_entity($entitytype, $entityid, $questionid, $las
), true); ), true);
if (isset($randomuserid)) { if (isset($randomuserid)) {
// If one was found, this means we have one or more individual event streams, so update them all // If one was found, this means we have one or more individual event streams, so update them all
qa_db_query_sub( qa_db_query_sub(
'INSERT INTO ^userevents (userid, entitytype, entityid, questionid, lastpostid, updatetype, lastuserid, updated) ' . 'INSERT INTO ^userevents (userid, entitytype, entityid, questionid, lastpostid, updatetype, lastuserid, updated) ' .
'SELECT userid, $, #, #, #, $, $, ' . $updatedsql . ' FROM ^userfavorites WHERE entitytype=$ AND entityid=# AND nouserevents=0', 'SELECT userid, $, #, #, #, $, $, ' . $updatedsql . ' FROM ^userfavorites WHERE entitytype=$ AND entityid=# AND nouserevents=0',
...@@ -109,7 +107,6 @@ function qa_db_event_create_for_entity($entitytype, $entityid, $questionid, $las ...@@ -109,7 +107,6 @@ function qa_db_event_create_for_entity($entitytype, $entityid, $questionid, $las
// Now truncate the random individual event stream that was found earlier // Now truncate the random individual event stream that was found earlier
// (in theory we should truncate them all, but truncation is just a 'housekeeping' activity, so it's not necessary) // (in theory we should truncate them all, but truncation is just a 'housekeeping' activity, so it's not necessary)
qa_db_user_events_truncate($randomuserid, $questionid); qa_db_user_events_truncate($randomuserid, $questionid);
} }
} }
......
...@@ -143,7 +143,6 @@ function qa_db_favorite_create($userid, $entitytype, $entityid) ...@@ -143,7 +143,6 @@ function qa_db_favorite_create($userid, $entitytype, $entityid)
// If we're going to use the shared stream... // If we're going to use the shared stream...
if ($useshared) { if ($useshared) {
// ... for all the people for whom we're switching this to a shared stream, find the highest number of other shared streams they have // ... for all the people for whom we're switching this to a shared stream, find the highest number of other shared streams they have
$maxshared = qa_db_read_one_value(qa_db_query_sub( $maxshared = qa_db_read_one_value(qa_db_query_sub(
......
...@@ -771,7 +771,6 @@ function qa_db_upgrade_tables() ...@@ -771,7 +771,6 @@ function qa_db_upgrade_tables()
qa_db_upgrade_progress(QA_DB_VERSION_CURRENT - $version . ' upgrade step/s remaining...'); qa_db_upgrade_progress(QA_DB_VERSION_CURRENT - $version . ' upgrade step/s remaining...');
switch ($newversion) { switch ($newversion) {
// Up to here: Version 1.0 beta 1 // Up to here: Version 1.0 beta 1
case 2: case 2:
......
...@@ -148,8 +148,7 @@ if (qa_clicked('docancel')) { ...@@ -148,8 +148,7 @@ if (qa_clicked('docancel')) {
$errors['name'] = qa_lang_sub('main/max_length_x', QA_DB_MAX_CAT_PAGE_TITLE_LENGTH); $errors['name'] = qa_lang_sub('main/max_length_x', QA_DB_MAX_CAT_PAGE_TITLE_LENGTH);
else { else {
foreach ($incategories as $category) { foreach ($incategories as $category) {
if ( if (!strcmp($category['parentid'], $inparentid) &&
!strcmp($category['parentid'], $inparentid) &&
strcmp($category['categoryid'], @$editcategory['categoryid']) && strcmp($category['categoryid'], @$editcategory['categoryid']) &&
qa_strtolower($category['title']) == qa_strtolower($inname) qa_strtolower($category['title']) == qa_strtolower($inname)
) { ) {
...@@ -284,7 +283,6 @@ if ($setmissing) { ...@@ -284,7 +283,6 @@ if ($setmissing) {
} elseif (isset($editcategory)) { } elseif (isset($editcategory)) {
$qa_content['form'] = array( $qa_content['form'] = array(
'tags' => 'method="post" action="' . qa_path_html(qa_request()) . '"', 'tags' => 'method="post" action="' . qa_path_html(qa_request()) . '"',
......
...@@ -712,9 +712,7 @@ else { ...@@ -712,9 +712,7 @@ else {
foreach ($getoptions as $optionname) { foreach ($getoptions as $optionname) {
$optionvalue = qa_post_text('option_' . $optionname); $optionvalue = qa_post_text('option_' . $optionname);
if ( if (@$optiontype[$optionname] == 'number' || @$optiontype[$optionname] == 'checkbox' ||
@$optiontype[$optionname] == 'number' ||
@$optiontype[$optionname] == 'checkbox' ||
(@$optiontype[$optionname] == 'number-blank' && strlen($optionvalue)) (@$optiontype[$optionname] == 'number-blank' && strlen($optionvalue))
) )
$optionvalue = (int)$optionvalue; $optionvalue = (int)$optionvalue;
...@@ -905,7 +903,6 @@ if ($recalchotness) { ...@@ -905,7 +903,6 @@ if ($recalchotness) {
); );
} elseif ($startmailing) { } elseif ($startmailing) {
if (qa_post_text('has_js')) { if (qa_post_text('has_js')) {
$qa_content['form']['ok'] = '<span id="mailing_ok">' . qa_html($mailingprogress) . '</span>'; $qa_content['form']['ok'] = '<span id="mailing_ok">' . qa_html($mailingprogress) . '</span>';
......
...@@ -464,9 +464,7 @@ if (isset($editpage)) { ...@@ -464,9 +464,7 @@ if (isset($editpage)) {
$qa_content['focusid'] = 'name'; $qa_content['focusid'] = 'name';
} else { } else {
// List of standard navigation links // List of standard navigation links
$qa_content['form'] = array( $qa_content['form'] = array(
'tags' => 'method="post" action="' . qa_self_html() . '"', 'tags' => 'method="post" action="' . qa_self_html() . '"',
......
...@@ -71,7 +71,6 @@ if (qa_clicked('doblock') || qa_clicked('dounblock') || qa_clicked('dohideall')) ...@@ -71,7 +71,6 @@ if (qa_clicked('doblock') || qa_clicked('dounblock') || qa_clicked('dohideall'))
$pageerror = qa_lang_html('misc/form_security_again'); $pageerror = qa_lang_html('misc/form_security_again');
elseif ($blockable) { elseif ($blockable) {
if (qa_clicked('doblock')) { if (qa_clicked('doblock')) {
$oldblocked = qa_opt('block_ips_write'); $oldblocked = qa_opt('block_ips_write');
qa_set_option('block_ips_write', (strlen($oldblocked) ? ($oldblocked . ' , ') : '') . $ip); qa_set_option('block_ips_write', (strlen($oldblocked) ? ($oldblocked . ' , ') : '') . $ip);
......
...@@ -429,7 +429,6 @@ function qa_page_q_question_view($question, $parentquestion, $closepost, $usersh ...@@ -429,7 +429,6 @@ function qa_page_q_question_view($question, $parentquestion, $closepost, $usersh
// Information about the question that this question is a duplicate of (if appropriate) // Information about the question that this question is a duplicate of (if appropriate)
if (isset($closepost)) { if (isset($closepost)) {
if ($closepost['basetype'] == 'Q') { if ($closepost['basetype'] == 'Q') {
if ($closepost['hidden']) { if ($closepost['hidden']) {
// don't show link for hidden questions // don't show link for hidden questions
......
...@@ -455,18 +455,15 @@ if (isset($jumptoanchor)) ...@@ -455,18 +455,15 @@ if (isset($jumptoanchor))
// Determine whether this request should be counted for page view statistics. // Determine whether this request should be counted for page view statistics.
// The lastviewip check is now in the hotness query in order to bypass caching. // The lastviewip check is now in the hotness query in order to bypass caching.
if ( if (qa_opt('do_count_q_views') && !$formrequested && !qa_is_http_post() && qa_is_human_probably() &&
qa_opt('do_count_q_views') &&
(!$formrequested) &&
(!qa_is_http_post()) &&
qa_is_human_probably() &&
((!$question['views']) || ( // if it has more than zero views ((!$question['views']) || ( // if it has more than zero views
((@inet_ntop($question['createip']) != qa_remote_ip_address()) || (!isset($question['createip']))) && // and different IP from the creator (@inet_ntop($question['createip']) != qa_remote_ip_address() || !isset($question['createip'])) && // and different IP from the creator
(($question['userid'] != $userid) || (!isset($question['userid']))) && // and different user from the creator ($question['userid'] != $userid || !isset($question['userid'])) && // and different user from the creator
(($question['cookieid'] != $cookieid) || (!isset($question['cookieid']))) // and different cookieid from the creator ($question['cookieid'] != $cookieid || !isset($question['cookieid'])) // and different cookieid from the creator
)) ))
) ) {
$qa_content['inc_views_postid'] = $questionid; $qa_content['inc_views_postid'] = $questionid;
}
return $qa_content; return $qa_content;
...@@ -33,9 +33,7 @@ require_once QA_INCLUDE_DIR . 'app/search.php'; ...@@ -33,9 +33,7 @@ require_once QA_INCLUDE_DIR . 'app/search.php';
// Perform the search if appropriate // Perform the search if appropriate
if (strlen(qa_get('q'))) { if (strlen(qa_get('q'))) {
// Pull in input parameters // Pull in input parameters
$inquery = trim(qa_get('q')); $inquery = trim(qa_get('q'));
$userid = qa_get_logged_in_userid(); $userid = qa_get_logged_in_userid();
$start = qa_get_start(); $start = qa_get_start();
......
...@@ -406,7 +406,6 @@ if (!QA_FINAL_EXTERNAL_USERS) { ...@@ -406,7 +406,6 @@ if (!QA_FINAL_EXTERNAL_USERS) {
// Levels editing or viewing (add category-specific levels) // Levels editing or viewing (add category-specific levels)
if ($userediting) { if ($userediting) {
if (isset($maxlevelassign)) { if (isset($maxlevelassign)) {
$qa_content['form_profile']['fields']['level']['type'] = 'select'; $qa_content['form_profile']['fields']['level']['type'] = 'select';
...@@ -525,8 +524,7 @@ if (!QA_FINAL_EXTERNAL_USERS) { ...@@ -525,8 +524,7 @@ if (!QA_FINAL_EXTERNAL_USERS) {
foreach ($permitoptions as $permitoption) { foreach ($permitoptions as $permitoption) {
// if not available to approved and email confirmed users with no points, but yes available to the user, it's something special // if not available to approved and email confirmed users with no points, but yes available to the user, it's something special
if ( if (qa_permit_error($permitoption, $userid, QA_USER_LEVEL_APPROVED, QA_USER_FLAGS_EMAIL_CONFIRMED, 0) &&
qa_permit_error($permitoption, $userid, QA_USER_LEVEL_APPROVED, QA_USER_FLAGS_EMAIL_CONFIRMED, 0) &&
!qa_permit_error($permitoption, $userid, $useraccount['level'], $useraccount['flags'], $userpoints['points']) !qa_permit_error($permitoption, $userid, $useraccount['level'], $useraccount['flags'], $userpoints['points'])
) { ) {
if ($permitoption == 'permit_retag_cat') if ($permitoption == 'permit_retag_cat')
...@@ -647,8 +645,7 @@ if (!QA_FINAL_EXTERNAL_USERS) { ...@@ -647,8 +645,7 @@ if (!QA_FINAL_EXTERNAL_USERS) {
// Edit form or button, if appropriate // Edit form or button, if appropriate
if ($userediting) { if ($userediting) {
if ( if ((qa_opt('avatar_allow_gravatar') && ($useraccount['flags'] & QA_USER_FLAGS_SHOW_GRAVATAR)) ||
(qa_opt('avatar_allow_gravatar') && ($useraccount['flags'] & QA_USER_FLAGS_SHOW_GRAVATAR)) ||
(qa_opt('avatar_allow_upload') && ($useraccount['flags'] & QA_USER_FLAGS_SHOW_AVATAR) && isset($useraccount['avatarblobid'])) (qa_opt('avatar_allow_upload') && ($useraccount['flags'] & QA_USER_FLAGS_SHOW_AVATAR) && isset($useraccount['avatarblobid']))
) { ) {
$qa_content['form_profile']['fields']['removeavatar'] = array( $qa_content['form_profile']['fields']['removeavatar'] = array(
......
...@@ -84,8 +84,7 @@ class qa_event_limits ...@@ -84,8 +84,7 @@ class qa_event_limits
'u_block', 'u_edit', 'u_level', 'u_message', 'u_password', 'u_save', 'u_unblock', 'u_block', 'u_edit', 'u_level', 'u_message', 'u_password', 'u_save', 'u_unblock',
); );
if ( if (is_numeric(array_search(strstr($event, '_'), $writeactions)) ||
is_numeric(array_search(strstr($event, '_'), $writeactions)) ||
is_numeric(array_search($event, $writeactions)) is_numeric(array_search($event, $writeactions))
) { ) {
if (isset($userid)) { if (isset($userid)) {
......
...@@ -303,9 +303,7 @@ $lines[] = '<link>' . qa_xml(qa_path($linkrequest, $linkparams, $siteurl)) . '</ ...@@ -303,9 +303,7 @@ $lines[] = '<link>' . qa_xml(qa_path($linkrequest, $linkparams, $siteurl)) . '</
$lines[] = '<description>Powered by Question2Answer</description>'; $lines[] = '<description>Powered by Question2Answer</description>';
foreach ($questions as $question) { foreach ($questions as $question) {
// Determine whether this is a question, answer or comment, and act accordingly // Determine whether this is a question, answer or comment, and act accordingly
$options = array('blockwordspreg' => @$blockwordspreg, 'showurllinks' => $showurllinks); $options = array('blockwordspreg' => @$blockwordspreg, 'showurllinks' => $showurllinks);
$time = null; $time = null;
......
...@@ -42,9 +42,7 @@ elseif (isset($_GET['qa']) && $_GET['qa'] == 'blob') { ...@@ -42,9 +42,7 @@ elseif (isset($_GET['qa']) && $_GET['qa'] == 'blob') {
} }
else { else {
// Otherwise, load the Q2A base file which sets up a bunch of crucial stuff // Otherwise, load the Q2A base file which sets up a bunch of crucial stuff
require 'qa-base.php'; require 'qa-base.php';
/** /**
......
...@@ -173,9 +173,7 @@ class qa_event_logger ...@@ -173,9 +173,7 @@ class qa_event_logger
} }
if (qa_opt('event_logger_to_files')) { if (qa_opt('event_logger_to_files')) {
// Substitute some placeholders if certain information is missing // Substitute some placeholders if certain information is missing
if (!strlen($userid)) if (!strlen($userid))
$userid = 'no_userid'; $userid = 'no_userid';
......
...@@ -83,7 +83,6 @@ class qa_facebook_login ...@@ -83,7 +83,6 @@ class qa_facebook_login
<div 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"'?>> <div 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"'?>>
</div> </div>
<?php <?php
} }
......
...@@ -35,9 +35,7 @@ class qa_html_theme_layer extends qa_html_theme_base ...@@ -35,9 +35,7 @@ class qa_html_theme_layer extends qa_html_theme_base
} }
if (!empty($postids)) { if (!empty($postids)) {
// Retrieve the content for these questions from the database // Retrieve the content for these questions from the database
$maxlength = qa_opt('mouseover_content_max_len'); $maxlength = qa_opt('mouseover_content_max_len');
$result = qa_db_query_sub('SELECT postid, content, format FROM ^posts WHERE postid IN (#)', $postids); $result = qa_db_query_sub('SELECT postid, content, format FROM ^posts WHERE postid IN (#)', $postids);
$postinfo = qa_db_read_all_assoc($result, 'postid'); $postinfo = qa_db_read_all_assoc($result, 'postid');
......
...@@ -95,7 +95,6 @@ class qa_html_theme extends qa_html_theme_base ...@@ -95,7 +95,6 @@ class qa_html_theme extends qa_html_theme_base
$this->output('<div class="qa-main-shadow">', ''); $this->output('<div class="qa-main-shadow">', '');
$this->output('<div class="qa-main-wrapper">', ''); $this->output('<div class="qa-main-wrapper">', '');
$this->nav_main_sub(); $this->nav_main_sub();
} }
// removes sidebar for user profile pages // removes sidebar for user profile pages
......
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