";
if ($head == "on") {
include("footer.php");
}
exit();
}
} else {
echo "";
}
// end password protection.
function admin(){
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// "Choose a name for the new Edit-Point" form-field.
echo "";
// End of "Select a webpage to edit" form-field.
// Manually edit Editor Page.
echo "
";
// End manually edit Editor Page.
// Manually edit webpages.
echo "";
// End manually edit webpages.
// include Edit-Point links on admin page, if "on" in config.php.
if ($adminlink == "on") {
echo "
$p
Choose an Edit-Point to modify:
$p2";
include("$datadir/textlinks.txt");
}
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// add Edit-Point to data directory and Editor Page function.
function admin2($name, $comments, $file){
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// option to add one link to multiple places.
if ($multi == "off") {
$multi2 = "admin3";
} else {
$multi2 = "admin6";
}
$txt = 'txt'; // extension for data files.
$nametxt = $name.'.'.$txt; // add .txt extension to $name for data files.
$point = '$point'; // html output fix for printing Edit-Point link added to webpage.
$comments = stripslashes($comments);// stripslashes from text.
// open/create data file, write to it and close.
$open = fopen("$datadir/$nametxt", 'wb');
fwrite($open, $comments);
fclose($open);
// html for Edit-Point links on Editor-Page (index.php).
$addlink = "
";
// add html for Edit-Point links to Editor-Page (index.php).
$openlink = fopen("$datadir/textlinks.txt", 'a+');
fwrite($openlink, $addlink);
fclose($openlink);
// html.
echo "$p
Edit-point $name was successfully created and the Edit-Point editor link has been added to the Editor-Page";
// confirm the include of Edit-Point links on admin page, if "yes" in config.php.
if ($adminlink == "on") {
echo " and the Admin-Page.";
}
else {
echo ".";
}
echo "$p2
";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Add Edit-point to webpage function.
function admin3($name, $comments, $file){
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// write to webpage.
$comments = stripslashes($comments);
$open = fopen("$file", 'wb');
fwrite($open, $comments);
fclose($open);
// redirect to admin page.
echo "";
echo "$p
Edit-Point $name has been successfully added to $file!!!
$p2
$p
Automatically redirecting to the Admin-Page
$p2";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Open the Editor-Page for editing function.
function admin4(){
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// Open Editor-Page for editing.
echo "";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Save changes to the Editor-Page function.
function admin5($comments){
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// save editor-page changes.
$comments = stripslashes($comments);
$open = fopen("$datadir/textlinks.txt", 'wb');
fwrite($open, $comments);
fclose($open);
echo "";
echo "
";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// function to add edit-point to multiple places option.
function admin6($name, $comments, $file){
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// write to webpage.
$comments = stripslashes($comments);
$open = fopen($file, 'wb');
fwrite($open, $comments);
fclose($open);
echo "$p
Edit-Point $name has been successfully added to $file!!!
$p2
";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// add edit-point to multiple places "select file" function.
function admin7($name) {
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// "Choose a name for the new Edit-Point" form-field.
echo "";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Save Edit-Point to webpage function.
function admin8($name, $file) {
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
$txt = 'txt'; // extension for data files.
$nametxt = $name.'.'.$txt; // add .txt extension to $name for data files.
$point = '$point'; // html output fix for printing Edit-Point link added to webpage.
echo "$p2
";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Function to manually edit a webpage.
function admin9($file) {
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// Textarea with webpage code for manual editing.
echo "";
}
// Save manually edited webpage.
function admin10($comments, $file) {
// config.php is the main configuration file.
include('config.php');
// name of page for links and title.
if ($su == "on") {
$page_name = "su";
} else {
$page_name = "admin";
}
// include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// write to webpage.
$comments = stripslashes($comments);
$open = fopen($file, 'wb');
fwrite($open, $comments);
fclose($open);
// redirect to admin page.
echo "";
echo "$p
The webpage $file has been successfully edited!!!
$p2
$p
Automatically redirecting to the Admin-Page
$p2";
// include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
switch($_REQUEST['cmd']){
default:
admin();
break;
case "admin2";
admin2($_POST['name'], $_POST['comments'], $_POST['file']);
break;
case "admin3";
admin3($_POST['name'], $_POST['comments'], $_POST['file']);
break;
case "admin4";
admin4();
break;
case "admin5";
admin5($_POST['comments']);
break;
case "admin6";
admin6($_POST['name'], $_POST['comments'], $_POST['file']);
break;
case "admin7";
admin7($_POST['name']);
break;
case "admin8";
admin8($_POST['name'], $_POST['file']);
break;
case "admin9";
admin9($_POST['file']);
break;
case "admin10";
admin10($_POST['comments'], $_POST['file']);
}
?>