Home Forums Download Support Last Updated: Sat, 21 Jun 2003 19:18:32 GMT
 

View the mymud.inc Here
View the site.inc Here

<?php

function openhtml()
{
    echo 
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n";
}

function 
printsource($file)
{
    global 
$rcpath;
    
$legal_dirs = array(
            
"/include"=>1,
            
"/"=>1
            
);
  
  
$dir $file dirname($file) : "";
  
    if(isset(
$legal_dirs[$dir]))
    {
        
$legal_dir TRUE;
        if(
$dir == "/")
        {
            
$file basename($file);
        }
        else
        {
            
$dirlist explode("/",$file);
            
$file $dirlist[1];
            if(
$file == "include")
            {
                
$file $rcpath $file;
            }
            for(
$i 2$i count($dirlist); $i++)
            {
                    
$file .= "/" $dirlist[$i];
            }
        }
    }
    else
    {
        
$legal_dir FALSE;
    }

    
// If this is a legal dir, then display it
    
if ($dir && $legal_dir)
    {
        if (
file_exists($file) && !is_dir($file))
        {
            
show_source($file);
        }
        else if (@
is_dir($file))
        {
            echo 
"<p>No file specified.  Can't show source for a directory.</p>\n";
        }
        else
        {
            echo 
"<p>$file does not exist.</p>\n";
        }

    }
    else
    {
    echo 
"<p>Sorry $file may contain sensitive data and cannot be viewed.</p>\n";
    }
}    

function 
gettimestring()
{
    return 
gmdate("D, d M Y H:i:s ", @getlastmod()) . "GMT"
}

function 
printlink($href,$display)
{
    echo 
"<a href=\"$href\">$display</a>";
}

function 
getlink($href,$display)
{
    return 
"<a href=\"$href\">$display</a>";
}

function 
getimage($src,$width,$height,$border)
{
    return 
"<img src=\"$src\" width=\"$width\" height=\"$height\" border=\"$border\">";
}

function 
printimage($src,$width,$height,$border)
{
    echo 
"<img src=\"$src\" width=\"$width\" height=\"$height\" border=\"$border\">";
}

function 
printtitle($title)
{
    echo 
"<title>$title</title>\n";
}

function 
closehtml()
{
    echo 
"</html>\n";
}

function 
openhead()
{
    echo 
"<head>\n";
}

function 
closehead()
{
    echo 
"</head>\n";
}

function 
openbody($bgcolor,$lmarg,$tmarg,$mwdith,$mheight)
{
    echo 
sprintf("<body bgcolor=\"%s\" leftmargin=\"%d\" topmargin=\"%d\" marginwidth=\"%d\" marginheight=\"%d\" link=\"black\" vlink=\"black\" alink=\"black\">\n",
                                
$bgcolor,$lmarg,$tmarg,$mwidht,$mheight);
}

function 
closebody()
{
    echo 
"</body>\n";
}

function 
opentable($cpad,$cspace,$border,$align,$valign,$width)
{
    if(
preg_match("/\%/",$width))
    {
        echo 
sprintf("<table cellpadding=\"%d\" cellspacing=\"%d\" border=\"%d\" align=\"%s\" valign=\"%s\" width=\"%s\">\n",
                                
$cpad,$cspace,$border,$align,$valign,$width);
    }
    else
    {
        echo 
sprintf("<table cellpadding=\"%d\" cellspacing=\"%d\" border=\"%d\" align=\"%s\" valign=\"%s\" width=\"%d\">\n",
                                
$cpad,$cspace,$border,$align,$valign,$width);
    }
}

function 
closetable()
{
    echo 
"</table>";
}

function 
openrow($back$valign$align$width$height$rowspan$colspan)
{
    
$rowdata sprintf("<tr rowspan=\"%d\" colspan=\"%d\" align=\"%s\" valign=\"%s\" background=\"%s\"",
                                        
$rowspan,$colspan,$align,$valign,$back);
    if(
preg_match("/\%/",$width) || preg_match("/\*/",$width))
    {
        
$rowdata .= sprintf(" width=\"%s\"",$width);
    }
    else
    {
        
$rowdata .= sprintf(" width=\"%d\"",$width);    
    }
    
    if(
preg_match("/\%/",$height) || preg_match("/\*/",$height))
    {
        
$rowdata .= sprintf(" height=\"%s\">\n",$height);
    }
    else
    {
        
$rowdata .= sprintf(" height=\"%d\">\n",$height);    
    }
    echo 
$rowdata;
}

function 
closerow()
{
    echo 
"</tr>\n";
}

function 
opencol($back$valign ,$align$width$height$rowspan$colspan)
{
    
$coldata sprintf("<td rowspan=\"%d\" colspan=\"%d\" align=\"%s\" valign=\"%s\" background=\"%s\"",
                                        
$rowspan,$colspan,$align,$valign,$back);
    if(
preg_match("/\%/",$width) || preg_match("/\*/",$width))
    {
        
$coldata .= sprintf(" width=\"%s\"",$width);
    }
    else
    {
        
$coldata .= sprintf(" width=\"%d\"",$width);    
    }
    
    if(
preg_match("/\%/",$height) || preg_match("/\*/",$height))
    {
        
$coldata .= sprintf(" height=\"%s\">\n",$height);
    }
    else
    {
        
$coldata .= sprintf(" height=\"%d\">\n",$height);    
    }
    echo 
$coldata;
}

function 
closecol()
{
    echo 
"</td>\n";
}

function 
printfont($color,$size,$string)
{
    if(!empty(
$color))
    {
        echo 
sprintf("<font color=\"%s\" size=\"%d\">%s</font>",$color,$size,$string);
    }
    else
    {
        echo 
sprintf("<font size=\"%d\">%s</font>",$size,$string);
    }
}

function 
printspace($count)
{
    if(
$count 0)
    {
        for(
$i 0$i $count$i++)
        {
            echo 
"&nbsp;";
        }
    }
    else
    {
        echo 
"&nbsp;";
    }
}

 
This webpage and it's content is released under the GNU General Public License.