function placement($placement, $args=array()) {
global $PAGEPATH, $PATH, $PATHTAB;
switch($placement) {
case 'header';
$inc_path = $GLOBALS['INCPATH'].'placement/header.php';
break;
case 'header_profil';
$inc_path = $GLOBALS['INCPATH'].'placement/header_profil.php';
break;
case 'header_2015'; $inc_path = $GLOBALS['INCPATH'].'placement/header_2015.php'; break;
case 'header_praca'; $inc_path = $GLOBALS['INCPATH'].'placement/header_praca.php'; break;
case 'header_praca_2018'; $inc_path = $GLOBALS['INCPATH'].'placement/header_praca_2018.php'; break;
case 'header_finanse'; $inc_path = $GLOBALS['INCPATH'].'placement/header_finanse.php'; break;
case 'footer_2015'; $inc_path = $GLOBALS['INCPATH'].'placement/footer_2015.php'; break;
case 'footer_2015_lazy'; $inc_path = $GLOBALS['INCPATH'].'placement/footer_2015_lazy.php'; break;
case 'footer_praca'; $inc_path = $GLOBALS['INCPATH'].'placement/footer_praca.php'; break;
case 'footer_praca_2018'; $inc_path = $GLOBALS['INCPATH'].'placement/footer_praca_2018.php'; break;
case 'footer_profil';
$inc_path = $GLOBALS['INCPATH'].'placement/footer_profil.php';
break;
case 'footer':
$inc_path = $GLOBALS['INCPATH'].'placement/footer.php';
break;
case 'footer_money_homepage':
$inc_path = $GLOBALS['INCPATH'].'placement/footer_money_homepage.php';
break;
case 'footer_standard':
$inc_path = $GLOBALS['INCPATH'].'placement/footer_standard.php';
break;
case 'menu_bottom':
$inc_path = $GLOBALS['INCPATH'].'placement/menu_bottom.php';
break;
case 'menu_top_firma':
$inc_path = $GLOBALS['INCPATH'].'placement/menu_top_firma.php';
break;
case 'menu_top2':
//$inc_path = $GLOBALS['INCPATH'].'placement/menu_top.php';
//break;
if(!isset($args['static_menu'])) {
$inc_path = $GLOBALS['INCPATH'].'placement/menu_top.php';
} else {
$inc_path = $PAGEPATH.$PATH.(($PATH) ? "/" : "").$placement.".php";
}
break;
case 'path':
$inc_path = $PAGEPATH.$PATH.(($PATH) ? "/" : "").$placement.".php";
if (in_array($_SERVER['HTTP_HOST'], array('firma.money.pl')) && !file_exists($inc_path)) {
$inc_path = $GLOBALS['INCPATH'].'placement/path_firma.php';
}
break;
default:
$inc_path = $PAGEPATH.$PATH.(($PATH) ? "/" : "").$placement.".php";
break;
}
if(file_exists($inc_path)) {
include_once($inc_path);
return true;
}
return false;
}
/*
function incdate($path,$date_from="",$date_to="")
{
global $INCPATH;
if ($date_from)
{
preg_match("'(\d)\D(\d)\D(\d)(())?'iU",$date_from);
}
}
*/
function inc($path)
{
@include_once($path);
//global $PATH,$PATHTAB;
//$inc_path=$path;
//if (file_exists($inc_path)) {include_once($inc_path);}
}
function includeParentPlacement($placement)
{
global $PAGEPATH,$PATHTAB;
$inc_path = $PAGEPATH.implode("/",array_slice($PATHTAB,0,-1))."/".$placement;
if (file_exists($inc_path)) {include_once($inc_path);}
}
function explodePath($path)
{
global $PATH,$FULLPATH,$PATHTAB;
//echo "sciezka: $path
";
if ($path{0}=="/") $path=substr($path,1);
$FULLPATH=str_replace("//","/",$path);
if ($FULLPATH{strlen($FULLPATH)-1}!="/") $FULLPATH.="/";
$PATH=$FULLPATH;
//if ($PATH{strlen($PATH)-1}!="/") $PATH.="/";
//echo $PATH."
";
$PATHTAB=explode("/",$PATH);
array_pop($PATHTAB);
if(strrchr($PATH,",")) {
global $args;
$args=explode(",",$PATHTAB[count($PATHTAB)-1]);
$lastInArgs = count($args)-1;
$dotPos = strrpos($args[$lastInArgs],".");
if(false !== $dotPos) {
$args[$lastInArgs] = substr($args[$lastInArgs], 0, $dotPos);
}
foreach($args as &$arg)
{
$arg=strip_tags(urldecode($arg));
$arg=preg_replace('|["\'\(\)]*|', '', $arg);
}
array_pop($PATHTAB);
}
if (strrchr($PATH,'=')) {
$i=count($PATHTAB)-1;
$tab=explode("=",$PATHTAB[$i]);
//print_r($tab);
while (count($tab)>1) {
$$tab[0]=$tab[1];
$GLOBALS[$tab[0]]=$tab[1];
$_REQUEST[$tab[0]]=$tab[1];
$_GET[$tab[0]]=$tab[1];
array_pop($PATHTAB);
$i--;
$tab=explode("=",$PATHTAB[$i]);
}
}
$PATH=implode("/",$PATHTAB)."/";
//$PATH="/".$PATH;
if ($PATH{0}!="/") $PATH="/".$PATH;
if ($FULLPATH{0}!="/") $FULLPATH="/".$FULLPATH;
//$FULLPATH="/".$FULLPATH;
return $PATH;
}
?>
global $BASEPATH,$PAGEPATH,$INCLUDEPATH,$INCPATH,$TEMPLATEPATH,$TPLPATH,$NEWSTPLPATH,$PLACEMENTPATH,$CHARTPATH,$NEWSIMGPATH,$NEWSIMGPATH1,$RESULTSPERPAGE,$ADVERT;
$BASEPATH="/disk140/www/money.pl/";
$PAGEPATH=$BASEPATH."nowe.moto.money.pl/pages/";
$INCLUDEPATH=$BASEPATH."config/portal/includes/";
$INCPATH=$BASEPATH."include/";
$TEMPLATEPATH=$INCPATH."config/portal/templates/new/";
$TPLPATH=$BASEPATH."template/";
$NEWSTPLPATH=$BASEPATH."template/news/";
$PLACEMENTPATH=$BASEPATH."config/portal/placements/";
$NEWSIMGPATH=$BASEPATH."money.pl/i/w/";
$NEWSIMGPATH1=$BASEPATH."money.pl/i/n/";
$CHARTPATH=$BASEPATH."money.pl/i/c/";
$RESULTSPERPAGE=50;
$ADVERT=1;
define('MNY_ADS','/var/www/money.pl/ads.money.pl/');
define('JS_VERSION',1.1);
define('STATIC_FILES_DIR', '/dane/www/money.pl/money.pl/statyczne/');
//echo "";
//require_once("../class/common/Object.php");
//require_once("../class/common/Error.php");
//require_once("../class/db/DB.php");
//require_once("../class/db/MySQL.php");
//ponizsza konstrukcja inicjuje dzialania zwiazane z przekazywaniem "reffow" w query-string
function doReff()
{
if(array_key_exists("reff", $_GET))
{
//echo $_GET['reff'];
include_once('config/database/MoneyDBConnection.php');
$oADO = MoneyDBConnection::autoConn('DSN_DIRECT');
$oADO->SetFetchMode(ADODB_FETCH_BOTH);
$reff=$_GET['reff'];
list($partner, $word)=explode('_', $reff);
if((is_numeric($reff)&&((strlen($reff)>=3)))||(is_numeric($partner)&&is_numeric($word)))
{
if(!(is_numeric($partner)&&is_numeric($word)))
{
//dwuznakowy kod partnera
if(strlen($reff)==4)
{
$partner=substr($reff, 0, 2);
$word=substr($reff, 2);
}
//kod jednoznakowy
else
{
$partner=substr($reff, 0, 1);
$word=substr($reff, 1);
}
}
else
{
//echo "$partner $word";
}
if(is_numeric($partner)&&is_numeric($word))
{
//$db=new DB();
$query="select id_advert_partner from AdvertPartner where code='$partner'";
//echo $query;
// $query="select id_advert_word from AdvertWord where code='$word'";
$res=$oADO->getAll($query);
//echo "tu";
//die;
$query="select id_advert_word from AdvertWord where code='$word'";
$res2=$oADO->getAll($query);
if((count($res)==1)&&(count($res2)==1))
{
$idPartner=$res[0][0];
$idWord=$res2[0][0];
$distrib=(isset($GLOBALS['ID_DISTRIBUTOR'])&&$GLOBALS['ID_DISTRIBUTOR'])>0?$GLOBALS['ID_DISTRIBUTOR']:1;
// echo "";
$query = "insert into AdvertUser (advert_partner_id, pages_cnt, date_start, track_cookie, advert_word_id, distributor_id) ";
$query.= "values ($idPartner, 0, now(), '', $idWord, $distrib) ";
$oADO->execute($query);
$userId=$oADO->Insert_ID();
$domain=explode('.', $_SERVER['HTTP_HOST']);
$domain='.'.$domain[count($domain)-2].'.'.$domain[count($domain)-1];
// echo "";
setcookie("reff", $_GET['reff'], time()+7200, "/", $domain);
setcookie("reff_id", $userId, time()+7200, "/", $domain);
// setcookie("reff", $_GET['reff'], time()+7200, "/", ".money.pl");
// setcookie("reff_id", $userId, time()+7200, "/", ".money.pl");
$_COOKIE['reff']=$_GET['reff'];
$_COOKIE['reff_id']=$userId;
// print "";
}
}
}
}
}
/*
function doReff()
{
//echo "aaaaaaaa";
if(array_key_exists("reff", $_GET))
{
// echo "zaczynam";
// return;
include('config/database/db_direct_conf2.php');
// print_r(get_included_files());
$reff=$_GET['reff'];
if(is_numeric($reff)&&((strlen($reff)>=3)))
{
//dwuznakowy kod partnera
if(strlen($reff)==4)
{
$partner=substr($reff, 0, 2);
$word=substr($reff, 2);
}
//kod jednoznakowy
else
{
$partner=substr($reff, 0, 1);
$word=substr($reff, 1);
}
if(is_numeric($partner)&&is_numeric($word))
{
// $db=new DB();
$query="select id_advert_partner from AdvertPartner where code='$partner'";
$res=aquery($query);
$query="select id_advert_word from AdvertWord where code='$word'";
$res2=aquery($query);
if((count($res)==1)&&(count($res2)==1))
{
$idPartner=$res[0][0];
$idWord=$res2[0][0];
$distrib=isset($GLOBALS['ID_DISTRIBUTOR'])?$GLOBALS['ID_DISTRIBUTOR']:1;
$query = "insert into AdvertUser (advert_partner_id, pages_cnt, date_start, track_cookie, advert_word_id, distributor_id) ";
$query.= "values ($idPartner, 0, now(), '', $idWord, $distrib) ";
query($query);
$userId=get_insert_id();
$domain=explode('.', $_SERVER['HTTP_HOST']);
$domain='.'.$domain[count($domain)-2].'.'.$domain[count($domain)-1];
setcookie("reff", $_GET['reff'], time()+7200, "/", $domain);
setcookie("reff_id", $userId, time()+7200, "/", $domain);
$_COOKIE['reff']=$_GET['reff'];
$_COOKIE['reff_id']=$userId;
}
}
}
}
}
*/
//doReff();
?>