Cooper Baker · About This Website
Webpage Object System
This website automatically generates itself based on the content of several files within each webpage-object. Each page is represented on disk by a corresponding directory which has a files sub-directory containing content and metadata files, as well as a symbolically linked lib directory, pointing to a single location that contains site-wide files. Organizing and rearranging pages is as simple as moving directories because webpage hierarchy is dictated by directory structure.

The PHP scripting language is used to navigate the page hierarchy, interpret files, and output html to your browser. PHP was chosen for its extensive set of html and string handling functions.

Editor
The website has an editor as well as several PHP functions that create content from media files according to stylesheet rules. I do it this way so that pages are created and updated quickly, and content may be edited from any browser.

Content Functions
<?php
    ruler
'topic' );
    
// makes a horizontal ruler with topic above the line
    
    
big_ruler'topic' );
    
// makes a horizontal ruler with large text above the line
    
    
big_link'http://url...''title''description')
    
// makes a large link named title which points to url description after the link
    
    
child_index();
    
// makes a list of child objects using big_link() and respective description data
    
    
href'http://url...''title' );
    
// makes a link named title which points to url and opens in a new window
    
    
graphic'graphic.png' );
    
// inserts an <img...> tag with graphic.png and no style rules
    // graphic.png must be in page/files
    
    
photo'photo.jpg' );
    
// inserts an <img...> tag with photo.jpg and style rules defined in .photo
    // photo.jpg must be in page/files
    
    
fileadd'filename.xxx' );
    
// includes filename.xxx using include()
    // filename.xxx must be in page/files

    
file_dl'filename.xxx''descrip' );
    
// links filename.xxx for download using an <a href...> tag
    // filename.xxx must be in page/files

    
video'video.mp4''info' );
    
// embeds video.mp4 and displays info according to #video formatting rules
    // video.mp4 must be in page/files
    
    
audio'video.mp3''info' );
    
// embeds video.mp4 and displays info according to #audio formatting rules
    // audio.mp3 must be in page/files
    
    
code'code.xxx' );
    
// includes code.xxx and preserves whitespace using highlight_file()
    // code.xxx must be in page/files and will only be highlighted if it is .php
    
    
blog();
    
// stitches together .php files to create a chronological weblog
    // /files/blog must exist and contain files
    
    
gallery();
    
// displays thumbnails linked to larger images
    // /files/gallery/thumbs must exist with identical file names in
    // both /gallery and /gallery/thumbs
    
    
faq();
    
// displays a unformatted list of clickable frequently asked question topics
    // made from the filenames of .php files in files/faq
    // files/faq must exist and contain files
?>

index.php
<?php                          
    
// put this file in the webpage directories

    // turn on error reporting
    
ini_set'display_errors');
    
error_reportingE_ALL E_NOTICE );

    
// include the global index template
    
sitewide_require"lib/global_index.php" );

    
// root is file owner's http root directory 
    
function sitewide_require$file_name )
    {                                                                
        
$http_root "Sites/";
        
$uid_info  posix_getpwuidfileowner__FILE__ ) );
        
$root_path explode$uid_info'name' ], $_SERVER'SCRIPT_FILENAME' ] );

        require( 
$root_path].$uid_info'name' ]."/".$http_root.$file_name );    
    } 
?>

functions.php
<?php

ini_set
('highlight.comment''#aa3333; font-weight: bold;');
ini_set('highlight.default''#333333; font-weight: bold;');
ini_set('highlight.html''#996633; font-weight: bold;');
ini_set('highlight.keyword''#3366aa; font-weight: bold;');
ini_set('highlight.string''#339933; font-weight: bold;');


$local;
$parent;

function 
get_username()
{
    
$uid_info posix_getpwuidfileowner__FILE__ ) );
    return 
$uid_info'name' ];
}

function 
local_dir$dir '.' )
{
    return 
substrrealpath$dir ), 24 );
    
// echo realpath( $dir );  // <-------------- enable to count position
    // edit the above substr to indicate the starting character position of the
    // site's top-level directory in realpath( $dir );
    //
/*
/Volumes/Studios/people/cbaker/Sites/Home  
/Volumes/Studios/cbaker/Sites/Home  
/Volumes/Studios/cbaker/public_html/Home
*/  
}
    
function 
ls$dir '.'$local_dir '' 
{       
    
$separator_flag 0;
    
$ignore = array( '.''..''.DS_Store''index.php''files''lib''Under Construction' );
    
$dh = @opendir$dir );

    
$local_flag $local_dir 1;
    
