-
Notifications
You must be signed in to change notification settings - Fork 4
/
qa-plugin.php
42 lines (33 loc) · 1.36 KB
/
qa-plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/*
Plugin Name: Comment Voting
Plugin URI: https://github.com/NoahY/q2a-comment-voting
Plugin Update Check URI: https://raw.github.com/NoahY/q2a-comment-voting/master/qa-plugin.php
Plugin Description: Vote on comments
Plugin Version: 1.4
Plugin Date: 2011-08-15
Plugin Author: NoahY
Plugin Author URI:
Plugin License: GPLv2
Plugin Minimum Question2Answer Version: 1.3
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
qa_register_plugin_module('module', 'qa-comment-voting-admin.php', 'qa_comment_voting_admin', 'Comment Voting Admin');
qa_register_plugin_layer('qa-comment-voting-layer.php', 'Comment Voting Layer');
if(function_exists('qa_register_plugin_phrases')) {
qa_register_plugin_overrides('qa-cv-overrides.php');
qa_register_plugin_phrases('qa-cv-lang-*.php', 'comment_voting');
}
if(!function_exists('qa_permit_check')) {
function qa_permit_check($opt) {
if(qa_opt($opt) == QA_PERMIT_POINTS)
return qa_get_logged_in_points() >= qa_opt($opt.'_points');
return !qa_permit_value_error(qa_opt($opt), qa_get_logged_in_userid(), qa_get_logged_in_level(), qa_get_logged_in_flags());
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/