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
912cabc4
Commit
912cabc4
authored
Jul 25, 2017
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add options for comment voting
parent
6a36c080
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
7 deletions
+31
-7
options.php
qa-include/app/options.php
+11
-2
points.php
qa-include/db/points.php
+1
-0
qa-lang-options.php
qa-include/lang/qa-lang-options.php
+5
-0
qa-lang-profile.php
qa-include/lang/qa-lang-profile.php
+1
-0
admin-default.php
qa-include/pages/admin/admin-default.php
+6
-3
admin-points.php
qa-include/pages/admin/admin-points.php
+7
-2
No files found.
qa-include/app/options.php
View file @
912cabc4
...
@@ -345,13 +345,18 @@ function qa_default_option($name)
...
@@ -345,13 +345,18 @@ function qa_default_option($name)
'permit_view_special_users_page'
=>
QA_PERMIT_MODERATORS
,
'permit_view_special_users_page'
=>
QA_PERMIT_MODERATORS
,
'permit_view_voters_flaggers'
=>
QA_PERMIT_ADMINS
,
'permit_view_voters_flaggers'
=>
QA_PERMIT_ADMINS
,
'permit_vote_a'
=>
QA_PERMIT_USERS
,
'permit_vote_a'
=>
QA_PERMIT_USERS
,
'permit_vote_c'
=>
QA_PERMIT_USERS
,
'permit_vote_down'
=>
QA_PERMIT_USERS
,
'permit_vote_down'
=>
QA_PERMIT_USERS
,
'permit_vote_q'
=>
QA_PERMIT_USERS
,
'permit_vote_q'
=>
QA_PERMIT_USERS
,
'points_a_selected'
=>
30
,
'points_a_selected'
=>
30
,
'points_a_voted_max_gain'
=>
20
,
'points_a_voted_max_gain'
=>
20
,
'points_a_voted_max_loss'
=>
5
,
'points_a_voted_max_loss'
=>
5
,
'points_base'
=>
100
,
'points_base'
=>
100
,
'points_c_voted_max_gain'
=>
10
,
'points_c_voted_max_loss'
=>
3
,
'points_multiple'
=>
10
,
'points_multiple'
=>
10
,
'points_per_c_voted_down'
=>
0
,
'points_per_c_voted_up'
=>
0
,
'points_post_a'
=>
4
,
'points_post_a'
=>
4
,
'points_post_q'
=>
2
,
'points_post_q'
=>
2
,
'points_q_voted_max_gain'
=>
10
,
'points_q_voted_max_gain'
=>
10
,
...
@@ -381,6 +386,7 @@ function qa_default_option($name)
...
@@ -381,6 +386,7 @@ function qa_default_option($name)
'tags_or_categories'
=>
'tc'
,
'tags_or_categories'
=>
'tc'
,
'use_microdata'
=>
1
,
'use_microdata'
=>
1
,
'voting_on_as'
=>
1
,
'voting_on_as'
=>
1
,
'voting_on_cs'
=>
0
,
'voting_on_qs'
=>
1
,
'voting_on_qs'
=>
1
,
);
);
...
@@ -795,7 +801,10 @@ function qa_get_permit_options()
...
@@ -795,7 +801,10 @@ function qa_get_permit_options()
if
(
qa_opt
(
'voting_on_as'
))
if
(
qa_opt
(
'voting_on_as'
))
$permits
[]
=
'permit_vote_a'
;
$permits
[]
=
'permit_vote_a'
;
if
(
qa_opt
(
'voting_on_qs'
)
||
qa_opt
(
'voting_on_as'
))
if
(
qa_opt
(
'voting_on_cs'
))
$permits
[]
=
'permit_vote_c'
;
if
(
qa_opt
(
'voting_on_qs'
)
||
qa_opt
(
'voting_on_as'
)
||
qa_opt
(
'voting_on_cs'
))
$permits
[]
=
'permit_vote_down'
;
$permits
[]
=
'permit_vote_down'
;
if
(
qa_using_tags
()
||
qa_using_categories
())
if
(
qa_using_tags
()
||
qa_using_categories
())
...
@@ -813,7 +822,7 @@ function qa_get_permit_options()
...
@@ -813,7 +822,7 @@ function qa_get_permit_options()
array_push
(
$permits
,
'permit_select_a'
,
'permit_anon_view_ips'
);
array_push
(
$permits
,
'permit_select_a'
,
'permit_anon_view_ips'
);
if
(
qa_opt
(
'voting_on_qs'
)
||
qa_opt
(
'voting_on_as'
)
||
qa_opt
(
'flagging_of_posts'
))
if
(
qa_opt
(
'voting_on_qs'
)
||
qa_opt
(
'voting_on_as'
)
||
qa_opt
(
'
voting_on_cs'
)
||
qa_opt
(
'
flagging_of_posts'
))
$permits
[]
=
'permit_view_voters_flaggers'
;
$permits
[]
=
'permit_view_voters_flaggers'
;
if
(
qa_opt
(
'flagging_of_posts'
))
if
(
qa_opt
(
'flagging_of_posts'
))
...
...
qa-include/db/points.php
View file @
912cabc4
...
@@ -36,6 +36,7 @@ function qa_db_points_option_names()
...
@@ -36,6 +36,7 @@ function qa_db_points_option_names()
return
array
(
return
array
(
'points_post_q'
,
'points_select_a'
,
'points_per_q_voted_up'
,
'points_per_q_voted_down'
,
'points_q_voted_max_gain'
,
'points_q_voted_max_loss'
,
'points_post_q'
,
'points_select_a'
,
'points_per_q_voted_up'
,
'points_per_q_voted_down'
,
'points_q_voted_max_gain'
,
'points_q_voted_max_loss'
,
'points_post_a'
,
'points_a_selected'
,
'points_per_a_voted_up'
,
'points_per_a_voted_down'
,
'points_a_voted_max_gain'
,
'points_a_voted_max_loss'
,
'points_post_a'
,
'points_a_selected'
,
'points_per_a_voted_up'
,
'points_per_a_voted_down'
,
'points_a_voted_max_gain'
,
'points_a_voted_max_loss'
,
'points_per_c_voted_up'
,
'points_per_c_voted_down'
,
'points_c_voted_max_gain'
,
'points_c_voted_max_loss'
,
'points_vote_up_q'
,
'points_vote_down_q'
,
'points_vote_up_a'
,
'points_vote_down_a'
,
'points_vote_up_q'
,
'points_vote_down_q'
,
'points_vote_up_a'
,
'points_vote_down_a'
,
'points_multiple'
,
'points_base'
,
'points_multiple'
,
'points_base'
,
...
...
qa-include/lang/qa-lang-options.php
View file @
912cabc4
...
@@ -219,9 +219,13 @@ return array(
...
@@ -219,9 +219,13 @@ return array(
'points_a_voted_max_gain'
=>
'Limit from up votes on each answer:'
,
'points_a_voted_max_gain'
=>
'Limit from up votes on each answer:'
,
'points_a_voted_max_loss'
=>
'Limit from down votes on each answer:'
,
'points_a_voted_max_loss'
=>
'Limit from down votes on each answer:'
,
'points_base'
=>
'Add for all users:'
,
'points_base'
=>
'Add for all users:'
,
'points_c_voted_max_gain'
=>
'Limit from up votes on each comment:'
,
'points_c_voted_max_loss'
=>
'Limit from down votes on each comment:'
,
'points_multiple'
=>
'Multiply all points:'
,
'points_multiple'
=>
'Multiply all points:'
,
'points_per_a_voted_down'
=>
'Per down vote on your answer:'
,
'points_per_a_voted_down'
=>
'Per down vote on your answer:'
,
'points_per_a_voted_up'
=>
'Per up vote on your answer:'
,
'points_per_a_voted_up'
=>
'Per up vote on your answer:'
,
'points_per_c_voted_down'
=>
'Per down vote on your comment:'
,
'points_per_c_voted_up'
=>
'Per up vote on your comment:'
,
'points_per_q_voted_down'
=>
'Per down vote on your question:'
,
'points_per_q_voted_down'
=>
'Per down vote on your question:'
,
'points_per_q_voted_up'
=>
'Per up vote on your question:'
,
'points_per_q_voted_up'
=>
'Per up vote on your question:'
,
'points_post_a'
=>
'Posting an answer:'
,
'points_post_a'
=>
'Posting an answer:'
,
...
@@ -296,6 +300,7 @@ return array(
...
@@ -296,6 +300,7 @@ return array(
'use_microdata'
=>
'Use schema.org microdata:'
,
'use_microdata'
=>
'Use schema.org microdata:'
,
'votes_separated'
=>
'Show separate up and down votes:'
,
'votes_separated'
=>
'Show separate up and down votes:'
,
'voting_on_as'
=>
'Allow voting on answers:'
,
'voting_on_as'
=>
'Allow voting on answers:'
,
'voting_on_cs'
=>
'Allow voting on comments:'
,
'voting_on_q_page_only'
=>
'Allow voting on question page only:'
,
'voting_on_q_page_only'
=>
'Allow voting on question page only:'
,
'voting_on_qs'
=>
'Allow voting on questions:'
,
'voting_on_qs'
=>
'Allow voting on questions:'
,
);
);
qa-include/lang/qa-lang-profile.php
View file @
912cabc4
...
@@ -60,6 +60,7 @@ return array(
...
@@ -60,6 +60,7 @@ return array(
'permit_view_special_users_page'
=>
'Viewing the special users page'
,
'permit_view_special_users_page'
=>
'Viewing the special users page'
,
'permit_view_voters_flaggers'
=>
'Viewing who voted or flagged posts'
,
'permit_view_voters_flaggers'
=>
'Viewing who voted or flagged posts'
,
'permit_vote_a'
=>
'Voting on answers'
,
'permit_vote_a'
=>
'Voting on answers'
,
'permit_vote_c'
=>
'Voting on comments'
,
'permit_vote_down'
=>
'Voting posts down'
,
'permit_vote_down'
=>
'Voting posts down'
,
'permit_vote_q'
=>
'Voting on questions'
,
'permit_vote_q'
=>
'Voting on questions'
,
'post_wall_blocked'
=>
'This user has disallowed new posts on their wall'
,
'post_wall_blocked'
=>
'This user has disallowed new posts on their wall'
,
...
...
qa-include/pages/admin/admin-default.php
View file @
912cabc4
...
@@ -231,6 +231,7 @@ $optiontype = array(
...
@@ -231,6 +231,7 @@ $optiontype = array(
'minify_html'
=>
'checkbox'
,
'minify_html'
=>
'checkbox'
,
'votes_separated'
=>
'checkbox'
,
'votes_separated'
=>
'checkbox'
,
'voting_on_as'
=>
'checkbox'
,
'voting_on_as'
=>
'checkbox'
,
'voting_on_cs'
=>
'checkbox'
,
'voting_on_q_page_only'
=>
'checkbox'
,
'voting_on_q_page_only'
=>
'checkbox'
,
'voting_on_qs'
=>
'checkbox'
,
'voting_on_qs'
=>
'checkbox'
,
...
@@ -389,7 +390,7 @@ switch ($adminsection) {
...
@@ -389,7 +390,7 @@ switch ($adminsection) {
$subtitle
=
'admin/viewing_title'
;
$subtitle
=
'admin/viewing_title'
;
$showoptions
=
array
(
$showoptions
=
array
(
'q_urls_title_length'
,
'q_urls_remove_accents'
,
'do_count_q_views'
,
'show_view_counts'
,
'show_view_count_q_page'
,
''
,
'q_urls_title_length'
,
'q_urls_remove_accents'
,
'do_count_q_views'
,
'show_view_counts'
,
'show_view_count_q_page'
,
''
,
'voting_on_qs'
,
'voting_on_q_page_only'
,
'voting_on_as'
,
'votes_separated'
,
''
,
'voting_on_qs'
,
'voting_on_q_page_only'
,
'voting_on_as'
,
'vot
ing_on_cs'
,
'vot
es_separated'
,
''
,
'show_url_links'
,
'links_in_new_window'
,
'show_when_created'
,
'show_full_date_days'
'show_url_links'
,
'links_in_new_window'
,
'show_when_created'
,
'show_full_date_days'
);
);
...
@@ -613,7 +614,7 @@ switch ($adminsection) {
...
@@ -613,7 +614,7 @@ switch ($adminsection) {
$showoptions
[]
=
''
;
$showoptions
[]
=
''
;
if
(
qa_opt
(
'voting_on_qs'
)
||
qa_opt
(
'voting_on_as'
))
if
(
qa_opt
(
'voting_on_qs'
)
||
qa_opt
(
'voting_on_as'
)
||
qa_opt
(
'voting_on_cs'
)
)
array_push
(
$showoptions
,
'max_rate_ip_votes'
,
'max_rate_user_votes'
);
array_push
(
$showoptions
,
'max_rate_ip_votes'
,
'max_rate_user_votes'
);
array_push
(
$showoptions
,
'max_rate_ip_flags'
,
'max_rate_user_flags'
,
'max_rate_ip_uploads'
,
'max_rate_user_uploads'
);
array_push
(
$showoptions
,
'max_rate_ip_flags'
,
'max_rate_user_flags'
,
'max_rate_ip_uploads'
,
'max_rate_user_uploads'
);
...
@@ -1352,6 +1353,7 @@ foreach ($showoptions as $optionname) {
...
@@ -1352,6 +1353,7 @@ foreach ($showoptions as $optionname) {
case
'permit_post_c'
:
case
'permit_post_c'
:
case
'permit_vote_q'
:
case
'permit_vote_q'
:
case
'permit_vote_a'
:
case
'permit_vote_a'
:
case
'permit_vote_c'
:
case
'permit_vote_down'
:
case
'permit_vote_down'
:
case
'permit_edit_q'
:
case
'permit_edit_q'
:
case
'permit_retag_cat'
:
case
'permit_retag_cat'
:
...
@@ -1395,7 +1397,7 @@ foreach ($showoptions as $optionname) {
...
@@ -1395,7 +1397,7 @@ foreach ($showoptions as $optionname) {
$narrowest
=
QA_PERMIT_MODERATORS
;
$narrowest
=
QA_PERMIT_MODERATORS
;
elseif
(
$optionname
==
'permit_post_c'
||
$optionname
==
'permit_edit_q'
||
$optionname
==
'permit_retag_cat'
||
$optionname
==
'permit_edit_a'
||
$optionname
==
'permit_flag'
)
elseif
(
$optionname
==
'permit_post_c'
||
$optionname
==
'permit_edit_q'
||
$optionname
==
'permit_retag_cat'
||
$optionname
==
'permit_edit_a'
||
$optionname
==
'permit_flag'
)
$narrowest
=
QA_PERMIT_EDITORS
;
$narrowest
=
QA_PERMIT_EDITORS
;
elseif
(
$optionname
==
'permit_vote_q'
||
$optionname
==
'permit_vote_a'
||
$optionname
==
'permit_post_wall'
)
elseif
(
$optionname
==
'permit_vote_q'
||
$optionname
==
'permit_vote_a'
||
$optionname
==
'permit_
vote_c'
||
$optionname
==
'permit_
post_wall'
)
$narrowest
=
QA_PERMIT_APPROVED_POINTS
;
$narrowest
=
QA_PERMIT_APPROVED_POINTS
;
elseif
(
$optionname
==
'permit_delete_hidden'
||
$optionname
==
'permit_edit_silent'
)
elseif
(
$optionname
==
'permit_delete_hidden'
||
$optionname
==
'permit_edit_silent'
)
$narrowest
=
QA_PERMIT_ADMINS
;
$narrowest
=
QA_PERMIT_ADMINS
;
...
@@ -1420,6 +1422,7 @@ foreach ($showoptions as $optionname) {
...
@@ -1420,6 +1422,7 @@ foreach ($showoptions as $optionname) {
case
'permit_post_c_points'
:
case
'permit_post_c_points'
:
case
'permit_vote_q_points'
:
case
'permit_vote_q_points'
:
case
'permit_vote_a_points'
:
case
'permit_vote_a_points'
:
case
'permit_vote_c_points'
:
case
'permit_vote_down_points'
:
case
'permit_vote_down_points'
:
case
'permit_flag_points'
:
case
'permit_flag_points'
:
case
'permit_edit_q_points'
:
case
'permit_edit_q_points'
:
...
...
qa-include/pages/admin/admin-points.php
View file @
912cabc4
...
@@ -145,15 +145,19 @@ foreach ($optionnames as $optionname) {
...
@@ -145,15 +145,19 @@ foreach ($optionnames as $optionname) {
case
'points_per_q_voted_up'
:
case
'points_per_q_voted_up'
:
case
'points_per_a_voted_up'
:
case
'points_per_a_voted_up'
:
case
'points_per_c_voted_up'
:
case
'points_q_voted_max_gain'
:
case
'points_q_voted_max_gain'
:
case
'points_a_voted_max_gain'
:
case
'points_a_voted_max_gain'
:
case
'points_c_voted_max_gain'
:
$prefix
=
'+'
;
$prefix
=
'+'
;
break
;
break
;
case
'points_per_q_voted_down'
:
case
'points_per_q_voted_down'
:
case
'points_per_a_voted_down'
:
case
'points_per_a_voted_down'
:
case
'points_per_c_voted_down'
:
case
'points_q_voted_max_loss'
:
case
'points_q_voted_max_loss'
:
case
'points_a_voted_max_loss'
:
case
'points_a_voted_max_loss'
:
case
'points_c_voted_max_loss'
:
$prefix
=
'–'
;
$prefix
=
'–'
;
break
;
break
;
...
@@ -172,8 +176,9 @@ foreach ($optionnames as $optionname) {
...
@@ -172,8 +176,9 @@ foreach ($optionnames as $optionname) {
}
}
qa_array_insert
(
$qa_content
[
'form'
][
'fields'
],
'points_post_a'
,
array
(
'blank0'
=>
array
(
'type'
=>
'blank'
)));
qa_array_insert
(
$qa_content
[
'form'
][
'fields'
],
'points_post_a'
,
array
(
'blank0'
=>
array
(
'type'
=>
'blank'
)));
qa_array_insert
(
$qa_content
[
'form'
][
'fields'
],
'points_vote_up_q'
,
array
(
'blank1'
=>
array
(
'type'
=>
'blank'
)));
qa_array_insert
(
$qa_content
[
'form'
][
'fields'
],
'points_per_c_voted_up'
,
array
(
'blank1'
=>
array
(
'type'
=>
'blank'
)));
qa_array_insert
(
$qa_content
[
'form'
][
'fields'
],
'points_multiple'
,
array
(
'blank2'
=>
array
(
'type'
=>
'blank'
)));
qa_array_insert
(
$qa_content
[
'form'
][
'fields'
],
'points_vote_up_q'
,
array
(
'blank2'
=>
array
(
'type'
=>
'blank'
)));
qa_array_insert
(
$qa_content
[
'form'
][
'fields'
],
'points_multiple'
,
array
(
'blank3'
=>
array
(
'type'
=>
'blank'
)));
$qa_content
[
'navigation'
][
'sub'
]
=
qa_admin_sub_navigation
();
$qa_content
[
'navigation'
][
'sub'
]
=
qa_admin_sub_navigation
();
...
...
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