$down_flag 0;

    if( 
$local_dir != 'Home' )
    {
        while( 
$file readdir$dh ) )
        {   
            if( !
in_array$file$ignore ) && !stristr$file'._' ) )
            {
                if( 
is_dir"$dir/$file) && ( $file != $local_dir ) )
                {
                    if( !
$local_flag )
                    {
                        echo( 
'<img src="./files/lib/arrow_sides.png" border=0 align=top> ' );
                    }
                    if( ( 
$local_flag == ) && ( $down_flag == ) )
                    {
                        echo( 
'<br><img src="./files/lib/arrow_down.png" border=0 align=top> ' );
                    }
                    if( 
$separator_flag )
                    {
                        echo( 
' &middot; ' );
                    }
                    
$separator_flag 1;
                    
$local_flag 1;
                    
$down_flag 1;
                    
                    echo( 
'<a href="'.$dir.$file.'" class=navlink>'.$file.'</a>' );
                }
            }
        }
    }
    
closedir$dh );
    if( !
$separator_flag )
    {
        
// echo( '&nbsp;' );
    
}
}
http://music.calarts.edu/~cbaker/Home/Artwork/files/lib/forms.php?path=/Volumes/Studios/people/cbaker/Sites/Home/Artwork/files
function sitemap_edit$dir '../../'$depth )
{
    
$ignore = array( '.''..''.DS_Store''index.php''files''lib' );
    
$dh = @opendirrealpath$dir ) );
    
    
$local_url substrlocal_dir$dir ), strposlocal_dir$dir ), "Home" ));
    
    
$local_file substrrealpath$dir ), strrposrealpath$dir ), '/' )+);
    
$spaces str_repeat'&nbsp;', ( $depth ) );
    echo( 
$spaces.'<a href="/~'.get_username().'/lib/forms.php?path='.realpath$dir ).'/files" class=navlink target=edit_frame>'.$local_file.'</a><br />' );
    
    while( 
$file readdir$dh ) )
    {   
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {
            if( 
is_dir"$dir/$file) )
            {
                
sitemap_edit"$dir/$file", ($depth+1) );
            }
        }
    }
    
closedir$dh );
}
    
function 
sitemap$dir '.'$depth )
{
    
$ignore = array( '.''..''.DS_Store''index.php''files''lib''Under Construction' );
    
$dh = @opendirrealpath$dir ) );
    
    
$local_url substrlocal_dir$dir ), strposlocal_dir$dir ), "Home" ));
    
    
$local_file substrrealpath$dir ), strrposrealpath$dir ), '/' )+);
    
$spaces str_repeat'&nbsp;', ( $depth ) );
    echo( 
$spaces.'<a href="../../'.$local_url.'" class=navlink>'.$local_file.'</a><br />' );
    
    while( 
$file readdir$dh ) )
    {   
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {
            if( 
is_dir"$dir/$file) )
            {
                
sitemap"$dir/$file", ($depth+1) );
            }
        }
    }
    
closedir$dh );
}

function 
generate_xml_sitemap()
{
//  $root_a = "http://www.cooperbaker.com"; 
    
$root_b "http://music.calarts.edu/~".get_username();


    
$htmlroot_sitemap "Sites/sitemap.xml";
    
$uid_info posix_getpwuidfileowner__FILE__ ) );
    
$rootpath explode$uid_info'name' ], $_SERVER'SCRIPT_FILENAME' ] );
    
$xml_file fopen$rootpath].$uid_info'name' ]."/".$htmlroot_sitemap"a+" );
    
    

//  edit this line when migrating to match the new path to sitemap.xml   
//    $xml_file = fopen( "/Volumes/Studios/people/cbaker/Sites/Home/lib/sitemap.xml", "a+" );
    
    
ftruncate$xml_file);
    
fwrite$xml_file,  '<?xml version="1.0" encoding="UTF-8"?>'."\n".'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n" );
    
//fwrite( $xml_file, "\n  <url>\n    <loc>$root</loc>\n  </url>\n" );
    
    
xml_sitemap'.'0$xml_file$root_b );
//  xml_sitemap( '.', 0, $xml_file, $root_a );
    
    
fwrite$xml_file"\n</urlset>\n" );
    
fclose$xml_file );
}

function 
xml_sitemap$dir '.'$depth 0$xml_file$root )
{   
    
$ignore = array( '.''..''.DS_Store''index.php''files''lib''Under Construction' );
    
$dh = @opendirrealpath$dir ) );
    
    
$local_url substrlocal_dir$dir ), strposlocal_dir$dir ), "Home" ));
    
    
$local_file substrrealpath$dir ), strrposrealpath$dir ), '/' )+);
    
$spaces str_repeat'&nbsp;', ( $depth ) );

    
fwrite$xml_file"\n  <url>\n    <loc>$root/$local_url</loc>\n  </url>\n" );
    
    
    while( 
$file readdir$dh ) )
    {   
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {
            if( 
is_dir"$dir/$file) )
            {
                
xml_sitemap"$dir/$file", ( $depth+), $xml_file$root );
            }
        }
    }
    
closedir$dh );

}

function 
edit_files_ls$dir '.'$depth )
{
    
$ignore = array( '.''..''lib''.DS_Store' );
    
$dh = @opendir$dir );
    
