compile_check = (int) $Config->_('compile_check'); $smarty->debugging = (int) $Config->_('debug'); $smarty->template_dir = $Config->_('abspath').'/templates/'; $smarty->compile_dir = $Config->_('abspath').'/templates_c/'; /* FORCE DEFINES ************************************************************************************************/ $q = 'SELECT a.* FROM '.$Config->_('cats').' AS a '. 'WHERE '. (isset($_GET['edition']) ? 'a.id="'.$_GET['edition'].'" ' : 'a.date <= NOW() '). 'order by a.date DESC limit 0,1'; $q = $Database->query($q); $c = $Database->fetch($q); /* TOPICS *******************************************************************************************************/ $tp = explode(",", $c['topic_id']); foreach ($tp as $val) { $ex[] = 'a.id = "'.$val.'" '; } $e = implode(" OR ", $ex); $q = 'SELECT a.name FROM '.$Config->_('topic').' AS a '. 'WHERE '.$e.' '; $q = $Database->query($q); $t = array(); while ($s = $Database->fetch($q)) { $t[] = $s['name']; } /* GET ARTICLES *************************************************************************************************/ $q = 'SELECT a.id, a.byline1, a.byline2, a.byline3, a.headline, a.tease FROM '.$Config->_('news').' AS a '. 'WHERE a.categoryID="'. $c['id'] .'" '. 'ORDER BY a.priority ASC '; $q = $Database->query($q); $a = array(); // For article information; while ($h = $Database->fetch($q)) { foreach ($h as $k=>$v) { $h[$k] = $Database->formatText($v); } $a[] = $h; } $smarty->assign('msg', (isset($_GET['error']) && !empty($_GET['error']) ? $_GET['error'] : '')); $smarty->assign('url', $Config->_('absurl')); $smarty->assign('edit', $c); $smarty->assign('news', $a); $smarty->assign('topi', implode(", ", $t)); ob_start('callback'); $smarty->display('error.tmpl', 'error'); $data = ob_get_flush(); $smarty->clear_all_assign(); function abridgeText($temp,$chars) { $temp = preg_replace("|\n|is", "", $temp); $temp = preg_replace("|\r|is", "", $temp); $temp = strip_tags($temp); if (strlen($temp) > $chars) { $pos = strpos($temp, " ", $chars); if (!empty($pos)) { $temp = substr($temp, 0, $pos)."..."; } } return($temp); } ?>