Пример #1
0
function isMod($id, $what = "topic")
{
    global $CURUSER;
    if ($what == "topic") {
        $topics = topicmods($CURUSER["id"], "", true);
        return stristr($topics, "[" . $id . "]") == true ? true : false;
    } elseif ($what == "forum") {
        return stristr($CURUSER["forums_mod"], "[" . $id . "]") == true ? true : false;
    } else {
        return false;
    }
}
Пример #2
0
     $curuser_cache['forums_mod'] = '';
     $user_cache['forums_mod'] = '';
     $updateset[] = "forum_mod=" . sqlesc($forum_mod);
     $curuser_cache['forum_mod'] = $forum_mod;
     $user_cache['forum_mod'] = $forum_mod;
     $mc1->delete_value('forummods');
     $modcomment = get_date(TIME_NOW, 'DATE', 1) . " " . $CURUSER["username"] . " " . $whatm . " forum moderator rights\n" . $modcomment;
 }
 $forums = isset($_POST["forums"]) ? $_POST["forums"] : "";
 if (!empty($forums) && sizeof($forums) > 0 && $forum_mod == "yes") {
     $foo = "[" . join("][", $forums) . "]";
     $q = sql_query("SELECT id FROM topics WHERE forum_id IN (" . join(",", $forums) . ") ") or sqlerr(__FILE__, __LINE__);
     while ($a = mysqli_fetch_assoc($q)) {
         $temp[] = $a["id"];
     }
     topicmods($user["id"], "[" . join("][", $temp) . "]");
     $updateset[] = "forums_mod =" . sqlesc($foo);
     $curuser_cache['forums_mod'] = $foo;
     $user_cache['forums_mod'] = $foo;
     $mc1->delete_value('forummods');
 }
 //== Add ModComment... (if we changed stuff we update otherwise we dont include this..)
 if ($CURUSER['class'] == UC_MAX && ($user['modcomment'] != $_POST['modcomment'] || $modcomment != $_POST['modcomment']) || $CURUSER['class'] < UC_MAX && $modcomment != $user['modcomment']) {
     $updateset[] = "modcomment = " . sqlesc($modcomment);
 }
 $user_stats_cache['modcomment'] = $modcomment;
 $stats_cache['modcomment'] = $modcomment;
 //== Memcache - delete the keys
 $mc1->delete_value('inbox_new_' . $userid);
 $mc1->delete_value('inbox_new_sb_' . $userid);
 if ($curuser_cache) {