1
0

karma plugin update

This commit is contained in:
Garvin Hicking
2011-03-09 11:11:14 +00:00
parent 21ff71abd2
commit 40116e3802
4 changed files with 32 additions and 3 deletions

View File

@ -116,3 +116,4 @@
@define('PLUGIN_KARMA_INVALID_INPUT', 'Invalid input!');
@define('PLUGIN_KARMA_DELETE_VOTES', 'Delete selected votes');
@define('PLUGIN_KARMA_APPROVE_VOTES', 'Approve selected votes');
@define('PLUGIN_KARMA_ACTIVE_REGISTERED', 'Only logged-in authors can vote');

View File

@ -43,7 +43,7 @@ class serendipity_event_karma extends serendipity_event
$propbag->add('description', PLUGIN_KARMA_BLAHBLAH);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking, Grischa Brockhaus, Gregor V<>ltz, Judebert');
$propbag->add('version', '2.4');
$propbag->add('version', '2.5');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -63,6 +63,7 @@ class serendipity_event_karma extends serendipity_event
// Functionality options
'options_tab',
'karma_active',
'karma_active_registered',
'extended_only',
'max_karmatime',
'max_votetime',
@ -173,6 +174,14 @@ class serendipity_event_karma extends serendipity_event
$propbag->add('default', 'true');
break;
// Is karma voting allowed only for registered authors?
case 'karma_active_registered':
$propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_KARMA_ACTIVE_REGISTERED);
$propbag->add('description', '');
$propbag->add('default', 'false');
break;
// Min votes to display
case 'min_disp_votes':
$propbag->add('type', 'string');
@ -1039,6 +1048,10 @@ END_IMG_CSS;
// Find out what the admin wants
$track_clicks = serendipity_db_bool($this->get_config('visits_active', true));
$track_karma = serendipity_db_bool($this->get_config('karma_active', true));
if (serendipity_db_bool($this->get_config('karma_active_registered', false))) {
if (!serendipity_userLoggedIn()) $track_karma = false;
}
$track_exits = serendipity_db_bool($this->get_config('exits_active', true));
// Get the limits