-
Notifications
You must be signed in to change notification settings - Fork 0
/
rgallery.install
65 lines (60 loc) · 1.48 KB
/
rgallery.install
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
<?php
/**
* Implement of hook_install().
*/
function rgallery_install() {
file_prepare_directory(file_build_uri(RGALLERY_UPLOAD_PATH), FILE_CREATE_DIRECTORY);
file_unmanaged_copy(rgallery_path() .'/default.jpg', file_build_uri(RGALLERY_UPLOAD_PATH), FILE_EXISTS_REPLACE);
}
/**
* Implement of hook_uninstall().
*/
function rgallery_uninstall() {
}
/**
* Implementation of hook_schema().
*/
function rgallery_schema() {
$schema['ralbum'] = array(
'fields' => array(
'aid' => array(
'type' => 'int',
'description' => 'album id as nid',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => '0',
),
'pid' => array(
'type' => 'int',
'description' => 'photo nid of gallery as nid',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => '0',
),
'fid' => array(
'type' => 'int',
'description' => 'file id',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => '0',
),
'weight' => array(
'type' => 'int',
'description' => 'weight to order',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => '0',
),
'is_thumbnail' => array(
'type' => 'int',
'description' => 'is thumbnail for set cover',
'unsigned' => TRUE,
'not null '=> TRUE,
'default' => '0',
),
),
'primary key' => array('aid', 'pid', 'weight'),
);
return $schema;
}
?>