This repository has been archived by the owner on Sep 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathheader.php
executable file
·107 lines (94 loc) · 3.94 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
/***************************************************************************
*
* PROJECT: eLitius Open Source Affiliate Software
* VERSION: 1.0
* LISENSE: GNU GPL (http://www.opensource.org/licenses/gpl-license.html)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*
* Link to eLitius.com can not be removed from the software pages without
* permission of the eLitius respective owners. It is the only requirement
* for using this software.
*
* Copyright 2009 Intelliants LLC
* http://www.intelliants.com/
*
***************************************************************************/
$directory = @opendir('./install/');
if ($directory)
{
header("Location: install/index.php");
exit;
}
/** require necessary files **/
require_once('includes/config.inc.php');
require_once('classes/Xp.php');
require_once('includes/auth.inc.php');
require_once('templates/'.$gXpConfig['tmpl'].'/Layout.php');
require_once('classes/XpSmarty.php');
require_once('utils/util.php');
/** define used language **/
$GLOBALS['langs'] = $gXpDb->getLangList();
$l = !empty($_GET['language']) ? $_GET['language'] : (!empty($_COOKIE['language']) ? $_COOKIE['language'] : false);
if(!$l || !in_array($l, $GLOBALS['langs']))
{
// get default
$gXpLang = $gXpDb->getLangPhrase($gXpConfig['lang']);
} else {
$gXpLang = $gXpDb->getLangPhrase($l);
}
define("LANGUAGE", $l);
unset($l);
if($_COOKIE['aff_id']>0)
{
$aff =& $gXpDb->getAffiliateById($_COOKIE['aff_id']);
if($aff)
{
$login = '<a href="logout.php?action=logout">'.$gXpPrase['logout'].'</a>';
$username = $aff['username'];
$stat['transactions'] = $gXpDb->getSalesCount($aff);
$temp = $gXpDb->getEarnings($aff);
if($temp)
$stat['earnings'] = $temp;
else
$stat['earnings'] = "0.00";
}
}
$images = $gXpConfig['templates'].$gXpConfig['tmpl'].$gXpConfig['dir'].$gXpConfig['images'];
$styles = $gXpConfig['templates'].$gXpConfig['tmpl'].$gXpConfig['dir'].'css'.$gXpConfig['dir'];
$main_menu[] = array('title' => $gXpLang['home'], 'link' => 'index.php');
if($aff['approved'] == 2)
{
$main_menu[] = array('title' => $gXpLang['my_account'] ,'link' => 'account.php');
}
$main_menu[] = array('title' => $gXpLang['contact_us'], 'link' => 'contact.php');
$main_menu[] = array('title' => $gXpLang['create_account'], 'link' => 'register.php');
$main_menu[] = $login ? array('title' => $gXpLang['logout'], 'link' => 'logout.php?action=logout') : array('title' => $gXpLang['affiliate_login'], 'link' => 'login.php');
$context_menu = array(
0 => array('title' => $gXpLang['general_statistics'], 'link' => 'statistics.php'),
1 => array('title' => $gXpLang['payment_history'] ,'link' => 'payments.php'),
2 => array('title' => $gXpLang['commission_details'] ,'link' => 'commission-details.php'),
3 => array('title' => $gXpLang['edit_myaccount'] ,'link' => 'edit-account.php'),
);
$marketing_menu = array(
0 => array('title' => $gXpLang['banners'], 'link' => 'banners.php'),
1 => array('title' => $gXpLang['text_ads'] ,'link' => 'text-ads.php'),
2 => array('title' => $gXpLang['text_links'] ,'link' => 'text-links.php'),
3 => array('title' => $gXpLang['email_links'] ,'link' => 'email-links.php'),
// 4 => array('title' => 'Custom Links' ,'link' => 'custom-links.php'),
);
$gXpSmarty->assign_by_ref('xpurl', $gXpConfig['xpurl']);
$gXpSmarty->assign_by_ref('marketing_items', $marketing_menu);
$gXpSmarty->assign_by_ref('context_items', $context_menu);
$gXpSmarty->assign_by_ref('main_items',$main_menu);
$gXpSmarty->assign_by_ref('id', $aff['id']);
$gXpSmarty->assign_by_ref('stat', $stat);
$gXpSmarty->assign_by_ref('images', $images);
$gXpSmarty->assign_by_ref('styles', $styles);
$gXpSmarty->assign_by_ref('username', $username);
$gXpSmarty->assign_by_ref('aff', $aff);
$gXpSmarty->assign_by_ref('login', $login);
?>