Skip to content

Commit fa86105

Browse files
committed
Merge branch 'pr/917' into dev
2 parents d7a97da + 8f5d994 commit fa86105

File tree

9 files changed

+42
-86
lines changed

9 files changed

+42
-86
lines changed

qa-include/db/selects.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,10 @@ function qa_db_related_qs_selectspec($voteuserid, $questionid, $count = null)
828828
* a match in its answers, comments, or comments on answers). The 'matchparts' is a comma-separated list of tuples
829829
* matchtype:matchpostid:matchscore to be used with qa_search_set_max_match().
830830
* @param mixed $voteuserid
831-
* @param string $titlewords
832-
* @param string $contentwords
831+
* @param array $titlewords
832+
* @param array $contentwords
833833
* @param array $tagwords
834-
* @param string $handlewords
834+
* @param array $handlewords
835835
* @param string $handle
836836
* @param int $start
837837
* @param bool $full

qa-include/pages/account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

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

6161
$haspasswordold = isset($useraccount['passsalt']) && isset($useraccount['passcheck']);
6262
$haspassword = isset($useraccount['passhash']);

qa-include/plugins/qa-search-basic.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ public function index_post($postid, $type, $questionid, $parentid, $title, $cont
4646

4747
$contentwordidcounts = array();
4848
foreach ($contentcount as $word => $count) {
49-
if (isset($wordtoid[$word]))
49+
if (isset($wordtoid[$word])) {
5050
$contentwordidcounts[$wordtoid[$word]] = $count;
51+
}
5152
}
5253

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

114115
$words = qa_string_to_words($query);
115116

116-
$questions = qa_db_select_with_pending(
117+
$questions = qa_service('dbselect')->selectWithPending(
117118
qa_db_search_posts_selectspec($userid, $words, $words, $words, $words, trim($query), $start, $fullcontent, $count)
118119
);
119120

qa-include/plugins/qa-widget-activity-count.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function allow_template($template)
2828

2929
public function allow_region($region)
3030
{
31-
return ($region == 'side');
31+
return $region === 'side';
3232
}
3333

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

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

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

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

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

55-
if ($value == 1)
56+
if ($value == 1) {
5657
$themeobject->output(qa_lang_html_sub($langsingular, '<span class="qa-activity-count-data">1</span>', '1'));
57-
else
58+
} else {
5859
$themeobject->output(qa_lang_html_sub($langplural, '<span class="qa-activity-count-data">' . qa_format_number((int)$value, 0, true) . '</span>'));
60+
}
5961

6062
$themeobject->output('</p>');
6163
}

qa-include/plugins/qa-widget-category-list.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,18 @@
2121

2222
class qa_category_list
2323
{
24-
private $themeobject;
25-
2624
public function allow_template($template)
2725
{
2826
return true;
2927
}
3028

3129
public function allow_region($region)
3230
{
33-
return $region == 'side';
31+
return $region === 'side';
3432
}
3533

3634
public function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
3735
{
38-
$this->themeobject = $themeobject;
39-
4036
if (isset($qa_content['navigation']['cat'])) {
4137
$nav = $qa_content['navigation']['cat'];
4238
} else {
@@ -45,14 +41,14 @@ public function output_widget($region, $place, $themeobject, $template, $request
4541
'key' => 'qa_db_category_nav_selectspec:default:full',
4642
'ttl' => qa_opt('caching_catwidget_time'),
4743
);
48-
$navcategories = qa_db_single_select($selectspec);
44+
$navcategories = qa_service('dbselect')->singleSelect($selectspec);
4945
$nav = qa_category_navigation($navcategories);
5046
}
5147

52-
$this->themeobject->output('<h2>' . qa_lang_html('main/nav_categories') . '</h2>');
53-
$this->themeobject->set_context('nav_type', 'cat');
54-
$this->themeobject->nav_list($nav, 'nav-cat', 1);
55-
$this->themeobject->nav_clear('cat');
56-
$this->themeobject->clear_context('nav_type');
48+
$themeobject->output('<h2>' . qa_lang_html('main/nav_categories') . '</h2>');
49+
$themeobject->set_context('nav_type', 'cat');
50+
$themeobject->nav_list($nav, 'nav-cat', 1);
51+
$themeobject->nav_clear('cat');
52+
$themeobject->clear_context('nav_type');
5753
}
5854
}

qa-include/plugins/qa-widget-related-qs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function output_widget($region, $place, $themeobject, $template, $request
4343
$userid = qa_get_logged_in_userid();
4444
$cookieid = qa_cookie_get();
4545

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

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

qa-src/Database/DbSelect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function __construct(DbConnection $db)
8383

8484
/**
8585
* Return the data specified by a single $selectspec - see long comment above.
86-
* @param $selectspec
86+
* @param array $selectspec
8787
* @return array|mixed
8888
*/
8989
public function singleSelect(array $selectspec)

qa-theme/SnowFlat/qa-styles.css

Lines changed: 19 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
url("fonts/fontello.woff?7704297") format("woff"),
4848
url("fonts/fontello.ttf?7704297") format("truetype"),
4949
url("fonts/fontello.svg?7704297#fontello") format("svg");
50-
font-weight: normal;
51-
font-style: normal;
50+
font-weight: normal;
51+
font-style: normal;
5252
}
5353

5454
/*------[ base css ]------*/
@@ -213,7 +213,7 @@ pre code {
213213

214214
code, samp, kbd {
215215
color: #34495e;
216-
font-family: "Courier New",Courier,monospace,sans-serif;
216+
font-family: "Courier New", Courier, monospace, sans-serif;
217217
text-align: left;
218218
}
219219

@@ -1692,8 +1692,6 @@ li.qa-q-item-tag-item.qa-tag-favorited:before {
16921692
}
16931693

16941694

1695-
1696-
16971695
.qa-part-form-message .qam-pm-message {
16981696
padding: 10px;
16991697
background: #27ae60;
@@ -2162,14 +2160,10 @@ input[type="submit"], button {
21622160
}
21632161

21642162
.qa-form-light-button-answer {
2165-
background-color: #27ae60;
21662163
background-image: url('images/icons/answer-white.png');
21672164
float: left;
21682165
margin: 0 5px 0 0;
21692166
}
2170-
.qa-form-light-button-answer:hover, .qa-form-light-button-answer:focus {
2171-
background-color: #2ecc71;
2172-
}
21732167

21742168
.qa-form-light-button-comment {
21752169
background-image: url('images/icons/comment-white.png');
@@ -2397,9 +2391,9 @@ input[type="submit"], button {
23972391
min-height: 190px;
23982392
}
23992393
/* highlight selected answer */
2400-
.qa-a-list-item:target{
2401-
-webkit-animation: answer-highlight 2s ease-in-out;
2402-
animation: answer-highlight 2s ease-in-out;
2394+
.qa-a-list-item:target {
2395+
-webkit-animation: answer-highlight 2s ease-in-out;
2396+
animation: answer-highlight 2s ease-in-out;
24032397
}
24042398

24052399
.qa-a-item-avatar-meta {
@@ -2541,8 +2535,8 @@ input[type="submit"], button {
25412535
}
25422536
/* highlight selected comment */
25432537
.qa-c-list-item:target {
2544-
-webkit-animation: comment-highlight 2s ease-in-out;
2545-
animation: comment-highlight 2s ease-in-out;
2538+
-webkit-animation: comment-highlight 2s ease-in-out;
2539+
animation: comment-highlight 2s ease-in-out;
25462540
}
25472541

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

27742768
/*------[ sidebar ]------*/
2775-
#qam-overlay {
2776-
position: fixed;
2777-
top: 0;
2778-
right: 0;
2779-
bottom: 0;
2780-
left: 0;
2781-
background-color: rgba(0, 0, 0, 0.85);
2782-
z-index: 9;
2783-
box-shadow: 0 0 300px 50px rgba(0, 0, 0, 0.3) inset;
2784-
display: none;
2785-
}
2786-
27872769
#qam-sidepanel-toggle {
27882770
display: none;
27892771
}
@@ -2840,17 +2822,11 @@ input[type="submit"], button {
28402822
}
28412823
.qa-sidepanel.open {
28422824
right: 0 !important;
2843-
transition: all 0.15s ease;
28442825
box-shadow: -5px 0 15px 0 rgba(0, 0, 0, 0.5);
28452826
}
28462827
}
28472828

28482829

2849-
.stick {
2850-
top: 10px !important;
2851-
transition: all 0.15s ease;
2852-
}
2853-
28542830
.qa-sidepanel {
28552831
word-wrap: break-word;
28562832
}
@@ -2933,14 +2909,14 @@ input[type="submit"], button {
29332909
top: 5px;
29342910
left: 10px;
29352911
opacity: 0.2;
2912+
transition: all .2s ease-in-out;
29362913
}
29372914
.qa-activity-count-item:hover {
29382915
cursor: help;
29392916
}
29402917
.qa-activity-count-item:hover:before {
2941-
opacity: 1;
2942-
-webkit-animation: shake 0.25s;
2943-
animation: shake 0.25s;
2918+
opacity: .6;
2919+
transform: scale(1.2);
29442920
}
29452921
.qa-activity-count-item:nth-child(1) {
29462922
background: #1abc9c;
@@ -3325,41 +3301,22 @@ input[type="submit"], button {
33253301
}
33263302
}
33273303

3328-
@-webkit-keyframes shake {
3329-
0% { transform: scale(1); }
3330-
17% { transform: scale(1.5); }
3331-
34% { transform: scale(0.8); }
3332-
51% { transform: scale(1.1); }
3333-
68% { transform: scale(0.9); }
3334-
85% { transform: scale(1.05); }
3335-
100% { transform: scale(1); }
3336-
}
3337-
@keyframes shake {
3338-
0% { transform: scale(1); }
3339-
17% { transform: scale(1.5); }
3340-
34% { transform: scale(0.8); }
3341-
51% { transform: scale(1.1); }
3342-
68% { transform: scale(0.9); }
3343-
85% { transform: scale(1.05); }
3344-
100% { transform: scale(1); }
3345-
}
3346-
33473304
@-webkit-keyframes answer-highlight {
3348-
0% { background-color: #ffffaa; }
3349-
100% { background-color: #fff; }
3305+
0% { background-color: #ffa; }
3306+
100% { background-color: #fff; }
33503307
}
33513308
@keyframes answer-highlight {
3352-
0% { background-color: #ffffaa; }
3353-
100% { background-color: #fff; }
3309+
0% { background-color: #ffa; }
3310+
100% { background-color: #fff; }
33543311
}
33553312

33563313
@-webkit-keyframes comment-highlight {
3357-
0% { background-color: #ffffaa; }
3358-
100% { background-color: #f4f4f4; }
3314+
0% { background-color: #ffa; }
3315+
100% { background-color: #f4f4f4; }
33593316
}
33603317
@keyframes comment-highlight {
3361-
0% { background-color: #ffffaa; }
3362-
100% { background-color: #f4f4f4; }
3318+
0% { background-color: #ffa; }
3319+
100% { background-color: #f4f4f4; }
33633320
}
33643321

33653322

qa-theme/SnowFlat/qa-theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function nav_user_search()
196196
public function nav_main_sub()
197197
{
198198
$this->output('<div class="qam-main-nav-wrapper clearfix">');
199-
$this->output('<div class="sb-toggle-left qam-menu-toggle"><i class="icon-th-list"></i></div>');
199+
$this->output('<div class="qam-menu-toggle"><i class="icon-th-list"></i></div>');
200200
$this->nav_user_search();
201201
$this->logo();
202202
$this->nav('main');

0 commit comments

Comments
 (0)