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
349d03ab
Commit
349d03ab
authored
Jun 17, 2015
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more minor formatting changes
parent
de40daa8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
28 deletions
+33
-28
qa-editor-basic.php
qa-include/plugins/qa-editor-basic.php
+4
-4
qa-event-limits.php
qa-include/plugins/qa-event-limits.php
+2
-2
qa-widget-related-qs.php
qa-include/plugins/qa-widget-related-qs.php
+27
-22
No files found.
qa-include/plugins/qa-editor-basic.php
View file @
349d03ab
...
...
@@ -28,10 +28,10 @@ class qa_editor_basic
public
function
calc_quality
(
$content
,
$format
)
{
if
(
$format
==
''
)
if
(
$format
==
''
)
return
1.0
;
if
(
$format
==
'html'
)
if
(
$format
==
'html'
)
return
0.2
;
return
0
;
...
...
@@ -41,7 +41,7 @@ class qa_editor_basic
{
return
array
(
'type'
=>
'textarea'
,
'tags'
=>
'name="'
.
$fieldname
.
'" id="'
.
$fieldname
.
'"'
,
'tags'
=>
'name="'
.
$fieldname
.
'" id="'
.
$fieldname
.
'"'
,
'value'
=>
qa_html
(
$content
),
'rows'
=>
$rows
,
);
...
...
@@ -49,7 +49,7 @@ class qa_editor_basic
public
function
focus_script
(
$fieldname
)
{
return
"document.getElementById('"
.
$fieldname
.
"').focus();"
;
return
"document.getElementById('"
.
$fieldname
.
"').focus();"
;
}
public
function
read_post
(
$fieldname
)
...
...
qa-include/plugins/qa-event-limits.php
View file @
349d03ab
...
...
@@ -89,12 +89,12 @@ class qa_event_limits
is_numeric
(
array_search
(
$event
,
$writeactions
))
)
{
if
(
isset
(
$userid
))
{
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
qa_user_report_action
(
$userid
,
$event
);
}
elseif
(
isset
(
$cookieid
))
{
require_once
QA_INCLUDE_DIR
.
'app/cookies.php'
;
require_once
QA_INCLUDE_DIR
.
'app/cookies.php'
;
qa_cookie_report_action
(
$cookieid
,
$event
);
}
...
...
qa-include/plugins/qa-widget-related-qs.php
View file @
349d03ab
...
...
@@ -24,37 +24,38 @@ class qa_related_qs
{
public
function
allow_template
(
$template
)
{
return
(
$template
==
'question'
)
;
return
$template
==
'question'
;
}
public
function
allow_region
(
$region
)
{
return
(
$region
==
'side'
)
||
(
$region
==
'main'
)
||
(
$region
==
'full'
);
return
in_array
(
$region
,
array
(
'side'
,
'main'
,
'full'
)
);
}
public
function
output_widget
(
$region
,
$place
,
$themeobject
,
$template
,
$request
,
$qa_content
)
{
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
if
(
@
$qa_content
[
'q_view'
][
'raw'
][
'type'
]
!=
'Q'
)
// question might not be visible, etc...
if
(
!
isset
(
$qa_content
[
'q_view'
][
'raw'
][
'type'
])
||
$qa_content
[
'q_view'
][
'raw'
][
'type'
]
!=
'Q'
)
// question might not be visible, etc...
return
;
$questionid
=
$qa_content
[
'q_view'
][
'raw'
][
'postid'
];
$questionid
=
$qa_content
[
'q_view'
][
'raw'
][
'postid'
];
$userid
=
qa_get_logged_in_userid
();
$cookieid
=
qa_cookie_get
();
$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_db_single_select
(
qa_db_related_qs_selectspec
(
$userid
,
$questionid
,
qa_opt
(
'page_size_related_qs'
)));
$minscore
=
qa_match_to_min_score
(
qa_opt
(
'match_related_qs'
));
$minscore
=
qa_match_to_min_score
(
qa_opt
(
'match_related_qs'
));
foreach
(
$questions
as
$key
=>
$question
)
if
(
$question
[
'score'
]
<
$minscore
)
foreach
(
$questions
as
$key
=>
$question
)
{
if
(
$question
[
'score'
]
<
$minscore
)
unset
(
$questions
[
$key
]);
}
$titlehtml
=
qa_lang_html
(
count
(
$questions
)
?
'main/related_qs_title'
:
'main/no_related_qs_title'
);
$titlehtml
=
qa_lang_html
(
count
(
$questions
)
?
'main/related_qs_title'
:
'main/no_related_qs_title'
);
if
(
$region
==
'side'
)
{
if
(
$region
==
'side'
)
{
$themeobject
->
output
(
'<div class="qa-related-qs">'
,
'<h2 style="margin-top:0; padding-top:0;">'
,
...
...
@@ -64,14 +65,20 @@ class qa_related_qs
$themeobject
->
output
(
'<ul class="qa-related-q-list">'
);
foreach
(
$questions
as
$question
)
$themeobject
->
output
(
'<li class="qa-related-q-item"><a href="'
.
qa_q_path_html
(
$question
[
'postid'
],
$question
[
'title'
])
.
'">'
.
qa_html
(
$question
[
'title'
])
.
'</a></li>'
);
foreach
(
$questions
as
$question
)
{
$themeobject
->
output
(
'<li class="qa-related-q-item">'
.
'<a href="'
.
qa_q_path_html
(
$question
[
'postid'
],
$question
[
'title'
])
.
'">'
.
qa_html
(
$question
[
'title'
])
.
'</a>'
.
'</li>'
);
}
$themeobject
->
output
(
'</ul>'
,
'</div>'
);
}
else
{
$themeobject
->
output
(
'<h2>'
,
...
...
@@ -79,23 +86,21 @@ class qa_related_qs
'</h2>'
);
$q_list
=
array
(
$q_list
=
array
(
'form'
=>
array
(
'tags'
=>
'method="post" action="'
.
qa_self_html
()
.
'"'
,
'tags'
=>
'method="post" action="'
.
qa_self_html
()
.
'"'
,
'hidden'
=>
array
(
'code'
=>
qa_get_form_security_code
(
'vote'
),
),
),
'qs'
=>
array
(),
);
$defaults
=
qa_post_html_defaults
(
'Q'
);
$usershtml
=
qa_userids_handles_html
(
$questions
);
$defaults
=
qa_post_html_defaults
(
'Q'
);
$usershtml
=
qa_userids_handles_html
(
$questions
);
foreach
(
$questions
as
$question
)
$q_list
[
'qs'
][]
=
qa_post_html_fields
(
$question
,
$userid
,
$cookieid
,
$usershtml
,
null
,
qa_post_html_options
(
$question
,
$defaults
));
$q_list
[
'qs'
][]
=
qa_post_html_fields
(
$question
,
$userid
,
$cookieid
,
$usershtml
,
null
,
qa_post_html_options
(
$question
,
$defaults
));
$themeobject
->
q_list_and_form
(
$q_list
);
}
...
...
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