<?PHP
######################################################################
# PHP-NUKE: Web Portal System
# ===========================
#
# Module to highlight easy language programs
#
# 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.
######################################################################
if(!isset($mainfile)) { include("mainfile.php"); }
function Highlight($script,$color) {
include ('config.php');
include ('header.php');
if ($color == "color")
$with_color="--color";
$inScript = $script;
echo "
<table border=0 width=100% cellpadding=0 cellspacing=1 bgcolor=000000>
<tr>
<td>
<table border=0 width=100% cellpadding=10
cellspacing=1 bgcolor=FFFFFF>
<tr>
<td><font size=3>
<b>
Output:
</b><br><br>
<table border=0 width=100% cellpadding=0
cellspacing=1 bgcolor=000000>
<tr><td>
<table border=0 width=100% cellpadding=10
cellspacing=1 bgcolor=FFFFFF>
<tr><td><font size=2>";
$script=preg_replace("/</","<",$script);
$script=preg_replace("/>/",">",$script);
$script=preg_replace("/ /","@myspace@",$script);
$script=`echo "$script" | /usr/home2/freemark/public_html/cgi-bin/enscript -Whtml $with_color -Eeasylanguage -p -`;
$script=preg_replace("/@myspace@/"," ",$script);
$script=preg_replace("/\t/"," ",$script);
$script=preg_replace("/\n/","<br>",$script);
echo "$script";
echo " </font></td></tr>
</table>
</td></tr>
</table><br>
<form action=ezhilit.php method=post>
<input type=submit value=\"Highlight Another Script\">
</form>
</font></td>
</tr>
</table>
</td>
</tr>
</table>
";
include ('footer.php');
}
function SubmitScript() {
global $sampleScript;
if (!isset($config)) { include("config.php"); }
include ('header.php');
if (strlen($script) == 0) {
$script = $sampleScript;
} else {
print "Here 2\n";
}
echo "
<table border=0 width=100% cellpadding=0 cellspacing=1 bgcolor=000000>
<tr>
<td>
<table border=0 width=100% cellpadding=10
cellspacing=1 bgcolor=FFFFFF>
<tr>
<td><font size=4>
<b>
EasyLanguage Highlighting
</b><br><br>
<font size=2>
<b>Enter your EasyLanguage Script Below:</b>
<form action=ezhilit.php method=post>
<input type=hidden name=op value=Highlight>
<TEXTAREA class=textbox cols=70 rows=18 name=script>
{
SumTimesClose
Erase this script and enter your own script
since this script is useless.
}
Inputs : Price(NumericSeries), Length(NumericSimple);
Variables: Counter(0), Sum(0);
Sum = 0;
For Counter = 0 to Length - 1 Begin
Sum = Sum + Price[Counter];
End
Plot1(Sum,\"Sum\");
SumTimesClose = Sum * Close;
</TEXTAREA><br>
Color: <input type=radio name=color value=color CHECKED>
B/W: <input type=radio name=color value=bw>
<input type=submit value=\"Highlight\">
</form>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
";
include ('footer.php');
}
switch($op) {
case "Highlight":
Highlight($script,$color);
break;
default:
SubmitScript();
break;
}
?>