$local_url substrlocal_dir$dir ), strposlocal_dir$dir ), "Home" ));
    
    while( 
$file readdir$dh ) )
    {   
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {
            
$spaces str_repeat'&nbsp;', ( $depth ) );
            if( 
is_dir$dir.'/'.$file ) )
            {
                echo( 
$spaces.$file.'<br>' );
                
edit_files_ls$dir.'/'.$file, ($depth+1) );
            }
            else 
            {
                echo( 
$spaces.'<a href="/~'.get_username().'/'.$local_url.'/'.$file.'" class=navlink target=new>'.$file.'</a><br>' );
            }           
        }
    }
    
closedir$dh );
}

    
function 
parent_dir( )
{
    
$dir_array explode'/'realpath'../' ) );
    
$dir $dir_arraycount$dir_array ) - ];
    if( ( 
$dir )
    &&  ( 
$dir != 'public_html' )
    &&  ( 
$dir != 'Sites' ) )
    {
        echo( 
'<a href="../" class=navlink>'.$dir.'</a>' );
    }
}

function 
self_dir( )
{
    global 
$local;
    global 
$parent;
    
    
$dir_array explode'/'realpath'./' ) );
    
$local $dir_arraycount$dir_array ) - ];

    
$dir_array explode'/'realpath'../' ) );
    
$dir $dir_arraycount$dir_array ) - ];
    
    if( ( 
$dir )
    &&  ( 
$dir != 'public_html' )
    &&  ( 
$dir != 'Sites' ) )
    {
        
$parent $dir;
    }
}

// function random_background( $dir = './files/lib/bgnd' )
function random_background()
{                                                  
    
$html_background_dir "/~".get_username()."/lib/backgrounds/";

    
$htmlroot_background_dir "Sites/lib/backgrounds/";
    
$uid_info posix_getpwuidfileowner__FILE__ ) );
    
$rootpath explode$uid_info'name' ], $_SERVER'SCRIPT_FILENAME' ] );
    
$dir $rootpath].$uid_info'name' ]."/".$htmlroot_background_dir;

    
$separator_flag 0;
    
$ignore = array( '.''..''.DS_Store' );
    
$dh = @opendir$dir );
    
$i 0;
    
    while( 
$file$i ] = readdir$dh ) )
    {   
        if( !
in_array$file$i ], $ignore ) && !stristr$file$i ], '._' ) )
        {
            
$image_file$i ] = $file$i ];
            
$i++;
        }
    }
    
closedir$dh );
    
    
$i rand() % ( $i );
    
    echo( 
'<img src="'.$html_background_dir.$image_file$i ].'" width="100%" height="100%" class="bgimg">' );
}
    
function 
random_background_edit()
{   
    
$html_background_dir "/~".get_username()."/lib/backgrounds/";

    
$htmlroot_background_dir "Sites/lib/backgrounds/";
    
$uid_info posix_getpwuidfileowner__FILE__ ) );
    
$rootpath explode$uid_info'name' ], $_SERVER'SCRIPT_FILENAME' ] );
    
$dir $rootpath].$uid_info'name' ]."/".$htmlroot_background_dir;

    
$separator_flag 0;
    
$ignore = array( '.''..''.DS_Store' );
    
$dh = @opendir$dir );
    
$i 0;
    
    while( 
$file[$i] = readdir$dh ) )
    {   
        if( !
in_array$file[$i], $ignore ) && !stristr$file[$i], '._' ) )
        {
            
$image_file[$i] = $file[$i];
            
$i++;
        }
    }
    
closedir$dh );
    
    
$i rand()%($i-1);
    
    echo( 
'<img src="'.$html_background_dir.$image_file$i ].'" width="100%" height="100%" class="bgimg">' );
}

function 
head_maker()
{                       
    
$username get_username();
    
    
$title_path "./files/title.txt";
    
$title file_get_contents$title_path );
    
    
$author_path "./files/author.txt";
    
$author file_get_contents$author_path );
    
    
$keywords_path "./files/keywords.txt";
    
$keywords file_get_contents$keywords_path);
    
    
$description_path "./files/description.txt";
    
$description file_get_contents$description_path );
    
    
$copyright_path "./files/copyright.txt";
    
$copyright file_get_contents$copyright_path );
    
    echo ( 
'<head>'."\n" );
    echo ( 
'    <meta http-equiv="content-type" content="text/html" charset="UTF-8">'."\n" );
    echo ( 
'    <meta name="description" content="'.$description.'">'."\n" );
    echo ( 
'    <meta name="keywords" content="'.$keywords.'">'."\n" );  
    echo ( 
'    <meta name="author" content="'.$author.'">'."\n" );  
    echo ( 
'    <meta name="copyright" content="'.$copyright.'">'."\n" );
    echo ( 
'    <link rel="shortcut icon" type="image/x-icon" href="/~'.get_username().'/lib/browser_icon.png">'."\n" );
    echo ( 
'    <title>'."\n" );
    echo ( 
'        Cooper Baker &middot; '.$title.''."\n" );
    echo ( 
'    </title>'."\n" );
    echo ( 
'</head>'."\n" );
}

