-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.php
71 lines (64 loc) · 1.71 KB
/
database.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
<?php
/**
* @package SMF WhoDownloadedAttachment
* @file database.php
* @author digger <digger@mysmf.ru> <http://mysmf.ru>
* @copyright Copyright (c) 2017, digger
* @license The MIT License (MIT) https://opensource.org/licenses/MIT
* @version 1.0
*/
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) {
require_once(dirname(__FILE__) . '/SSI.php');
} elseif (!defined('SMF')) {
die('<b>Error:</b> Cannot install - please verify that you put this file in the same place as SMF\'s index.php and SSI.php files.');
}
if ((SMF == 'SSI') && !$user_info['is_admin']) {
die('Admin privileges required.');
}
global $smcFunc;
db_extend('packages');
$columns = array(
array(
'name' => 'id_attach',
'type' => 'int',
'size' => 10,
'unsigned' => true,
'default' => 0,
'null' => false,
),
array(
'name' => 'id_member',
'type' => 'mediumint',
'size' => 8,
'unsigned' => true,
'default' => 0,
'null' => false,
),
array(
'name' => 'log_time',
'type' => 'int',
'size' => 10,
'unsigned' => true,
'default' => 0,
'null' => false,
),
array(
'name' => 'ip',
'type' => 'varchar',
'size' => 16,
'default' => '',
'null' => false,
),
);
$indexes = array(
array(
'name' => 'member_to_attach',
'type' => 'primary',
'columns' => array('id_attach', 'id_member'),
)
);
$tblname = '{db_prefix}log_downloads';
$smcFunc['db_create_table']($tblname, $columns, $indexes, array(), 'update');
if (SMF == 'SSI') {
echo 'Database changes are complete! <a href="/">Return to the main page</a>.';
}