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
584e4c9e
Commit
584e4c9e
authored
Mar 18, 2014
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link title on question page; add [closed] indicator
parent
e9f0c3a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
11 deletions
+38
-11
qa-app-q-list.php
qa-include/qa-app-q-list.php
+18
-9
qa-page-question-view.php
qa-include/qa-page-question-view.php
+2
-0
qa-theme-base.php
qa-include/qa-theme-base.php
+18
-2
No files found.
qa-include/qa-app-q-list.php
View file @
584e4c9e
...
...
@@ -75,21 +75,30 @@
),
);
$qa_content
[
'q_list'
][
'qs'
]
=
array
();
$qa_content
[
'q_list'
][
'qs'
]
=
array
();
if
(
count
(
$questions
))
{
$qa_content
[
'title'
]
=
$sometitle
;
$qa_content
[
'title'
]
=
$sometitle
;
$defaults
=
qa_post_html_defaults
(
'Q'
);
$defaults
=
qa_post_html_defaults
(
'Q'
);
if
(
isset
(
$categorypathprefix
))
$defaults
[
'categorypathprefix'
]
=
$categorypathprefix
;
$defaults
[
'categorypathprefix'
]
=
$categorypathprefix
;
foreach
(
$questions
as
$question
)
$qa_content
[
'q_list'
][
'qs'
][]
=
qa_any_to_q_html_fields
(
$question
,
$userid
,
qa_cookie_get
(),
$usershtml
,
null
,
qa_post_html_options
(
$question
,
$defaults
));
foreach
(
$questions
as
$question
)
{
$fields
=
qa_any_to_q_html_fields
(
$question
,
$userid
,
qa_cookie_get
(),
$usershtml
,
null
,
qa_post_html_options
(
$question
,
$defaults
));
}
else
$qa_content
[
'title'
]
=
$nonetitle
;
if
(
!
empty
(
$fields
[
'raw'
][
'closedbyid'
]))
{
$fields
[
'closed'
]
=
array
(
'state'
=>
qa_lang_html
(
'main/closed'
),
);
}
$qa_content
[
'q_list'
][
'qs'
][]
=
$fields
;
}
}
else
$qa_content
[
'title'
]
=
$nonetitle
;
if
(
isset
(
$userid
)
&&
isset
(
$categoryid
))
{
$favoritemap
=
qa_get_favorite_non_qs_map
();
...
...
qa-include/qa-page-question-view.php
View file @
584e4c9e
...
...
@@ -369,6 +369,7 @@
if
(
$closepost
[
'basetype'
]
==
'Q'
)
{
$q_view
[
'closed'
]
=
array
(
'state'
=>
qa_lang_html
(
'main/closed'
),
'label'
=>
qa_lang_html
(
'question/closed_as_duplicate'
),
'content'
=>
qa_html
(
qa_block_words_replace
(
$closepost
[
'title'
],
qa_get_block_words_preg
())),
'url'
=>
qa_q_path_html
(
$closepost
[
'postid'
],
$closepost
[
'title'
]),
...
...
@@ -378,6 +379,7 @@
$viewer
=
qa_load_viewer
(
$closepost
[
'content'
],
$closepost
[
'format'
]);
$q_view
[
'closed'
]
=
array
(
'state'
=>
qa_lang_html
(
'main/closed'
),
'label'
=>
qa_lang_html
(
'question/closed_with_note'
),
'content'
=>
$viewer
->
get_html
(
$closepost
[
'content'
],
$closepost
[
'format'
],
array
(
'blockwordspreg'
=>
qa_get_block_words_preg
(),
...
...
qa-include/qa-theme-base.php
View file @
584e4c9e
...
...
@@ -693,8 +693,22 @@
public
function
title
()
{
if
(
isset
(
$this
->
content
[
'title'
]))
$this
->
output
(
$this
->
content
[
'title'
]);
$q_view
=
@
$this
->
content
[
'q_view'
];
// link title where appropriate
$url
=
isset
(
$q_view
[
'url'
])
?
$q_view
[
'url'
]
:
false
;
if
(
isset
(
$this
->
content
[
'title'
]))
{
$this
->
output
(
$url
?
'<a href="'
.
$url
.
'">'
:
''
,
$this
->
content
[
'title'
],
$url
?
'</a>'
:
''
);
}
// add closed note in title
if
(
!
empty
(
$q_view
[
'closed'
]))
$this
->
output
(
' ['
.
$q_view
[
'closed'
][
'state'
]
.
']'
);
}
public
function
favorite_inner_html
(
$favorite
)
...
...
@@ -1478,6 +1492,8 @@
$this
->
output
(
'<div class="qa-q-item-title">'
,
'<a href="'
.
$q_item
[
'url'
]
.
'">'
.
$q_item
[
'title'
]
.
'</a>'
,
// add closed note in title
empty
(
$q_item
[
'closed'
])
?
''
:
' ['
.
$q_item
[
'closed'
][
'state'
]
.
']'
,
'</div>'
);
}
...
...
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