<?php
/********************************************************/
/* NSN Groupes Sections                                 */
/* By: NukeScripts Network (webmaster@nukescripts.fr)   */
/* http://www.nukescripts.fr                            */
/* Copyright ¿ 2000-2005 by NukeScripts Network         */
/* ==================================================== */
/* Based from:                                          */
/* PHP-NUKE: Web Portal System                          */
/********************************************************/
defined('MAXIMUS') or Header("Location: index.php");

    global $multilingual, $currentlang,  $module_name;
    $sections_config = sections_get_configs();
    $blockr  = $sections_config['blockr'];
    $nblect  = $sections_config['nblect'];
    $fimp    = $sections_config['fimp'];
    $afftime = $sections_config['afftime'];
    $class   = $sections_config['class'];
    
    if ($multilingual == 1) {
    $querylang = "AND `slanguage`='$currentlang'";
    } else {
    $querylang = "";
    }
    $index = $blockr; 
    incoh();
    menu();
    $secid = $GLOBALS['db']->XMFnum($secid);
    $row_sec = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `secname` FROM `".TABLE_NSNSECTIONS_RUBRIQUES."` WHERE `secid`='$secid'"));
    $secname = stripslashes($row_sec['secname']);
    $result = $GLOBALS['db']->sql_query("SELECT `artid`, `secid`, `title`, `content`, `counter`, `time` FROM `".TABLE_NSNSECTIONS_ARTICLES."` WHERE `secid`='$secid' and `actif`='1' $querylang ORDER BY $class");
    Max_OpenTable();
    $row2 = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `image` FROM `".TABLE_NSNSECTIONS_RUBRIQUES."` WHERE `secid`='$secid'"));
    $image = stripslashes($row2['image']);
    echo "<table><tr>";
    if ($image) {
    echo "<td width='30%'><img src=\"images/sections/$image\" border=\"0\" alt='' /></td><td width='70%'>"; 
    } else {
    echo "<td width='100%'>"; 
    }
    echo "<font class=\"option\">
    "._THISISSEC." <b>$secname</b>.<br />"._FOLLOWINGART."</td></tr></table>
    <table border='0' align='center'>";$a = 1;
    while($row = $GLOBALS['db']->sql_fetchrow($result)) {
        $artid   = $GLOBALS['db']->XMFnum($row['artid']);
        $secid   = $GLOBALS['db']->XMFnum($row['secid']);
        $title   = stripslashes($row['title']);
        $content = stripslashes($row['content']);
        $counter = $GLOBALS['db']->XMFnum($row['counter']);
	$time    = formatTimestamp($row['time']);
        echo "<tr><td align='left'><font class='content'>
        <li> $a - <a href=\"modules.php?name=$module_name&amp;op=viewarticle&amp;artid=$artid\">$title</a>";
	if ($afftime) {
	echo ", "._WRITE." $time ";
	}
	if ($nblect) {
	echo " ($counter "._READS.")";
	}
	if ($fimp) {
        echo " <a href=\"modules.php?name=$module_name&amp;op=printpage&amp;artid=$artid\"><img src='modules/Sections/images/print.png' border='0' alt=\""._PRINTER."\" title=\""._PRINTER."\" /></a>";
	}
	echo "</li></td></tr>
        "; $a++;
    }
    echo "</table>";
    br('3');
    echo"<center>[ <a href=\"modules.php?name=$module_name\">"._SECRETURN."</a> ]</center>";
    Max_CloseTable();
    incof();