I could tell you have no idea. Don't get me wrong, but imo you shouldn't do what you're trying to do, as you simply don't have the skills to accomplish it (yet). I have edited the files, but the custom footer won't do what you expect it to do - the code is just crap. I put some notes into the code, and I'll post the relevant bits here as well, so others might learn from it (although this is not a good example for what you can do with custom header functions).
I had to delete the attachment you made, as it contains your db password. You must never ever post your db details publicly; you're encouraged to change it asap (or ask your webhost to do this for you) for security reasons.
This is the relevant part of theme.php:function pageheader($section, $meta = '')
{
global $CONFIG, $THEME_DIR;
global $template_header, $lang_charset, $lang_text_dir;
// this is the place where the custom header file gets included
if(empty($custom_header)){
ob_start();
// your custom footer's php code starts here.
// Of course it's crap and won't work, that's why I commented it out.
// To put it back into place, remove the slash_asterisk and asterisk_slash lines (910 and 931).
// the code won't actually do anything except running a query (without using the queried data for anything particular).
// You'll have to edit the password values as well, as I removed them for security reasons.
/*
$update = "$_POST['update']";
if ($update=="1") {
$name = "$_POST['name']";
$comment = "$_POST['comment']";
$Host = "localhost";
$User = "scum002_scum002x";
$Password = "***";
$DBName = "scum002_xmb1";
$Link = mysql_connect ($Host, $User, $Password);
$Query = "INSERT INTO `comments` ( `id` , `name` , `comment` )VALUES('', '$name', '$comment');";
$Result = mysql_db_query($DBName, $Query, $Link);
mysql_close($Link);
}
$Host2 = "localhost";
$User2 = "scum002_scum002x";
$Password2 = "***";
$DBName2 = "scum002_xmb1";
$Link2 = mysql_connect ($Host2, $User2, $Password2);
$Query2 = "SELECT * FROM `comments` ORDER BY 'id' DESC";
$Result2 = mysql_db_query($DBName2, $Query2, $Link2);
*/
// your custom footer's php code ends here
$custom_header = cleanup_custom_includes(ob_get_contents());
ob_clean();
}
if(empty($users_online)){
ob_start();
// your users online script get's included here
// the next line needs editing
include('/your/path/to/virtualonline/virtualonline.php');
$users_online = cleanup_custom_includes(ob_get_contents());
ob_clean();
}
header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
user_save_profile();
$template_vars = array('{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
'{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
'{META}' => $meta,
'{GAL_NAME}' => $CONFIG['gallery_name'],
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
'{MAIN_MENU1}' => theme_main_menu1(),
'{MAIN_MENU2}' => theme_main_menu2(),
'{ADMIN_MENU}' => theme_admin_mode_menu(),
'{USERS_ONLINE}' => $users_online,
'{CUSTOM_HEADER}' => $custom_header,
);
echo template_eval($template_header, $template_vars);
}
// Function for writing a pagefooter
function pagefooter()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
global $USER, $ALBUM_SET, $CONFIG, $time_start, $query_stats;
global $template_footer;
if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
cpg_debug_output();
}
echo $template_footer;
}
// Function to clean up any double html leftovers from the custom header and footer that are not meant to get parsed
function cleanup_custom_includes($string) {
$string = str_replace('<HTML>', '', $string);
$string = str_replace('<HEAD>', '', $string);
$string = str_replace('<BODY>', '', $string);
$string = str_replace('</HTML>', '', $string);
$string = str_replace('</HEAD>', '', $string);
$string = str_replace('</BODY>', '', $string);
return $string;
}
Code for template.html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{lang_dir}">
<head>
<title>{TITLE}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<meta http-equiv="Pragma" content="no-cache" />
<style type="text/css">
<!--
.style1 {font-size: 9px}
form#login {
background-color: #56606D;
color: #000000;
border: 0px solid #56606D;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
text-align: right;
}
#login .text {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
width: 300px;
margin-right: 1px;
}
#login .buttons {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
background-color: #333333;
color: #FFFFFF;
margin-right: 1px;
}
-->
</style>
{META}
<meta name="keywords" content="VX7000, VX7000 ringtones, vx7000 wallpapers, qpst, qpst 2.7, ringtones, wallpapers, free ringtones, free wallpapers, mp3 ringtones, 176x184, lg vx7000 ringtones, vx7000 hack, vx7000 mp3 ringtones, free ringtones for vx7000, qualcomm qpst, download qpst, VX8000">
<meta name="description" content="This is a website that provides Wallpapers, Ringtones, and Tutorials for your cell phones (LG VX6000, VX7000, VX8000, as well as any other phones that play mp3 ringtones and have wallpaper capabilities). Most images are 176x184 and will fit the LG VX7000/8000 phones perfectly.">
<link rel="stylesheet" href="themes/hardwired/style.css" />
<script type="text/javascript" src="scripts.js"></script>
<!--
$Id: template.html,v 1.3 2004/06/11 09:20:09 tarique Exp $
-->
</head>
<body onLoad="fadeRumor()">
{CUSTOM_HEADER}
<table width="778" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="778" height="61" valign="middle" align="right" background="themes/hardwired/images/hw_01.gif">
<table width="73%" height="32" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="94%" height="22" valign="bottom" align="right"><span class="gal_name">{GAL_NAME}</span><br />
<span class="style1">{GAL_DESCRIPTION}</span><br />
{USERS_ONLINE}
</td>
<td width="6%"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="100%" align="center" valign="top" background="themes/hardwired/images/hw_02.gif"><table width="100%" height="100%" border="0" align="center">
<tr>
<td valign="top" align="left">
<table width="725" border="0" align="center" cellpadding="6" cellspacing="0">
<tr>
<td height="108" valign="top"><div align="right">{MAIN_MENU1}</div><br />
{MAIN_MENU2} <br />
<div align="center">{LANGUAGE_SELECT_FLAGS}<br>{THEME_SELECT_LIST} {LANGUAGE_SELECT_LIST}</div><br />
{ADMIN_MENU} {GALLERY}</td>
</tr>
</table>
<br />
</td>
</tr>
</table></TD>
</tr>
<tr>
<td valign="bottom"> <img src="themes/hardwired/images/hw_03.gif"></td>
</tr>
</table>
</body>
</html>