$cache_id = 'nd' . md5(serialize($params)); $compile_id = 'nd' . $articleid; $template = 'detail' . $this->GetPreference('current_detail_template'); if (isset($params['detailtemplate'])) { $template = 'detail' . $params['detailtemplate']; } if ($id == '_preview_' && isset($_SESSION['news_preview']) && isset($params['preview'])) { // see if our data matches. if (md5(serialize($_SESSION['news_preview'])) == $params['preview']) { $fname = TMP_CACHE_LOCATION . '/' . $_SESSION['news_preview']['fname']; if (file_exists($fname) && md5_file($fname) == $_SESSION['news_preview']['checksum']) { $data = unserialize(file_get_contents($fname)); if (is_array($data)) { // get passed data into a standard format. $article = new news_article(); $article->set_linkdata($id, $params); news_ops::fill_article_from_formparams($article, $data, FALSE, FALSE); $compile_id = 'news_preview_' . time(); $preview = TRUE; } } } } if ($preview || !$smarty->isCached($this->GetDatabaseResource($template), $cache_id, $compile_id)) { // not cached... have to do to the work. if (isset($params['articleid']) && $params['articleid'] == -1) { $article = news_ops::get_latest_article(); } else { if (isset($params['articleid']) && (int) $params['articleid'] > 0) { $show_expired = $this->GetPreference('expired_viewable', 1); if (isset($params['showall'])) {