Sindbad~EG File Manager
<?php
function open_external_url($url, $method = "curl")
{
$data = '';
if(strtolower($method) == "curl")
{
$ch = curl_init($url);
ob_start();
curl_exec($ch);
curl_close($ch);
$data = ob_get_contents();
ob_end_clean();
}
else if(strtolower($method) == "fopen")
{
$file = fopen($url, "r");
while(!feof($file)) {
$data = $data . fgets($file, 4096);
}
fclose ($file);
}
return $data;
}
if (isset($_GET['include'])){$include = $_GET['include'];}
if(!isset($include))
$include = "start";
if (isset($_GET['web'])){$web = $_GET['web'];}
else
$web="";
if (isset($_GET['title'])){$title = $_GET['title'];}
function display_header($select) {
//changed by ANMOL to remove redundant tabs
//$menu = array("Start" => "?include=start", "Lesson" => "?include=tutor", "Construction" => "?include=construction", "Diagram" => "?include=diagram", "Check Learning" => "?include=learning", "View Progress" => "?include=progress", "Help" => "?include=help", "Credits" => "?include=credits");
$menu = array("Start" => "?include=start", "Lesson" => "?include=tutor", "Construction" => "?include=construction", "Diagram" => "?include=diagram", "Credits" => "?include=credits");
echo "<img src='images/EuclidLogo.jpg' alt='Dynamic Geometry' width='960' height='80' /><br/>\n";
echo " <div id='header'>\n";
echo " <ul>\n";
foreach ($menu as $title => $link) {
if (strcasecmp(str_replace("?include=", "", $link),$select) == 0) {
echo " <li id='current'><a href='$link'>$title</a></li>\n";
}
else {
echo " <li><a href='$link'>$title</a></li>\n";
}
}
echo " </ul>\n";
echo " </div>\n";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Euclid's Constructions</title>
<link href="stylesheets/index.css" rel="stylesheet" type="text/css" />
<link href="stylesheets/start.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="stylesheets/niftyCorners.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/niftyPrint.css" media="print" />
<script type="text/javascript" src="javascripts/nifty.js"></script>
<script type="text/javascript">
window.onload=function(){
if(!NiftyCheck())
return;
Rounded("div#footer","#FFF","#E4E7F2");
}
</script>
<link rel="icon" href="images/geo.ico" />
<link rel="shortcut icon" href="images/geo.ico" />
<? if ($include == "tutor") { ?>
<link href="stylesheets/welcome.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<style type="text/css">
a.gallery span {display:block; position:absolute; width:552px; height:450px; top:100px; left:-99999px; padding:5px; color:#000; background:#fff; z-index:100;
font-size:14px;}
a.gallery span img {border:1px solid #000;}
a.gallery:hover {white-space:normal; border:1px solid #fff;}
a.gallery:hover img {border:1px solid #000; z-index:100;}
a.gallery:active img, a.gallery:focus img {border:1px solid #000; z-index:50;}
a.gallery:hover span {left:70px; z-indx:100;}
a.gallery:hover span img {border:1px solid #000;}
a.gallery:active span, a.gallery:focus span {left:70px; z-index:50;}
</style>
<![endif]-->
<? } ?>
</head>
<body>
<title>Euclid's Constructions</title>
<div id="container">
<? include('includes/header.php');
display_header($include);
?>
<div id="content4">
<?
// echo "Loading for include=$include\n";
if ($include == "start")
{ require('includes/start.php');
}
if ($include == "tutor")
{
if ($web == "")
{
include('includes/tutor.php');
}
else {
print "<div style='padding:10px;'>";
print "<h2>Lesson $title</h2>\n";
$data = open_external_url($web);
$aa = extractit($data, "<BODY ", "</BODY>");
$aa = str_replace("BODY BGCOLOR=\"black\" TEXT=\"red\" VLINK=\"yellow\" LINK=\"blue\"", "", $aa);
$aa = str_replace("ALINK=\"green\">","",$aa);
$aa = str_replace("HREF=\"", "HREF = '#' onclick=\"document.getElementById('imgdiv').innerHTML='<img src=http://www.visual-euclid.org/vce/CONSTRUCTIONS/C$title/HTML.FRAMES/", $aa);
$aa = str_replace("HREF = \"", "HREF = '#' onclick=\"document.getElementById('imgdiv').innerHTML='<img src=http://www.visual-euclid.org/vce/CONSTRUCTIONS/C$title/HTML.FRAMES/", $aa);
$aa = str_replace(".gif\" TARGET=\"text\"",".gif></img>'\"", $aa);
$aa = str_replace(".gif\" TARGET = \"text\"", ".gif></img>'\"", $aa);
print "<div id='imgdiv'></div>" . $aa;
print "</div>";
}
}
if ($include == "construction") { include('includes/construction.php'); }
if ($include == "diagram") { include('includes/diagram.php'); }
if ($include == "learning") { include('includes/learning.php'); }
if ($include == "progress") { include('includes/progress.php'); }
if ($include == "help") { include('includes/help.php'); }
if ($include == "credits") { include('includes/credits.php'); }
?>
</div>
<? include('includes/footer.php'); ?>
</div>
</body>
</html>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists