Skip to content

Commit

Permalink
Merge branch 'pr/917' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
svivian committed Jan 9, 2024
2 parents d7a97da + 8f5d994 commit fa86105
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 86 deletions.
6 changes: 3 additions & 3 deletions qa-include/db/selects.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,10 @@ function qa_db_related_qs_selectspec($voteuserid, $questionid, $count = null)
* a match in its answers, comments, or comments on answers). The 'matchparts' is a comma-separated list of tuples
* matchtype:matchpostid:matchscore to be used with qa_search_set_max_match().
* @param mixed $voteuserid
* @param string $titlewords
* @param string $contentwords
* @param array $titlewords
* @param array $contentwords
* @param array $tagwords
* @param string $handlewords
* @param array $handlewords
* @param string $handle
* @param int $start
* @param bool $full
Expand Down
2 changes: 1 addition & 1 deletion qa-include/pages/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

$changehandle = qa_opt('allow_change_usernames') || (!$userpoints['qposts'] && !$userpoints['aposts'] && !$userpoints['cposts']);
$doconfirms = qa_opt('confirm_user_emails') && $useraccount['level'] < QA_USER_LEVEL_EXPERT;
$isconfirmed = ($useraccount['flags'] & QA_USER_FLAGS_EMAIL_CONFIRMED) ? true : false;
$isconfirmed = (bool)($useraccount['flags'] & QA_USER_FLAGS_EMAIL_CONFIRMED);

