示例#1
0
function forumlog ($userid,$now,$before,$type) {
	global $CURUSER;
	if(!$CURUSER)
		$username = mysql_result(mysql_query('SELECT username FROM users WHERE id='.$userid),0);
	else
		$username = $CURUSER['username'];
	switch($type) {
		case title:
			$type = 'Titill';
			$subject = 'Notandi: '.$username."\n".'Tegund breytingar: '.$type."\n".'Núna: '.$now."\n".'Áður: '.$before;
		break;
		case signiture:
			$type = 'Undirskrift';
			if(empty($now))
				$now = 'Undirskrift eytt úr kerfinu';
			$subject = 'Notandi: '.$username."\n".'Tegund breytingar: '.$type."\n\n".'Núna: '."\n".$now."\n\n".'Áður: '."\n".$before;
		break;
		case cheat:
			$type = 'Svindl grunur';
			$subject = 'Notandi: '.$username."\n".'Tilkynnti 2GB eða meira í deilingarmagn - grunur um svindl'."\n\n".'Deilingarmagn: '.$now."\n".'Niðurhalsmagn: '.$before;
		break;
		case username:
			$type = 'Notandanafn';
			$subject = 'Breyting á notandanafni'."\n".'Núna: '.$now."\n".'Áður: '.$before;
		break;
	}

	$sql = 'INSERT INTO topics (userid, forumid, subject) VALUES('.$userid.', 12, \''.$username.' - '.$type.'\')'; 

	mysql_query($sql) or sqlerr(__FILE__, __LINE__);

	$topicid = mysql_insert_id() or sqlerr(__FILE__, __LINE__);

	$added = "'".get_date_time()."'";

	$sql = 'INSERT INTO posts (topicid, userid, added, body) VALUES ('.$topicid.','.$userid.','.$added.','.sqlesc($subject).')';

	mysql_query($sql) or sqlerr (__FILE__, __LINE__);

	$postid = mysql_insert_id();

	update_topic_last_post($topicid);

	if(verifystring(mysql_insert_id(),'num'))
		return TRUE;
	else
		return FALSE;
}
示例#2
0
    sql_query("DELETE FROM posts WHERE id={$postid}") or sqlerr(__FILE__, __LINE__);
    $Cache->delete_value('user_' . $userid . '_post_count');
    $Cache->delete_value('topic_' . $topicid . '_post_count');
    // update forum
    $forumid = get_single_value("topics", "forumid", "WHERE id=" . sqlesc($topicid));
    if (!$forumid) {
        die;
    } else {
        sql_query("UPDATE forums SET postcount=postcount-1 WHERE id=" . sqlesc($forumid));
    }
    $forum_last_replied_topic_row = $Cache->get_value('forum_' . $forumid . '_last_replied_topic_content');
    if ($forum_last_replied_topic_row && $forum_last_replied_topic_row['lastpost'] == $postid) {
        $Cache->delete_value('forum_' . $forumid . '_last_replied_topic_content');
    }
    //------- Update topic
    update_topic_last_post($topicid);
    //===remove karma
    KPS("-", $makepost_bonus, $userid);
    header("Location: " . get_protocol_prefix() . "{$BASEURL}/forums.php?action=viewtopic&topicid={$topicid}{$redirtopost}");
    die;
}
//-------- Action: Set locked on/off
if ($action == "setlocked") {
    $topicid = 0 + $_POST["topicid"];
    $ismod = is_forum_moderator($topicid, 'topic');
    if (!$topicid || get_user_class() < $postmanage_class && !$ismod) {
        permissiondenied();
    }
    $locked = sqlesc($_POST["locked"]);
    sql_query("UPDATE topics SET locked={$locked} WHERE id={$topicid}") or sqlerr(__FILE__, __LINE__);
    header("Location: {$_POST['returnto']}");
示例#3
0
function forumlog ($userid,$now,$before,$type) {
	$username = mysql_result(mysql_query('SELECT username FROM users WHERE id='.$userid),0);
	$type = 'Svindl grunur';
	$subject = 'Notandi: '.$username."\n".'Tilkynnti 2GB eða meira í deilingarmagn - grunur um svindl'."\n\n".'Deilingarmagn: '.$now."\n".'Niðurhalsmagn: '.$before;

	$sql = 'INSERT INTO topics (userid, forumid, subject) VALUES('.$userid.', 12, \''.$username.' - '.$type.'\')';
        mysql_query($sql) or sqlerr(__FILE__, __LINE__);

        $topicid = mysql_insert_id() or sqlerr(__FILE__, __LINE__);
        $added = "'".get_date_time()."'";
        $sql = 'INSERT INTO posts (topicid, userid, added, body) VALUES ('.$topicid.','.$userid.','.$added.','.sqlesc($subject).')';
        mysql_query($sql) or sqlerr (__FILE__, __LINE__);
        $postid = mysql_insert_id();
        update_topic_last_post($topicid);
        if(verifystring(mysql_insert_id()))
                return TRUE;
        else
                return FALSE;
}