break; case 3: // set if ($amount >= 0 || $allow_neg) { $moderate_array[3][$c_cur->id()] = $amount; $modedit[3] = true; $moderate_clause[3][] = $c_cur->display($amount, true); $editlist[] = $c_cur->name(true); } break; } } } if ($modedit[1] || $modedit[2] || $modedit[3]) { $message = isset($HTTP_POST_VARS['message']) ? str_replace("\\'", "''", $HTTP_POST_VARS['message']) : ''; $action = array($userdata['user_id'], $userdata['username'], $target->id(), $target->name(), implode('</b>, <b>', $moderate_clause[1]), implode('</b>, <b>', $moderate_clause[2]), implode('</b>, <b>', $moderate_clause[3])); cash_create_log(CASH_LOG_ADMIN_MODEDIT, $action, $message); if ($modedit[1]) { $target->give_by_id_array($moderate_array[1]); } if ($modedit[2]) { $target->remove_by_id_array($moderate_array[2]); } if ($modedit[3]) { $target->set_by_id_array($moderate_array[3]); } if ($message != '' && $userdata['user_allow_pm']) { $privmsg_subject = sprintf($lang['Has_moderated'], $userdata['username'], implode(", ", $editlist)); $preamble = $privmsg_subject . ":\n[list]"; if ($modedit[1]) { $preamble .= sprintf($lang['Has_added'], implode('[/b], [b]', $moderate_clause[1]));
$max_user = intval($row['user_id']); } } define('CASH_POSTS', 0); define('CASH_BONUS', 1); define('CASH_REPLIES', 2); define('FLUSH', ' '); $cm_groups->load(true, true); $sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('cash_resetting','-1,{$max_user}')"; if (!$db->sql_query($sql)) { message_die(GENERAL_ERROR, 'Error setting config data', '', __LINE__, __FILE__, $sql); } for ($i = 0; $i < count($userlist); $i++) { if ($userlist['user_id'] != ANONYMOUS) { $c_user = new cash_user($userlist[$i]['user_id'], $userlist[$i]); $sql = "SELECT t.forum_id, t.topic_id, t.topic_poster, t.topic_replies, count( p.post_id ) AS user_replies\n\t\t\t\t\tFROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p \n\t\t\t\t\tWHERE t.topic_id = p.topic_id AND p.poster_id = " . $c_user->id() . "\n\t\t\t\t\tGROUP BY t.topic_id"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Error retrieving data', '', __LINE__, __FILE__, $sql); } $forums = array(); $forum_list = array(CASH_POSTS => 0, CASH_BONUS => 0, CASH_REPLIES => 0); // // $forums is an array of arrays. the first index is the forum_id. the remainder are a count of // [0] => topics started // [1] => bonus earned on those topics // [2] => replies // while ($row = $db->sql_fetchrow($result)) { $forum_id = intval($row['forum_id']); $topic_poster = intval($row['topic_poster']); $topic_replies = intval($row['topic_replies']);