forked from SMLabs/fbgallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetails.php
159 lines (142 loc) · 4.19 KB
/
details.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php defined('BASEPATH') or exit('No direct script access allowed');
class Module_FbGallery extends Module {
public $version = '1.2';
public function info()
{
return array(
'name' => array(
'sl' => 'Facebook Gallery',
'en' => 'Facebook Gallery',
'de' => 'Facebook Gallery',
'nl' => 'Facebook Gallery',
'fr' => 'Facebook Gallery',
'zh' => 'Facebook Gallery',
'it' => 'Facebook Gallery',
'ru' => 'Facebook Gallery',
'ar' => 'Facebook Gallery',
'pt' => 'Facebook Gallery',
'cs' => 'Facebook Gallery',
'es' => 'Facebook Gallery',
'fi' => 'Facebook Gallery',
'lt' => 'Facebook Gallery'
),
'description' => array(
'sl' => 'Manage your gallery.',
'en' => 'Import and Manage Facebook Galleries.',
'de' => 'Manage your gallery.',
'nl' => 'Manage your gallery.',
'fr' => 'Manage your gallery.',
'zh' => 'Manage your gallery.',
'it' => 'Manage your gallery.',
'ru' => 'Manage your gallery.',
'ar' => 'Manage your gallery.',
'pt' => 'Manage your gallery.',
'cs' => 'Manage your gallery.',
'es' => 'Manage your gallery.',
'fi' => 'Manage your gallery.',
'lt' => 'Manage your gallery.'
),
'sections' => array(
'fbgallery' => array(
'name' => 'fbgallery_admin_section_title',
'uri' => 'admin/fbgallery',
'shortcuts' => array(
array(
'name' => 'fbgallery_admin_shortcut_settings',
'uri' => 'admin/fbgallery/settings',
'class' => ''
),
array(
'name' => 'fbgallery_admin_shortcut_import',
'uri' => 'admin/fbgallery/import',
'class' => ''
),
array(
'name' => 'fbgallery_admin_shortcut_import_fanpage',
'uri' => 'admin/fbgallery/import_fanpage',
'class' => ''
)
),
)
),
'frontend' => TRUE,
'backend' => TRUE,
'menu' => 'content'
);
}
public function install()
{
$this->dbforge->drop_table('fbgallery_albums');
$dch_album_fbgallery = "
CREATE TABLE ".$this->db->dbprefix('fbgallery_albums')." (
`id` bigint(20) DEFAULT NULL,
`cover_pid` bigint(20) DEFAULT NULL,
`owner` bigint(20) unsigned DEFAULT NULL,
`name` varchar(255) NOT NULL DEFAULT '',
`link` varchar(255) NOT NULL,
`index` tinyint(5) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
";
$this->dbforge->drop_table('fbgallery_photos');
$dch_photos_fbgallery = "
CREATE TABLE ".$this->db->dbprefix('fbgallery_photos')." (
`id` bigint(20) DEFAULT NULL,
`aid` bigint(20) DEFAULT NULL,
`picture` varchar(255) NOT NULL,
`source` varchar(255) NOT NULL,
`link` varchar(255) NOT NULL,
`name` longtext NOT NULL,
`index` tinyint(5) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime NOT NULL,
`active` tinyint(4) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
";
$this->dbforge->drop_table('fbgallery_options');
$dch_options_fbgallery = "
CREATE TABLE ".$this->db->dbprefix('fbgallery_options')." (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`option_name` varchar(64) NOT NULL DEFAULT '',
`option_value` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
";
if($this->db->query($dch_album_fbgallery) && $this->db->query($dch_photos_fbgallery) && $this->db->query($dch_options_fbgallery) )
{
return TRUE;
}
}
public function uninstall()
{
if($this->dbforge->drop_table($this->db->dbprefix('fbgallery_photos')))
{
return TRUE;
}
if($this->dbforge->drop_table($this->db->dbprefix('fbgallery_albums')))
{
return TRUE;
}
if($this->dbforge->drop_table($this->db->dbprefix('fbgallery_options')))
{
return TRUE;
}
}
public function upgrade($old_version)
{
// Your Upgrade Logic
return TRUE;
}
public function help()
{
// Return a string containing help info
// You could include a file and return it here.
return "<h4>Overview</h4>
<p>Facebook Photo Gallery.</p>";
}
}
/* End of file details.php */