...

View Full Version : problems with includes ()



danelliott
06-09-2007, 06:56 PM
Hi all, this is my first post so first of all HI.

You may be seeing a lot more of me over the coming weeks / months as im really trying to get to grips with the whole PHP thing lol.

Anyway my problem is regarding the includes() function.

Senario:

I have a website called mysite.co.uk and my ROOT looks like this:

[ROOT]-----------[carparts]---------[themes]---------[choosen_theme]/files to include

All the files from within the carparts directory all work using the includes () for files found in thr choosen theme directory i.e. header.php, footer.php

I am trying to call these same header and footer.php files from the choosen theme directory to an index.php which will be located in the ROOT directory.

am i making sense so far?

There is also a config file found in ROOT/carparts/config/ which needs to be included also.

i have tried
include ("../subdirectory/themes/".$setts['default_theme']."/header.php"); and
include("../path/to/file.php") but all im getting is loads of errors. i realize that there are mysql strings on the page aswell but even so the simple includes () should still be able to call the header and footer.php shuoldnt it?

I have really roughly put together something which may help you understand what i mean by clicking here----->HERE (http://bmobm.co.uk/help/help.html)<--------

I hope you can help me as im pulling my hair out

whizard
06-09-2007, 08:07 PM
Can you show your errors?

Dan

danelliott
06-09-2007, 08:26 PM
This is tho original code from the file i am using,


<?
## v5.24 -> apr. 05, 2006
session_start();

if (!file_exists("config/config.php")) echo "<script>document.location.href='install.php'</script>";

$option = (!empty($_GET['option'])) ? $_GET['option'] : "";

if ($option=="logout") {
session_destroy();
echo "<script>document.location.href='index.php'</script>";
}

include_once ("config/config.php");


### do the cron job if selected to run from mywebpage
if ($setts['cron_job']==2) {
$manualCron = TRUE;
include_once ("cron/cron1.php");
}

$getFeatItems=mysql_query("SELECT id, itemname, picpath, maxbid, enddate, currency FROM probid_auctions WHERE
hpfeat='Y' AND active=1 AND closed=0 AND deleted!=1 AND listin!='store' ORDER BY rand() LIMIT 0,".$layout['max_feat_hp']." ");
$nbFeatItems=mysql_num_rows($getFeatItems);
if ($layout['nb_feat_hp']>0) {
$j=floor($nbFeatItems/$layout['nb_feat_hp']);
$j++;
} else $notfeat="Y";
$fct=0;

$id = array();
$name = array();
$pic = array();
$maxbid = array();
$enddate = array();
$currency = array();

while ($hpFeatured=mysql_fetch_array($getFeatItems)) {
$id[$fct] = $hpFeatured['id'];
$name[$fct] = $hpFeatured['itemname'];
$pic[$fct] = $hpFeatured['picpath'];
$maxbid = array ($fct => $hpFeatured['maxbid']);
$enddate = array ($fct => $hpFeatured['enddate']);
$currency[$fct] = $hpFeatured['currency'];
$fct++;
}
include ("themes/".$setts['default_theme']."/header.php");
include ("themes/".$setts['default_theme']."/mainpage.php");
include ("themes/".$setts['default_theme']."/footer.php");
?>

This all works fine from within the carparts directory. I wish for this to work from one level up that is the main ROOT directory.

I have tried adding the extra step in the includes path as shown below but it just doesnt like it.


include ("carparts/themes/".$setts['default_theme']."/header.php");
include ("carparts/themes/".$setts['default_theme']."/mainpage.php");
include ("carparts/themes/".$setts['default_theme']."/footer.php");
?>

even when i try just the includes nothing else i.e.:

<?
include ("carparts/themes/".$setts['default_theme']."/header.php");
include ("carparts/themes/".$setts['default_theme']."/mainpage.php");
include ("carparts/themes/".$setts['default_theme']."/footer.php");
?>

im getting all these errors.... by the way im sorry bout this but i really wanna learn but i am completly new to this........

Warning: main(carparts/themes//header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

Warning: main(carparts/themes//header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

Warning: main(carparts/themes//header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

are some of the errors im getting but while typing this reply i had an idea but after trying it i got a new error and only 1 error this time and that was "Access Denied"
this error was after just using this peice of code


<?
include ("carparts/themes/v524/header.php");
include ("carparts/themes/v524/mainpage.php");
include ("carparts/themes/v524/footer.php");
?>

so its like there is some kind of protection maybe or i may be missing something out of the code above which needs to e put in this new file i just dont know

_Aerospace_Eng_
06-09-2007, 08:53 PM
You have to go back 3 directories.

<?php
include ("../../../../header.php");
include ("../../../../mainpage.php");
include ("../../../../footer.php");
?>
Go back one directory and you will be b in v524, go back another you'll be in themes, then another, you'll be in carparts, now you need to get back to the root. Something like this might be a little more efficient though

<?php
include ($_SERVER['DOCUMENT_ROOT']."/header.php");
include ($_SERVER['DOCUMENT_ROOT']."/mainpage.php");
include ($_SERVER['DOCUMENT_ROOT']."/footer.php");
?>
That should give you something like this

<?php
include ("/home/username/public_html/header.php");
include ("/home/username/public_html/mainpage.php");
include ("/home/username/public_html/footer.php");
?>
Also don't use <? instead use <?php using <? is lazy and can cause problems when using xml.

danelliott
06-09-2007, 10:46 PM
Thank you for reply, however im getting errors again now as shown below:


Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/header.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 2

Warning: main(/home/username/public_html/header.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 2

Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/header.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 2

Warning: main(/home/username/public_html/header.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 2

Warning: main() [function.include]: Failed opening '/home/username/public_html/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 2

Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/mainpage.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 3

Warning: main(/home/username/public_html/mainpage.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 3

Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/mainpage.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 3

Warning: main(/home/username/public_html/mainpage.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 3

Warning: main() [function.include]: Failed opening '/home/username/public_html/mainpage.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 3

Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/footer.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 4

Warning: main(/home/username/public_html/footer.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 4

Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/footer.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 4

Warning: main(/home/username/public_html/footer.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 4

Warning: main() [function.include]: Failed opening '/home/username/public_html/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 4


this was using the

<?php
include ("/home/username/public_html/header.php");
include ("/home/username/public_html/mainpage.php");
include ("/home/username/public_html/footer.php");
?> suggestion.

what does "open_basedir restriction in effect" mean?

mr e
06-09-2007, 10:57 PM
Look at the errors, notice there's a path in there that looks a lot like the one you're trying to include, only with a different user name? You want to use this user name, not literally "username".


Warning: main() [function.include]: Failed opening '/home/username/public_html/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 4


So you would want


include ("/home/bmobm/public_html/footer.php");


Or as was said earlier


// $_SERVER['DOCUMENT_ROOT'] evaluates to /home/bmobm/public_html

include ($_SERVER['DOCUMENT_ROOT']."/footer.php");

danelliott
06-09-2007, 11:07 PM
Ok ive just tried this code:

<?php
include ($_SERVER['DOCUMENT_ROOT']."/carparts/themes/v525/header.php");
include ($_SERVER['DOCUMENT_ROOT']."/carparts/themes/v524/mainpage.php");
include ($_SERVER['DOCUMENT_ROOT']."/carparts/themes/v524/footer.php");
?>

and im getting these errors:

Warning: main(/home/bmobm/public_html/carparts/themes/v525/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

Warning: main(/home/bmobm/public_html/carparts/themes/v525/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/carparts/themes/v525/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 2
Access Denied

the carparts/themes/v525 is the path to the files i want but its still not working AAGGGHHHHHHH!!!! lol this is really doing my head in. ive been fiddeling round with the code for ages now trying different things lol but im still no closer to where i wanna be.

_Aerospace_Eng_
06-09-2007, 11:16 PM
Sighs. I suggest you follow the suggestions given rather than make up your own. Use this as is, DON'T change it

<?php
include ($_SERVER['DOCUMENT_ROOT']."/header.php");
include ($_SERVER['DOCUMENT_ROOT']."/mainpage.php");
include ($_SERVER['DOCUMENT_ROOT']."/footer.php");
?>

danelliott
06-09-2007, 11:31 PM
sorry _Aerospace_Eng_,

i did try as you suggested also but i got this result:


Warning: main(/home/bmobm/public_html/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

Warning: main(/home/bmobm/public_html/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 2

Warning: main(/home/bmobm/public_html/mainpage.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 3

Warning: main(/home/bmobm/public_html/mainpage.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 3

Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/mainpage.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 3

Warning: main(/home/bmobm/public_html/footer.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 4

Warning: main(/home/bmobm/public_html/footer.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 4

Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 4

mr e
06-09-2007, 11:41 PM
If your main file is in your /www (or /public_html, both go to the same place) folder, then any of these should work, do they all not?


include('./carparts/themes/v524/header.php');

include('/home/bmobm/public_html/carparts/themes/v524/header.php');

include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/header.php');

danelliott
06-09-2007, 11:47 PM
Ok, with this access denied with ALL three of those examples

the index i want to use as entry point to the site is in the ROOT the files i want to call upon are in ROOT----carparts-----themes-----v524/

mr e
06-09-2007, 11:58 PM
Ok, I think it has to do with the header/footer, not the include() itself

Try this, I bet it works


include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/main.js');

// Or try

include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/index.php');

danelliott
06-10-2007, 12:03 AM
when i use
include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/index.php');

do i use it on its own? or should i replace the index.php with header.php, footer.php ect? because on its own i get a blank page

and if i use
include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/main.js');
i get a load of weird code like this
function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var

_Aerospace_Eng_
06-10-2007, 12:10 AM
Post the code for header.php and footer.php

Going to them directly I get access denied. Whatever is in those files is also denying access for inclusion.

danelliott
06-10-2007, 12:21 AM
It wont allow me to post the whole code in one go im afraid ill have to do it in bits the first bit of the header code looks like this.

Ok, before you read this code, would i get access denied if there is MySQL queiries in the code im trying to call? if so then please dont bother reading the code unless it will help someone explain to me what i need to do for the page to work.

header.php looks like this:[PHP]<?
## v5.24 -> apr. 05, 2006
if ( !defined('INCLUDED') ) { die("Access Denied"); }
### enter hit into stats table
if ($setts['maintenance_mode']==1&&$_SESSION['adminarea']!="Active") {
include_once ("maintenance_splash_page.php");
die();
}

function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}

$time_start = getmicrotime();
$currentTime = time();
### Site Stats currently disabled
/* $refererSite=getenv("HTTP_REFERER");
$enterhit = mysql_query("INSERT INTO probid_stats (userip,userbrowser,clickdate,referralsite)
VALUES ('".$_SERVER['REMOTE_ADDR']."','".$_SERVER['HTTP_USER_AGENT']."','".$currentTime."','".$refererSite."')") or die(mysql_error());
*/
### session language settings
if(!$_SESSION['sess_lang']) {
include_once ("config/lang/".$setts['default_lang']."/site.lang");
$_SESSION['sess_lang']="".$setts['default_lang']."";
include_once ("config/lang/".$setts['default_lang']."/category.lang");
}else{
include_once ("config/lang/".$_SESSION['sess_lang']."/site.lang");
include_once ("config/lang/".$_SESSION['sess_lang']."/category.lang");
}

## modification regarding the SSL - only the registration and login page will be in SSL.
$path = $setts['siteurl'];
$path_ssl = ($setts['is_ssl']==1) ? $setts['ssl_address'] : $setts['siteurl'];

## show sell button
if ($setts['private_site']=="Y") $showSell = $_SESSION['is_seller'];
else $showSell="Y";

if ($_SESSION['membersarea']=="Active"||$_SESSION['accsusp']==2) {
$btn2_link=$path."sellitem.php";
$btn3_caption=$lang[Cap_members];
$btn3_link=$path."membersarea.php";
$btn4_caption=$lang[Cap_logout];
$btn4_link=$path."index.php?option=logout";
} else {
$btn2_link=$path_ssl."login.php?redirect=sell";
$btn3_caption=$lang['Cap_register'];
$btn3_link=$path_ssl."register.php";
$btn4_caption=$lang['Cap_login'];
$btn4_link=$path_ssl."login.php";
}
include ("themes/".$setts['default_theme']."/title.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
<?
if (eregi("auctiondetails.php",$_SERVER['PHP_SELF'])) echo getSqlField("SELECT itemname FROM probid_auctions WHERE id='".$_GET['id']."'","itemname")." - ";
if (eregi("wanted.details.php",$_SERVER['PHP_SELF'])) echo getSqlField("SELECT itemname FROM probid_wanted_ads WHERE id='".$_GET['id']."'","itemname")." - ";
else if (eregi("categories.php",$_SERVER['PHP_SELF'])) {
$cat_title = getSqlField("SELECT name FROM probid_categories WHERE id='".$_REQUEST['parent']."'","name");
if ($cat_title!=""&&$cat_title!="n/a") echo $cat_title." - ";
}
echo $setts['sitename'];
?>
</title>
<?
if (eregi("categories.php",$_SERVER['PHP_SELF'])) {
$meta_cat = getMainCat($_REQUEST['parent']);
$meta_details = getSqlRow("SELECT meta_description, meta_keywords FROM probid_categories WHERE id='".$meta_cat."'");
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$lang[codepage];?>">
<?
if ($meta_details['meta_description']!=""||$meta_details['meta_keywords']!="") {
echo "<meta name=\"description\" content=\"".$meta_details['meta_description']."\"> \n";
echo "<meta name=\"keywords\" content=\"".$meta_details['meta_keywords']."\"> \n";
} else {
echo addSpecialChars(getSqlField ("SELECT metatags FROM probid_gen_setts","metatags"));
}

if (eregi("shop", $_SERVER['PHP_SELF'])) {
$store_metatags = getSqlField("SELECT store_metatags FROM probid_users WHERE id='".$_REQUEST['userid']."'", "store_metatags");
if (!empty($store_metatags)) echo "<meta name=\"keywords\" content=\"".$store_metatags."\"> \n";
}
?>
<link href="themes/<?=$setts['default_theme'];?>/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.lb {
background-image: url(themes/<?=$setts['default_theme'];?>/img/lb_bg.gif);
}
.db {
background-image: url(themes/<?=$setts['default_theme'];?>/img/db_bg.gif);
}
-->
</style>
<script language="javascript" src="themes/<?=$setts['default_theme'];?>/main.js" type="text/javascript"></script>
<script language=JavaScript src='scripts/innovaeditor.js'></script>
<script type="text/javascript">
<? $diff=getSqlField("SELECT * FROM probid_timesettings WHERE active='selected'","value"); ?>
var currenttime = '<? print date("F d, Y H:i:s", time()+$diff*3600)?>';
var serverdate=new Date(currenttime);

function padlength(what){
var output=(what.toString().length==1)? "0"+what : what;
return output;
}

function displaytime(){
serverdate.setSeconds(serverdate.getSeconds()+1)
var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds());
document.getElementById("servertime").innerHTML=timestring;
}

window.onload=function(){
setInterval("displaytime()", 1000);
}

</script>
</head>
<body bgcolor="#ffffff" leftmargin="5" topmargin="5" marginwidth="5" marginheight="5" <? if (eregi("index.php",$_SERVER['PHP_SELF'])) { ?>onLoad="loadScroller()"<? } ?>>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%"><table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-bottom: 4px solid #0f3f79;">
<tr valign="bottom">
<td><img src="images/probidlogo.gif?<?=rand(2,9999);?>" alt="Bmobm Carparts Online Vehicle Related Auction Site" vspace="4"></td>
<td width="100%" valign="bottom" style="padding-left: 30px;"><div class="toplink" align="right" style="padding: 10px;"> <a href="<?=$path;?>index.php">
<?=$lang[Cap_home];?>
</a> |
&nbsp;<a href="<?=$path;?>faq.php">
<?=$lang[Cap_faq];?>
</a>
<? if ($layout['is_about']=="Y") { ?>
| <a href="<?=$path;?>aboutus.php">
<?=$lang[Cap_about];?>
</a>
<? } ?>
<? if ($layout['is_contact']=="Y") { ?>
| <a href="<?=$path;?>contactus.php">
<?=$lang[Cap_contact];?>
</a>
<? } ?>
</div>
<? ## calculate width
$headerCells = 3;
if ($showSell == "Y") $headerCells ++;
if ($setts['enable_wantedads'] == "Y") $headerCells ++;
if ($setts['stores_enabled'] == "Y") $headerCells++;
if ($layout['is_about'] == "Y") $headerCells ++;
if ($layout['is_contact'] == "Y") $headerCells ++;
$headBtnWidth = 100/$headerCells."%";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="31" align="center">
<? if (eregi("index.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>index.php">
<?=$lang[Cap_home];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else {?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>index.php">
<?=$lang[Cap_home];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? } ?>
<? if ($showSell=="Y") {
if (eregi("sellitem.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn2_link;?>">
<?=$lang[Cap_sell];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else {?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn2_link;?>">
<?=$lang[Cap_sell];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? } }
if (eregi("membersarea.php",$_SERVER['PHP_SELF'])||eregi("register.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn3_link;?>">
<?=$btn3_caption;?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn3_link;?>">
<?=$btn3_caption;?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? } if (eregi("login.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn4_link;?>">
<?=$btn4_caption;?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else {?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn4_link;?>">
<?=$btn4_caption;?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? }
if ($setts['stores_enabled']=="Y") {
if (eregi("stores.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>stores.php">
<?=$lang[Cap_stores];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else {?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>stores.php">
<?=$lang[Cap_stores];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? } }
if ($setts['enable_wantedads']=="Y") {
if (eregi("wanted.categories.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>wanted.categories.php">
<?=$lang[Cap_wantedads];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else {?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>wanted.categories.php">
<?=$lang[Cap_wantedads];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? } }
if (eregi("help.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>help.php">
<?=$lang[Cap_help];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else {?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>help.php">
<?=$lang[Cap_help];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? }
if (eregi("sitefees.php",$_SERVER['PHP_SELF'])) { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
<td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>sitefees.php">
<?=$lang[Cap_fees];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
<? } else { ?>
<td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
<td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>sitefees.php">
<?=$lang[Cap_fees];?>
</a>&nbsp;</td>
<td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
<? } ?>
</tr>
</table></td>
</tr>
</table>
<table width="100%" height="29" border="0" cellpadding="0" cellspacing="0" bgcolor="#efefef" style="border: 1px solid #a6a6a6; border-top: 2px solid #a6a6a6;">
<tr height="31">
<td width="194" nowrap align="center" class="search">&nbsp;&nbsp;&nbsp;
<?php
$diff=getSqlField("SELECT * FROM probid_timesettings WHERE active='selected'","value");
echo date(substr($setts['date_format'],0,7),time()+($diff*3600)) ?>
<span id="servertime"></span>&nbsp;&nbsp;&nbsp;</td>
<form action="auctionsearch.php" method="post">
<td class="search" nowrap style="border-left: 1px solid #dddddd;">&nbsp;&nbsp;&nbsp;<a href="<?=$path;?>search.php">
<?=$lang[Cap_search];?>
</a>&nbsp;&nbsp;&nbsp;</td>
<td class="search" nowrap><INPUT size=25 name="basicsearch">
&nbsp;&nbsp;&nbsp;</td>
<td class="search" nowrap><input name="searchok" type="submit" value="<?=$lang[search]?>">
&nbsp;&nbsp;&nbsp;</td>
</form>
<td class="search" nowrap style="border-left: 1px solid #dddddd;">&nbsp;&nbsp;&nbsp;
<?=$lang[browse];?>
&nbsp;&nbsp;</td>
<form name="catbrowse" method="post" action="<?=$path;?>categories.php">
<input type="hidden" name="show" value="subcats">
<? $getCategories = mysql_query("SELECT id,name FROM probid_categories WHERE parent=0 AND hidden=0 AND userid=0 ORDER BY theorder,name");?>
<td width="100%" class="search"><select name="parent" onChange="javascript:catbrowse.submit()">
<option value="" selected>
<?=$lang[choosecat];?>
</option>
<? while($category=mysql_fetch_array($getCategories)) { ?>
<option value="<?=$category['id'];?>" <? echo (($category['id']==$_REQUEST['parent'])?"selected":"");?>>
<?=$c_lang[$category['id']];?>
</option>
<? } ?>
<option value="">------------------------</option>
<option value="0">
<?=$lang[allcats];?>
</option>
</select>
</td>
</form>
<? if ($setts['user_lang']==1) { ?>
<td nowrap style="border-left: 1px solid #dddddd;"><!-- ADD THE FOLLOWING CODE WHEREEVER YOU WANT YOUR LANGUAGE OPTIONS TO SHOW-->
<div align="center"> &nbsp;&nbsp;
<? include ("config/lang/list2.php");
$langlist = explode(" ", $langlist);
$sizeofarray = count($langlist)-1;
for ($z=0; $z < $sizeofarray; $z++) {
echo "<a href=\"lang.php?lang=".$langlist[$z]."\">";
echo "<img src=\"themes/".$setts['default_theme']."/img/".$langlist[$z].".gif\" border=\"0\" alt=\"$langlist[$z]\"></a>&nbsp;&nbsp;";
} ?>
</div>
<!-- END ADDITION -->

danelliott
06-10-2007, 12:22 AM
the second part of the header.php look like this:
</td>
<? } ?>
</tr>
</table>
<div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="10"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<? if (eregi("index.php",$_SERVER['PHP_SELF'])) {} else { ?>
<td width="180"><script language="javascript">
var ie4 = false;
if(document.all) { ie4 = true; }

function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } }
function toggle(link, divId) {
var lText = link.innerHTML;
var d = getObject(divId);
if (lText == '+') { link.innerHTML = ''; d.style.display = 'block'; }
else { link.innerHTML = '+'; d.style.display = 'none'; }
}
</script>
<?
if ($_SESSION['membersarea']=="Active") {
$getAn=mysql_query("SELECT id,date,title FROM probid_announcements WHERE active=1 AND lang='".$_SESSION['sess_lang']."' ORDER BY date DESC");
$nbAn=mysql_num_rows($getAn);
if ($nbAn>0) {
header6("$lang[member_announcements2] [<a title=\"show/hide\" class=\"hidelayer\" id=\"exp1102170555_link\" href=\"javascript: void(0);\" onclick=\"toggle(this, 'exp1102170555');\"></a>]"); ?>
<div id="exp1102170555">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="c4"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
<td class="c3"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
</tr>
<? while ($ans=mysql_fetch_array($getAn)) { ?>
<tr>
<td class="c3"><img src="themes/<?=$setts['default_theme'];?>/img/arrow.gif" width="8" height="8" hspace="4"></td>
<td width="100%" class="c2 smallfont"><b><? echo displaydatetime($ans['date'],substr($setts['date_format'],0,7));?></b></td>
</tr>
<tr class="contentfont">
<td class="c4"></td>
<td class="c3"><a href="<?=$path;?>viewannouncement.php?id=<?=$ans['id'];?>">
<?=$ans['title'];?>
</a> </td>
</tr>
<? } ?>
</table>
</div>
<div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="5"></div>
<? } } ?>
<? if ($_SESSION['membersarea']=="Active"||$_SESSION['accsusp']==2) { ?>
<? header7("$lang[memarea_title] [<a title=\"show/hide\" class=\"hidelayer\" id=\"exp1102170142_link\" href=\"javascript: void(0);\" onclick=\"toggle(this, 'exp1102170142');\"></a>]");?>
<div id="exp1102170142">
<table border="0" cellpadding="1" cellspacing="1" width="100%" class="c4">
<tr>
<td align="center" height="35"><b style="font-size: 10px;">
<?=$lang[welcome];?>
,<br>
<? echo $_SESSION['membername']; ?></b> </td>
</tr>
<tr>
<td class="c5"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td>
</tr>
</table>
<? if ($showSell=="Y") { ?>
<table border="0" cellpadding="3" cellspacing="2" width="100%" class="c4">
<? if ($_SESSION['accsusp']!=2) { ?>
<tr align="center" bgcolor="white">
<td width="50%"><a class="membutt" href="membersarea.php?page=bidding"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_bidding.gif" width="40" height="40" border="0"><br>
<?=$lang[bidding_img]?>
</a></td>
<td width="50%"><a class="membutt" href="membersarea.php?page=selling"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_selling.gif" width="40" height="40" border="0"><br>
<?=$lang[selling_img]?>
</a></td>
</tr>
<tr align="center" bgcolor="white">
<td><a class="membutt" href="membersarea.php?page=feedback"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_feedback.gif" width="40" height="40" border="0"><br>
<?=$lang[feedback_img]?>
</a></td>
<? if ($setts['enable_bulk_lister']==1) { ?>
<td><a class="membutt" href="membersarea.php?page=bulk"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_bulk.gif" width="40" height="40" border="0"><br>
<?=$lang[bulk_img]?>
</a></td>
<? } ?>
</tr>
<tr align="center" bgcolor="white">
<td><a class="membutt" href="membersarea.php?page=aboutme"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_aboutme.gif" width="40" height="40" border="0"><br>
<?=$lang[aboutme_img]?>
</a></td>
<td><a class="membutt" href="abusereport.php"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_abuse.gif" width="40" height="40" border="0"><br>
<?=$lang[abuse]?>
</a></td>
</tr>
<tr align="center" bgcolor="white">
<? if ($setts['enable_wantedads']=="Y") { ?>
<td><a class="membutt" href="membersarea.php?page=wanted"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_wanted.gif" width="40" height="40" border="0"><br>
<?=$lang[wanted_img]?>
</a> </td>
<? } ?>
<? if ($setts['stores_enabled']=="Y") { ?>
<td><a class="membutt" href="membersarea.php?page=store"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_store.gif" width="40" height="40" border="0"><br>
<?=$lang[store_img]?>
</a></td>
<? } ?>
</tr>
<? } ?>
<tr align="center" bgcolor="white">
<td><a class="membutt" href="membersarea.php?page=preferences"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_details.gif" width="40" height="40" border="0"><br>
<?=$lang[details_img]?>
</a></td>
<td><a class="membutt" href="index.php?option=logout"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_logout.gif" width="40" height="40" border="0"><br>
<?=$lang[logout]?>
</a></td>
</tr>
</table>
<? } else { ?>
<table border="0" cellpadding="3" cellspacing="2" width="100%" bgcolor="#e9e9eb">
<? if ($_SESSION['accsusp']!=2) { ?>
<tr align="center" bgcolor="white">
<td width="50%"><a class="membutt" href="membersarea.php?page=bidding"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_bidding.gif" width="40" height="40" border="0"><br>
<?=$lang[bidding_img]?>
</a></td>
<td width="50%"><a class="membutt" href="membersarea.php?page=feedback"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_feedback.gif" width="40" height="40" border="0"><br>
<?=$lang[feedback_img]?>
</a></td>
</tr>
<? } ?>
<tr align="center" bgcolor="white">
<td><a class="membutt" href="membersarea.php?page=preferences"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_details.gif" width="40" height="40" border="0"><br>
<?=$lang[details_img]?>
</a></td>
<td><a class="membutt" href="index.php?option=logout"><img src="themes/<?=$setts['default_theme'];?>/img/system/ma_logout.gif" width="40" height="40" border="0"><br>
<?=$lang[logout]?>
</a></td>
</tr>
</table>
<? } ?>
<? } else { ?>
<? if ($_SESSION['membersarea']!="Active"&&$layout['d_login_box']==1&&$setts['is_ssl']!=1) { ?>
<? header7("$lang[memarea_title]");?>
<table border="0" cellpadding="2" cellspacing="2" width="100%" class="c4">
<form action="<?=$path_ssl;?>login.php" method="post" name="loginbox">
<input type="hidden" name="islogin" value="yes">
<input type="hidden" name="loginok" value="login">
<tr class="c2">
<td align="right" class="user"><?=$lang[username];?>
&nbsp;</td>
<td nowrap class="user"><input name="username" type="text" size="10">
</td>
</tr>
<tr class="c2">
<td align="right" nowrap class="user"><?=$lang[pass];?>
&nbsp;</td>
<td nowrap class="user"><input name="password" type="password" size="10"></td>
</tr>
<tr >
<td colspan="2" align="center"><input name="loginok" id="loginok" type="submit" value="login"></td>
</tr>
</form>
</table>
<? } else if ($_SESSION['membersarea']!="Active"&&$layout['d_login_box']==1&&$setts['is_ssl']==1) { ?>
<? header7("$lang[memarea_title]");?>
<table border="0" cellpadding="2" cellspacing="2" width="100%" class="c4">
<tr class="c2">
<td align="center" class="contentfont"><br>
<? echo "[ <a href=\"".$path_ssl."login.php\"><strong>".$lang[login_secure]."</strong></a> ]"; ?><br>
<br></td>
</tr>
</table>
<? } } ?>
</div>
<div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="5"></div>
<noscript>
JS not supported
</noscript>
<!-- flooble Expandable Content box end -->
<? headercat("$lang[Cap_categories] [<a title=\"show/hide\" class=\"hidelayer\" id=\"exp1102170166_link\" href=\"javascript: void(0);\" onclick=\"toggle(this, 'exp1102170166');\"></a>]");?>
<div id="exp1102170166">
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="bordercat">
<?
$getCats = mysql_query("SELECT id,name,items_counter, hover_title FROM probid_categories WHERE parent=0 AND hidden=0 AND userid=0 ORDER BY theorder,name");
while ($catBrowse=mysql_fetch_array($getCats)) {
$nbSubCats = getSqlNumber("SELECT id FROM probid_categories WHERE parent='".$catBrowse['id']."'");

if ($nbSubCats>0) $catLink=$path.processLink('categories', array('category' => $c_lang[$catBrowse['id']], 'parent' => $catBrowse['id'], 'show' => 'subcats'));
else $catLink=$path.processLink('categories', array('category' => $c_lang[$catBrowse['id']], 'parent' => $catBrowse['id'])); ?>
<tr>
<td class="contentfont"><img src="themes/<?=$setts['default_theme'];?>/img/arrow.gif" hspace="3" align="absmiddle"><a href="<?=$catLink;?>" <? echo ($catBrowse['hover_title']!="") ? "title=\"".$catBrowse['hover_title']."\"":""; ?>><? echo $c_lang[$catBrowse['id']];?>
<? if (eregi('Y', $setts['enable_cat_counters'])) echo ($catBrowse['items_counter']!=0) ? "(<strong>".$catBrowse['items_counter']."</strong>)":"(".$catBrowse['items_counter'].")";?>
</a> </td>
</tr>
<? } ?>
</table>
</div>
<noscript>
JS not supported
</noscript>
<div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="180" height="1"></div></td>
<td width="10"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="10" height="1"></td>
<? } ?>
<td width="100%">

danelliott
06-10-2007, 12:24 AM
and the footer like this:
<?
## v5.24 -> apr. 05, 2006
if ( !defined('INCLUDED') ) { die("Access Denied"); }
?>
</td>
</tr>
</table>
<?
if (isset($_SESSION['membersarea'])) {
$btn2_link=$path."sellitem.php";
$btn3_caption=$lang[memarea_title];
$btn3_link=$path."membersarea.php";
$btn4_caption=$lang[Cap_logout];
$btn4_link=$path."index.php?option=logout";
} else {
$btn2_link=$path_ssl."login.php?redirect=sell";
$btn3_caption=$lang[Cap_register];
$btn3_link=$path_ssl."register.php";
$btn4_caption=$lang[Cap_login];
$btn4_link=$path_ssl."login.php";
}
?>

<div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="5"></div>
<div style="border-top: 2px solid #a6a6a6;"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="5"></div>
<div align="center">
<?
if ($setts['is_ssl']==1&&(eregi("register.php",$_SERVER['PHP_SELF'])||eregi("login.php",$_SERVER['PHP_SELF']))) {
## do nothing, but dont display the banners.
} else {
## banner ads management

$nbAds = 0;
if (eregi("categories.php",$_SERVER['PHP_SELF'])) {
$catName = getSqlField("SELECT name FROM probid_categories WHERE id='".$_REQUEST['parent']."'","name");
$getAdvert = mysql_query("SELECT * FROM probid_adverts WHERE
cat_filter LIKE '%".$catName."%' AND (views_p=0 OR views_p>=views) AND (clicks_p=0 OR clicks_p>=clicks) ORDER BY RAND() LIMIT 0,1");
$nbAds = mysql_num_rows($getAdvert);
}
if (eregi("auctiondetails.php",$_SERVER['PHP_SELF'])) {
$advertId=0;
$allAdverts = mysql_query("SELECT * FROM probid_adverts WHERE
(views_p=0 OR views_p>=views) AND (clicks_p=0 OR clicks_p>=clicks) AND keyword_filter!='' ORDER BY RAND()");
while ($advertsQuery = mysql_fetch_array($allAdverts)) {
$isAdvert = getSqlNumber("SELECT id FROM probid_auctions WHERE keywords LIKE '%".$advertsQuery['keyword_filter']."%' AND id='".$_GET['id']."'");
if ($isAdvert>0) $advertId = $advertsQuery['id'];
}
$getAdvert = mysql_query("SELECT * FROM probid_adverts WHERE id='".$advertId."'");
$nbAds = mysql_num_rows($getAdvert);
}
// if we are not on one of the pages, or there are no ads with filter, display an ad with no filter
if ($nbAds==0) {
$getAdvert=mysql_query("SELECT * FROM probid_adverts WHERE
cat_filter='' AND keyword_filter='' AND (views_p=0 OR views_p>=views) AND (clicks_p=0 OR clicks_p>=clicks) ORDER BY RAND() LIMIT 0,1");
}
while ($bannerDetails = mysql_fetch_array($getAdvert)) {
$addView = mysql_query ("UPDATE probid_adverts SET views=views+1 WHERE id='".$bannerDetails['id']."'");
if ($bannerDetails['type']=="custom") {
echo "<a href=\"click.php?refid=".$bannerDetails['id']."\" target=\"new\"><img src=\"".$bannerDetails['imgpath']."\" alt=\"".$bannerDetails['alttext']."\" border=\"0\"><br>".$bannerDetails['textunder']."</a>";
} else if ($bannerDetails['type']=="code") {
echo addSpecialChars($bannerDetails['banner_code']);
}

}
mysql_free_result($getAdvert);
} ?>
</div>
<div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="5"></div>
<div align="center" style="padding: 5px;" class="footerfont"> <a href="<?=$path;?>index.php">
<?=$lang[home]?>
</a>
<? if ($showSell=="Y") { ?>
| <a href="<?=$btn2_link;?>">
<?=$lang[sell]?>
</a>
<? } ?>
| <a href="<?=$btn3_link;?>">
<?=$btn3_caption;?>
</a> | <a href="<?=$btn4_link;?>">
<?=$btn4_caption;?>
</a> | <a href="<?=$path;?>help.php">
<?=$lang[help]?>
</a>
<?
if ($layout['is_about']=="Y") echo " | <a href=".$path."aboutus.php>".$lang[about_us]."</a> |";
if ($layout['is_contact']=="Y") echo " <a href=".$path."contactus.php>".$lang[contactus]."</a> |";
if ($layout['is_faq']=="Y") echo " <a href=".$path."faq.php>".$lang[faq_abbr]."</a> | ";
echo " <a href=".$path."sitefees.php>".$lang[Site_fees]."</a>";
$getCustomPages = mysql_query("SELECT * FROM probid_pages_additional WHERE lang='".$_SESSION['sess_lang']."'");
while ($customPg = mysql_fetch_array($getCustomPages)) echo ' | <a href="custompage.php?id='.$customPg['id'].'">'.$customPg['pagename'].'</a>';
?>
</div>
<div align="center" class="footerfont1"> Copyright &copy;2006 <b>
<?=$setts['sitename'];?>
</b>. All Rights Reserved. Designated trademarks and brands are the property of their respective owners.<br>
Use of this Web site constitutes acceptance of the <b>
<?=$setts['sitename'];?>
</b>
<?
if ($layout['is_pp']=="Y") echo " <a href=".$path."pp.php>".$lang[Privacy_Policy]."</a>";
if ($layout['is_terms']=="Y") echo " and <a href=".$path."terms.php>".$lang[terms_cond]."</a>";?>
. </div>
<div align="center" style="padding: 5px;">
<?
$time_end = getmicrotime();
$time_passed = $time_end - $time_start;
echo "<font style=\"color: #555555;\">$lang[Page_loaded_in] $time_passed $lang[seconds].</font>";
?>
</div>
</td>
</tr>
</table>


so im guessing it may have something to do with the
if ( !defined('INCLUDED') ) { die("Access Denied"); }

mr e
06-10-2007, 12:30 AM
Yep, whatever file is including them (or somewhere higher up) INCLUDED isn't defined and it needs to be.

You could try this in your root index file, but no guarentee it'll work, usually scripts do that to make sure they have the correct functions/classes defined


define('INCLUDED', 1);

danelliott
06-10-2007, 12:32 AM
does that go within the php tags or before them?

mr e
06-10-2007, 12:33 AM
Ah sorry, within


<?php
// Stuff
define('INCLUDED', 1);

// More stuff
?>

danelliott
06-10-2007, 12:34 AM
thank you, i will try now.

danelliott
06-10-2007, 12:41 AM
right ive tried it with
include('./carparts/themes/v524/header.php');

include('/home/bmobm/public_html/carparts/themes/v524/header.php');

include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/header.php');

all formats and im getting this
Warning: main(config/lang//site.lang) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/carparts/themes/v524/header.php on line 25

Warning: main() [function.include]: Failed opening 'config/lang//site.lang' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/carparts/themes/v524/header.php on line 25

Warning: main(config/lang//category.lang) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/carparts/themes/v524/header.php on line 27

Warning: main() [function.include]: Failed opening 'config/lang//category.lang' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/carparts/themes/v524/header.php on line 27

Warning: main(themes//title.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/carparts/themes/v524/header.php on line 54

Warning: main(themes//title.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/carparts/themes/v524/header.php on line 54

Warning: main(themes//title.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/carparts/themes/v524/header.php on line 54

Warning: main() [function.include]: Failed opening 'themes//title.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/carparts/themes/v524/header.php on line 54

Fatal error: Call to undefined function: addspecialchars() in /home/bmobm/public_html/carparts/themes/v524/header.php on line 82

Any other ideas?? . im sorry bout this btw lol i am new. but i appreciate ALL the help you guys are giving me.

mr e
06-10-2007, 12:52 AM
Yeah, that's what I meant about scripts that require a defined constant usually do so to ensure that other files are also included, which if you look at those errors, aren't.

You'll need to somehow make sure those other files are in the proper directory for inclusion by the header/footer, either by manually editing the header/footer, or moving the files to a different directory, which could then break even more stuff.

It's a huge pain (I've done it before) and just takes slowly working out the kinks.

Your best bet would probably be to make sure your new directory structure matches the themes (or whatever it looks like you're trying to integrate) directory structure, aside from it being in a subdirectory.

danelliott
06-10-2007, 12:58 AM
here is a thought.......
would it work if i copied the carparts directory structure (just the files and folders which the includes are trying to call) to the ROOT. in the same structure as they are in the carparts directory. thus making the index think its still inside the carparts directory, and if i only call the files which i need for the index then this shouldnt use up to much space.......... is this right? but would i need to modify any settings for the database or will it still be able to find the database from either directory?

how does that sound, b4 i go ruining my site directory lol.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum