<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or Header("Location: index.php");

	incoh( 'Encyclo', 'html', "".CACHE_VENCYCLO."", '1' );
	title("$sitename: "._ENCYCLOPEDIA."");
	Max_OpenTable();
	echo "<center><font class=\"content\">"._AVAILABLEENCYLIST." $sitename:</font></center><br /><br />";
	$sql = "SELECT `eid`, `title`, `description`, `elanguage` FROM `".TABLE_ENCYCLOPEDIA."` WHERE `active`='1'";
	if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(CORE_ERROR, 'Could not obtain _encyclopedia', '', __LINE__, __FILE__, $sql);}
	echo "<blockquote>";
	while ($row = $GLOBALS['db']->sql_fetchrow($result)) {
		$eid         = $GLOBALS['db']->XMFnum($row['eid']);
		$title       = stripslashes(check_html($row['title'], "nohtml"));
		$description = stripslashes($row['description']);
		$elanguage   = stripslashes($row['elanguage']);
		if ($multilingual == 1) {
			$the_lang = "<img src=\"images/language/flag-$elanguage.png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\" alt='$elanguage' title='$elanguage' />";
		} else {
			$the_lang = "";
		}
		if ($subtitle != "") {
			$subtitle = "<br />($description)<br /><br />";
		} else {
			$subtitle = "";
		}
		if (defined('ADMIN_ALLOW')) {
			echo "<strong><big>&middot;</big></strong> $the_lang <a href=\"modules.php?name=$module_name&amp;op=list_content&amp;eid=$eid\">$title</a><br />$description<br />[ <a href=\"".$admin_file.".php?op=encyclopedia_edit&amp;eid=$eid\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=encyclopedia_change_status&amp;eid=$eid&amp;active=1\">"._DEACTIVATE."</a> | <a href=\"".$admin_file.".php?op=encyclopedia_delete&amp;eid=$eid\">"._DELETE."</a> ]<br /><br />";
		} else {
			echo "<strong><big>&middot;</big></strong> $the_lang <a href=\"modules.php?name=$module_name&amp;op=list_content&amp;eid=$eid\">$title</a><br /> $description<br /><br />";
		}
	}
	echo "</blockquote>";
	if (defined('ADMIN_ALLOW')) {
		$sql2 = "SELECT `eid`, `title`, `description`, `elanguage` FROM ".TABLE_ENCYCLOPEDIA." WHERE `active`='0'";
		if ( !($result2 = $GLOBALS['db']->sql_query($sql2)) )
{ query_die(CORE_ERROR, 'Could not obtain _encyclopedia', '', __LINE__, __FILE__, $sql2);}
		br('2');
		echo "<center><b>"._YOURADMININACTIVELIST."</b></center>";
		br('2');
		echo "<blockquote>";
		while ($row2 = $GLOBALS['db']->sql_fetchrow($result2)) {
			$eid         = $GLOBALS['db']->XMFnum($row2['eid']);
			$title       = stripslashes(check_html($row2['title'], "nohtml"));
			$description = stripslashes($row2['description']);
			$elanguage   = $GLOBALS['db']->XMFlang($row2['elanguage']);
			if ($multilingual == 1) {
				$the_lang = "<img src=\"images/language/flag-".$elanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\" />";
			} else {
				$the_lang = "";
			}
			if ($subtitle != "") {
				$subtitle = " ($subtitle) ";
			} else {
				$subtitle = " ";
			}
			echo "<strong><big>&middot;</big></strong> $the_lang <a href=\"modules.php?name=$module_name&amp;op=list_content&amp;eid=$eid\">$title</a><br />$description<br />[ <a href=\"".$admin_file.".php?op=encyclopedia_edit&amp;eid=$eid\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=encyclopedia_change_status&amp;eid=$eid&amp;active=0\">"._ACTIVATE."</a> | <a href=\"".$admin_file.".php?op=encyclopedia_delete&amp;eid=$eid\">"._DELETE."</a> ]<br /><br />";
		}
		echo "</blockquote>";
	}
	Max_CloseTable();
	incof( 'Encyclo', 'html', "".CACHE_VENCYCLO."", '1' );