This repository was archived by the owner on Nov 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathenable.php
More file actions
50 lines (43 loc) · 1.43 KB
/
enable.php
File metadata and controls
50 lines (43 loc) · 1.43 KB
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
<?php
/**
* Tagger Plugin for Wolf CMS <http://thehub.silentworks.co.uk/plugins/frog-cms/tagger.html>
* Alternate Mirror site <http://www.tbeckett.net/articles/plugins/tagger.xhtml>
* Copyright (C) 2008 - 2011 Andrew Smith <a.smith@silentworks.co.uk>
* Copyright (C) 2008 - 2011 Tyler Beckett <tyler@tbeckett.net>
*
* Dual licensed under the MIT (license/mit-license.txt)
* and GPL (license/gpl-license.txt) licenses.
*/
/**
* Tagger Utils
*/
$tagger_dir = dirname(__FILE__) . '/';
include_once $tagger_dir . "utils.php";
$PDO = Record::getConnection();
$driver = strtolower($PDO->getAttribute(Record::ATTR_DRIVER_NAME));
if ($driver == 'mysql') {
$query = $PDO->query("SELECT * FROM ".TABLE_PREFIX."page WHERE behavior_id = 'tagger'");
if(!$query->rowCount()){
// Create Pages
executioner(
file($tagger_dir . 'sql/install.sql'),
array(
'{prefix}' => TABLE_PREFIX
)
);
}
}
// Check if the plugin's settings already exist and create them if not.
if (Plugin::getSetting('tag_type', 'tagger') === false) {
// Store settings new style
$settings = array('tag_type' => 'count',
'case' => '0',
'rowspage' => '15',
'sort_field' => '0',
'sort_order' => 'ASC',
'font_min' => '12',
'font_max' => '32'
);
Plugin::setAllSettings($settings, 'tagger');
}
Flash::set('success', __('Tagger: Plugin was successfully enabled!'));