[ create a new paste ] login | about

Link: http://codepad.org/hXyHuT75    [ raw code | fork ]

PHP, pasted on May 15:
<?php
    require "includes/configuration.php";
    
    include "languages/" . $language . ".php";
    
    if(!$alive) {
        echo "Site is down for maintenance, please check back again later...";
        die();
    }
    
    require "includes/secrets.php";
    
    $rootPath = "http://" . $_SERVER['HTTP_HOST'] . "/" . $subDirectory . "/";
    $stylePath = $rootPath . "styles/" . $style . "/";
    
    function dbConnection()
    {
        global $dbServer, $dbUser, $dbPassword, $dbName;
        
        mysql_connect($dbServer, $dbUser, $dbPassword) or mysql_error();
        mysql_select_db($dbName);
    }
	
    function overallHeader($pageTitle = "")
    {
        global $siteTitle, $stylePath, $defaultStyle, $content, $jQuery;
        
        if($pageTitle == "") {
            $pageTitle = $siteTitle;
        }
        
        header("Content-Type: text/html; charset=utf-8");
        
        include $stylePath . "overall_header.php";
    }
    
    function overallFooter()
    {
        global $stylePath, $framework, $siteTitle;
        
        include $stylePath . "overall_footer.php";
    }
    
    function beginFrame($caption = "")
    {
        global $stylePath;
        
        include $stylePath . "begin_frame.php";
    }
    
    function endFrame()
    {
        global $stylePath;
        
        include $stylePath . "end_frame.php";
    }
    
    function message($type, $content)
    {
        global $stylePath;
        
        if($type == "announcment") {
            require $stylePath . "messages/announcment.php";
        }
        if($type == "note") {
            require $stylePath . "messages/note.php";
        }
        if($type == "error") {
            require $stylePath . "messages/error.php";
        }
    }


Create a new paste based on this one


Comments: