$cgiDir = $nof_rootDir ."/". $nof_scriptDir . "/";
$componentid = $nof_componentId;
$xml_file = $nof_scriptInterfaceFile;
if (NOF_fileExists($cgiDir . "nw_lib.php")) {
include_once($cgiDir."nw_lib.php");
} else {
exit();
}
$conf = parseXmlFile($cgiDir.$xml_file);
$SNCompIdent = $nof_componentName . "." . $componentid . ".";
$showdate = $conf[$SNCompIdent."showDate"];
$dateformat = $conf[$SNCompIdent."dateFormat"];
$timeformat = $conf[$SNCompIdent."timeFormat"];
$timezone = $conf[$SNCompIdent."timeZone"];
$timezone = $timezone*3600;
$newsTitle = $conf[$SNCompIdent."newsTitle"];
$gobackLinkText = $conf[$SNCompIdent."backLink"];
$showbacklink = $conf[$SNCompIdent."backLink.show"];
$gobackLink = $conf[$SNCompIdent."itemsListpage"];
if ( isset($nof_popupwindow) and $nof_popupwindow ) {
$gobackLink = "javascript:window.close();window.opener.focus();";
}
$shownavigation = $conf[$SNCompIdent."showNavigation"];
$dbPath = $conf[$SNCompIdent.'dbPath'];
$labels = explode(",", $conf[$SNCompIdent."fields"]);
$showtitle = substr($labels[0],0,1) == '1' ? true : false;
$titlereq = substr($labels[0],1,1) == '1' ? true : false;
$titlelabel = substr($labels[0],2);
$showshortmessage = substr($labels[1],0,1) == '1' ? true : false;
$shortmessagereq = substr($labels[1],1,1) == '1' ? true : false;
$shortmessagelabel = substr($labels[1],2);
$showfullmessage = substr($labels[2],0,1) == '1' ? true : false;
$fullmessagereq = substr($labels[2],1,1) == '1' ? true : false;
$fullmessagelabel = substr($labels[2],2);
$showauthor = substr($labels[3],0,1) == '1' ? true : false;
$authorreq = substr($labels[3],1,1) == '1' ? true : false;
$authorlabel = substr($labels[3],2);
$showpicture = substr($labels[4],0,1) == '1' ? true : false;
$picturereq = substr($labels[4],1,1) == '1' ? true : false;
$picturelabel = substr($labels[4],2);
$flag_emptydb=0;
$lines_array=array();
$numberoflines=0;
if (!file_exists($cgiDir.$dbPath)) {
$flag_emptydb=1;
}else{
$lines_array=nwgetdb($cgiDir.$dbPath,1);
$numberoflines = sizeof($lines_array);
$picture_pos="";
foreach($fields_array as $key => $value){
if(trim($value)=="validation"){
$validation_pos=$key;
}
if(trim($value)=="title"){
$title_pos=$key;
}
if(trim($value)=="shortmessage"){
$shortmessage_pos=$key;
}
if(trim($value)=="fullmessage"){
$fullmessage_pos=$key;
}
if(trim($value)=="author"){
$author_pos=$key;
}
if(trim($value)=="image"){
$picture_pos=$key;
}
if(trim($value)=="date"){
$date_pos=$key;
}
if(trim($value)=="id"){
$id_pos=$key;
}
}
}
$offset=1;
if ( GetGVariable('nwoffset') != '' ) { $offset = GetGVariable('nwoffset'); }
$extraVars = '';
$itemsnumber = 1;
?>
|
if ( $showbacklink == "true" ) {
echo ''.$gobackLinkText.'';
} else {
echo ' ';
}
?>
|
if ( $shownavigation == "true" and $flag_emptydb==0 and $numberoflines!=0 ) {
displaypages($offset,$numberoflines,$itemsnumber,5,$extraVars);
}
?>
|
if ( isset($nof_popupwindow) and $nof_popupwindow ) {
echo "\r\n";
}
?>
$start=$offset-1;
$inc=1;
while($start>=0 and $start<$numberoflines and $inc<=$itemsnumber and $lines_array[$start]){
//show the detalied news
?>
if ( $showpicture and $picture_pos!="" and $lines_array[$start][$picture_pos]!="" ) {
echo ' ';
echo '  ';
echo imgresize($cgiDir."images/",$lines_array[$start][$picture_pos],122,180);
echo " ";
echo ' | ';
echo ' ';
}
else {
echo ' | ';
}
if ( $showdate == "true" ) {
echo "".displayDate($lines_array[$start][$date_pos],$dateformat, $timeformat, $timezone)."";
echo '
';
echo ' ';
}
?>
".htmlspecialchars($lines_array[$start][$title_pos])."";?>
=htmlEncode(htmlspecialchars($lines_array[$start][$fullmessage_pos]))?>
if ( $showauthor ) { ?>
=htmlspecialchars($lines_array[$start][$author_pos])?>
} ?>
|
$inc++;
$start++;
}
?>
if(sizeof($lines_array)==0){
?>
| =$GLOBALS['nof_resources']->get('nw.Text.NoNews')?> |
}
?>
|
|