$_POST['open'] = 1; $_POST['icon'] = iif($_POST['icon'] && $_POST['icon'] != 'none', $_POST['icon'], -1); //Thema erstellen $db->dinsert(PRE . '_forum_threads', 'forumid,title,icon,opener,opener_userid,opentime,firstpost,lastpost,lastposter,lastposter_userid,lastposttime,open,sticky,sticky_text,posts'); $tid = $db->insert_id(); //Beiträge verschieben $db->query("UPDATE " . PRE . "_forum_posts SET threadid='" . $tid . "' WHERE ( postid IN (" . implode(',', $_POST['post']) . ") AND del=0 AND threadid='" . $threadinfo['threadid'] . "' )"); //Themen aktualisieren thread_update_cache($threadinfo['threadid'], -$selected, true); thread_update_cache($tid, $selected, true); //Foreninfo aktualisieren (gleiches Forum) if ($_POST['forum'] == $threadinfo['forum']) { forum_update_cache($foruminfo['forumid'], 0, 1); } else { forum_update_cache($foruminfo['forumid'], -$selected, 0); forum_update_cache($destinfo['forumid'], $selected, 1); } //Suchindex anpassen $db->query("UPDATE " . PRE . "_forum_index SET threadid='" . $tid . "' WHERE postid IN (" . implode(',', $_POST['post']) . ")"); $goto = mkrellink('thread.php?id=' . $tid, 'thread,' . $tid . ',1' . urlformat($_POST['title']) . '.html'); } message($apx->lang->get('MSG_SPLITTHREAD_OK'), $goto); require 'lib/_end.php'; require '../lib/_end.php'; } } elseif (!$_POST['p']) { $_REQUEST['p'] = 1; $_POST['icon'] = 'none'; $_POST['sticky_type'] = 'no'; $_POST['sticky_text'] = ''; $_POST['forum'] = $foruminfo['forumid'];
//Links parsen if ($_POST['transform_links']) { $_POST['text'] = transform_urls($_POST['text']); } $now = time(); $_POST['threadid'] = $threadinfo['threadid']; $_POST['username'] = $username; $_POST['userid'] = $user->info['userid']; $_POST['time'] = $now; $_POST['ip'] = get_remoteaddr(); //Posting erstellen $db->dinsert(PRE . '_forum_posts', 'threadid,userid,username,title,text,allowsmilies,allowcodes,allowsig,time,ip,hash'); $pid = $db->insert_id(); //Thema und Forum aktualisieren thread_update_cache($threadinfo['threadid'], 1); forum_update_cache($foruminfo['forumid'], 1); //Postingzahl des Benutzers erhöhen if ($user->info['userid'] && $foruminfo['countposts']) { $db->query("UPDATE " . PRE . "_user SET forum_posts=forum_posts+1 WHERE userid='" . $user->info['userid'] . "' LIMIT 1"); } //Anhänge hinzufügen if (forum_access_addattachment($foruminfo)) { $db->query("UPDATE " . PRE . "_forum_attachments SET postid='" . $pid . "' WHERE hash='" . addslashes($_POST['hash']) . "' AND time>'" . (time() - 3600) . "'"); } //Index aktualisieren if ($foruminfo['searchable']) { update_index($_POST['text'], $threadinfo['threadid'], $pid); update_index($_POST['title'], $threadinfo['threadid'], $pid, true); } //Abonnements if (isset($_POST['subscription']) && $user->info['userid']) {