function setCaption($captions) { if (!$this->auth->isAdmin()) { return false; } return Comman::setConfig('home', 'caption', implode(";", array_filter($captions))); }
public static function createConfig($mod, $name, $value = null) { $db = new DBManager(); $table = 'core_conf'; if (Comman::isConfig($mod, $name)) { return false; } $columns = array(0 => 'module', 1 => 'name'); $data = array(0 => $mod, 1 => $name); if ($value == null) { return $db->insertData($table, $columns, $data); } return $db->insertData($table, $columns, $data) && Comman::setConfig($mod, $name, $value); }
<?php include '../core/includes.php'; $config = new Config(); $auth = new Auth(); if (!$auth->isAdmin()) { header("Location:" . $config->site_address . "login"); } $param = array("phone", "email", "fb", "tw", "gp", "yt"); foreach ($param as $p) { if (isset($_POST[$p])) { Comman::setConfig("contact", $p, $_POST[$p]); } } header("Location:" . $_POST['return_path']);