-
Notifications
You must be signed in to change notification settings - Fork 3
/
home.php
64 lines (53 loc) · 1.66 KB
/
home.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
<?php
require "global.php";
require "nucleo/class.homes.php";
$qryId = 0;
$userData = null;
if (isset($_GET['qryName'])) {
$qryId = $users->Name2id(($_GET['qryName']));
} else if (isset($_GET['qryId']) && is_numeric($_GET['qryId'])) {
$qryId = (int)($_GET['qryId']);
}
if ($qryId <= 0 || !$users->IdExists($qryId)) {
require "error.php";
exit;
}
if (LOGGED_IN && $qryId == USER_ID) {
define('TAB_ID', 1);
define('PAGE_ID', 33);
}
if (!HomesManager::HomeExists('user', $qryId)) {
HomesManager::CreateHome('user', $qryId);
}
$userData = db::query("SELECT username FROM users WHERE id = ? LIMIT 1", $qryId)->fetch(2);
$homeData = HomesManager::GetHome(HomesManager::GetHomeId('user', $qryId));
$tpl->Init();
$tpl->SetParam('page_title', clean($userData['username']));
if (isset($_SESSION['startSessionEditHome'])) {
if ($_SESSION['startSessionEditHome'] == $qryId) {
$tpl->SetParam('body_id', 'editmode');
} else {
$tpl->SetParam('body_id', 'viewmode');
}
} else {
$tpl->SetParam('body_id', 'viewmode');
}
$tpl->AddGeneric('head/head-init');
$tpl->AddIncludeSet('homes');
$tpl->WriteIncludeFiles();
$tpl->AddGeneric('head/head-myhabbo');
if (isset($_SESSION['startSessionEditHome'])) {
$homeedit = new Template('home-edit');
$homeedit->SetParam('qryId', $qryId);
$tpl->AddTemplate($homeedit);
}
$tpl->AddGeneric('head/head-bottom');
$tpl->AddGeneric('generic-top');
$home = new Template('page-home-personaje');
$home->SetParam('home_title', clean($userData['username']));
$home->SetParam('qryId', $qryId);
$home->SetParam('homeData', $homeData);
$tpl->AddTemplate($home);
$tpl->AddGeneric('footer');
$tpl->Output();
?>