global $bbuserinfo, $DB_site, $vboptions, $vbphrase; require_once('./includes/functions_newpost.php'); $forumid = 2; $foruminfo = fetch_foruminfo($forumid); $post['title'] = "Discuss: ".$newstitle.""; $strippedtext= strip_bbcode($newstext, FALSE, TRUE); if(strlen($strippedtext) > 350) { $shortenedtext= substr($strippedtext, 0, 347); $shortenedtext.= "..."; } else { $shortenedtext= $strippedtext; } $newsdate= vbdate($vboptions['dateformat'], $newsdate); $articleurl= "".$vboptions['bburl']."/news/newsarticle".$articleid.".html"; $image= "".$vboptions['bburl']."/images/news/news".$articleid."_medium.".$extension.""; $post['message'] = construct_phrase($vbphrase['news_post_content'], $image, $newstitle, $newsdate, $user['userid'], $user['username'], $shortenedtext, $articleurl); $post['poststarttime'] = $newsdate; $post['posthash'] = md5($post['poststarttime'] . $user['userid'] . $user['salt']); build_new_post('thread', $foruminfo, array(), 0, $post, $errors); $DB_site->query("UPDATE ".TABLE_PREFIX."news SET threadid=".intval($post['threadid']).", postid=".intval($post['postid'])." WHERE news_id=".intval($articleid)."");