Chris@76: {int:wait_time}', Chris@76: array( Chris@76: 'wait_time' => (int) ($modSettings['karmaWaitTime'] * 3600), Chris@76: 'current_time' => time(), Chris@76: ) Chris@76: ); Chris@76: Chris@76: // Start off with no change in karma. Chris@76: $action = 0; Chris@76: Chris@76: // Not an administrator... or one who is restricted as well. Chris@76: if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum')) Chris@76: { Chris@76: // Find out if this user has done this recently... Chris@76: $request = $smcFunc['db_query']('', ' Chris@76: SELECT action Chris@76: FROM {db_prefix}log_karma Chris@76: WHERE id_target = {int:id_target} Chris@76: AND id_executor = {int:current_member} Chris@76: LIMIT 1', Chris@76: array( Chris@76: 'current_member' => $user_info['id'], Chris@76: 'id_target' => $_REQUEST['uid'], Chris@76: ) Chris@76: ); Chris@76: if ($smcFunc['db_num_rows']($request) > 0) Chris@76: list ($action) = $smcFunc['db_fetch_row']($request); Chris@76: $smcFunc['db_free_result']($request); Chris@76: } Chris@76: Chris@76: // They haven't, not before now, anyhow. Chris@76: if (empty($action) || empty($modSettings['karmaWaitTime'])) Chris@76: { Chris@76: // Put it in the log. Chris@76: $smcFunc['db_insert']('replace', Chris@76: '{db_prefix}log_karma', Chris@76: array('action' => 'int', 'id_target' => 'int', 'id_executor' => 'int', 'log_time' => 'int'), Chris@76: array($dir, $_REQUEST['uid'], $user_info['id'], time()), Chris@76: array('id_target', 'id_executor') Chris@76: ); Chris@76: Chris@76: // Change by one. Chris@76: updateMemberData($_REQUEST['uid'], array($dir == 1 ? 'karma_good' : 'karma_bad' => '+')); Chris@76: } Chris@76: else Chris@76: { Chris@76: // If you are gonna try to repeat.... don't allow it. Chris@76: if ($action == $dir) Chris@76: fatal_lang_error('karma_wait_time', false, array($modSettings['karmaWaitTime'], $txt['hours'])); Chris@76: Chris@76: // You decided to go back on your previous choice? Chris@76: $smcFunc['db_query']('', ' Chris@76: UPDATE {db_prefix}log_karma Chris@76: SET action = {int:action}, log_time = {int:current_time} Chris@76: WHERE id_target = {int:id_target} Chris@76: AND id_executor = {int:current_member}', Chris@76: array( Chris@76: 'current_member' => $user_info['id'], Chris@76: 'action' => $dir, Chris@76: 'current_time' => time(), Chris@76: 'id_target' => $_REQUEST['uid'], Chris@76: ) Chris@76: ); Chris@76: Chris@76: // It was recently changed the OTHER way... so... reverse it! Chris@76: if ($dir == 1) Chris@76: updateMemberData($_REQUEST['uid'], array('karma_good' => '+', 'karma_bad' => '-')); Chris@76: else Chris@76: updateMemberData($_REQUEST['uid'], array('karma_bad' => '+', 'karma_good' => '-')); Chris@76: } Chris@76: Chris@76: // Figure out where to go back to.... the topic? Chris@76: if (!empty($topic)) Chris@76: redirectexit('topic=' . $topic . '.' . $_REQUEST['start'] . '#msg' . (int) $_REQUEST['m']); Chris@76: // Hrm... maybe a personal message? Chris@76: elseif (isset($_REQUEST['f'])) Chris@76: redirectexit('action=pm;f=' . $_REQUEST['f'] . ';start=' . $_REQUEST['start'] . (isset($_REQUEST['l']) ? ';l=' . (int) $_REQUEST['l'] : '') . (isset($_REQUEST['pm']) ? '#' . (int) $_REQUEST['pm'] : '')); Chris@76: // JavaScript as a last resort. Chris@76: else Chris@76: { Chris@76: echo ' Chris@76: Chris@76: Chris@76: ... Chris@76: Chris@76: Chris@76: « Chris@76: '; Chris@76: Chris@76: obExit(false); Chris@76: } Chris@76: } Chris@76: Chris@76: // What's this? I dunno, what are you talking about? Never seen this before, nope. No siree. Chris@76: function BookOfUnknown() Chris@76: { Chris@76: global $context; Chris@76: Chris@76: if (strpos($_GET['action'], 'mozilla') !== false && !$context['browser']['is_gecko']) Chris@76: redirectexit('http://www.getfirefox.com/'); Chris@76: elseif (strpos($_GET['action'], 'mozilla') !== false) Chris@76: redirectexit('about:mozilla'); Chris@76: Chris@76: echo ' Chris@76: Chris@76: Chris@76: The Book of Unknown, ', @$_GET['verse'] == '2:18' ? '2:18' : '4:16', ' Chris@76: Chris@76: Chris@76: Chris@76:
'; Chris@76: if (@$_GET['verse'] == '2:18') Chris@76: echo ' Chris@76: Woe, it was that his name wasn\'t known, that he came in mystery, and was recognized by none. And it became to be in those days something.  Something not yet unknown to mankind.  And thus what was to be known the secret project began into its existence.  Henceforth the opposition was only weary and fearful, for now their match was at arms against them.'; Chris@76: else Chris@76: echo ' Chris@76: And it came to pass that the unbelievers dwindled in number and saw rise of many proselytizers, and the opposition found fear in the face of the x and the j while those who stood with the something grew stronger and came together.  Still, this was only the beginning, and what lay in the future was unknown to all, even those on the right side.'; Chris@76: echo ' Chris@76:
Chris@76:
'; Chris@76: if (@$_GET['verse'] == '2:18') Chris@76: echo ' Chris@76: from The Book of Unknown, 2:18'; Chris@76: else Chris@76: echo ' Chris@76: from The Book of Unknown, 4:16'; Chris@76: echo ' Chris@76:
Chris@76: Chris@76: '; Chris@76: Chris@76: obExit(false); Chris@76: } Chris@76: Chris@76: ?>