$haspasswordold = isset($useraccount['passsalt']) && isset($useraccount['passcheck']);
$haspassword = isset($useraccount['passhash']);
Expand Down
5 changes: 3 additions & 2 deletions qa-include/plugins/qa-search-basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public function index_post($postid, $type, $questionid, $parentid, $title, $cont

$contentwordidcounts = array();
foreach ($contentcount as $word => $count) {
if (isset($wordtoid[$word]))
if (isset($wordtoid[$word])) {
$contentwordidcounts[$wordtoid[$word]] = $count;
}
}

qa_db_contentwords_add_post_wordidcounts($postid, $type, $questionid, $contentwordidcounts);
Expand Down Expand Up @@ -113,7 +114,7 @@ public function process_search($query, $start, $count, $userid, $absoluteurls, $

$words = qa_string_to_words($query);

$questions = qa_db_select_with_pending(
$questions = qa_service('dbselect')->selectWithPending(
qa_db_search_posts_selectspec($userid, $words, $words, $words, $words, trim($query), $start, $fullcontent, $count)
);

Expand Down
10 changes: 6 additions & 4 deletions qa-include/plugins/qa-widget-activity-count.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function allow_template($template)

public function allow_region($region)
{
return ($region == 'side');
return $region === 'side';
}

public function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
Expand All @@ -38,8 +38,9 @@ public function output_widget($region, $place, $themeobject, $template, $request
$this->output_count($themeobject, qa_opt('cache_qcount'), 'main/1_question', 'main/x_questions');
$this->output_count($themeobject, qa_opt('cache_acount'), 'main/1_answer', 'main/x_answers');

if (qa_opt('comment_on_qs') || qa_opt('comment_on_as'))
if (qa_opt('comment_on_qs') || qa_opt('comment_on_as')) {
$this->output_count($themeobject, qa_opt('cache_ccount'), 'main/1_comment', 'main/x_comments');
}

$this->output_count($themeobject, qa_opt('cache_userpointscount'), 'main/1_user', 'main/x_users');

Expand All @@ -52,10 +53,11 @@ public function output_count($themeobject, $value, $langsingular, $langplural)

$themeobject->output('<p class="qa-activity-count-item">');

if ($value == 1)
if ($value == 1) {
$themeobject->output(qa_lang_html_sub($langsingular, '<span class="qa-activity-count-data">1</span>', '1'));
else
} else {
$themeobject->output(qa_lang_html_sub($langplural, '<span class="qa-activity-count-data">' . qa_format_number((int)$value, 0, true) . '</span>'));
}

$themeobject->output('</p>');
}
Expand Down
18 changes: 7 additions & 11 deletions qa-include/plugins/qa-widget-category-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,18 @@

class qa_category_list
{
private $themeobject;

public function allow_template($template)
{
return true;
}

public function allow_region($region)
{
return $region == 'side';
return $region === 'side';
}

public function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
$this->themeobject = $themeobject;

if (isset($qa_content['navigation']['cat'])) {
$nav = $qa_content['navigation']['cat'];
} else {
Expand All @@ -45,14 +41,14 @@ public function output_widget($region, $place, $themeobject, $template, $request
'key' => 'qa_db_category_nav_selectspec:default:full',
'ttl' => qa_opt('caching_catwidget_time'),
);
$navcategories = qa_db_single_select($selectspec);
$navcategories = qa_service('dbselect')->singleSelect($selectspec);
$nav = qa_category_navigation($navcategories);
}

$this->themeobject->output('<h2>' . qa_lang_html('main/nav_categories') . '</h2>');
$this->themeobject->set_context('nav_type', 'cat');
$this->themeobject->nav_list($nav, 'nav-cat', 1);
$this->themeobject->nav_clear('cat');
$this->themeobject->clear_context('nav_type');
$themeobject->output('<h2>' . qa_lang_html('main/nav_categories') . '</h2>');
$themeobject->set_context('nav_type', 'cat');
$themeobject->nav_list($nav, 'nav-cat', 1);
$themeobject->nav_clear('cat');
$themeobject->clear_context('nav_type');
}
}
2 changes: 1 addition & 1 deletion qa-include/plugins/qa-widget-related-qs.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function output_widget($region, $place, $themeobject, $template, $request
$userid = qa_get_logged_in_userid();
$cookieid = qa_cookie_get();

$questions = qa_db_single_select(qa_db_related_qs_selectspec($userid, $questionid, qa_opt('page_size_related_qs')));
$questions = qa_service('dbselect')->singleSelect(qa_db_related_qs_selectspec($userid, $questionid, qa_opt('page_size_related_qs')));

$minscore = qa_match_to_min_score(qa_opt('match_related_qs'));

Expand Down
2 changes: 1 addition & 1 deletion qa-src/Database/DbSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct(DbConnection $db)

/**
* Return the data specified by a single $selectspec - see long comment above.
* @param $selectspec
* @param array $selectspec
* @return array|mixed
*/
public function singleSelect(array $selectspec)
Expand Down
81 changes: 19 additions & 62 deletions qa-theme/SnowFlat/qa-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
url("fonts/fontello.woff?7704297") format("woff"),
url("fonts/fontello.ttf?7704297") format("truetype"),
url("fonts/fontello.svg?7704297#fontello") format("svg");
font-weight: normal;
font-style: normal;
font-weight: normal;
font-style: normal;
}

/*------[ base css ]------*/
Expand Down Expand Up @@ -213,7 +213,7 @@ pre code {

code, samp, kbd {
color: #34495e;
font-family: "Courier New",Courier,monospace,sans-serif;
font-family: "Courier New", Courier, monospace, sans-serif;
text-align: left;
}

Expand Down Expand Up @@ -1692,8 +1692,6 @@ li.qa-q-item-tag-item.qa-tag-favorited:before {
}




.qa-part-form-message .qam-pm-message {
padding: 10px;
background: #27ae60;
Expand Down Expand Up @@ -2162,14 +2160,10 @@ input[type="submit"], button {
}

.qa-form-light-button-answer {
background-color: #27ae60;
background-image: url('images/icons/answer-white.png');
float: left;
margin: 0 5px 0 0;
}
.qa-form-light-button-answer:hover, .qa-form-light-button-answer:focus {
background-color: #2ecc71;
}

.qa-form-light-button-comment {
background-image: url('images/icons/comment-white.png');
Expand Down Expand Up @@ -2397,9 +2391,9 @@ input[type="submit"], button {
min-height: 190px;
}
/* highlight selected answer */
.qa-a-list-item:target{
-webkit-animation: answer-highlight 2s ease-in-out;
animation: answer-highlight 2s ease-in-out;
.qa-a-list-item:target {
-webkit-animation: answer-highlight 2s ease-in-out;
animation: answer-highlight 2s ease-in-out;
}

.qa-a-item-avatar-meta {
Expand Down Expand Up @@ -2541,8 +2535,8 @@ input[type="submit"], button {
}
/* highlight selected comment */
.qa-c-list-item:target {
-webkit-animation: comment-highlight 2s ease-in-out;
animation: comment-highlight 2s ease-in-out;
-webkit-animation: comment-highlight 2s ease-in-out;
animation: comment-highlight 2s ease-in-out;
}

/* voting styles for comments */
Expand Down Expand Up @@ -2772,18 +2766,6 @@ input[type="submit"], button {
}

/*------[ sidebar ]------*/
#qam-overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.85);
z-index: 9;
box-shadow: 0 0 300px 50px rgba(0, 0, 0, 0.3) inset;
display: none;
}

#qam-sidepanel-toggle {
display: none;
}
Expand Down Expand Up @@ -2840,17 +2822,11 @@ input[type="submit"], button {
}
.qa-sidepanel.open {
right: 0 !important;
transition: all 0.15s ease;
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5);
}
}


.stick {
top: 10px !important;
transition: all 0.15s ease;
}

.qa-sidepanel {
word-wrap: break-word;
}
Expand Down Expand Up @@ -2933,14 +2909,14 @@ input[type="submit"], button {
top: 5px;
left: 10px;
opacity: 0.2;
transition: all .2s ease-in-out;
}
.qa-activity-count-item:hover {
cursor: help;
}
.qa-activity-count-item:hover:before {
opacity: 1;
-webkit-animation: shake 0.25s;
animation: shake 0.25s;
opacity: .6;
transform: scale(1.2);
}
.qa-activity-count-item:nth-child(1) {
background: #1abc9c;
Expand Down Expand Up @@ -3325,41 +3301,22 @@ input[type="submit"], button {
}
}

@-webkit-keyframes shake {
0% { transform: scale(1); }
17% { transform: scale(1.5); }
34% { transform: scale(0.8); }
51% { transform: scale(1.1); }
68% { transform: scale(0.9); }
85% { transform: scale(1.05); }
100% { transform: scale(1); }
}
@keyframes shake {
0% { transform: scale(1); }
17% { transform: scale(1.5); }
34% { transform: scale(0.8); }
51% { transform: scale(1.1); }
68% { transform: scale(0.9); }
85% { transform: scale(1.05); }
100% { transform: scale(1); }
}

@-webkit-keyframes answer-highlight {
0% { background-color: #ffffaa; }
100% { background-color: #fff; }
0% { background-color: #ffa; }
100% { background-color: #fff; }
}
@keyframes answer-highlight {
0% { background-color: #ffffaa; }
100% { background-color: #fff; }
0% { background-color: #ffa; }
100% { background-color: #fff; }
}

@-webkit-keyframes comment-highlight {
0% { background-color: #ffffaa; }
100% { background-color: #f4f4f4; }
0% { background-color: #ffa; }
100% { background-color: #f4f4f4; }
}
@keyframes comment-highlight {
0% { background-color: #ffffaa; }
100% { background-color: #f4f4f4; }
0% { background-color: #ffa; }
100% { background-color: #f4f4f4; }
}


Expand Down
2 changes: 1 addition & 1 deletion qa-theme/SnowFlat/qa-theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function nav_user_search()
public function nav_main_sub()
{
$this->output('<div class="qam-main-nav-wrapper clearfix">');
$this->output('<div class="sb-toggle-left qam-menu-toggle"><i class="icon-th-list"></i></div>');
$this->output('<div class="qam-menu-toggle"><i class="icon-th-list"></i></div>');
$this->nav_user_search();
$this->logo();
$this->nav('main');
Expand Down

0 comments on commit fa86105

Please sign in to comment.