function 
visitor_log()
{
    
$page       $_SERVER['PHP_SELF'];
    
$agent      $_SERVER['HTTP_USER_AGENT'];
    
$ip         $_SERVER['REMOTE_ADDR'];
    
$ip_name    gethostbyaddr$ip );
    
$port       $_SERVER['REMOTE_PORT'];
    
$d          date"l F jS Y g:i:sa" );

    
$log_path "Sites/lib/visitor_log.txt";
    
$uid_info posix_getpwuidfileowner__FILE__ ) );
    
$rootpath explode$uid_info'name' ], $_SERVER'SCRIPT_FILENAME' ] );
    
$log fopen$rootpath].$uid_info'name' ]."/".$log_path"a+" );    

    
fwrite$log,  "Page       : $page\nIP Address : $ip - $ip_name\nBrowser    : $agent\nDate       : $d\n\n" );
    
fclose$log );
}

function 
get_visit_count()
{
    
$log_path "Sites/lib/visitor_log.txt";
    
$uid_info posix_getpwuidfileowner__FILE__ ) );
    
$rootpath explode$uid_info'name' ], $_SERVER'SCRIPT_FILENAME' ] );
    return 
countfile$rootpath].$uid_info'name' ]."/".$log_path ) ) / 5;
}

// Layout Functions Below ======================================================
//==============================================================================

function ruler$topic '' )
{
    echo( 
'<div id=ruler>' );
    echo 
$topic;
    echo( 
'</div>' );
}

function 
big_ruler$topic '' )
{
    echo( 
'<div id=big_ruler>' );
    echo 
$topic;
    echo( 
'</div>' );
}

function 
video$video_file$info '' )
{
    echo( 
'<div id=video>' );   
    echo( 
'<object width="320" height="256" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"' );
    echo( 
'codebase="http://www.apple.com/qtactivex/qtplugin.cab">' );
    echo( 
'<param name="src" value="./files/'.$video_file.'">' );
    echo( 
'<param name="autoplay" value="false"><param name="controller" value="true">' );
    echo( 
'<embed src="./files/'.$video_file.'" width="320" height="256" autoplay="false" controller="true"' );
    echo( 
'"pluginspage="http://www.apple.com/quicktime/download/"></embed></object>' );
    echo( 
'<br><table cellspacing=0 cellpadding=0 border=0 id=audio><tr><td align=left>' );
    echo( 
'<a href="./files/'.$video_file.'" class=medialink>'.$video_file.'</a></td>' );
    if( 
$info )
    {
        echo( 
'<td align=right>'.$info.'</td>');    
    }
    echo( 
'</tr></table></div>' );
}

function 
audio$audio_file$info '' )
{
    echo( 
'<div id=audio>' );   
    echo( 
'<object width="100%" height="16" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"' );
    echo( 
'codebase="http://www.apple.com/qtactivex/qtplugin.cab">' );
    echo( 
'<param name="src" value="./files/'.$audio_file.'">' );
    echo( 
'<param name="autoplay" value="false"><param name="controller" value="true">' );
    echo( 
'<embed src="./files/'.$audio_file.'" width="100%" height="16" autoplay="false" controller="true"' );
    echo( 
'"pluginspage="http://www.apple.com/quicktime/download/"></embed></object>' );
    echo( 
'<br><table cellspacing=0 cellpadding=0 border=0 id=audio><tr><td align=left>' );
    echo( 
'<a href="./files/'.$audio_file.'" class=medialink>'.$audio_file.'</a></td>' );
    if( 
$info )
    {
        echo( 
'<td align=right>'.$info.'</td>');    
    }
    echo( 
'</tr></table></div>' );
}

function 
code$code_file )
{
    echo( 
'<div id=code>' );
    echo 
rtrimhighlight_file'./files/'.$code_file ), );
    echo( 
'</div><br>' );
}

function 
fileadd$filename )
{
    include( 
'./files/'.$filename );
}

function 
file_dl$file$info )
{
    echo( 
'<a href="./files/'.$file.'" target=new>'.$info.'</a>' );
}

function 
href$url$info )
{
    echo( 
'<a href="'.$url.'" target=new>'.$info.'</a>' );
}

function 
big_link$url$info$text '' )
{
    echo( 
'<div id=big_text>' );
    echo( 
'<div id=big_link_box>' );
    echo( 
'<a href="'.$url.'" class=big_link>'.$info.'</a>' );
    echo( 
'</div>' );
    if( 
$text )
    {
        echo( 
$text );
    }
    echo( 
'&nbsp;</div>');
}

