This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/main/profile.php

55 lines
1.7 KiB
PHP
Raw Normal View History

2015-04-25 20:08:44 +00:00
<?php
/*
* Sakura User Profiles
*/
// Declare Namespace
namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
2015-04-27 00:41:59 +00:00
// Get user data
if(isset($_GET['u'])) {
2015-08-19 02:37:45 +00:00
// Get the user's context
$profile = new User($_GET['u']);
$renderData['legacyprofile'] = [
2015-06-04 12:41:55 +00:00
'notset' => false,
2015-08-19 02:37:45 +00:00
'is_premium' => Users::checkUserPremium($profile->data['id'])[0],
'is_online' => Users::checkUserOnline($profile->data['id']),
'warnings' => Users::getWarnings($profile->data['id']),
'friend' => Users::checkFriend($profile->data['id']),
'forum_stats' => Forum::getUserStats($profile->data['id']),
'ban_check' => Bans::checkBan($profile->data['id'])
2015-04-27 00:41:59 +00:00
];
2015-05-29 19:27:45 +00:00
2015-08-19 02:37:45 +00:00
$renderData['profile'] = $profile;
2015-05-03 21:43:25 +00:00
$renderData['page'] = [
2015-08-19 02:37:45 +00:00
'title' => ($profile->data['id'] < 1 || $profile->data['password_algo'] == 'nologin' ? 'User not found!' : 'Profile of '. $profile->data['username']),
'style' => (!empty($profile->data['userData']['profileBackground']) ? [
2015-05-05 03:47:58 +00:00
'#userBackground' => [
2015-08-19 02:37:45 +00:00
'background' => 'url("/bg/'. $profile->data['id'] .'") no-repeat center center / cover transparent !important',
'position' => 'fixed',
'top' => '0',
'bottom' => '0',
'right' => '0',
'left' => '0',
'z-index' => '-1'
2015-05-03 21:43:25 +00:00
]
] : null)
];
2015-04-27 00:41:59 +00:00
} else {
2015-08-19 02:37:45 +00:00
$renderData['legacyprofile']['notset'] = true;
$renderData['page']['title'] = 'User not found!';
2015-04-27 00:41:59 +00:00
}
// Print page contents
print Templates::render('main/profile.tpl', $renderData);