0) { // PART OF A BAD NEWS CATEGORY!!! $news_id = 0; } */ // GET NEWS CATEGORIES $aNewsCategories = GetNewsCategories(); // ************************************************************ // ************************************************************ // GET NEWS POST DATA // ************************************************************ $sql = 'SELECT n.tstamp, n.news_id, n.title, n.url, n.image, n.content, n.source, n.hits, n.user_id, n.topic_id FROM news n WHERE n.news_id = '.number($news_id).' AND n.tstamp <= UNIX_TIMESTAMP(NOW()) AND n.is_active = 1 AND n.is_deleted = 0 ORDER BY n.is_sticky DESC, n.tstamp DESC LIMIT 1'; //echo $sql; $res = mysql_query($sql) OR die(mysql_error()); if (mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); mysql_free_result($res); extract($row); $prev = GetField('prev', 'SELECT CONCAT_WS("||", "prev", "«", cip.news_id, cip.title, cip.image) AS prev FROM news cip WHERE cip.tstamp > '.number($tstamp).' AND cip.tstamp <= '.number(time()).' AND cip.is_active = 1 AND cip.is_deleted = 0 AND cip.tstamp <= '.number(time()).' ORDER BY cip.tstamp ASC LIMIT 1'); $next = GetField('next', 'SELECT CONCAT_WS("||", "next", "»", cin.news_id, cin.title, cin.image) AS next FROM news cin WHERE cin.tstamp < '.number($tstamp).' AND cin.tstamp <= '.number(time()).' AND cin.is_active = 1 AND cin.is_deleted = 0 AND cin.tstamp <= '.number(time()).' ORDER BY cin.tstamp DESC LIMIT 1'); $aUserIDs[] = $user_id; // GET TOPIC TITLES $aTopics = GetForumTopics($topic_id); if (is_array($aTopics)) extract($aTopics[$topic_id]); $notify_status = 1; if (IsLoggedIn()) { $notify_status = GetField('notify_status', 'SELECT notify_status FROM forums__topics_watch WHERE user_id = '.number($_SESSION['USER_ID']).' AND topic_id = '.number($topic_id).' ORDER BY notify_status ASC LIMIT 1'); $notify_status = (!is_numeric($notify_status) ? 1 : $notify_status); if ($notify_status == 1) { $mode = 'watch'; $topic_status = 'Subscribe'; } else { $mode = 'unwatch'; $topic_status = 'Unsubscribe'; } //$hash = generate_link_hash($mode.'_'.$topic_id); //$user_topic_options = 'Reply · '.$topic_status.''; $user_topic_options = 'Reply · '.$topic_status.''; } else { $user_topic_options = 'Sign in or Join to reply'; } /* if ($F_KEYWORD) { $title = eregi_replace(' '.$F_KEYWORD,strtoupper(' '.$F_KEYWORD.''), $title); $content = eregi_replace(' '.$F_KEYWORD,strtoupper(' '.$F_KEYWORD.''), $content); } */ $aNewsNav = Array($prev, $next); $sNewsCategories = DisplayNewsCategoryLinks('', $news_id, $aNewsCategories); if ($topic_id > 0) { mysql_unbuffered_query('UPDATE LOW_PRIORITY forums__topics SET topic_views = (topic_views + 1) WHERE topic_id = '.number($topic_id)); } $title = html_entity_decode($title, ENT_QUOTES); } else { $sErrorMsg = '

The news article you are trying to access no longer exists or is invalid.
Please verify that the URL is correct or visit the main news section page here.

'; } // ************************************************************ // ************************************************************ // GET MESSAGE BOARD POSTS // ************************************************************ $iLimitForumPosts = 20; $sql = 'SELECT p.post_id, p.poster_id AS user_id, p.post_time, p.post_text, p.bbcode_uid, p.bbcode_bitfield, p.enable_bbcode, p.enable_smilies, p.enable_magic_url FROM forums__topics t JOIN forums__posts p ON t.topic_id = p.topic_id AND t.topic_first_post_id != p.post_id AND p.post_time > '.number($tstamp + 60).' WHERE t.topic_id = '.number($topic_id).' ORDER BY p.post_time ASC LIMIT '.$iLimitForumPosts; $res = mysql_query($sql) OR die(mysql_error()); $iHowManyForumPosts = mysql_num_rows($res); $aPosts = GetResults($sql); mysql_free_result($res); // GET USER_IDS //echo '
'.DisplayArray($aPosts).'
'; foreach($aPosts as $post) { $aUserIDs[] = $post['user_id']; } // GET USERNAMES $aUsers = GetUsernames($aUserIDs); $image_src_prev = ''; $image_div = ''; $news_image = ''; if (!isEmpty($image) && is_file(STATIC_PATH.'/images/news/small/'.$image)) { $news_image = 'images/news/small/'.$image; $image_src_prev = STATIC_SITE.'/images/news/small/'.$image; //$size = GetImageSize($_SERVER['DOCUMENT_ROOT'].'/'.$news_image); $alt_text = HTMLencode(strip_tags('Transformers News: '.$title)); $image_div = '
'.(!isEmpty($topic_id) ? '' : '').''.$alt_text.''.(!isEmpty($topic_id) ? '' : '').'
'; } $content = HTMLDecode($content); $pagetitle = strip_tags($title).(!isEmpty($title) ? '' : 'Transformers News'); $page_description = $content; //$section_id = 37; DisplayHeader(); //$content = smiley_text(bbcode_nl2br($content)); $content = nl2br($content); $content = affiliate_links($content, 1); //$content = nl2br($content); if (isEmpty($sErrorMsg)) { mysql_unbuffered_query('UPDATE news SET hits = hits + 1 WHERE news_id = '.number($news_id)); $sqlConditions = ' is_active = 1 AND is_deleted = 0 '; if (!isEmpty($f_cat)) { $sqlConditions .= ' AND news_id IN (SELECT news_id FROM news_category_news WHERE cat_id = '.number($f_cat).')'; } ?>