<?php
// filename: nukelayoutclass.php
//
// +----------------------------------------------------------------------------+
// | NukeLayoutClass (PHP) |
// +----------------------------------------------------------------------------+
// | Copyright (C) 2001 Chauncey Thorn |
// +----------------------------------------------------------------------------+
// / 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, or (at your option) any later version. /
// / /
// / This program is distributed in the hope that it will be useful, /
// / but WITHOUT ANY WARRANTY; without even the implied warranty of /
// / MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /
// / GNU General Public License for more details. /
// / /
// / You should have received a copy of the GNU General Public License /
// / along with this program; if not, write to the Free Software /
// / Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA./
// +----------------------------------------------------------------------------+
// | Authors: /
// / Chauncey Thorn <hide@address.com> |
// | CSS Support: Kam Salisbury <hide@address.com> |
// +----------------------------------------------------------------------------+
//
// $Id: nukelayoutclass.php ,v 1.3 2001/12/8 cthorn
/**
*********** What is NukeLayout Class ******************
NukeLayout Class is a PHP class that allow you to develop web pages
that look and feel like PHPNuke.
With out the need for a database and alot of programming...
This class allows you to focus on content!
********** Changelog for NukeLayout Class (PHP) *********
09-21-2001
-- got the idea from some code I was working on for my site.
PCCS-Linux.COM. This layout is a layout taken from HLUG.org
and hacked to fit how I wanted my site to look. As I was coding
I noticed that I was creating a template of the layout.
-- cleaned up code, removing all custom pccs-linux.com code
and decided to release it as NukeLayout Class
09-22-2001
-- NOTICE: very little modification is required.
this is the initial release.
-- version 0.1
09-23-2001
-- Fix bug in layout
space between left middle column and right column
render badly.. thanks IE explorer for finding this
bug
-- renamed most of the functions to nukelayoutXxxx
-- renamed the leftbar and right bar render functions
to renderleftBar, renderrightBar
-- create var for site logo
-- begin working on color themes (still limited)
-- Added support for language (very basic)
-- expand ability to over ride default values
-- add support to turn off features
turn off the rightBar, topBanner, bottomBanner, and leftBar
-- verion 0.2
09-24-2001
-- Fixed - failed HTML validation issue
I would like to thank Mathew Solnik for making me aware of this
NOTE A page with ONLY Text it will format HTML without errors..
If invalid HTML is used by the page developer it will produce
invalid HTML errors when validated
-- Fixed - major bug in navBarLinks() -- upgrade required to fix
in the narBarLinks() I had hardcoded /$val which
caused links to become broken if outside the ./ directory
e.g. http://freshmeat.net would be http://sitename/http://freshmeat.net
-- Fixed - renamed some vars
$userightcol ---> $rightbarStatus
$leftbarOff ---> $leftbarStatus
$topbannerOff ---> $topbannerStatus
$bottombannerOff ---> $bottombannerStatus
-- Fixed - removed the Default link array for site from inside class
removing it gives more control and makes the class easier to use.
$this->nukelayoutmenuLink_array = array("HOME"=>"./"); REMOVED
-- Added support - set bottom banner text by using
$mypage->nukelayoutfooterText
-- Added support - define what appeared before link_array
in main menu box e.g.
$this->nukelayoutmenuLinkstarter = <IMG SRC=dot.gif>
default <strong><big> * </big></strong>
-- Added support - turn off Greeting
-- Added support - change the postion of the site logo
e.g. left, middle, right
-- Added support - make site banner a link to ./ or no link
no link default
-- Added support - ability point to a remote site and have it
open in a new windows via the main menu links
rhttp://www.linux.com would open http://www.linux.com in a new
browser window
-- version 0.3
09-25-2001
-- Fixed - bug where layout would fail if php was configured
using the --disable-short-tags which doesn't allow <?
-- As a result I removed the mixture of HTML and now using
only php calls
-- cleaned up code... more readable
10-03-2001
-- Fixed - renamed a number of variables
-- added support - $this->nukelayoutpageTitle to META keywords
The Title of page is used to generate keywords for page
-- changed #000000 to $this->nukelayoutthemeTrimcolor
-- made acive and visited link color vars
-- added support - ability to set page cache var $mypage->nukelayoutcacheStatus ON/OFF
10-04-2001
-- Fixed - cleaned up code
-- Documented code
-- Tested each example...
-- Jumped version # from 0.3 -> 1.0
The is not much I can do without making bloatware
-- moving from development to stable
10-07-2001
-- Added support - better theme support
-- created functions to set vars
Example usage of functions
// set Site Name, Site Banner, Site Theme
$mypage->set_nukeLayout("NukeLayout php Class", "nukelayout.jpg", "wine");
$mypage->set_pageTitle("NukeLayout PHP Class 1.0");
$mypage->set_pageOwner("hide@address.com", "Chauncey Thorn");
$mypage->set_Metadata("This is Chauncey Thorn's Web Site");
-- added comments email link to pageowner
-- extended class to support articles with links to more...
-- added examples for themes
11-05-2001
-- Added support - CSS support theme/style.css.php
-- Added support - Random Quotes from a text file
-- Added support - Random Images
-- Added support - link_array processor
-- Added support - quick links bar
11-06-2001
-- Added support - $nukelayoutthemehlink; // Hover Link Colors
submitted by hide@address.com
12-01-2001
-- Moved css support to class
the css statements where submitted by hide@address.com
with the recommendation of having just one config file.
globalinclude.php
12-08-2001
-- removed banner greeting support
-- removed code that prevent script from
running on Winnt
01-31-2002
-- change the theme system again
02-07-2002
-- bug fixes -- turned on error_reporting(E_ALL)
03-30-2002
-- documentation
-- minor changes
added more color schemes
********** End of Changelog for NukeLayout Class (PHP) *********
**/
/****** BEGIN NukeLayout Class *********/
/******* nukeLayout Class defined as nukeLayout *******
**
** NukeLayout Class is PHP class that allows you to
** develop web pages that look and feel
** like PHPNuke. With out the need for a database
** and alot of programming
** It was designed to make static portals easy
**
*/
/** don't allow anyone to load file directly **/
if (eregi('nukelayoutclass.php', $_SERVER['PHP_SELF'])) {
if(!isset($infraction_subject)) $infraction_subject = "INVALID FILE ACCESS Attempt ";
if(!isset($infraction)) $infraction = "INVALID FILE ACCESS Attempted to nukelayoutclass.php !!!";
if(!isset($send_email)) $send_mail = "0"; // 0 NO, 1 YES
if(!isset($email_admin)) $email_admin = "hide@address.com";
if($send_email == "1") {
if(!isset($todayis)) $todayis = date("dS of F Y h:i:s A");
if(!isset($to)) $to = $email_admin;
if(!isset($from)) $from = "HACKER@". $_SERVER['REMOTE_ADDR'];
if(!isset($subject)) $subject = $infraction_subject . "From" . $_SERVER['REMOTE_ADDR'];
$message = "\tSome one at" . $_SERVER['REMOTE_ADDR'] . "Did: " . $infraction . "\n";
$message .= " Using : " . $_SERVER['HTTP_USER_AGENT'] . " on : " . $todayis;
mail("$to","$subject","$message","From:$from\nReply-To: $from");
}
die("ERROR File not found ...");
}
/**
* NukeLayout PHP Class
* Website Template System
* @author Chauncey Thorn <hide@address.com>
* @version 1.3
* @link http://www.pccs-linux.com
*/
class nukeLayout
{
// No need to really modify these values
var $PCCSLinuxappname = "NukeLayout PHP Class"; // Name of Class
var $PCCSLinuxappVersion = "1.3"; // I will maintain this
// Feature values
var $nukelayoutpageOwner;
var $nukelayoutpageOwneremail; // your e-mail
var $nukelayoutpageTitle; // <title>TITLE</title>
var $nukelayoutpageArticles; // Articles
var $nukelayoutmenuLink_array; // Link array
var $nukelayoutSitename; // Your site name
var $nukelayoutmenuLinkstarter;
var $nukelayouttopbannerGreeting;
var $nukelayoutnavBarLinks_array;
var $nukelayoutbasehref;
// Turn off sections of the layout
var $topbannerStatus; // Display RightBar
var $bottombannerStatus;
var $leftbarStatus;
var $rightbarStatus;
// Theme values
// need to get some themes together...
var $nukelayoutthemeBgcolor; // Page Background Color
var $nukelayoutthemeSectionheader; // Section Header Color
var $nukelayoutthemeSectionbody; // Section body color
var $nukelayoutthemeText; // Page Text Color
var $nukelayoutthemeTrimcolor; // Header Footer Trim Color
var $nukelayoutthemesectionheaderTextcolor;
var $nukelayoutthemelink; // Default Link Colors
var $nukelayoutthemealink; // active Link Colors
var $nukelayoutthemevlink; // Visited Link Colors
var $nukelayoutthemehlink; // Hover Link Colors
var $nukelayoutstylesheet;
var $nukelayoutsitefonts; // site fonts
var $nukelayoutLogo; // Site logo Image
var $nukelayoutlogoPosition;
var $nukelayoutlogolinkStatus; // Active Link to ./
var $nukelayoutfooterText;
// Meta Tags values
var $nukelayoutmetaAuthor;
var $nukelayoutmetaCopyright;
var $nukelayoutmetaDesc;
// english lang values
// translate to your language
var $lang_mainmenu = "Main Menu";
// leftblock settings
var $leftblocktblwidth;
// rightblock settings
var $rightblocktblwidth;
//////////////////////////////////////////
/****** METHODS BEING DEFINED *********/
/////////////////////////////////////////
/**
* Constructor
* Detemine what browser is being used.
*/
function nukelayout()
{
global $HTTP_USER_AGENT;
unset ($BROWSER_AGENT);
unset ($BROWSER_VER);
unset ($BROWSER_PLATFORM);
if (ereg( 'MSIE ([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$log_version)) {
$BROWSER_VER=$log_version[1];
$BROWSER_AGENT='IE';
} elseif (ereg( 'Opera ([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$log_version)) {
$BROWSER_VER=$log_version[1];
$BROWSER_AGENT='OPERA';
} elseif (ereg( 'Mozilla/([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$log_version)) {
$BROWSER_VER=$log_version[1];
$BROWSER_AGENT='MOZILLA';
} else {
$BROWSER_VER=0;
$BROWSER_AGENT='OTHER';
}
/* Determine platform */
if (strstr($_SERVER['HTTP_USER_AGENT'],'Win')) {
$BROWSER_PLATFORM='Win';
} else if (strstr($_SERVER['HTTP_USER_AGENT'],'Mac')) {
$BROWSER_PLATFORM='Mac';
} else if (strstr($_SERVER['HTTP_USER_AGENT'],'Linux')) {
$BROWSER_PLATFORM='Linux';
} else if (strstr($_SERVER['HTTP_USER_AGENT'],'Unix')) {
$BROWSER_PLATFORM='Unix';
} else {
$BROWSER_PLATFORM='Other';
}
} // end of function
/****** FUNCTIONS BEING DEFINED *********/
/**
* Function set_nukeLayout
* A function that set needed values for top banner and
* theme colors
*
* @param string $sitename
* @param string $image
* @param string $logolinkstatus
* @param string $logoposition
* @param string $menulinkstarter
* @return string
*/
function set_nukeLayout($sitename, $sitelogo, $logolinkstatus = "OFF", $logoposition =
"left", $menulinkstarter = " ")
{
$this->set_siteName($sitename);
$this->set_layoutLogo($sitelogo);
$this->set_layoutTheme();
$this->set_logolinkStatus($logolinkstatus);
$this->set_logoPosition($logoposition);
$this->set_menuLinkstarter($menulinkstarter);
}
/**
* Function set_columnStatus
* A function that set needed values for left and right bar status
* default ON
* @param string $leftcolumn
* @param string $rightcolumn
* @return string
*/
function set_columnStatus($leftcolumn = "ON", $rightcolumn = "ON")
{
$this->set_leftbarStatus($leftcolumn);
$this->set_rightbarStatus($rightcolumn);
}
/**
* Function set_bannerStatus
* A function that set needed values for top and bottom banner status
* @param string $topbanner
* @param string $bottombanner
* @param string $bannergreeting
* @return string
*/
function set_bannerStatus($topbanner = "ON", $bottombanner = "ON", $bannergreeting = "OFF" )
{
$this->set_topbannerStatus($topbanner);
$this->set_bottombannerStatus($bottombanner);
$this->set_bannerGreeting($bannergreeting);
}
/**
* Function set_siteName
* A function that set needed values for site Name
* @param string $sitename
* @return string
*/
function set_siteName($sitename)
{
$this->nukelayoutSitename = $sitename;
}
/**
* Function set_pageTitle
* A function that set needed values for page title
* @param string $pagetitle
* @return string
*/
function set_pageTitle($pagetitle)
{
$this->nukelayoutpageTitle = $pagetitle;
}
/**
* Function set_pageOwner
* A function that set needed values for page owner
* @param string $_email
* @param string $pageowner
* @return string
*/
function set_pageOwner($_email, $pageowner= "Page Owner")
{
$this->nukelayoutpageOwner = $pageowner;
$this->nukelayoutpageOwneremail = $_email;
}
/**
* Function set_leftblocktblwidth
* A function that set needed values for left block top nested table width
* Default 150
* @param string $leftblocktblwidth_str
* @return string
*/
function set_leftblocktblwidth($leftblocktblwidth_str = "150")
{
$this->leftblocktblwidth = $leftblocktblwidth_str;
}
/**
* Function set_rightblocktblwidth
* A function that set needed values for left block top nested table width
* Default 150
* @param string $rightblocktblwidth_str
* @return string
*/
function set_rightblocktblwidth($rightblocktblwidth_str = "150")
{
$this->rightblocktblwidth = $rightblocktblwidth_str;
}
/**
* Function set_layoutLogo
* A function that set needed values for layout logo
* @param string $sitelogo
* @return string
*/
function set_layoutLogo($sitelogo)
{
$this->nukelayoutLogo = $sitelogo;
}
/**
* Function set_logoPosition
* A function that set needed values for site logo position
* @param string $logposition
* @return string
*/
function set_logoPosition($logposition)
{
$this->nukelayoutlogoPosition = $logposition;
}
/**
* Function set_logolinkStatus
* A function that set needed values for site logo link status
* @param string $logolinkstatus
* @return string
*/
function set_logolinkStatus($logolinkstatus)
{
$this->nukelayoutlogolinkStatus = $logolinkstatus;
}
/**
* Function set_menuLinkstarter
* A function that set needed values for site logo link starter
* @param string $menulinkstarter
* @return string
*/
function set_menuLinkstarter($menulinkstarter)
{
$this->nukelayoutmenuLinkstarter = $menulinkstarter;
}
/**
* Function set_layoutfooterText
* A function that set needed values for Bottom Banner Footer Text
* @param string $footertext
* @return string
*/
function set_layoutfooterText($footertext = 'Using NukeLayout Class by PCCS-Linux.COM<br> http://www.pccs-linux.com/')
{
$this->nukelayoutfooterText = $footertext;
}
/**
* Function set_layoutTheme
* A function that set needed values for layout theme
* @param string $footertext
* @return string
*/
function set_layoutTheme()
{
global $nukelayout_theme, $site_fonts, $theme;
$this->set_themeBgcolor($nukelayout_theme[$theme]['bgcolor']);
$this->set_themeSectionheader($nukelayout_theme[$theme]['sectionheader']);
$this->set_themeSectionbody($nukelayout_theme[$theme]['sectionbody']);
$this->set_headertextColor($nukelayout_theme[$theme]['headertextColor']);
$this->set_trimColor($nukelayout_theme[$theme]['trimcolor']);
$this->set_textColor($nukelayout_theme[$theme]['textcolor']);
$this->set_linkColor($nukelayout_theme[$theme]['linkcolor']);
$this->set_vlinkColor($nukelayout_theme[$theme]['vlinkcolor']);
$this->set_alinkColor($nukelayout_theme[$theme]['alinkcolor']);
$this->set_hlinkColor($nukelayout_theme[$theme]['hlinkcolor']);
$this->set_siteFonts($site_fonts);
}
/**
* Function set_Metadata
* A function that set needed values for META content: Description is all that is really required...
* @param string $desctext
* @return string
*/
function set_Metadata($desctext = 'Site is using NukeLayout PHP Class from http://www.pccs-linux.com')
{
$this->set_metaAuthor();
$this->set_metaCopyright();
$this->set_metaDescription($desctext);
} // end of function
/**
* Function set_metaAuthor
* A function that set needed values for meta Author
* @return string
*/
function set_metaAuthor()
{
$this->nukelayoutmetaAuthor = $this->nukelayoutpageOwner;
} // end of function
/**
* Function set_metaCopyright
* A function that set needed values for meta Copyright
* @return string
*/
function set_metaCopyright()
{
$year = date("Y");
$this->nukelayoutmetaCopyright = "Copyright (c) $year by $this->nukelayoutSitename";
} // end of function
/**
* Function set_metaDescription
* A function that set needed values for meta Copyright
* @param string $desctext
* @return string
*/
function set_metaDescription($desctext)
{
$this->nukelayoutmetaDesc = $desctext;
} // end of function
/**
* Function set_themeBgcolor
* A function that set needed values for theme background color
* @param string $bgcolor
* @return string
*/
function set_themeBgcolor($bgcolor)
{
$this->nukelayoutthemeBgcolor = $bgcolor;
} // end of function
/**
* Function set_themeSectionheader
* A function that set needed values for theme section header backgroud color
* @param string $sectionheader
* @return string
*/
function set_themeSectionheader($sectionheader)
{
$this->nukelayoutthemeSectionheader = $sectionheader;
} // end of function
/**
* Function set_themeSectionbody
* A function that set needed values for theme section body color
* @param string $sectionbody
* @return string
*/
function set_themeSectionbody($sectionbody)
{
$this->nukelayoutthemeSectionbody = $sectionbody;
} // end of function
/**
* Function set_trimColor
* A function that set needed values for theme section table trim color
* @param string $trimcolor
* @return string
*/
function set_trimColor($trimcolor)
{
$this->nukelayoutthemeTrimcolor = $trimcolor;
} // end of function
/**
* Function set_textColor
* A function that set needed values for theme text color
* @param string $textcolor
* @return string
*/
function set_textColor($textcolor)
{
$this->nukelayoutthemeText = $textcolor;
} // end of function
/**
* Function set_linkColor
* A function that set needed values for link color
* @param string $linkcolor
* @return string
*/
function set_linkColor($linkcolor)
{
$this->nukelayoutthemelink = $linkcolor;
} // end of function
/**
* Function set_vlinkColor
* A function that set needed values for vlink color
* @param string $vlinkcolor
* @return string
*/
function set_vlinkColor($vlinkcolor)
{
$this->nukelayoutthemevlink = $vlinkcolor;
} // end of function
/**
* Function set_alinkColor
* A function that set needed values for alink color
* @param string $alinkcolor
* @return string
*/
function set_alinkColor($alinkcolor)
{
$this->nukelayoutthemealink = $alinkcolor;
} // end of function
/**
* Function set_hlinkColor
* A function that set needed values for hlink color
* @param string $hlinkcolor
* @return string
*/
// submitted by hide@address.com
function set_hlinkColor($hlinkcolor)
{
$this->nukelayoutthemehlink = $hlinkcolor;
}
/**
* Function set_headertextColor
* A function that set needed values for Section Header text color
* @param string $headertextColor
* @return string
*/
function set_headertextColor($headertextColor)
{
$this->nukelayoutthemesectionheaderTextcolor = $headertextColor;
} // end of function
/**
* Function set_leftbarStatus
* A function that set needed values for left bar status
* @param string $leftbarstatus
* @return string
*/
function set_leftbarStatus($leftbarstatus)
{
$this->leftbarStatus = $leftbarstatus;
} // end of function
/**
* Function set_rightbarStatus
* A function that set needed values for right bar status
* @param string $rightbarstatus
* @return string
*/
function set_rightbarStatus($rightbarstatus)
{
$this->rightbarStatus = $rightbarstatus;
} // end of function
/**
* Function set_topbannerStatus
* A function that set needed values for top banner status
* @param string $topbannerstatus
* @return string
*/
function set_topbannerStatus($topbannerstatus)
{
$this->topbannerStatus = $topbannerstatus;
} // end of function
/**
* Function set_bottombannerStatus
* A function that set needed values for bottom banner status
* @param string $bottombannerstatus
* @return string
*/
function set_bottombannerStatus($bottombannerstatus)
{
$this->bottombannerStatus = $bottombannerstatus;
} // end of function
/**
* Function set_bannerGreeting
* A function that set needed values for banner greeting
* @param string $bannergreeting
* @return string
*/
function set_bannerGreeting($bannergreeting)
{
$this->nukelayouttopbannerGreeting = $bannergreeting;
} // end of function
/**
* Function set_siteFonts
* A function that set needed values for site fonts
* @param string $site_fonts
* @return string
*/
function set_siteFonts($site_fonts)
{
$this->nukelayoutsitefonts = $site_fonts;
} // end of function
/**
* Function render
* A function that set needed values for site fonts
* this is called at the end of every page
* puts the page together
* @return string
*/
function render ()
{
$this->nukelayoutsiteHeader();
$this->nukelayoutsiteBody();
$this->nukelayoutsiteFooter();
} // end of render function
/****** FUNCTION BEING DEFINED *********/
/**
* Function addAtricle
* used to add articles to a page
* It also support a link to another page for more content
* @param string $nukelayoutpageTitle
* @param string $pagetext
* @param string $link
* @return string
*/
function addArticle ($nukelayoutpageTitle, $pagetext, $link="")
{
$article = array("nukelayoutpageTitle" => $nukelayoutpageTitle,
"pagetext" => $pagetext, "link"=> $link);
$this->nukelayoutpageArticles[] = $article;
} // end of addArticle function
/****** FUNCTION BEING DEFINED *********/
/*
* Function renderArticles
* this function generates std HTML syntax
* middle section of page
* @param array() $nukelayoutArticlesarray
* @return string
*/
function renderArticles($nukelayoutArticlesarray)
{
if (empty($nukelayoutArticlesarray[0]["nukelayoutpageTitle"]))
return;
for ($i = 0; $i < count($nukelayoutArticlesarray); $i++)
{
print"
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" bgcolor=\"$this->nukelayoutthemeTrimcolor\"
align=\"center\" width=\"100%\">
<tr>
<td>
<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" bgcolor=\"$this->nukelayoutthemeTrimcolor\"
width=\"100%\">
<tr>
<td bgcolor=\"$this->nukelayoutthemeSectionheader\" width=\"100%\">
<font size=\"2\">
";
print "<b><font
color=".$this->nukelayoutthemesectionheaderTextcolor.">". $nukelayoutArticlesarray[$i]["nukelayoutpageTitle"] ."</font></b>";
print "
</font>
</td>
</tr>
<tr>
<td bgcolor=\"$this->nukelayoutthemeSectionbody\">
<font size=\"2\">
";
print $nukelayoutArticlesarray[$i]["pagetext"];
print "
</font>
</td>
</tr>
";
if($nukelayoutArticlesarray[$i]["link"] == "") {
// do nothing
} else {
print "
<tr>
<td bgcolor=\"$this->nukelayoutthemeSectionbody\" align=\"right\">
<font size=2>( <a href=".$nukelayoutArticlesarray[$i]["link"]."> More Info ... </a>)
</font>
</td>
</tr>
";
}
print "
</table>
</td>
</tr>
</table><br>
";
}
} // end renderArticles
/****** FUNCTION BEING DEFINED *********/
/*
** nukelayoutsiteBody()
** this function generates std HTML syntax
** This function has the most control
** it brings everything together for the render function
**
** the $this->nukelayoutsiteBanner() is used
** $this->navigationMenu() is used
** $this->renderleftBar($this->addleftbarContent) is used
** $this->renderArticles($this->nukelayoutpageArticles) is used
** $this->renderrightBar($this->addrightbarText) is used
**
** If $quicklink_array has a value it will display a
** Quick Menu bar below the Top banner section
** $quicklink_array can be defined globally via globalinclude file
** or used per page
** globalinclude recommended...
*/
/**
* Function nukelayoutsiteBody
* A function that brings everything together for the render function
* @return string
*/
function nukelayoutsiteBody()
{
/** BEGIN TOP AND LEFT SIDE OF PAGE **/
if($this->topbannerStatus == "OFF") {
// do nothing
} else {
// Display sitebanner and main site links
// set the $quicklink_array to nothing if nothing is
// passed 11-05-2001 hide@address.com
$this->nukelayoutsiteBanner($quicklink_array = "");
}
// check the status of the left side of page
if($this->leftbarStatus == "OFF")
{
// need to keep page together if main menu is off
$this->nukelayoutSpacer();
} else {
$this->nukelayoutSpacer();
// Display Items on the left side
$this->renderleftBar($this->addleftbarContent);
}
/****** End of Left side ******/
/**DO NOT DELETE START***/
print "
<td>
<td bgcolor=". $this->nukelayoutthemeBgcolor ."> </td>
<td width=\"100%\" valign=top bgcolor=". $this->nukelayoutthemeBgcolor .">
";
/**DO NOT DELETE END ***/
/****** Begin Middle Section ******/
// display center articles
if(!isset($this->nukelayoutpageArticles)) $this->nukelayoutpageArticles = " ";
$this->renderArticles($this->nukelayoutpageArticles);
/*** DO NOT EDIT it will break !!! ***/
print "</td>";
print "<td bgcolor=". $this->nukelayoutthemeBgcolor ."> </td>";
/*** DO NOT EDIT END it will break !!! ***/
/******** Begin right side of page ********/
// if the rightbarStatus is off don't display the third column
if($this->rightbarStatus == "OFF") {
// do nothing because the right column was turned off
} else {
/*** DO NOT EDIT it will break !!! ***/
print "<td></td><td valign=\"top\" width=\"150\" bgcolor=". $this->nukelayoutthemeBgcolor .">";
/*** DO NOT EDIT END it will break !!! ***/
// render rightbar text
$this->renderrightBar($this->addrightbarText);
}
} // end of siteBody function
/****** FUNCTION BEING DEFINED *********/
/**
* Function nukelayoutsiteHeader
* this function generates std HTML syntax
* Controls HTML META
* @return string
*/
function nukelayoutsiteHeader()
{
global $HTTP_USER_AGENT;
$getkeywords = ltrim(ereg_replace("The","",$this->nukelayoutpageTitle));
$genkeywords = ereg_replace(" ",",",$getkeywords);
if(isset($this->nukelayoutbasehref)) {
print "<BASE HREF=\"$this->nukelayoutbasehref\">\n";
}
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
print "<!--This site is using NukeLayout PHP Class -->\n";
print "<!--Developed by Chauncey Thorn at http://www.pccs-linux.com -->\n";
print "<!--Modified and tuned by Kam Salisbury http://www.salsolutions.net -->\n";
print "<HTML lang=en-us>\n";
print "<HEAD>\n";
print "<TITLE>". $this->nukelayoutpageTitle ."</TITLE>\n";
print "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">\n";
print "<META NAME=\"AUTHOR\" CONTENT=\"".$this->nukelayoutmetaAuthor."\">\n";
print "<META NAME=\"GENERATOR\" CONTENT=\"". $this->PCCSLinuxappname . " - Version " . $this->PCCSLinuxappVersion ."\">\n";
print "<META NAME=\"COPYRIGHT\" CONTENT=\"".$this->nukelayoutmetaCopyright ."\">\n";
print "<META NAME=\"DESCRIPTION\" CONTENT=\"". $this->nukelayoutmetaDesc ."\">\n";
print "<META NAME=\"KEYWORDS\" CONTENT=\"$genkeywords\">\n";
print "<META NAME=\"ROBOTS\" CONTENT=\"INDEX, NOFOLLOW\">\n";
print "<META NAME=\"revisit-after\" content=\"1 days\">\n";
print "<META NAME=\"distribution\" content=\"Global\">\n";
print "<META NAME=\"resource-type\" CONTENT=\"document\">\n";
print "<META HTTP-EQUIV=\"expires\" CONTENT=\"0\">\n";
print "\n";
/***
print "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
print " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
print " <rdf:Description rdf:about=\"\"\n";
print " dc:creator=\"".$this->nukelayoutmetaAuthor."\"\n";
print " dc:title=\"". $this->nukelayoutpageTitle ."\"\n";
print " dc:description=\"". $this->nukelayoutmetaDesc ."\"\n";
print " dc:date=\"". date('Y-m-d') ."\" />\n";
print "</rdf:Description>\n";
print "</rdf:RDF>\n";
**/
// get css stuff
$this->nukelayout_css_site();
print "\n</HEAD>\n\n";
// this is a major hack to make rendering under linux work
// as it should
if (strstr($_SERVER['HTTP_USER_AGENT'],'Linux')) {
print "<BODY bgcolor=".$this->nukelayoutthemeBgcolor.">\n";
}
} // end the siteHeader function
/****** FUNCTION BEING DEFINED *********/
/**
* Function nukelayoutsiteFooter
* this function generates std HTML syntax
* @return string
*/
function nukelayoutsiteFooter()
{
print "</td></tr></table>\n";
print "<br>\n";
if($this->bottombannerStatus == "OFF") {
print "</body>\n";
print "</html>\n";
} else {
print "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\" bgcolor=". $this->nukelayoutthemeTrimcolor ."><tr><td>\n";
print "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\" bgcolor=\"$this->nukelayoutthemeSectionbody\"><tr><td>\n";
print "<table bgcolor=\"$this->nukelayoutthemeSectionbody\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">\n";
print "<tr><td>\n";
print " <center><font size=\"1\">\n";
print " <br><br>\n";
print $this->nukelayoutfooterText;
print "<br>";
print "Comments to " . $this->mailto();
print "<br>";
print " <br>";
print " </font></center>\n";
print " </td></tr></table>\n";
print "</td></tr></table></td></tr></table>\n";
print "</body>\n";
print "</html>\n";
}
} // end of function
/****** FUNCTION BEING DEFINED *********/
/**
* Function addleftBar
* Creates the array for adding a left column
* The array create by this function will be
* @return string
*/
function addleftBar($addleftbarTitle, $addleftbarBody)
{
$leftbarContent = array("addleftbarTitle"=> $addleftbarTitle,
"addleftbarBody" => $addleftbarBody);
$this->addleftbarContent[] = $leftbarContent;
} // end of addleftBar function
/****** FUNCTION BEING DEFINED *********/
/**
* Function renderleftBar($addleftbararray)
* process the array passed by the addleftBar function
* @return string
*/
function renderleftBar($addleftbararray )
{
if(empty($addleftbararray[0]["addleftbarTitle"]))
return;
for($i = 0; $i < count($addleftbararray); $i++)
{
print "
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$this->leftblocktblwidth\" bgcolor=\"$this->nukelayoutthemeTrimcolor\">
<tr>
<td >
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"$this->nukelayoutthemeTrimcolor\">
<tr>
<td colspan=1 bgcolor=". $this->nukelayoutthemeSectionheader ." align=\"left\">
<font size=\"2\" color=".$this->nukelayoutthemesectionheaderTextcolor."><B>". $addleftbararray[$i]["addleftbarTitle"] ." </b></font>
</td>
</tr>
<tr>
<td bgcolor=\"$this->nukelayoutthemeSectionbody\" >
" . $addleftbararray[$i]["addleftbarBody"] . "
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
";
}
} // end of function
/****** FUNCTION BEING DEFINED *********/
/**
* Function addrightBar
* Creates the array for adding a right column
* The array create by this function will be
* used by renderrightBar($addrightbararray)
* @param $addrightbarTitle
* @param $addrightbarBody
* @return string
*/
function addrightBar($addrightbarTitle, $addrightbarBody)
{
$rightbarContent = array("addrightbarTitle"=> $addrightbarTitle,
"addrightbarBody" => $addrightbarBody);
$this->addrightbarText[] = $rightbarContent;
} // end of function
/****** FUNCTION BEING DEFINED *********/
/*
* Function renderrightBar
* process the array passed by the addrightBar function
* Generates std HTML
* @param $addrightbararray
* @return string
*/
function renderrightBar($addrightbararray)
{
if(empty($addrightbararray[0]["addrightbarTitle"]))
return;
for($i = 0; $i < count($addrightbararray); $i++)
{
print "
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$this->rightblocktblwidth\" bgcolor=\"$this->nukelayoutthemeTrimcolor\">
<tr>
<td>
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"$this->nukelayoutthemeTrimcolor\">
<tr>
<td colspan=\"1\" bgcolor=". $this->nukelayoutthemeSectionheader ." align=\"left\">
<font size=\"2\" color=".$this->nukelayoutthemesectionheaderTextcolor."><B>". $addrightbararray[$i]["addrightbarTitle"] ." </b></font>
</td>
</tr>
<tr>
<td bgcolor=\"$this->nukelayoutthemeSectionbody\">
" . $addrightbararray[$i]["addrightbarBody"] . "
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
";
}
} // end of function
/**
* Function nukelayoutsiteBanner()
* site banner function
* sets cookie, detects browser and setup header image...
* no need to really modify... unless you like hacking
* @return string
*/
function nukelayoutsiteBanner()
{
// global $REMOTE_ADDR;
global $HTTP_COOKIE_VARS;
global $linkbar;
print "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\" bgcolor=". $this->nukelayoutthemeBgcolor ."><tr><td>";
print " <table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\" bgcolor=". $this->nukelayoutthemeTrimcolor ."><tr><td>";
print " <table bgcolor=\"$this->nukelayoutthemeSectionbody\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" width=\"100%\">";
print " <tr>";
print "<td colspan=\"3\" align=\"$this->nukelayoutlogoPosition\">";
print $this->nukelayoutLogo;
print "</td>";
print "</tr>";
print "</table>";
print " </td></tr>";
print "</table>";
print " </td></tr>";
print "</table>";
print "<table width=\"100%\"><tr><td height=\"5\"></td></tr></table>";
print "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\" bgcolor=". $this->nukelayoutthemeBgcolor ."><tr><td>";
print " <table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\" bgcolor=". $this->nukelayoutthemeTrimcolor ."><tr><td>";
print " <table bgcolor=\"$this->nukelayoutthemeSectionbody\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" width=\"100%\">";
print " <tr>";
print "<td colspan=\"1\" align=\"left\">";
if(!isset($linkbar)) {
print " ";
} else {
print $linkbar;
}
print "</td>";
print "<td colspan=\"1\" align=\"right\">";
print date("F j, Y");
print "</td>";
print "</tr>";
print "</table>";
print " </td></tr>";
print "</table>";
print " </td></tr>";
print "</table>";
print "<table width=\"100%\"><tr><td height=\"5\"></td></tr></table>";
} // end of function
/****** FUNCTION BEING DEFINED *********/
/**
* Function navigationMenu
* Provide the menu system for page. Top left table box
* @return string
*/
function navigationMenu()
{
print "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"$this->nukelayoutthemeTrimcolor\"\">";
print "<tr><td valign=\"top\" bgcolor=". $this->nukelayoutthemeBgcolor. ">";
print "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$this->leftblocktblwidth\" bgcolor=\"$this->nukelayoutthemeTrimcolor\"\"><tr><td>";
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\"><tr>";
print "<td colspan=\"1\" bgcolor=". $this->nukelayoutthemeSectionheader ." align=\"left\">";
print "<b><font size=\"2\" color=".$this->nukelayoutthemesectionheaderTextcolor.">". $this->lang_mainmenu ."</b></font>";
print "</td></tr><tr>";
print "<td bgcolor=". $this->nukelayoutthemeSectionbody ." >";
$this->navBarLinks($this->nukelayoutmenuLink_array);
print "<font size=\"2\">";
print "<br>";
print "</font>";
print "</td></tr></table></td></tr></table><br>";
} // end of function
/****** FUNCTION BEING DEFINED *********/
/**
* Function navBarLinks
* Provide the menu system links for page.
* @return string
*/
function navBarLinks()
{
reset($this->nukelayoutmenuLink_array);
while (list($key, $val) = each($this->nukelayoutmenuLink_array)) {
$label = ucfirst($key);
echo "<FONT SIZE='1' FACE='Arial'>";
echo "$this->nukelayoutmenuLinkstarter";
// see if we want to open in a new window
// code added 09-24-2001
if(ereg("rhttp://", $val)) {
$val = ereg_replace("rhttp", "http", $val);
echo "<A HREF=\"$val\" TARGET=\"_blank\">$label</A></FONT><br>\n";
} else {
echo "<A HREF=\"$val\">$label</A></FONT><br>\n";
}
}
} // end of function
/****** FUNCTION BEING DEFINED *********/
/*
* FunctionnukelayoutSpacer
* just a spacer keeps table structure if left menu is turned of
* @return string
*/
function nukelayoutSpacer()
{
print "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"#CCCCCC\">";
print "<tr><td valign=\"top\" bgcolor=". $this->nukelayoutthemeBgcolor .">";
} // end of function
/**
* Function displayLinks
* Provide the menu system links for page.
* @param array $link_array
* @return string
*/
function displayLinks($link_array)
{
reset($link_array);
$content = "";
while (list($key, $val) = each($link_array)) {
$label = ucfirst($key);
$content .= "<FONT SIZE='1' FACE='Arial'>";
// see if we want to open in a new window
// code added 09-24-2001
if(ereg("rhttp://", $val)) {
$val = ereg_replace("rhttp", "http", $val);
$content .= "<A HREF=\"$val\" TARGET=\"_blank\">$label</A></FONT>\n";
} else {
$content .= " <A HREF=\"$val\">$label</A></FONT>\n";
}
}
return $content;
} // end of function
/**
* Function getrandomImage
* Get random images from directory
* @param $dirpath
* @return string
*/
function getrandomImage($dirpath)
{
$imgdir = array();
$i = 0;
$d = dir($dirpath);
while($entry=$d->read()) {
if ( $entry !="." && $entry !=".." ) {
$imgdir[$i]=$entry;
$i++;
}
}
$d->close();
srand ((double) microtime() * 10000000);
$key = rand ( 0,$i-1 );
return $dirpath."/".$imgdir[$key];
}
/**
* Function displaymyLinks
* Provide links for left/right bar.
* @param $linkarray
* @return string
*/
function displaymyLinks($linkarray)
{
reset($linkarray);
$link_str = "";
while (list($key, $val) = each($linkarray)) {
$label = ucfirst($key);
if(ereg("rhttp://", $val)) {
$val = ereg_replace("rhttp", "http", $val);
$link_str .= "<FONT SIZE='1' FACE='Arial'> <A HREF=\"$val\" TARGET=\"_blank\">$label</A></FONT><br>\n";
} else {
$link_str .= "<FONT SIZE='1' FACE='Arial'> <A HREF=\"$val\">$label</A></FONT><br>\n";
}
}
return $link_str;
} // end of function
/**
* Function getrandQuote
* Provide quote system.
* @param $quotefile
* @return string
*/
function getrandQuote($quotefile)
{
$quotes = file("$quotefile");
srand ((double) microtime() * 1000000);
return $quotes[rand(0,count($quotes)-1)];
} // end of function
////////////////////////////////////////////////////////////
// Functions taken from example posted on phpbuilder.com //
//////////////////////////////////////////////////////////
function browser_get_agent () {
global $BROWSER_AGENT;
return $BROWSER_AGENT;
}
function browser_get_version() {
global $BROWSER_VER;
return $BROWSER_VER;
}
function browser_get_platform() {
global $BROWSER_PLATFORM;
return $BROWSER_PLATFORM;
}
function browser_is_mac() {
if ($this->browser_get_platform()=='Mac') {
return true;
} else {
return false;
}
}
function browser_is_windows() {
if ($this->browser_get_platform()=='Win') {
return true;
} else {
return false;
}
}
function browser_is_ie() {
if ($this->browser_get_agent()=='IE') {
return true;
} else {
return false;
}
}
function browser_is_netscape() {
if ($this->browser_get_agent()=='MOZILLA') {
return true;
} else {
return false;
}
}
/**
* Function nukelayout_css_site
* Provide class support.
* @return string
*/
function nukelayout_css_site() {
//determine font for this platform
if ($this->browser_is_windows() && $this->browser_is_ie()) {
//ie needs smaller fonts than anyone else
$font_size='x-small';
$font_smaller='xx-small';
$font_smallest='7pt';
} else if ($this->browser_is_windows()) {
//netscape or "other" on wintel
$font_size='small';
$font_smaller='x-small';
$font_smallest='x-small';
} else if ($this->browser_is_mac()){
//mac users need bigger fonts
$font_size='medium';
$font_smaller='small';
$font_smallest='x-small';
} else {
//linux and other users
$font_size='small';
$font_smaller='x-small';
$font_smallest='x-small';
}
?>
<!--CSS by Kam Salisbury http://www.salsolutions.net -->
<STYLE TYPE="text/css">
<!--
BODY, DIV {
background-color: <?php echo $this->nukelayoutthemeBgcolor; ?>;
background-repeat: repeat; background-attachment: scroll;
background-position: 0% 50%;
color: <?php echo $this->nukelayoutthemeText; ?>;
margin-left : .3em;
margin-right : .3em;
margin-top : .3em;
margin-bottom : .3em;
}
TH, TD, OL, UL, LI { font-family: <?php echo $this->nukelayoutsitefonts; ?>; font-size: <?php echo $font_size; ?>; }
H1 { font-size: 175%; font-family: <?php echo $this->nukelayoutsitefonts; ?>; }
H2 { font-size: 150%; font-family: <?php echo $this->nukelayoutsitefonts; ?>; }
H3 { font-size: 125%; font-family: <?php echo $this->nukelayoutsitefonts; ?>; }
H4 { font-size: 100%; font-family: <?php echo $this->nukelayoutsitefonts; ?>; }
H5 { font-size: 75%; font-family: <?php echo $this->nukelayoutsitefonts; ?>; }
H6 { font-size: 50%; font-family: <?php echo $this->nukelayoutsitefonts; ?>; }
PRE, TT, CODE { font-family: courier, sans-serif; font-size: <?php echo $font_size; ?>; }
A:link { text-decoration: none; font-family: <?php echo $this->nukelayoutsitefonts; ?>;
font-size: <?php echo $font_smaller; ?>; color: #<?php echo $this->nukelayoutthemelink; ?>;}
A:visited { text-decoration: none; font-family: <?php echo $this->nukelayoutsitefonts; ?>;
font-size: <?php echo $font_smaller; ?>; color: #<?php echo $this->nukelayoutthemealink; ?>;}
A:active { text-decoration: none; font-family: <?php echo $this->nukelayoutsitefonts; ?>; font-size: <?php echo $font_smaller; ?>;
color: #<?php echo $this->nukelayoutthemevlink; ?>;}
A:hover { text-decoration: none; font-family: <?php echo $this->nukelayoutsitefonts; ?>;
font-size: <?php echo $font_smaller; ?>; color: #<?php echo $this->nukelayoutthemehlink; ?>;}
.ahem { display: none }
-->
</STYLE>
<?php
} // end of function
/**
* Function mailto
* Provide email str.
* @return string
*/
function mailto(){
$mailtostr = "<a href=\"mailto:".$this->nukelayoutpageOwneremail."\">".$this->nukelayoutpageOwner."</a>\n";
return $mailtostr;
} // end of function
} // end nukeLayout class
/****** END OF NukeLayout Class *********/
// BETA code...
// Stuff I'm testing
class nukelayout_Extended extends nukelayout
{
} //end of class
?>