Repository navigation
Expand file tree
/
Copy pathindex.php
More file actions
60 lines (49 loc) · 3.25 KB
/
Copy pathindex.php
File metadata and controls
60 lines (49 loc) · 3.25 KB
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
<?php
require_once('./includes/config.php');
require_once('./includes/skins.php');
require_once('./includes/functions.php');
mysql_connect($conf['host'], $conf['user'], $conf['pass']);
mysql_query('SET NAMES utf8');
mysql_select_db($conf['name']);
if(isset($_GET['a']) && isset($action[$_GET['a']])) {
$page_name = $action[$_GET['a']];
} else {
$page_name = 'welcome';
}
require_once("./sources/{$page_name}.php");
$confUrl = $conf['url'];
$confMail = $conf['mail'];
$TMPL['content'] = PageMain();
if(isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
if(loginCheck($_COOKIE['username'], $_COOKIE['password'])) {
$data = loginCheck($_COOKIE['username'], $_COOKIE['password']);
$getImg = (!empty($data['image'])) ? '<img style="margin-right: 7px;" src="'.$confUrl.'/uploads/avatars/'.$data['image'].'" width="80" height="80" />' : '<img src="http://www.gravatar.com/avatar/'.md5($data['mail']).'?s=80&d=mm" />';
$TMPL['userStatus'] = 'My Account';
$TMPL['welcomeStatus'] = '
<a href="'.$confUrl.'/index.php?a=me&logout=1"><div class="menu_btn nord-est" title="Log out"><br/><i class="icon-signout" style="font-size: 130%; color: whitesmoke"></i></div></a>
<a href="'.$confUrl.'/help.php"><div class="menu_btn nord" title="Help"><br/><i class="icon-info-sign" style="font-size: 130%; color: whitesmoke"></i></div></a>
<a href="'.$confUrl.'/index.php?a=settings"><div class="menu_btn nord" title="Settings"><br/><i class="icon-cogs" style="font-size: 130%; color: whitesmoke"></i></div></a>
<a href="'.$confUrl.'/index.php?a=messages"><div class="menu_btn nord" title="Messages"><br/><i class="icon-envelope-alt" style="font-size: 130%; color: whitesmoke"></i></div></a>
<a href="'.$confUrl.'/index.php?a=mentions"><div class="menu_btn nord" title="Mentions"><br/><i class="icon-bullhorn" style="font-size: 130%; color: whitesmoke"></i></div></a>
<a href="'.$confUrl.'/index.php?a=me"><div class="menu_btn nord" title="New message"><br/><i class="icon-pencil" style="font-size: 130%; color: whitesmoke"></i></div></a>
<a href="'.$confUrl.'/index.php?a=profile&u='.$data['user'].'"><div class="menu"><div class="menu_img" style="margin-top: 11px;">'.$getImg.'</div><div class="menu_name"><strong><!--'.$data['user'].'--></strong></div></div></a>';
} else {
$TMPL['userStatus'] = 'Log In / Register';
$TMPL['welcomeStatus'] = '<a href="'.$confUrl.'/index.php?a=welcome"><div class="menu_btn nord" title="Register"><img src="'.$confUrl.'/images/register.png" /></div></a>
<a href="#"><div class="menu_visitor">Hello <strong>Visitor</strong></div></a>';
}
} else {
$TMPL['userStatus'] = 'Log In / Register';
$TMPL['welcomeStatus'] = '<a href="'.$confUrl.'/index.php?a=welcome#log-in"><div class="menu_btn nord-est" title="Register / Login" ><img src="'.$confUrl.'/images/register.png" style="margin-top: 17px;" /></div></a>
<a href="'.$confUrl.'/index.php?a=welcome#log-in"><div class="menu_visitor">New? <strong>Register</strong></div></a>';
}
$resultSettings = mysql_fetch_row(mysql_query(getSettings($querySettings)));
$TMPL['footer'] = $resultSettings[0];
$TMPL['url'] = $conf['url'];
$TMPL['ad1'] = $resultSettings[2];
$TMPL['ad2'] = $resultSettings[3];
$TMPL['msgLimit'] = $resultSettings[10];
$skin = new skin('wrapper');
echo $skin->make();
mysql_close();
?>