本文整理汇总了PHP中get_config_value函数的典型用法代码示例。如果您正苦于以下问题:PHP get_config_value函数的具体用法?PHP get_config_value怎么用?PHP get_config_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_config_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_blog
function update_blog()
{
if ($_FILES['image']['name']) {
$image = $this->load_image_name($this->input->post('id'));
unlink('upload/images/' . $image);
$config['upload_path'] = get_config_value('upload_blog_path');
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = get_config_value('max_size');
$config['encrypt_name'] = TRUE;
// rename to random string
$this->load->library('upload', $config);
if ($this->upload->do_upload('image')) {
$datax = $this->upload->data();
$this->db->set('image', $datax['file_name']);
} else {
print_r($this->upload->display_errors());
exit;
}
}
$this->db->set('title', $this->input->post('title'));
$this->db->set('alias', seo_url($this->input->post('title')));
$this->db->set('content', $this->input->post('content'));
$this->db->where('id', $this->input->post('id'));
$result = $this->db->update('blog');
return $result;
}
示例2: add_article
function add_article($data)
{
$config['upload_path'] = get_config_value('upload_news_path');
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = get_config_value('max_size');
$config['encrypt_name'] = TRUE;
// rename to random string
if ($_FILES['image']['name']) {
$this->load->library('upload', $config);
if ($this->upload->do_upload('image')) {
$datax = $this->upload->data();
} else {
print_r($this->upload->display_errors());
exit;
}
} else {
$datax['file_name'] = NULL;
}
$this->db->set('title', $data['title']);
$this->db->set('alias', seo_url($data['title']));
$this->db->set('category_id', $data['category_id']);
$this->db->set('image', $datax['file_name']);
$this->db->set('short_content', $data['short_content']);
$this->db->set('full_content', $data['full_content']);
$this->db->set('time', time());
$this->db->set('publish', 1);
$result = $this->db->insert('article');
return $result;
}
示例3: save_edit
function save_edit()
{
if ($_FILES['image']['name']) {
$image = $this->article_model->load_image_name($this->input->post('id'));
unlink('upload/images/' . $image);
$config['upload_path'] = get_config_value('upload_news_path');
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = get_config_value('max_size');
$config['encrypt_name'] = TRUE;
// rename to random string
$this->load->library('upload', $config);
if ($this->upload->do_upload('image')) {
$datax = $this->upload->data();
$data['image'] = $datax['file_name'];
} else {
print_r($this->upload->display_errors());
exit;
}
}
$data['title'] = $this->input->post('title');
$data['alias'] = seo_url($this->input->post('title'));
$data['category_id'] = $this->input->post('category_id');
$data['short_content'] = html_entity_decode($this->input->post('short_content'), ENT_QUOTES, "UTF-8");
$data['full_content'] = html_entity_decode($this->input->post('full_content'), ENT_QUOTES, "UTF-8");
$isOK = $this->article_model->update_article($this->input->post('id'), $data);
if ($isOK) {
$this->session->set_flashdata('message', 'Information is saved');
redirect('/article');
} else {
$this->session->set_flashdata('message', 'Can\'t save information');
redirect('/article');
}
}
示例4: update_b2b
function update_b2b($data)
{
if ($_FILES['image']['name']) {
$image = $this->load_image_name($this->input->post('id'));
unlink('upload/b2b/' . $image);
$config['upload_path'] = get_config_value('upload_b2b_path');
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = get_config_value('max_size');
$config['encrypt_name'] = TRUE;
// rename to random string
$this->load->library('upload', $config);
if ($this->upload->do_upload('image')) {
$datax = $this->upload->data();
$this->db->set('image', $datax['file_name']);
} else {
print_r($this->upload->display_errors());
exit;
}
}
if ($data['new_pass']) {
$this->db->set('password', md5($data['new_pass']));
}
$this->db->set('name', $data['name']);
$this->db->set('web', $data['web']);
$this->db->set('company', $data['company']);
$this->db->where('id', $data['id']);
$result = $this->db->update('b2b_user');
return $result;
}
示例5: getInstance
/**
* Return a geocoder singleton
*
* @param $config KConfig object
*
* @return ComLocationsGeocoderAdapterAbstract child singleton
*/
public function getInstance(KConfig $config)
{
if ($this->_geocoder) {
return $this->_geocoder;
}
$service = ucfirst(get_config_value('locations.service', 'google'));
$class_name = 'ComLocationsGeocoderAdapter' . $service;
$this->_geocoder = new $class_name($config);
return $this->_geocoder;
}
示例6: site_get_symbol
function site_get_symbol($key)
{
if (!($symbols = get_config_value('symbols', 'site'))) {
return '';
}
if (empty($symbols[$key])) {
return '';
}
return $symbols[$key];
}
示例7: smarty_function_get_config_value
function smarty_function_get_config_value($params, &$smarty)
{
if (empty($params['key'])) {
return '';
}
$key = $params['key'];
if (!empty($params['index'])) {
$index = $params['index'];
}
return get_config_value($key, $index);
}
示例8: map
/**
* renders a map
*
* @param array of ComLocationsDomainEntityLocation entities
* @param array of configuration params: longitude, latitude, name, url
*
* @return string html
*/
public function map($locations, $config = array())
{
if ($locations instanceof ComLocationsDomainEntityLocation) {
$locations = array($locations);
}
$data = array();
foreach ($locations as $location) {
$data[] = array('longitude' => $location->longitude, 'latitude' => $location->latitude, 'name' => $location->name, 'url' => JRoute::_($location->getURL()));
}
$config['locations'] = htmlspecialchars(json_encode($data), ENT_QUOTES, 'UTF-8');
$config['service'] = get_config_value('locations.service', 'google');
return $this->_render('map_' . $config['service'], $config);
}
示例9: _authorizeAdd
/**
* Authorize whether we can add a new actor or not.
*
* @param KCommandContext $context
*
* @return bool
*/
protected function _authorizeAdd(KCommandContext $context)
{
$can_publish = get_config_value($this->_entity->component, 'can_publish', self::CAN_ADD_ADMIN);
switch ($can_publish) {
case self::CAN_ADD_ADMIN:
return $this->_viewer->admin();
case self::CAN_ADD_SPECIAL:
return $this->_viewer->userType != 'Registered' && !$this->_viewer->guest();
case self::CAN_ADD_ALL:
return !$this->_viewer->guest();
default:
return false;
}
}
示例10: ok_to_impersonate
function ok_to_impersonate($euid, $uid)
{
global $dbh;
// It's harmless to impersonate yourself ;)
if ($euid == $uid && $euid > 0 && $uid > 0) {
return true;
} else {
// Domain default users can be impersonated by admins
// responsible for those domains, and the superadmin.
// Only the superadmin can impersonate the system default
// user (@.).
if (is_a_domain_default_user($euid) || get_config_value("enable_privacy_invasion") == "Y") {
if (is_superadmin($uid)) {
return true;
} else {
if (is_a_domain_default_user($euid)) {
$domain_id = get_domain_id(get_user_name($euid));
return is_admin_for_domain($uid, $domain_id);
} else {
if (!is_superadmin($euid)) {
$sth = $dbh->prepare("SELECT email FROM users WHERE maia_user_id = ?");
$res = $sth->execute(array($euid));
if (PEAR::isError($sth)) {
die($sth->getMessage());
}
while ($row = $res->fetchRow()) {
$domain_id = get_domain_id("@" . get_domain_from_email($row["email"]));
if (is_admin_for_domain($uid, $domain_id)) {
$sth->free();
return true;
}
}
$sth->free();
return false;
} else {
return false;
}
}
}
// Impersonating other users is an invasion of privacy,
// even for administrators, unless explicitly overridden above.
} else {
return false;
}
}
}
示例11: save_add
function save_add()
{
$data['email'] = $this->input->post('email');
$data['name'] = $this->input->post('name');
$data['web'] = $this->input->post('web');
$data['company'] = $this->input->post('company');
$pass = $this->input->post('pass');
$isOK = $this->b2b_user_model->check_b2b($data['email']);
if ($isOK) {
$this->session->set_flashdata('message', 'This email is used, please input other email');
redirect(base_url() . index_page() . 'b2b_user/add');
}
$data['password'] = md5($pass);
$data['time'] = time();
$data['publish'] = 1;
if ($_FILES['image']['name']) {
$config['upload_path'] = get_config_value('upload_b2b_path');
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = get_config_value('max_size');
$config['encrypt_name'] = TRUE;
// rename to random string
$this->load->library('upload', $config);
if ($this->upload->do_upload('image')) {
$datax = $this->upload->data();
$data['image'] = $datax['file_name'];
} else {
$data['image'] = "";
}
}
$isOK = $this->b2b_user_model->add_b2b($data);
if ($isOK) {
//Send mail to user B2B
$data['link'] = base_url() . index_page();
$data['pass'] = $pass;
$data['login'] = base_url() . index_page() . 'user/login.html';
$data['site'] = base_url() . index_page() . 'index.html';
$emailTo = array($data['email']);
$mailOK = $this->b2b_user_model->sendEmail($emailTo, "Sugardating.dk - Detaljer for ny bruger", 'signupb2b', array('data' => $data), '');
$this->session->set_flashdata('message', 'A B2B account is added');
redirect(base_url() . index_page() . 'b2b_user');
} else {
$this->session->set_flashdata('message', 'Can\'t add account');
redirect(base_url() . index_page() . 'b2b_user');
}
}
示例12: fetch_class
/**
* @return string
*/
public function fetch_class()
{
if ($this->class != null) {
return $this->class;
}
// Get default class if not provided
if (count($this->uri->segments) == 0) {
if (trim(get_config_value('main', 'default_controller')) == '') {
error("Default controller is not defined.");
}
return strtolower(get_config_value('main', 'default_controller'));
}
// Do routing
$class = strtolower($this->uri->segments[0]);
$route = get_config_value('routes', $class);
if ($route !== NULL) {
array_shift($this->uri->segments);
$routeSegments = explode("/", $route);
array_unshift($this->uri->segments, $routeSegments[0], $routeSegments[1]);
}
$this->class = strtolower($this->uri->segments[0]);
return $this->class;
}
示例13: add_image
function add_image($user_id)
{
$config['upload_path'] = get_config_value('upload_gallery_path');
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = get_config_value('max_size');
$config['encrypt_name'] = TRUE;
// rename to random string
$this->load->library('upload', $config);
if ($_FILES['upl']['name']) {
if ($this->upload->do_upload('upl')) {
$datax = $this->upload->data();
} else {
die($this->upload->display_errors());
}
} else {
$datax['file_name'] = NULL;
}
$this->db->set('user_id', $user_id);
$this->db->set('image', $datax['file_name']);
$this->db->set('time', time());
$this->db->set('publish', 1);
$result = $this->db->insert('gallery');
return $result;
}
示例14: process_commands_list
function process_commands_list($commands_list, $plugin_name = '')
{
# check inputs
if (!is_string($plugin_name)) {
return error(null, "plugin name is not a string");
}
if (!is_array($commands_list)) {
return error(null, "commands to process are not an array");
}
if (empty($commands_list)) {
return notice(null, "no commands to process");
}
# loop through all the commands
foreach ($commands_list as $commands) {
$r = process_commands($commands);
if (@$GLOBALS['error'] === false) {
$r = true;
}
if ($r === true) {
$syslog = get_config_value('syslog_on_success', false);
if ($syslog) {
$syslog_error_msg = "[SureDone {$plugin_name} plugin] [Success]";
$syslog_priority = get_config_value('syslog_success_priority', LOG_INFO);
}
$msg = "[Success] Script execution successful";
} else {
$syslog = get_config_value('syslog_on_failure', true);
if ($syslog) {
$error_msg = $GLOBALS['error_msg'];
$syslog_msg = "[SureDone {$plugin_name} plugin] [Error] {$error_msg}";
$syslog_priority = get_config_value('syslog_failure_priority', LOG_ERR);
}
$msg = "[Failure] Script exited with errors";
break;
}
}
# perform a syslog if required
if ($syslog) {
syslog($syslog_priority, $syslog_msg);
$msg = "{$msg} (logged to syslog)";
$exit_status = 1;
} else {
$msg = "{$msg} (not logged to syslog)";
$exit_status = 0;
}
# echo the success/failure of the script and exit
echo "{$msg}\n";
if ($exit_status != 0) {
exit($exit_status);
}
}
示例15: trim
<!DOCTYPE html>
<head>
<title>Servatrice Administrator</title>
</head>
<html>
<body>
<?php
require '.config_commonfunctions';
global $configfile;
$version = trim(get_config_value($configfile, 'version'));
if (strpos(strtolower($version), "fail") !== false) {
echo $version;
exit;
}
$banner = trim(get_config_value($configfile, 'indexwelcomemessage'));
if (strpos(strtolower($banner), "fail") !== false) {
echo $banner;
exit;
}
?>
<table border="1" align="center" cellpadding="5">
<tr align="center">
<td><a href="loginpage.php">Account Log-in</a></td>
<td><a href="statistics.php">Statistics</a></td>
<td><a href="registrationpage.php">Registration</a></td>
<td><a href="codeofconduct.html">Code of Conduct</a></td>
</tr>
<tr><td colspan="4" align="center"><?php
if (!empty($banner)) {
echo trim($banner) . '<br>';
}