本文整理汇总了PHP中settings::SetVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP settings::SetVariable方法的具体用法?PHP settings::SetVariable怎么用?PHP settings::SetVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings
的用法示例。
在下文中一共展示了settings::SetVariable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setStatus
/**
* Устанавливает или проверяет статус дня рождения.
*
* @param integer $status статус
*
* @return integer 1 в случае успеха, 0 в случае ошибки
*/
public function setStatus($status)
{
if (pg_affected_rows(settings::SetVariable('birthday' . $this->year, 'status', $status))) {
return 1;
}
$sql = "INSERT INTO settings (id, module, variable, value) SELECT COALESCE(MAX(id),0)+1, 'birthday{$this->year}', 'status', '{$status}' FROM settings";
if (pg_query(DBConnect(), $sql)) {
return 1;
}
return 0;
}
示例2: trim
exit;
}
if (!hasPermissions('birthday')) {
exit;
}
$action = trim($_GET['action']);
$msettings = new settings();
switch ($action) {
case 'delete':
$id = trim($_GET['id']);
if ($id) {
$error = birthday08::Delete($id);
}
break;
case 'status':
$msettings->SetVariable('birthday08', 'status', $_GET['value']);
}
$users = birthday08::GetAll();
?>
<script src="/scripts/warning.js" type="text/javascript"></script>
<?php
if ($msettings->GetVariable('birthday08', 'status') == 'open') {
?>
<B>Статус регистрации: Открыта</B> » <A href="./?action=status&value=close" class="blue">Закрыть</A>
<?php
} else {
?>
<B>Статус регистрации: Закрыта</B> » <A href="./?action=status&value=open" class="blue">Открыть</A>
示例3: settings
define('MAX_SIZE', 5 * 1024 * 1024);
//5Mb
$action = __paramInit('string', 'action', 'action');
$type = __paramInit('bool', 'type', 'type');
$type_prefix = $type == 1 ? 'emp_' : '';
$settings = new settings();
switch ($action) {
case 'save':
$uploaded_file = new CFile($_FILES['file']);
$uploaded_file->server_root = 1;
$uploaded_file->max_size = MAX_SIZE;
$uploaded_file->allowed_ext = array('jpg', 'jpeg', 'gif', 'png');
$filename = $uploaded_file->MoveUploadedFile(BANNER_PATH);
if (!count($uploaded_file->error) && $filename) {
$settings->AddVariable('newsletter', $type_prefix . 'banner_file', WDCPREFIX . '/' . $uploaded_file->path . $uploaded_file->name);
$settings->AddVariable('newsletter', $type_prefix . 'banner_link', __paramInit('string', null, 'link'));
}
header_location_exit('./#' . ($type == 1 ? 'emp' : 'frl'));
break;
case 'delete':
$settings->SetVariable('newsletter', $type_prefix . 'banner_file', null);
$settings->SetVariable('newsletter', $type_prefix . 'banner_link', null);
break;
}
$newsletter_banner_file = $settings->GetVariable('newsletter', 'banner_file');
$newsletter_banner_link = $settings->GetVariable('newsletter', 'banner_link');
$newsletter_emp_banner_file = $settings->GetVariable('newsletter', 'emp_banner_file');
$newsletter_emp_banner_link = $settings->GetVariable('newsletter', 'emp_banner_link');
$content = '../content.php';
$inner_page = 'inner_index.php';
include $rpath . 'template2.php';