Well I was trying to do the same thing myself... to be able to come up with a header and footer for the pages and here's what I came up with.
If you've got the split apart php files open
config.php, otherwise, at the top of the main php file, just after all the $cfg[] varibles have been set and look for this line:
- Code: Select all
// end of configuration
if (file_exists('kpconfig.php')) include('kpconfig.php');
Before that add the following:
- Code: Select all
// This will be displayed at the top of every page. The Header Code
$cfg['topheader'] = '
<tr height=40 bgcolor=blue>
<td colspan=2 align=center>
<font color=yellow><B>THIS IS THE TOP OF THE PAGE!</B></font>
</td>
</tr>
';
// This will be displayed at the bottom of every page. The Footer Code
$cfg['bottomfooter'] = '
<tr height=40 bgcolor=blue>
<td colspan=2 align=center>
<font color=yellow><b>THIS IS THE BOTTOM OF THE PAGE</b></font>
</td>
</tr>
';
Now mind you this HTML code can be changed to whatever you want, just preserve the
colspan=2 in the TD commands
Now that you got that part done, save what you got and again, if you have the separate PHP files, open
design.php or if not, look for the following code:
- Code: Select all
$kdesign['top'] = '
switch($this->style)
{
case 0:
?>
<table width="100%" border="0" align="left" cellspacing="0" cellpadding="0">
<tr>
<td align="left" width="70%" valign="top">
<?php if ($this->addform) $this->form(); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php
break;
case 1:
?>
<table width="100%" border="0" align="left" cellspacing="0" cellpadding="0">
<?php echo $TopHeader; ?>
<tr>
<td width="320" valign="top">
<?php infobox(); ?></td>
<td align="left" valign="top">
<?php if ($this->addform) $this->form(); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td height="5"></td></tr>
<tr>
<td> <?php
break;
}
';
and
replace it with this code:
- Code: Select all
$kdesign['top'] = '
switch($this->style)
{
case 0:
?>
<table width="100%" border="0" align="left" cellspacing="0" cellpadding="0">
<?php echo $cfg["topheader"]; ?>
<tr>
<td align="left" width="70%" valign="top">
<?php if ($this->addform) $this->form(); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php
break;
case 1:
?>
<table width="100%" border="0" align="left" cellspacing="0" cellpadding="0">
<?php echo $cfg["topheader"]; ?>
<tr>
<td width="320" valign="top">
<?php infobox(); ?></td>
<td align="left" valign="top">
<?php if ($this->addform) $this->form(); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td height="5"></td></tr>
<tr>
<td>
<?php
break;
Now if you look closely, the only thing that was added to this code was the
<?php echo $cfg["topheader"]; ?> just after the first
TABLE command in both
case instances. So if you are following along, it shouldn't be too hard to realize that you do the exact same thing with the bottom footer.
Look for the following code just below the code above in the same file:
- Code: Select all
$kdesign['bottom'] = '
switch($this->style)
{
case 0:
echo \'</td><td valign="top" align="left" width="30%">\';
infobox();
echo \'</td></tr></table>\';
break;
case 1:
echo \'</td></tr></table>\';
break;
}';
And
replace it with this code:
- Code: Select all
$kdesign['bottom'] = '
switch($this->style)
{
case 0:
echo \'</td><td valign="top" align="left" width="30%">\';
infobox();
echo $cfg["bottomfooter"];
echo \'</td></tr></table>\';
break;
case 1:
echo $cfg["bottomfooter"];
echo \'</td></tr></table>\';
break;
}';
But where are the <? ?> commands at in the bottom code? Well... they aren't needed here because the bottom code is direct PHP whereas the top code is intermixed PHP/HTML.
Now just one more quick change to make... in order to use these, you have to make sure that the functions that display the top and bottom code recognize the
$cfg[] variable or everything you've done so far will be for nought... so... look in the
styles.php file or again just look for the following code in the single php:
- Code: Select all
function top()
{
eval(gethtml('top'));
}
function bottom()
{
eval(gethtml('bottom'));
}
And
replace it with the following code:
- Code: Select all
function top()
{
global $cfg;
eval(gethtml('top'));
}
function bottom()
{
global $cfg;
eval(gethtml('bottom'));
}
Note... the only thing you're adding to these to little functions is the command
global $cfg; which basically tells that function that there's something actually in the
$cfg variable and to use the contents of it instead of treating it as a new variable entirely.
Well that about does it for the day... You should now be able to change the Header and Footer code to anything you like... a graphic banner, a scrolling text... whatever your heart desires. I hope this helps... lemme know! Does this help Aba?
-=> Satyr! <=-