<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| Modified by PHP-Fusion SF Group
| Copyright © 2007 by SF
| http://www.rus-phpfusion.com/
+----------------------------------------------------*/

require_once "../maincore.php";
require_once BASEDIR."subheader.php";
require_once ADMIN."navigation.php";
include LOCALE.LOCALESET."admin/info_cms.php";
if (!checkRights("IC") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php");

opentable($locale['ic_001']);
echo "<table align='center' cellpadding='0' cellspacing='0' width='100%' RULES='cols' >
<tr>
<td class='tbl2' align='center' width='50%'>".$locale['ic_002']."</td>
<td class='tbl2' align='center' width='50%'>".$locale['ic_003']."</td>
</tr>
<tr>
<td class='tbl1' align='left'>";

//PHP info
$php_ver = phpversion();
echo $locale['ic_005'].$php_ver;

//MySQL info
$sql = "SELECT VERSION()";
list($version) = mysql_fetch_row(dbquery($sql));
echo "<br />".$locale['ic_017'].$version;

//GD info
$gdinfo = (function_exists('gd_info')) ? gd_info() : '';
$gdversion = ($gdinfo) ? trim(preg_replace("[A-Za-z()]","",$gdinfo["GD Version"])) : ' ------ ';
echo "<br />".$locale['ic_014'].$gdversion;

//REGISTER GLOBALS info
$register_globals = (ini_get('register_globals')==1) ? $locale['ic_006'] : $locale['ic_007'];
echo "<br />".$locale['ic_009'].$register_globals;

//SAFE MODE info
$safe_mode = (ini_get('safe_mode') == 1 || strtolower(ini_get('safe_mode'))=='on') ? $locale['ic_006'] : $locale['ic_007'];
echo "<br />".$locale['ic_010'].$safe_mode;

//MAGIC QUOTES info
$magic_quotes_gpc = (ini_get('magic_quotes_gpc')==1 || strtolower(ini_get('magic_quotes_gpc'))=='on') ? $locale['ic_006'] : $locale['ic_007'];
echo "<br />".$locale['ic_011'].$magic_quotes_gpc;

//MEMORY LIMIT info
$memory_limit = (ini_get('memory_limit')) ? ini_get('memory_limit') :  ' ------ ';
echo "<br />".$locale['ic_013'].$memory_limit;

//MAX UPLOAD info
$post_max_size = (ini_get('file_uploads')==0) ? $locale['ic_006'] : @ini_get('post_max_size');
echo "<br />".$locale['ic_012'].$post_max_size;

//MAX EXECUTION TIME info
$max_execution_time=@ini_get('max_execution_time');
echo "<br />".$locale['ic_008'].$max_execution_time;

//SERVER TYPE info
if(preg_match('#Microsoft-IIS/([0-9\.]+)#siU',$_SERVER['SERVER_SOFTWARE'],$servers)){
$type_server = "IIS v.$servers[1]";
} elseif(preg_match('#(Apache)/([0-9\.]+)\s#siU',$_SERVER['SERVER_SOFTWARE'],$servers)){
$type_server = "$servers[1] v.$servers[2]";
} elseif(strtoupper($_SERVER['SERVER_SOFTWARE'])=='APACHE'){
$type_server = 'Apache';
} else {
$type_server = ' ------ ';
}
echo "<br />".$locale['ic_015'].$type_server;

//OS TYPE info
$os = (PHP_OS) ? PHP_OS : ' ------ ';
echo "<br />".$locale['ic_016'].$os;
echo "</td>
<td class='tbl1' align='center'>";
include ('version.php');
echo "</td>
</tr>";
/*echo "<tr>
<td class='tbl2' align='center' colspan='2' width='100%'>".$locale['ic_004']."</td>
</tr>
<tr>
<td class='tbl1' align='center' colspan='2'>";
//RSS News
set_time_limit(0);

$file = "http://www.rus-phpfusion.com/rssnews.php";

$rss_channel = array();
$currently_writing = "";
$main = "";
$item_counter = 0;

function startElement($parser, $name, $attrs) {
   	global $rss_channel, $currently_writing, $main;
   	switch($name) {
   		case "RSS":
   		case "RDF:RDF":
   		case "ITEMS":
   			$currently_writing = "";
   			break;
   		case "CHANNEL":
   			$main = "CHANNEL";
   			break;
   		case "IMAGE":
   			$main = "IMAGE";
   			$rss_channel["IMAGE"] = array();
   			break;
   		case "ITEM":
   			$main = "ITEMS";
   			break;
   		default:
   			$currently_writing = $name;
   			break;
   	}
}

function endElement($parser, $name) {
   	global $rss_channel, $currently_writing, $item_counter;
   	$currently_writing = "";
   	if ($name == "ITEM") {
   		$item_counter++;
   	}
}

function characterData($parser, $data) {
	global $rss_channel, $currently_writing, $main, $item_counter;
	if ($currently_writing != "") {
		switch($main) {
			case "CHANNEL":
				if (isset($rss_channel[$currently_writing])) {
					$rss_channel[$currently_writing] .= $data;
				} else {
					$rss_channel[$currently_writing] = $data;
				}
				break;
			case "IMAGE":
				if (isset($rss_channel[$main][$currently_writing])) {
					$rss_channel[$main][$currently_writing] .= $data;
				} else {
					$rss_channel[$main][$currently_writing] = $data;
				}
				break;
			case "ITEMS":
				if (isset($rss_channel[$main][$item_counter][$currently_writing])) {
					$rss_channel[$main][$item_counter][$currently_writing] .= $data;
				} else {
					$rss_channel[$main][$item_counter][$currently_writing] = $data;
				}
				break;
		}
	}
}

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!($fp = fopen($file, "r"))) {
	die("could not open XML input");
}

while ($data = fread($fp, 4096)) {
	if (!xml_parse($xml_parser, $data, feof($fp))) {
		die(sprintf("XML error: %s at line %d",
					xml_error_string(xml_get_error_code($xml_parser)),
					xml_get_current_line_number($xml_parser)));
	}
}
xml_parser_free($xml_parser);

// output as HTML
$rss_channel["DESCRIPTION"] = mb_convert_encoding($rss_channel["DESCRIPTION"],"windows-1251","UTF-8");
$rss_channel["TITLE"] = mb_convert_encoding($rss_channel["TITLE"],"windows-1251","UTF-8");
if (isset($rss_channel["IMAGE"])) {
	echo "<a href=\"" . $rss_channel["LINK"] . "\" target=\"_blank\"><img border=\"0\" src=\"" . $rss_channel["IMAGE"]["URL"] . "\" align=\"middle\" alt=\"" . $rss_channel["IMAGE"]["TITLE"] . "\"></a>&nbsp;&nbsp;<b>" . $rss_channel["TITLE"] . "</b><br><br>";
} else {
	echo "<b>" . $rss_channel["TITLE"] . "</b><br><br>";
}
echo "" . $rss_channel["DESCRIPTION"] . "<br><br>";
if (isset($rss_channel["ITEMS"])) {
	if (count($rss_channel["ITEMS"]) > 0) {
		for($i = 0;$i < count($rss_channel["ITEMS"]);$i++) {
			$rss_channel["ITEMS"][$i]["TITLE"] = mb_convert_encoding($rss_channel["ITEMS"][$i]["TITLE"],"windows-1251","UTF-8");
			echo "\n<table width=\"100%\" border=\"0\"><tr><td width=\"100%\" class='tbl2'><a href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\" target=\"_blank\"><b>" . $rss_channel["ITEMS"][$i]["TITLE"] . "</b></a></b>";
			$rss_channel["ITEMS"][$i]["DESCRIPTION"] = mb_convert_encoding($rss_channel["ITEMS"][$i]["DESCRIPTION"],"windows-1251","UTF-8");
			echo "</td></tr><tr><td width=\"100%\" class='tbl1'>". html_entity_decode($rss_channel["ITEMS"][$i]["DESCRIPTION"]) . "";
			echo "</td></tr></table><br>";
		}
	} else {
		echo "<b>There are no articles in this feed.</b>";
	}
}
echo "</td>
</tr>";*/
echo "</table>\n";
closetable();

require_once BASEDIR."footer.php";
?>