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
|
<?php
$tables = array(
'stats_referers' => "
referer C(50) NOTNULL,
hits I8,
last I8
",
'stats_pageviews' => "
stats_day I8 PRIMARY,
pageviews I8
",
);
global $gBitInstaller;
foreach( array_keys( $tables ) AS $tableName ) {
$gBitInstaller->registerSchemaTable( STATS_PKG_NAME, $tableName, $tables[$tableName] );
}
$gBitInstaller->registerPackageInfo( STATS_PKG_NAME, array(
'description' => "Stats collects and display information about your site.",
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
'version' => '0.1',
'state' => 'stable',
'dependencies' => '',
) );
// ### Default Preferences
$gBitInstaller->registerPreferences( STATS_PKG_NAME, array(
array('', 'referer_stats','y')
) );
// ### Default UserPermissions
$gBitInstaller->registerUserPermissions( STATS_PKG_NAME, array(
array('p_stats_view_referer', 'Can view referer stats', 'editors', STATS_PKG_NAME),
array('p_stats_view', 'Can view site stats', 'basic', STATS_PKG_NAME),
) );
?>
|