-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsdsettings.ctrl.php
More file actions
65 lines (56 loc) · 1.6 KB
/
sdsettings.ctrl.php
File metadata and controls
65 lines (56 loc) · 1.6 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* Copyright (C) 2009-2019 www.seopanel.org. All rights reserved.
* @author Geo Varghese
*
*/
class SDSettings extends SeoDiary{
/*
* func to get all plugin settings
*/
function __getAllSDSettings($displayCheck=false) {
$where = $displayCheck ? "where display=1" : "";
$sql = "select * from sd_settings $where order by id";
$settingsList = $this->db->select($sql);
return $settingsList;
}
/*
* function to show ld plugin settings
*/
function showSDPluginSettings() {
$settingsList = $this->__getAllSDSettings(true);
$this->set( 'settingsList', $settingsList );
$this->set("spSettingsText", $this->getLanguageTexts('settings', $_SESSION['lang_code']));
$this->pluginRender('showsdsettings');
}
/*
* func to update plugin settings
*/
function updatePluginSettings($postInfo) {
$settingsList = $this->__getAllSDSettings(true);
foreach($settingsList as $setInfo){
switch($setInfo['set_name']){
default:
$postInfo[$setInfo['set_name']] = intval($postInfo[$setInfo['set_name']]);
break;
}
$sql = "update sd_settings set set_val='".addslashes($postInfo[$setInfo['set_name']])."'
where set_name='".addslashes($setInfo['set_name'])."'";
$this->db->query($sql);
}
$this->set('saved', 1);
$this->showSDPluginSettings();
}
/*
* function set all plugin settings
*/
function defineAllPluginSystemSettings() {
$settingsList = $this->__getAllSDSettings();
foreach($settingsList as $settingsInfo){
if(!defined($settingsInfo['set_name'])){
define($settingsInfo['set_name'], $settingsInfo['set_val']);
}
}
}
}
?>