Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
/**
3
 * Copyright (C) 2009-2019 www.seopanel.in. All rights reserved.
4
 * @author Geo Varghese
5
 *
6
 */
7
 
8
class SDSettings extends SeoDiary{
9
 
10
	/*
11
	 * func to get all plugin settings
12
	 */
13
	function __getAllSDSettings($displayCheck=false) {
14
	    $where = $displayCheck ? "where display=1" : "";
15
		$sql = "select * from sd_settings $where order by id";
16
		$settingsList = $this->db->select($sql);
17
		return $settingsList;
18
	}
19
 
20
	/*
21
	 * function to show ld plugin settings
22
	 */
23
	function showSDPluginSettings() {
24
		$settingsList = $this->__getAllSDSettings(true);
25
		$this->set( 'settingsList', $settingsList );
26
		$this->set("spSettingsText", $this->getLanguageTexts('settings', $_SESSION['lang_code']));
27
		$this->pluginRender('showsdsettings');
28
	}
29
 
30
	/*
31
	 * func to update plugin settings
32
	 */
33
	function updatePluginSettings($postInfo) {
34
 
35
		$settingsList = $this->__getAllSDSettings(true);
36
		foreach($settingsList as $setInfo){
37
			switch($setInfo['set_name']){
38
				default:
39
					$postInfo[$setInfo['set_name']] = intval($postInfo[$setInfo['set_name']]);
40
					break;
41
			}
42
 
43
			$sql = "update sd_settings set set_val='".addslashes($postInfo[$setInfo['set_name']])."'
44
					where set_name='".addslashes($setInfo['set_name'])."'";
45
			$this->db->query($sql);
46
		}
47
 
48
		$this->set('saved', 1);
49
		$this->showSDPluginSettings();
50
	}
51
 
52
	/*
53
	 * function set all plugin settings
54
	 */
55
	function defineAllPluginSystemSettings() {
56
		$settingsList = $this->__getAllSDSettings();
57
		foreach($settingsList as $settingsInfo){
58
			if(!defined($settingsInfo['set_name'])){
59
				define($settingsInfo['set_name'], $settingsInfo['set_val']);
60
			}
61
		}
62
	}
63
 
64
}
65
?>