function 
child_index$dir '.'$local_dir '' 
{       
    
$separator_flag 0;
    
$ignore = array( '.''..''.DS_Store''index.php''files''lib''Under Construction' );
    
$dh = @opendir$dir );

    echo( 
'<table cellspacing="12px" cellpadding="0" border="0">'  );
    
    while( 
$file readdir$dh ) )
    {   
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {
            if( 
is_dir"$dir/$file) && ( $file != $local_dir ) )
            {
                
$child_handle "$file/files/description.txt";
                
$child_description file_get_contents$child_handle );
               
                echo( 
'<tr><td align=right>' );
                echo( 
'<a href="'.$file.'" class=big_link>'.$file.'</a>' );
                echo( 
'</td><td id="big_text">');
                if( 
$child_description )
                {
                    echo( 
$child_description );    
                }
                echo( 
'</td></tr>');
            }
        }
    }
    
    echo( 
'</table>' );

    
closedir$dh );
}

function 
graphic$graphic_file )
{
    echo( 
'<img src="./files/'.$graphic_file.'">' );
}

function 
photo$photo_file )
{
    echo( 
'<img src="./files/'.$photo_file.'" class=photo>' );
}

function 
gallery()
{
    
$ignore = array( '.''..''.DS_Store' );
    
$dh = @opendir'./files/gallery/thumbs' );
    
$column 0;
    
    echo( 
'<center><table cellspacing=8 cellpadding=0 border=0 width="90%">' );
    echo( 
'<tr>' );
        
    while( 
$file readdir$dh ) )
    {   
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {
            if( !
is_dir"$dir/$file) )
            {
                switch( 
$column )
                {
                    case 
0  :   echo( '</tr><tr>' );
                    default :   echo( 
'<td align=center>' );
                                echo( 
'<a href="./files/gallery/'.$file.'" target=new>' );
                                echo( 
'<img src="./files/gallery/thumbs/'.$file.'" class=photo>' );
                                echo( 
'<br>'.substr$file0, -).'</a>' );
                                echo( 
'</td>' );
                }
                
$column++;
                
$column = ( $column ) ? $column;
            }
        }
    }
    
closedir$dh );
    echo( 
'</tr></table></center>' );
}

function 
blog_ruler$topic '' $date '' )
{
    echo( 
'<div id=ruler>'.$topic );
    echo( 
'<div id=blog_date>'.$date );
    echo( 
'</div></div>' );
}

function 
blog()
{
    
$ignore = array( '.''..''.DS_Store' );
    
$dh = @opendir'./files/blog' );
    
$i 0;
    
$j 0;
    
    while( 
$file readdir$dh ) )
    {
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {   
            
$file_name$i ] = $file;
            
$file_date$i ] = filemtime'./files/blog/'.$file );
            
$i++;
        }
    }
    
    
closedir$dh );

    
array_multisort$file_dateSORT_DESC$file_name );
    
    while( 
$j $i )
    {
        
blog_rulersubstr$file_name$j ], 0, -), date("l, F jS, Y @ g:ia"$file_date$j ] ) );
        include( 
'./files/blog/'.$file_name$j ] );
        echo( 
'<br><br>' );
        
$j++;
    }
}


function 
faq()
{
    
$ignore = array( '.''..''.DS_Store' );
    
$dh = @opendir'./files/faq' );
    
$i 0;
    
$j 0;
    
    echo( 
"<ul>" );
    while( 
$file readdir$dh ) )
    {
        if( !
in_array$file$ignore ) && !stristr$file'._' ) )
        {   
            
$file_name$i ] = $file;
            echo( 
"<li>" );
            echo( 
'<a href="#'.substr$file_name$i ], 0, -).'">'.substr$file_name$i ], 0, -).'</a>' );
            echo( 
"</li>" );
            
$i++;
        }
    }
    echo( 
"</ul>" );
    
closedir$dh );

    while( 
$j $i )
    {
        echo( 
'<a name="'.substr$file_name$j ], 0, -).'"></a>' );
        
blog_rulersubstr$file_name$j ], 0, -), '' );
        include( 
'./files/faq/'.$file_name$j ] );
        echo( 
'<br><br>' );
        
$j++;
    }
}

?>

edit.php
<?php 
    
include( './functions.php' );
    
$edit_path $_REQUEST'path' ];
?> 
<html>
<head>
    <META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW">
<title>
    Cooper Baker &middot; Site Editor
</title>
<link rel="shortcut icon" type="image/x-icon" href="./browser_icon.png" />
<link rel="stylesheet" type="text/css" href="./style.css" />
</head>
<body marginheight="0" marginwidth="0">
<div id=frame_box>
    <div id=page_box>
        <div id=edit_box_opacity_layer>
        </div>  
        <div id=edit_box>
            <div id=edit_nav_box>
                <div id=edit_title_ruler>
                    Site Map
                </div>
                <br>
                <?php sitemap_edit'../Home' ); ?>
            </div>
            <div id=edit_forms_box>
                <iframe name=edit_frame width="100%" height="100%" allowtransparency="true" frameborder=0></iframe>
            </div>
        </div>
    </div>
