Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
b9ccbef6
Commit
b9ccbef6
authored
Oct 06, 2017
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix count() notices on PHP 7.2
Fixes #540
parent
84943773
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
page.php
qa-include/app/page.php
+5
-3
hot.php
qa-include/pages/hot.php
+1
-1
unanswered.php
qa-include/pages/unanswered.php
+1
-1
qa-theme-base.php
qa-include/qa-theme-base.php
+7
-4
No files found.
qa-include/app/page.php
View file @
b9ccbef6
...
...
@@ -464,7 +464,7 @@ function qa_set_template($template)
* @param array $categoryids
* @return array
*/
function
qa_content_prepare
(
$voting
=
false
,
$categoryids
=
null
)
function
qa_content_prepare
(
$voting
=
false
,
$categoryids
=
array
()
)
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
...
...
@@ -480,10 +480,12 @@ function qa_content_prepare($voting = false, $categoryids = null)
$navpages
=
qa_db_get_pending_result
(
'navpages'
);
$widgets
=
qa_db_get_pending_result
(
'widgets'
);
if
(
isset
(
$categoryids
)
&&
!
is_array
(
$categoryids
))
// accept old-style parameter
if
(
!
is_array
(
$categoryids
))
{
// accept old-style parameter
$categoryids
=
array
(
$categoryids
);
}
$lastcategoryid
=
count
(
$categoryids
)
?
end
(
$categoryids
)
:
null
;
$lastcategoryid
=
count
(
$categoryids
)
>
0
?
end
(
$categoryids
)
:
null
;
$charset
=
'utf-8'
;
$language
=
qa_opt
(
'site_language'
);
$language
=
empty
(
$language
)
?
'en'
:
qa_html
(
$language
);
...
...
qa-include/pages/hot.php
View file @
b9ccbef6
...
...
@@ -65,7 +65,7 @@ return qa_q_list_page_content(
$countslugs
?
$categories
[
$categoryid
][
'qcount'
]
:
qa_opt
(
'cache_qcount'
),
// total count
$sometitle
,
// title if some questions
$nonetitle
,
// title if no questions
QA_ALLOW_UNINDEXED_QUERIES
?
$categories
:
null
,
// categories for navigation
QA_ALLOW_UNINDEXED_QUERIES
?
$categories
:
array
()
,
// categories for navigation
$categoryid
,
// selected category id
true
,
// show question counts in category navigation
QA_ALLOW_UNINDEXED_QUERIES
?
'hot/'
:
null
,
// prefix for links in category navigation (null if no navigation)
...
...
qa-include/pages/unanswered.php
View file @
b9ccbef6
...
...
@@ -122,7 +122,7 @@ $qa_content = qa_q_list_page_content(
@
$count
,
// total count
$sometitle
,
// title if some questions
$nonetitle
,
// title if no questions
QA_ALLOW_UNINDEXED_QUERIES
?
$categories
:
null
,
// categories for navigation (null if not shown on this page)
QA_ALLOW_UNINDEXED_QUERIES
?
$categories
:
array
()
,
// categories for navigation (null if not shown on this page)
QA_ALLOW_UNINDEXED_QUERIES
?
$categoryid
:
null
,
// selected category id (null if not relevant)
false
,
// show question counts in category navigation
QA_ALLOW_UNINDEXED_QUERIES
?
'unanswered/'
:
null
,
// prefix for links in category navigation (null if no navigation)
...
...
qa-include/qa-theme-base.php
View file @
b9ccbef6
...
...
@@ -208,10 +208,11 @@ class qa_html_theme_base
*/
public
function
widgets
(
$region
,
$place
)
{
if
(
count
(
@
$this
->
content
[
'widgets'
][
$region
][
$place
]))
{
$widgetsHere
=
isset
(
$this
->
content
[
'widgets'
][
$region
][
$place
])
?
$this
->
content
[
'widgets'
][
$region
][
$place
]
:
array
();
if
(
is_array
(
$widgetsHere
)
&&
count
(
$widgetsHere
)
>
0
)
{
$this
->
output
(
'<div class="qa-widgets-'
.
$region
.
' qa-widgets-'
.
$region
.
'-'
.
$place
.
'">'
);
foreach
(
$
this
->
content
[
'widgets'
][
$region
][
$place
]
as
$module
)
{
foreach
(
$
widgetsHere
as
$module
)
{
$this
->
output
(
'<div class="qa-widget-'
.
$region
.
' qa-widget-'
.
$region
.
'-'
.
$place
.
'">'
);
$module
->
output_widget
(
$region
,
$place
,
$this
,
$this
->
template
,
$this
->
request
,
$this
->
content
);
$this
->
output
(
'</div>'
);
...
...
@@ -629,8 +630,10 @@ class qa_html_theme_base
(
@
$navlink
[
'state'
]
?
(
' qa-'
.
$class
.
'-'
.
$navlink
[
'state'
])
:
''
)
.
' qa-'
.
$class
.
'-'
.
$suffix
.
'">'
);
$this
->
nav_link
(
$navlink
,
$class
);
if
(
count
(
@
$navlink
[
'subnav'
]))
$this
->
nav_list
(
$navlink
[
'subnav'
],
$class
,
1
+
$level
);
$subnav
=
isset
(
$navlink
[
'subnav'
])
?
$navlink
[
'subnav'
]
:
array
();
if
(
is_array
(
$subnav
)
&&
count
(
$subnav
)
>
0
)
{
$this
->
nav_list
(
$subnav
,
$class
,
1
+
$level
);
}
$this
->
output
(
'</li>'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment