ok i've got the redirect module specified correctly and its showing a page that resembles what was the finished product!
the index page, required the settings page, which in turn defined user.php, on user.php i've added an include function to include layout.php.
my problem now, is to understand what the developers have written to define the directory of the images. can anyone tell me if the code is correct, because having created a directory called images following the correct path, then creating a test image called index_01.jpg, nothing is showing up on the webpage!
the code for user.php is as follows
Code: Select all
<?php
session_start();
$SECTION = '_user';
define ('SECTION', $SECTION);
define('INDEX', 'user.php');
include 'systems/propmat/templates/user/layout.php';
require "settings.php";
include 'systems/'.ACTIVE_SITE.'/settings_user.php';
include 'systems/'.ACTIVE_SITE.'/constants.php';
include 'systems/'.ACTIVE_SITE.'/constants_payment.php';
require "lib/_include.php";
$__start_micro_time = getMicroTime();
$DEFAULT_CONNECTION = mysql_connect(DB_HOST, DB_USER, DB_PASS);
if (!$DEFAULT_CONNECTION) die('Unable to connect to database: '.mysql_error());
mysql_select_db(DB_NAME, $DEFAULT_CONNECTION);
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query('SET collation_connection = utf8_general_ci');
header('Content-type: text/html; charset=UTF-8');
if (file_exists("tools/generate.php")) { include "tools/generate.php"; }
require "classes/_include.php";
require "classes/$SECTION/_include.php";
$SECURITY = new Security();
// get current location
//Geo::saveCurrentLocationToSession();
if ($_REQUEST['get_location'] == 'yes') { var_dump($_SESSION['location']); die; }
// -- enable this if you want to NOT cache the location result
// $_SESSION['location_allowed'] = 'no';
// check for overall ban/block
if ($_SESSION['location_allowed'] != 'yes' && ($_REQUEST['_o'] != 'Default' || $_REQUEST['_m'] != 'deny'))
{
$r_blk = new Query('select * from '.TBL_ALLOW_BY_IP .' where ip=\''.encode($_SESSION['location']['ip']).'\'');
if (!$r_blk->fetch())
{
$r_blk = new Query('select * from '.TBL_BLOCK_BY_COUNTRY.' where country=\''.encode($_SESSION['location']['country']).'\' and blocked_by=0');
if ($r_blk->fetch()) redirect('Default', 'deny', array('err'=>'country banned by admin'));
$r_blk = new Query('select * from '.TBL_BLOCK_BY_REGION .' where country=\''.encode($_SESSION['location']['country']).'\' and region=\''.encode($_SESSION['location']['region']).'\' and blocked_by=0');
if ($r_blk->fetch()) redirect('Default', 'deny', array('err'=>'region banned by admin'));
$r_blk = new Query('select * from '.TBL_BLOCK_BY_IP .' where ip=\''.encode($_SESSION['location']['ip']).'\' and blocked_by=0');
if ($r_blk->fetch()) redirect('Default', 'deny', array('err'=>'ip banned by admin'));
}
$_SESSION['location_allowed'] = 'yes';
}
$index_php_site = $_SERVER['HTTP_HOST'];
$index_php_r = new Query("select * from ".TBL_SITE." where domain='$index_php_site' or domain_alias1='$index_php_site' or domain_alias2='$index_php_site'");
$index_php_a = $index_php_r->fetch();
if (!$index_php_a) die('This site is not hosted on our server.');
define ('SITE_NAME', $index_php_a['name']);
define ('SITE_TEMPLATE', $index_php_a['template']);
define ('SITE_WEBMASTER', $index_php_a['webmaster_id']);
define ('SITE_EMAIL', $index_php_a['email']);
define ('SITE_EMAIL_FULL', $index_php_a['email_name'] . ' <'.$index_php_a['email'] . '>');
$q = new Query ("select `key`, `value` from ".TBL_DICTIONARY);
$DICT = $q->getAssocArray ("key", "value");
$WEBOBJECT = $_REQUEST['_o'];
$WEBMETHOD = $_REQUEST['_m'];
if ($WEBOBJECT > '')
{
$WEBOBJECT = $WEBOBJECT;
if ($WEBMETHOD > ''); else $WEBMETHOD = 'index';
}
else
{
$WEBOBJECT = 'Default';
$WEBMETHOD = 'index';
}
define (WEBOBJECT, $WEBOBJECT);
define (WEBMETHOD, $WEBMETHOD);
$WEB_WEBOBJECT = "Web$WEBOBJECT";
$CALLABLE_OBJECT = new $WEB_WEBOBJECT;
if (is_callable(array(&$CALLABLE_OBJECT, $WEBMETHOD), false))
{
if ($INTERFACE["$WEBOBJECT.$WEBMETHOD"])
{
if ($INTERFACE["$WEBOBJECT.$WEBMETHOD"]['sec'] > '' && $INTERFACE["$WEBOBJECT.$WEBMETHOD"]['sec'] != 'allow')
{
if ($userLevel >= $INTERFACE["$WEBOBJECT.$WEBMETHOD"]['min_level'])
{
foreach($INTERFACE["$WEBOBJECT.$WEBMETHOD"]['perms'] as $k=>$v)
{
if ($userPerm[$v]); else
{
$_index_php_error = 'no_req_perm';
break;
}
}
}
else
{
$_index_php_error = 'no_req_level';
}
}
}
else
{
$_index_php_error = 'no_iface';
}
}
else
{
$_index_php_error = 'not_callable';
}
switch($_index_php_error)
{
case 'not_callable':
case 'no_iface':
redirect('Default', 'index', array('error'=>$_index_php_error));
break;
case 'no_req_level':
case 'no_req_perm':
if ($INTERFACE["$WEBOBJECT.$WEBMETHOD"]['sec'] == 'auth')
redirect('Default', 'login', array('error'=>$_index_php_error, 'goto'=>$_SERVER['REQUEST_URI']));
else
redirect('Default', 'deny', array('error'=>$_index_php_error));
break;
default:
$arr = array();
foreach($INTERFACE["$WEBOBJECT.$WEBMETHOD"]['params'] as $k3=>$v3) $arr[$v3] = $_REQUEST[$v3];
call_user_func_array(array(&$CALLABLE_OBJECT, $WEBMETHOD), $arr);
}
?>
i tried using the developers code by using
Code: Select all
include 'systems/'.ACTIVE_SITE.'/templates/'.SITE_TEMPLATE.'/layout.php';
but it wasnt having any of it, so i gave up and decided to type in the whole path. the ACTIVE_SITE constant is defined in the settings.php page.
the layout page then specifies
Code: Select all
<style type="text/css">
<? include Template::getFileName(SITE_TEMPLATE."/style.css"); ?>
</style>
<script language="javascript" src="js/_calendar.js" type="text/javascript"></script>
<script language="javascript" src="js/_lib.js" type="text/javascript"></script>
<script language="javascript" src="js/_my.js" type="text/javascript"></script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="body_header"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="body_footer"><table width="770" height="1201" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td width="770" height="44" colspan="9"><img src="systems/'.ACTIVE_SITE.'/templates/'.SITE_TEMPLATE.'/img/index_01.jpg" width="770" height="44" alt="" /></td>
</tr>
<tr>
<td width="10" height="272" rowspan="3"><img src="systems/<?=ACTIVE_SITE?>/templates/<?=SITE_TEMPLATE?>/img/index_02.jpg" width="10" height="272" alt="" /></td>
<td width="3" height="32"><img src="systems/<?=ACTIVE_SITE?>/templates/<?=SITE_TEMPLATE?>/img/index_03.jpg" width="3" height="32" alt="" /></td>
<td width="320" height="32" colspan="2" class="td_menu" style="text-align:center; vertical-align:middle;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<a class="menu" href="<?=getLink('Model', 'm_list', array('only_online'=>0))?>">home</span>
<?
if (!$GLOBALS["userID"])
{
?>
<a class="menu" href="<?=getLink('UsrRegister', 'index', array('user_type'=>'member'))?>" >sign up</a>
<a class="menu" href="<?=getCleanLink('Default', 'login')?>" >log in</a>
<?
}
else
{
?>
<a class="menu" href="javascript: return false;" onclick="javascript: window.open('<?=getLink('UsrAccount', 'stats')?>', null, 'height=200,width=200,status=no,toolbar=no,menubar=no,location=no');">account</a>
<!-- getLink('UsrAccount', 'index', array('user_type'=>'member')) -->
<a class="menu" href="<?=getCleanLink('UsrBuy', 'index')?>" >buy</a>
<a class="menu" href="<?=getLink('Default','logout')?>" >logout</a>
<?
}
?>
</td>
</tr>
</table></td>
<td width="102" height="32"><img src="systems/<?=ACTIVE_SITE?>/templates/<?=SITE_TEMPLATE?>/img/index_05.jpg" width="102" height="32" alt="" /></td>
<td width="322" height="32" colspan="2" class="td_menu" style="text-align:center; vertical-align:middle;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<a class="menu" href="javascript:windowOpen('<?=getLink('Default', 'help_pop',array())?>','Statement')" >faq</a>
<a href="<?=getLink('Model', 'm_list', array('only_online'=>0))?>" class="menu" >props</a>
<a href="<?=getLink('Model', 'm_list', array('only_online'=>1))?>" class="menu" >other props</a>
</td>
</tr>
</table></td>
<td width="3" height="32"><img src="systems/<?=ACTIVE_SITE?>/templates/<?=SITE_TEMPLATE?>/img/index_07.jpg" width="3" height="32" alt="" /></td>
<td width="10" height="272" rowspan="3"><img src="systems/<?=ACTIVE_SITE?>/templates/<?=SITE_TEMPLATE?>/img/index_08.jpg" width="10" height="272" alt="" /></td>
</tr>
<tr>
<td width="750" height="9" colspan="7"><img src="systems/<?=ACTIVE_SITE?>/templates/<?=SITE_TEMPLATE?>/img/index_09.jpg" width="750" height="9" alt="" /></td>
</tr>
<?
if ($_GET["_m"]== "m_list" || !$_GET["_m"]) {
$arr_top=$this->modelall;
for ($i=0;$i<1;) {
$ind=rand(0,count($arr_top));
$file=$arr_top[$ind]["file"];
$id=$arr_top[$ind]["id"];
if ($file!='')
$i++;
}
?>
i can get at least the layout page on the browser, but none of the links are working, so i dont know what im doing wrong! php is driving me nuts...