" . (int) ($modSettings['karmaWaitTime'] * 3600), __FILE__, __LINE__); // Start off with no change in karma. $action = 0; // Not an administrator... or one who is restricted as well. if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum')) { // Find out if this user has done this recently... $request = db_query(" SELECT action FROM {$db_prefix}log_karma WHERE ID_TARGET = $_REQUEST[uid] AND ID_EXECUTOR = $ID_MEMBER LIMIT 1", __FILE__, __LINE__); if (mysql_num_rows($request) > 0) list ($action) = mysql_fetch_row($request); mysql_free_result($request); } // They haven't, not before now, anyhow. if (empty($action) || empty($modSettings['karmaWaitTime'])) { // Put it in the log. db_query(" REPLACE INTO {$db_prefix}log_karma (action, ID_TARGET, ID_EXECUTOR, logTime) VALUES ($dir, $_REQUEST[uid], $ID_MEMBER, " . time() . ')', __FILE__, __LINE__); // Change by one. updateMemberData($_REQUEST['uid'], array($dir == 1 ? 'karmaGood' : 'karmaBad' => '+')); } else { // If you are gonna try to repeat.... don't allow it. if ($action == $dir) fatal_error($txt['smf62'] . ' ' . $modSettings['karmaWaitTime'] . ' ' . $txt[578] . '.', false); // You decided to go back on your previous choice? db_query(" UPDATE {$db_prefix}log_karma SET action = $dir, logTime = " . time() . " WHERE ID_TARGET = $_REQUEST[uid] AND ID_EXECUTOR = $ID_MEMBER LIMIT 1", __FILE__, __LINE__); // It was recently changed the OTHER way... so... reverse it! if ($dir == 1) updateMemberData($_REQUEST['uid'], array('karmaGood' => '+', 'karmaBad' => '-')); else updateMemberData($_REQUEST['uid'], array('karmaBad' => '+', 'karmaGood' => '-')); } // Figure out where to go back to.... the topic? if (!empty($topic)) redirectexit('topic=' . $topic . '.' . $_REQUEST['start'] . '#msg' . $_REQUEST['m']); // Hrm... maybe a personal message? elseif (isset($_REQUEST['f'])) redirectexit('action=pm;f=' . $_REQUEST['f'] . ';start=' . $_REQUEST['start'] . (isset($_REQUEST['l']) ? ';l=' . $_REQUEST['l'] : '') . (isset($_REQUEST['pm']) ? '#' . $_REQUEST['pm'] : '')); // JavaScript as a last resort. else { echo '