if ($news_sticky == "1") { $result = dbquery("UPDATE ".DB_NEWS." SET news_sticky='0' WHERE news_sticky='1'"); }
$result = dbquery("INSERT INTO ".DB_NEWS." (news_subject, news_cat, news_news, news_extended, news_breaks, news_name, news_datestamp, news_start, news_end, news_image, news_image_t1, news_image_t2, news_visibility, news_draft, news_sticky, news_reads, news_allow_comments, news_allow_ratings) VALUES ('$news_subject', '$news_cat', '$body', '$body2', '$news_breaks', '".$userdata['user_id']."', '".($news_start_date != 0 ? $news_start_date : time())."', '$news_start_date', '$news_end_date', '$news_image', '$news_image_t1', '$news_image_t2', '$news_visibility', '$news_draft', '$news_sticky', '0', '$news_comments', '$news_ratings')");
$user = $userdata['user_id'];
$forum_id = "14";
$result = dbquery("INSERT INTO ".DB_THREADS." (forum_id, thread_subject,
thread_author, thread_views,
thread_lastpost, thread_lastpostid,
thread_lastuser, thread_postcount,
thread_poll)
VALUES('".$forum_id."', '".$news_subject."',
'".$user."', '0',
'".time()."', '0',
'".$user."', '1',
'0')");
$thread_id = mysql_insert_id();
$result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id,
post_message, post_showsig,
post_author, post_datestamp,
post_ip, post_edituser,
post_edittime)
VALUES ('".$forum_id."', '$thread_id',
'[b]".$news_subject."[/b]\n".$news_cat."\n".$body."', '0',
'".$user."', '".time()."',
'".USER_IP."', '0',
'0')");
$post_id = mysql_insert_id();
$result = dbquery("UPDATE ".DB_FORUMS." SET forum_lastpost='".time()."', forum_postcount=forum_postcount+1, forum_threadcount=forum_threadcount+1, forum_lastuser='1' WHERE forum_id='".$forum_id."'");
$result = dbquery("UPDATE ".DB_THREADS." SET thread_lastpostid='".$post_id."' WHERE thread_id='".$thread_id."'");
$result = dbquery("UPDATE ".DB_USERS." SET user_posts=user_posts+1, user_lastvisit='".time()."' WHERE user_id='".$user."'");
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions