function show_newsarchive($newsAr, $i = 1) { global $ns, $gen, $pref, $tp, $news_archive_shortcodes, $NEWSARCHIVE, $news2; // do not show the news archive on the news.php?item.X page (but only on the news mainpage) require_once e_CORE . 'shortcodes/batch/news_archives.php'; $textnewsarchive = ''; ob_start(); $i++; // First entry to show while (isset($newsAr[$i])) { $news2 = $newsAr[$i]; // Code from Lisa // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X // instead of the actual hyperlink that may have been added to a newstitle on creation $search = array(); $replace = array(); $search[0] = "/\\<a href=\"(.*?)\">(.*?)<\\/a>/si"; $replace[0] = '\\2'; $search[1] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si"; $replace[1] = '\\2'; $search[2] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si"; $replace[2] = '\\2'; $search[3] = "/\\<a href="(.*?)">(.*?)<\\/a>/si"; $replace[3] = '\\2'; $search[4] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si"; $replace[4] = '\\2'; $news2['news_title'] = preg_replace($search, $replace, $news2['news_title']); // End of code from Lisa $gen = new convert(); $news2['news_datestamp'] = $gen->convert_date($news2['news_datestamp'], "short"); if (!$NEWSARCHIVE) { $NEWSARCHIVE = "<div>\n\t\t\t\t\t<table style='width:98%;'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t<div>{ARCHIVE_BULLET} <b>{ARCHIVE_LINK}</b> <span class='smalltext'><i>{ARCHIVE_AUTHOR} @ ({ARCHIVE_DATESTAMP}) ({ARCHIVE_CATEGORY})</i></span></div>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t</div>"; } $textnewsarchive .= $tp->parseTemplate($NEWSARCHIVE, FALSE, $news_archive_shortcodes); $i++; } $ns->tablerender($pref['newsposts_archive_title'], $textnewsarchive, 'news_archive'); $newsarchive = ob_get_contents(); ob_end_flush(); // dump collected data setNewsCache('newsarchive', $newsarchive); }
$thispostday = strftime("%j", $news['news_datestamp']); if ($newpostday != $thispostday && (isset($pref['news_newdateheader']) && $pref['news_newdateheader'])) { echo "<div class='" . DATEHEADERCLASS . "'>" . strftime("%A %d %B %Y", $news['news_datestamp']) . "</div>"; } $newpostday = $thispostday; $news['category_id'] = $news['news_category']; if ($action == "item") { unset($news['news_render_type']); } $ix->render_newsitem($news); $i++; } $cache_data = ob_get_clean(); require_once HEADERF; echo $cache_data; setNewsCache($cacheString, $text); } // ##### -------------------------------------------------------------------------------------------------------------- // #### new: news archive --------------------------------------------------------------------------------------------- if ($action != "item" && $action != 'list' && $pref['newsposts_archive']) { // do not show the newsarchive on the news.php?item.X page (but only on the news mainpage) require_once e_FILE . 'shortcode/batch/news_archives.php'; $i = $interval + 1; while (isset($newsAr[$i])) { $news2 = $newsAr[$i]; // Code from Lisa // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X // instead of the actual hyperlink that may have been added to a newstitle on creation $search = array(); $replace = array(); $search[0] = "/\\<a href=\"(.*?)\">(.*?)<\\/a>/si";