</div>
<?php
    random_background_edit
();
?>
</body>
</html>

forms.php
<?php
    
include( 'functions.php' );
    
    
$edit_path    $_REQUEST'path' ];
    
$title        $edit_path.'/title.txt';
    
$author        $edit_path.'/author.txt';
    
$copyright     $edit_path.'/copyright.txt';
    
$description$edit_path.'/description.txt';
    
$keywords     $edit_path.'/keywords.txt';
    
$content    $edit_path.'/content.php';

    if( 
$_POST['title_field'] )
    {
        
$handle fopen$title"w" );            // title.txt
        
$file_contents stripslashes$_POST['title_field'] );
        
fwrite($handle$file_contents);
        
fclose($handle);
    }
    
    if( 
$_POST['author_field'] )
    {
        
$handle fopen$author"w" );        // author.txt
        
$file_contents $_POST['author_field'];
        
fwrite($handle$file_contents);
        
fclose($handle);
    }
    if( 
$_POST['copyright_field'] )
    {
        
$handle fopen$copyright"w" );        // copyright.txt
        
$file_contents stripslashes$_POST['copyright_field'] );
        
fwrite($handle$file_contents);
        
fclose($handle);
    }
    
    if( 
$_POST['description_field'] )
    {
        
$handle fopen$description"w" );    // description.txt
        
$file_contents $_POST['description_field'];
        
fwrite($handle$file_contents);
        
fclose($handle);
    }
    
    if( 
$_POST['keywords_field'] )
    {
        
$handle fopen$keywords"w" );        // keywords.txt
        
$file_contents $_POST['keywords_field'];
        
fwrite($handle$file_contents);
        
fclose($handle);
    }
    
    if( 
$_POST['content_field'] )
    {
        
$handle fopen$content"w" );        // content.php
        
$file_contents stripslashes$_POST['content_field'] );
        
fwrite($handle$file_contents);
        
fclose($handle);
    }
?>
<html>
<head>
<?php
    
if( !stristr$_SERVER['HTTP_USER_AGENT'], 'MSIE' ) )
    {
        echo( 
'<link rel="stylesheet" type="text/css" href="./style.css">' );
    }
?>    
</head>
<body marginheight="0" marginwidth="0">
<div id=edit_fields_box>
<div id=edit_title_ruler>
<?php    $obj_path substrlocal_dir$edit_path ), 13, -);
        echo( 
$obj_path );
?>
</div>
<br>
<form name="editor" action="./forms.php?path=<?php echo( $edit_path ); ?>" method="post">
<table>
<tr>
<td align=right valign=top class=edit_form_title>
Title
</td>
<td>
<input type="text" name="title_field" size="82" value="<?php echo file_get_contents$title ); ?>">
</td>
</tr>

<tr>
<td align=right valign=top class=edit_form_title>
Author
</td>
<td>
<input type="text" name="author_field" size="82" value="<?php echo file_get_contents$author ); ?>">
</td>
</tr>

<tr>
<td align=right valign=top class=edit_form_title>
Copyright
</td>
<td>
<input type="text" name="copyright_field" size="82" value="(c)(p) <?php echo date'Y' ); ?> Cooper Baker. All Rights Reserved.">
</td>
</tr>

<tr>
<td align=right valign=top class=edit_form_title>
Description
</td>
<td>
<input type="text" name="description_field" size="82" value="<?php echo file_get_contents$description ); ?>">
</td>
</tr>

<tr>
<td align=right valign=top class=edit_form_title>
Keywords
</td>
<td>
<textarea name="keywords_field" rows="3" cols="80">
<?php echo file_get_contents$keywords ); ?>
</textarea>
</td>
</tr>

<tr>
<td align=right valign=top class=edit_form_title>
Content
</td>
<td>
<textarea name="content_field" rows="24" cols="80">
<?php echo file_get_contents$content ); ?>
</textarea>
</td>
</tr>

<tr>
<td align=right colspan=2>
<input type="submit" value="Save">
</td>
</table>
</form>
</div>

<div id=edit_files_box>
<div id=edit_title_ruler>
Files
</div>
<br>
<?php edit_files_ls$edit_path ); ?>
</div>
</body>
</html>

style.css
body
{   
    background-color:   transparent;

    margin-left:        0;
    margin-right:       0;
    margin-top:         0;
    margin-bottom:      0;
}

img
{
    border:             0px;
}


embed
{
    background:         #000000;
}

pre
{
    font-size:          10pt;
    font-family:        monospace;
    font-size:          10pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
}

