-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
75 lines (73 loc) · 2.41 KB
/
index.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
<?php
/**
**********************
** BTManager v3.0.2 **
**********************
** http://www.btmanager.org/
** https://github.com/blackheart1/BTManager3.0.2
** http://demo.btmanager.org/index.php
** Licence Info: GPL
** Copyright (C) 2018
** Formerly Known As phpMyBitTorrent
** Created By Antonio Anzivino (aka DJ Echelon)
** And Joe Robertson (aka joeroberts/Black_Heart)
** Project Leaders: Black_Heart, Thor.
** File index.php 2018-09-22 00:00:00 Thor
**
** CHANGES
**
** 2018-09-22 - Updated Masthead, Github, !defined('IN_BTM')
**/
if (defined('IN_BTM'))
{
require_once($_SERVER['DOCUMENT_ROOT'].'/security.php');
die ("Error 404 - Page Not Found");
}
else
{
define("IN_BTM",true);
}
//die(mysqli_get_client_info());
require_once("common.php");
$template = new Template();
set_site_var($user->lang['INDEX']);
if($config['load_birthdays'])
{
$birthday_list = '';
$now = getdate(time() - date('Z'));
$sql = "SELECT * FROM ".$db_prefix."_users WHERE ban = '0' AND birthday LIKE '" . $now['mday']."-". $now['mon']."-" . "%'";
$result = $db->sql_query($sql) or btsqlerror($sql);
while ($row = $db->sql_fetchrow($result))
{
if($row["donator"] == 'true')$donator = true;
else
$donator = false;
$img = '';
if ($row["level"] == "premium") $img .= pic("icon_premium.gif",'','premium');
elseif ($row["level"] == "moderator") $img .= pic("icon_moderator.gif",'','moderator');
elseif ($row["level"] == "admin") $img .= pic("icon_admin.gif",'','admin');
if($donator) $img .= '<img src="images/donator.gif" height="16" width="16" title="donator" alt="donator" />';
if($row["warned"] == "1") $img .= '<img src="images/warning.gif" title="warned" alt="warned" />';
$name = ($row['name'] == '' ? $row['username'] : $row['name']);
$birthday_list .= (($birthday_list != '') ? ', ' : '') ."<a href=\"user.php?op=profile&id=".$row["id"]."\"><font color=\"".getusercolor($row["can_do"])."\">{$name}</font></a>{$img}";
if ($age = (int) substr($row['birthday'], -4))
{
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
}
}
$db->sql_freeresult($result);
if($birthday_list!= '')
{
$birthday_list = $user->lang['HAPPY_BIRTHDAY'].$birthday_list;
}
else
{
$birthday_list = $user->lang['NO_BIRTHDAY'];
}
$template->assign_vars(array(
'BIRTHDAY_LIST' => $birthday_list,
));
}
echo $template->fetch('index_body.html');
close_out();
?>