OssnSite.php
Go to the documentation of this file.
1 <?php
2 
3 /**
4  * Open Source Social Network
5  *
6  * @package (Informatikon.com).ossn
7  * @author OSSN Core Team <[email protected]>
8  * @copyright 2014 iNFORMATIKON TECHNOLOGIES
9  * @license General Public Licence http://www.opensource-socialnetwork.org/licence
10  * @link http://www.opensource-socialnetwork.org/licence
11  */
12 class OssnSite extends OssnDatabase {
13  /**
14  * Get site settings;
15  *
16  * @param string $settings settings name
17  * @param string $settings
18  *
19  * @return string
20  */
21  public function getSettings($settings) {
22  $params['from'] = 'ossn_site_settings';
23  $params['wheres'] = array("name='{$settings}'");
24  $this->settings = $this->select($params);
25  return $this->settings->value;
26  }
27 
28  /**
29  * Get all site settings
30  *
31  * @return object
32  */
33  public function getAllSettings() {
34  $params['from'] = 'ossn_site_settings';
35  $this->settings = $this->select($params, true);
36  foreach ($this->settings as $setting) {
37  $result[$setting->name] = $setting->value;
38  }
39  return arrayObject($result, get_class($this));
40  }
41 
42  /**
43  * Update site settings
44  *
45  * @param array $settings array(settings)
46  * @param array $values array(values)
47  * @param array $wheres array(settings id)
48  *
49  * @return boolean
50  */
51  public function UpdateSettings($settings, $values, $wheres) {
52  $params['table'] = 'ossn_site_settings';
53  $params['names'] = $settings;
54  $params['values'] = $values;
55  $params['wheres'] = $wheres;
56  if ($this->settings = $this->update($params)) {
57  return true;
58  }
59  return false;
60  }
61 }//CLASS