include_once($_SERVER['DOCUMENT_ROOT'].'/_/db_sess.php');
@define('IRERU', $_SERVER['DOCUMENT_ROOT'].'/_/ireru');
?>
define('PG_ID', 45);
define('IS_ADM_PG', 0);
include_once IRERU.'/tmpl.php';
//include_once IRERU.'/convertlinks.php';
include_once(IRERU.'/pagnum/nw_pagnum.php');
include_once IRERU.'/db_f.php';
$db_conn = &db_conn(1);
include_once IRERU.'/news/news_f.php';
//$nw_id = clean($_GET['nw_id'],3);
//$archive = clean($_GET['archive'],1);
// pathvars
include_once(IRERU.'/pathvars.php');
$baseUrl = '/articles';
// Create instance of PathVars
$pathVars=new PathVars($baseUrl);
$cat_name = clean($pathVars->fetchByIndex(0), 255);
$nw_id = clean($pathVars->fetchByIndex(1), 7);
if ($cat_name) {
$cat_id = array_search($cat_name, $cat_urls);
$title = $cat_names[$cat_id].' Articles';
}
else {
$title = 'Article Categories';
}
/* echo '
';
$row = @ mysql_fetch_array($result, MYSQL_ASSOC);
//print_r($row);
if ($row['nw_img_filename']) {
$img = '

';
}
if (!$row['nw_title']) { $row['nw_title'] = $row['nw_head']; }
echo '
'.nl2br($row['nw_title']).'
';
if ($row['nw_author']) {
echo '
by '.nl2br($row['nw_author']).'
';
}
if ($row['nw_img_filename'] && $row['nw_img_pos']<3)
{
echo '
'.$img.'
';
}
echo '
'.$row['nw_text'].'
';
if ($row['nw_img_filename'] && $row['nw_img_pos'] == 3)
{
echo '
'.$img.'
';
}
echo '
This article was posted on '.date('j F \'y', $row['nw_date']).'
';
echo '
';
if (!$row['nw_archive']) {
echo '
« list of articles
';
}
else {
echo '
« archive
';
}
echo '
';
}
function show_articles($cat_id, $cat_urls, $fieldlist, $db_conn) {
echo '';
$sql= 'SELECT '.$fieldlist.', UNIX_TIMESTAMP(nw_date) AS nw_date FROM nw_news WHERE nw_archive='.($archive?1:0).' AND cat_id="'.$cat_id.'" ORDER BY nw_archive, nw_order';
if (!($result = mysql_query ($sql, $db_conn))) {showerror();}
// ***********************************************************************************
$pagnum = &new nw_pagnum(
array(
'numtoshow' => 12,
'str_results_prefix' => 'Article',
'sql' => $sql,
'db_conn' => $db_conn,
'p' => $p
)
);
$p_data = $pagnum->getlinks();
echo '
'
.$p_data['results'].'
';
echo $p_data['full'];
if ($p_data['total_results']) {
while ($row = @ mysql_fetch_array($pagnum->get_result(), MYSQL_ASSOC)) {
//if (!$row['nw_archive']) {
echo '
';
echo '
';
if ($row['nw_author']) {
echo '
by '.nl2br($row['nw_author']).'
';
}
echo $row['nw_brief'];
//echo '
';
//echo '
'.date('j F \'y', $row['nw_date']).'
';
//Tuesday, September 5th, 2006
//echo '
';
echo '
';
if ($row['nw_text']) {
echo '
'.date('j F \'y', $row['nw_date']).'
';
echo '
...more';
}
else {
echo '
';
}
echo '
';
echo '
';
}
echo $p_data['lite'];
}
echo '';
}
function show_catlist($cat_names, $cat_urls, $db_conn) {
echo '