.photo
{
    border:             1px;
    border-color:       #333333;
    border-style:       solid;
}

a
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    letter-spacing:     0px;
    
    padding-left:       2px;
    padding-right:      2px;
    
    outline:            none;
}
a:link{    color: #aa3333; }
a:hover{   color: #ff3333; }
a:active{  color: #ff3333; }
a:visited{ color: #aa3333; }

a.navlink
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    letter-spacing:     -1px;
    
    padding-left:       2px;
    padding-right:      2px;
    
    outline:            none;
}
a.navlink:link{    color: #aa3333; }
a.navlink:hover{   color: #ff3333; }
a.navlink:active{  color: #ff3333; }
a.navlink:visited{ color: #aa3333; }

a.medialink
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;                    
    font-size:          10pt;
    font-weight:        bold;
    text-decoration:    none;
    letter-spacing:     0px;

    padding-left:       2px;
    padding-right:      2px;
    
    outline:            none;
}
a.medialink:link{    color: #aa3333; }
a.medialink:hover{   color: #ff3333; }
a.medialink:active{  color: #ff3333; }
a.medialink:visited{ color: #aa3333; }

a.big_link
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          15pt;
    font-weight:        bold;
    text-decoration:    none;
    letter-spacing:     -1px;

    padding-left:       2px;
    padding-right:      2px;

    outline:            none;
}
a.big_link:link{    color: #aa3333; }
a.big_link:hover{   color: #ff3333; }
a.big_link:active{  color: #ff3333; }
a.big_link:visited{ color: #aa3333; }

/* Content Layout Below ======================================================*/
/*============================================================================*/

#content
{
    padding-left:       16px;
    padding-right:      16px;
    padding-top:        16px;
    
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     0px;
    color:              #333333;
}

#text
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     0px;
    color:              #333333;
}

#big_text
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          15pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333
}

#big_link_box
{
    overflow:           visible;
    width:              200px;
    text-align:         right;
    padding-right:      12px;
    float:              left;   
}

#ruler
{
    position:           relative;
    overflow:           hidden;
    
    padding-left:       0px;
    margin-bottom:      12px;
    
    border:             0px;
    border-bottom:      2px;
    border-color:       #aa3333;
    border-style:       solid;

    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          13pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333;
}

#big_ruler
{
    position:           relative;
    overflow:           hidden;
    
    padding-left:       0px;
    margin-bottom:      12px;
    
    border:             0px;
    border-bottom:      2px;
    border-color:       #aa3333;
    border-style:       solid;

    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          15pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333;
}

#blog_date
{
    position:           absolute;
    overflow:           visible;
    
    bottom:             0px;
    right:              0px;
    padding-right:      16px;
    
    border:             0px;
    border-color:       #bf3030;
    border-style:       dotted;

    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333;    
}

#video
{
    overflow:           hidden;
    width:              320px;
    text-align:         right;
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          10pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333;
    
    float:              left;
    margin-right:       16px;
    margin-bottom:      8px;

    border:             0px;
    border-color:       #000000;
    border-style:       solid;
}

#audio
{
    overflow:           hidden;
    position:           relative;
    width:              100%;
    margin-top:         8px;
    margin-bottom:      8px;
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          10pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333;

    border:             0px;
    border-color:       #000000;
    border-style:       solid;

}

#code
{
    position:           relative;
    left:               0px;
    right:              0px;

    font-family:        monospace;
    font-size:          10pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    border:             0px;
    border-color:       #000000;
    border-style:       solid;
}

/* Site Layout Below =========================================================*/
/*============================================================================*/

#page_box
{
    position:           absolute;
    overflow:           hidden;

    left:               16px;
    right:              16px;
    top:                16px;
    bottom:             16px;
    
    padding-top:        16px;
    padding-bottom:     16px;
    padding-left:       16px;
    padding-right:      16px;
    
    border:             1px;
    border-color:       #aa3333;
    border-style:       solid;
}

#content_box_opacity_layer
{
    position:           absolute;
    overflow:           auto;


/*    
    background:         #303030;      
*/
    background-image:   url( 'content_box_gradient.png' );
    opacity:            0.8;
    
    left:               0px;
    right:              0px;
    bottom:             0px;
    top:                48px;

    border:             0px;
    border-color:       #000000;
    border-style:       solid;
}

#content_box
{
    position:           absolute;
    overflow:           auto;
    
    left:               0px;
    right:              0px;
    bottom:             0px;
    top:                48px;

    border:             0px;
    border-color:       #aa0000;
    border-style:       solid;
}

#nav_box_opacity_layer
{
    position:           absolute;
    overflow:           hidden;
/*    
    background:         #202020;
*/
    background-image:   url( 'nav_box_gradient.png' );
    opacity:            0.9;
    
    height:             36px;
    left:               0px;
    right:              0px;
    top:                0px;
    
    padding-top:        10px;
    
    border:             0px;
    border-bottom:      2px;
    border-color:       #000000;
    border-style:       solid;  
}

#nav_box
{
    position:           absolute;
    overflow:           visible;
    
    height:             36px;
    left:               0px;
    right:              0px;
    top:                0px;
    
    padding-top:        10px;
    

    border:             0px;
    border-bottom:      2px;
    border-color:       #aa3333;
    border-style:       solid;  
}

#nav_title_box
{
    font-family:        'Century Gothic', sans-serif; 
    font-size:          24pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    line-height:        22pt;
    color:              #333333;
     
    overflow:           visible;
    height:             36px;
    top:                0px;
    float:              left;
    padding-left:       1px;
    padding-right:      1px;
    
    
    margin-left:        8px;
    margin-right:       8px;
    
    border:             0px;
    border-color:       #00cc00;
    border-style:       dotted; 
}

#nav_menu_box
{

    overflow:           visible;
    height:             36px;
    top:                0px;
    right:              0px;
    padding-left:       1px;
    padding-right:      1px;

    float:              left;
    line-height:        10pt;



    border:             0px;
    border-color:       #00cc00;
    border-style:       dotted; 
}

#copy_box
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          9pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    
    color:              #aa3333;
    opacity:            0.8;
    
    position:           absolute;   
    bottom:             0px;
    right:              16px;
    height:             16px;
    overflow:           hidden;
    padding-left:       1px;
    padding-right:      1px;
    

    border:             0px;
    border-color:       #00cc00;
    border-style:       dotted;
}

#site_map_box
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333;
    
    overflow:           hidden;
    height:             36px;
    float:              right;
    line-height:        10pt;
    margin-right:       12px;
    padding-left:       1px;
    padding-right:      1px;
    

    border:             0px;
    border-color:       #00cc00;
    border-style:       dotted;
}

#intro_text
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          10pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    text-align:         center;
    color:              #777777;
}

/* Editor Layout Below =======================================================*/
/*============================================================================*/
#edit_box
{
    position:           absolute;
    overflow:           auto;
    
    left:               0px;
    right:              0px;
    top:                0px;
    bottom:             0px;

    border:             0px;
    border-left:        0px;
    border-color:       #000000;
    border-style:       solid;  
}

#edit_box_opacity_layer
{
    position:           absolute;
    overflow:           auto;

    background-image:   url( 'content_box_gradient.png' );
    opacity:            0.8;   
    
    left:               0px;
    right:              0px;
    top:                0px;
    bottom:             0px;

    border:             0px;
    border-left:        0px;
    border-color:       #000000;
    border-style:       solid;
}

#edit_nav_box
{
    position:           absolute;
    overflow:           auto;
    left:               0px;
    right:              85%;
    top:                0px;
    bottom:             0px;
    
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     0px;

    border:             0px;
    border-color:       #990000;
    border-style:       dotted; 
}

#edit_forms_box
{
    position:           absolute;
    overflow:           auto;
    
    left:               15%;
    right:              0px;
    top:                0px;
    bottom:             0px;

    border:             0px;
    border-color:       #009900;
    border-style:       dotted;
}

#edit_fields_box
{
    position:           absolute;
    overflow:           auto;
    
    left:               0px;        
    right:              20%;
    top:                0px;
    bottom:             0px;

    border:             0px;
    border-color:       #000099;
    border-style:       dotted;
}

#edit_files_box
{
    position:           absolute;
    overflow:           auto;
    
    left:               80%;        
    right:              0px;
    top:                0px;
    bottom:             0px;

    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     0px;
    color:              #333333;
    
    border:             0px;
    border-color:       #000099;
    border-style:       dotted;
}

#edit_title_ruler
{
    position:           relative;
    overflow:           visible;
    
    left:               0px;
    right:              0px;
    padding-left:       4px;

    background-image:   url( 'nav_box_gradient.png' );
    opacity:            0.9;
    
    border:             0px;
    border-bottom:      2px;
    border-left:        0px;
    border-color:       #aa3333;
    border-style:       solid;
    color:              #333333;

    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          13pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
}

.edit_form_title
{
    font-family:        'Century Gothic', Helvetica, Arial, sans-serif;   
    font-size:          11pt;
    font-weight:        bold;
    text-decoration:    none;
    outline:            none;
    letter-spacing:     -1px;
    color:              #333333;
}

input
{
    padding:            4px;
    font-family:        monospace;
    font-size:          12px;
    font-weight:        normal;
    border-width:       1px;
    border-color:       #aa3333;
    background:         #ffffff;
    color:              #333333;
}

textarea
{
    padding:            4px;
    font-family:        monospace;
    font-size:          12px;
    font-weight:        normal;
    border-width:       1px;
    border-color:       #aa3333;
    background:         #ffffff;
    color:              #333333;
}

(c)(p) 2012 Cooper Baker · All Rights Reserved · 77281