Commit 912cabc4 by Scott

Add options for comment voting

parent 6a36c080
......@@ -345,13 +345,18 @@ function qa_default_option($name)
'permit_view_special_users_page' => QA_PERMIT_MODERATORS,
'permit_view_voters_flaggers' => QA_PERMIT_ADMINS,
'permit_vote_a' => QA_PERMIT_USERS,
'permit_vote_c' => QA_PERMIT_USERS,
'permit_vote_down' => QA_PERMIT_USERS,
'permit_vote_q' => QA_PERMIT_USERS,
'points_a_selected' => 30,
'points_a_voted_max_gain' => 20,
'points_a_voted_max_loss' => 5,
'points_base' => 100,
'points_c_voted_max_gain' => 10,
'points_c_voted_max_loss' => 3,
'points_multiple' => 10,
'points_per_c_voted_down' => 0,
'points_per_c_voted_up' => 0,
'points_post_a' => 4,
'points_post_q' => 2,
'points_q_voted_max_gain' => 10,
......@@ -381,6 +386,7 @@ function qa_default_option($name)
'tags_or_categories' => 'tc',
'use_microdata' => 1,
'voting_on_as' => 1,
'voting_on_cs' => 0,
'voting_on_qs' => 1,
);
......@@ -795,7 +801,10 @@ function qa_get_permit_options()
if (qa_opt('voting_on_as'))
$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';
if (qa_using_tags() || qa_using_categories())
......@@ -813,7 +822,7 @@ function qa_get_permit_options()
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';
if (qa_opt('flagging_of_posts'))
......
......@@ -36,6 +36,7 @@ function qa_db_points_option_names()
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_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_multiple', 'points_base',
......
......@@ -219,9 +219,13 @@ return array(
'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_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_per_a_voted_down' => 'Per down 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_up' => 'Per up vote on your question:',
'points_post_a' => 'Posting an answer:',
......@@ -296,6 +300,7 @@ return array(
'use_microdata' => 'Use schema.org microdata:',
'votes_separated' => 'Show separate up and down votes:',
'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_qs' => 'Allow voting on questions:',
);
......@@ -60,6 +60,7 @@ return array(
'permit_view_special_users_page' => 'Viewing the special users page',
'permit_view_voters_flaggers' => 'Viewing who voted or flagged posts',
'permit_vote_a' => 'Voting on answers',
'permit_vote_c' => 'Voting on comments',
'permit_vote_down' => 'Voting posts down',
'permit_vote_q' => 'Voting on questions',
'post_wall_blocked' => 'This user has disallowed new posts on their wall',
......
......@@ -231,6 +231,7 @@ $optiontype = array(
'minify_html' => 'checkbox',
'votes_separated' => 'checkbox',
'voting_on_as' => 'checkbox',
'voting_on_cs' => 'checkbox',
'voting_on_q_page_only' => 'checkbox',
'voting_on_qs' => 'checkbox',
......@@ -389,7 +390,7 @@ switch ($adminsection) {
$subtitle = 'admin/viewing_title';
$showoptions = array(
'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', 'voting_on_cs', 'votes_separated', '',
'show_url_links', 'links_in_new_window', 'show_when_created', 'show_full_date_days'
);
......@@ -613,7 +614,7 @@ switch ($adminsection) {
$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_flags', 'max_rate_user_flags', 'max_rate_ip_uploads', 'max_rate_user_uploads');
......@@ -1352,6 +1353,7 @@ foreach ($showoptions as $optionname) {
case 'permit_post_c':
case 'permit_vote_q':
case 'permit_vote_a':
case 'permit_vote_c':
case 'permit_vote_down':
case 'permit_edit_q':
case 'permit_retag_cat':
......@@ -1395,7 +1397,7 @@ foreach ($showoptions as $optionname) {
$narrowest = QA_PERMIT_MODERATORS;
elseif ($optionname == 'permit_post_c' || $optionname == 'permit_edit_q' || $optionname == 'permit_retag_cat' || $optionname == 'permit_edit_a' || $optionname == 'permit_flag')
$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;
elseif ($optionname == 'permit_delete_hidden' || $optionname == 'permit_edit_silent')
$narrowest = QA_PERMIT_ADMINS;
......@@ -1420,6 +1422,7 @@ foreach ($showoptions as $optionname) {
case 'permit_post_c_points':
case 'permit_vote_q_points':
case 'permit_vote_a_points':
case 'permit_vote_c_points':
case 'permit_vote_down_points':
case 'permit_flag_points':
case 'permit_edit_q_points':
......
......@@ -145,15 +145,19 @@ foreach ($optionnames as $optionname) {
case 'points_per_q_voted_up':
case 'points_per_a_voted_up':
case 'points_per_c_voted_up':
case 'points_q_voted_max_gain':
case 'points_a_voted_max_gain':
case 'points_c_voted_max_gain':
$prefix = '+';
break;
case 'points_per_q_voted_down':
case 'points_per_a_voted_down':
case 'points_per_c_voted_down':
case 'points_q_voted_max_loss':
case 'points_a_voted_max_loss':
case 'points_c_voted_max_loss':
$prefix = '–';
break;
......@@ -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_vote_up_q', 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_per_c_voted_up', array('blank1' => 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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment