<?php conf_set('sitename', '<Site Name>'); conf_set('domain', 'domain.tld'); conf_set('http.root', '/'); conf_set('db.type', 'mysql'); conf_set('db.host', 'localhost'); conf_set('db.name', '<Database Name>'); conf_set('db.user', '<Database User>'); conf_set('db.pass', '<Database Password>'); conf_set('mail.send', true); if (!defined('DISABLE_AUTOLOAD')) { conf_set('modules.autoload', array('db', 'web', 'data/json', 'data/date')); } conf_set('cms.salt', '<Salt>'); conf_set('cms.lang', 'en'); // "en" or "ru" conf_set('log_errors', true); conf_set('debug', true); conf_set('show_debug_info', false); // conf_set('log_debug_info', true); function set_utf8_connection($db) { $cmd = new SDBCommand('SET NAMES utf8', $db); $cmd->execute(); } conf_set('db.init_hook', 'set_utf8_connection'); if (is_readable(dirname(__FILE__) . '/local_config.php')) { require_once dirname(__FILE__) . '/local_config.php'; }
<?php /* conf_set('debug', false); conf_set('log_errors', true); */ conf_set('sitename', 'Sample site'); conf_set('domain', 'localhost'); conf_set('http.root', '/sample-site/'); /* conf_set('db.type', 'mysql'); conf_set('db.host', '127.0.0.1:3306'); conf_set('db.user', 'database-user'); conf_set('db.pass', 'database-pass'); conf_set('db.name', 'some-database'); */ conf_set('db.type', 'sqlite'); conf_set('db.name', '~cache/db.sqlite'); /* conf_set('db.prefix', 'table_prefix_'); */ /* conf_set('page.show_vars', true); */ /* conf_set('mail.send', true); conf_set('mail.smtp.enable', true); conf_set('mail.smtp.host', 'smtp.gmail.com'); conf_set('mail.smtp.port', 465); conf_set('mail.smtp.ssl', true); conf_set('mail.smtp.user', 'username'); conf_set('mail.smtp.pass', 'password'); */ conf_set('modules.autoload', array('db', 'web'));
$banid = param(2, 0); $ip0 = param('ip0', 0); $ip1 = param('ip1', 0); $ip2 = param('ip2', 0); $ip3 = param('ip3', 0); $expiry = param('expiry'); $expiry = strtotime($expiry); $ip0 = mid($ip0, 0, 255); $ip1 = mid($ip1, 0, 255); $ip2 = mid($ip2, 0, 255); $ip3 = mid($ip3, 0, 255); $banip = banip_read($banid); if (empty($banip)) { $r = banip_create(array('banid' => $banid, 'ip0' => $ip0, 'ip1' => $ip1, 'ip2' => $ip2, 'ip3' => $ip3, 'expiry' => $expiry)); $r !== FALSE ? message(0, '创建成功') : message(-1, '创建失败'); } $r = banip_update($banid, array('ip0' => $ip0, 'ip1' => $ip1, 'ip2' => $ip2, 'ip3' => $ip3, 'expiry' => $expiry)); $r !== FALSE ? message(0, '更新成功') : message(-1, '更新失败'); } elseif ($action == 'enable') { $method != 'POST' and message(-1, 'Method error'); $banip_on = param('banip_on', 0); $r = conf_set('banip_on', $banip_on); $r !== FALSE ? message(0, '更新成功') : message(-1, '更新失败,请检查 conf/conf.php 是否可写!'); } elseif ($action == 'delete') { $method != 'POST' and message(-1, 'Method error'); $banid = param(2, 0); $banip = banip_read($banid); empty($banip) and message(0, '已经删除'); $r = banip_delete($banid); $r !== FALSE ? message(0, '更新成功') : message(-1, '更新失败'); }
// 发布的时候改为 0 define('APP_NAME', 'bbs'); // 应用的名称 define('APP_PATH', '../../'); // 应用的路径 chdir(APP_PATH); $conf = (include './conf/conf.php'); include './xiunophp/xiunophp.php'; include './xiunophp/form.func.php'; include './model.inc.php'; $user = user_token_get('', 'bbs'); $user['gid'] != 1 and message(-1, '需要管理员权限才能设置。'); // 检测浏览器 $browser = get__browser(); check_browser($browser); $runtime = runtime_init(); if ($method == 'GET') { $input = array(); $input['tietuku_on'] = form_radio_yes_no('tietuku_on', $conf['tietuku_on']); $input['tietuku_token'] = form_textarea('tietuku_token', htmlspecialchars($conf['tietuku_token']), 600, 100); $header = array(); $header['title'] = '贴图库设置'; include './plugin/xn_tietuku/setting.htm'; } else { $tietuku_on = param('tietuku_on', 0); $tietuku_token = param('tietuku_token', '', FALSE); conf_set('tietuku_on', $tietuku_on); conf_set('tietuku_token', $tietuku_token); conf_save(); message(0, '设置成功!'); }
<?php !defined('DEBUG') and exit('Access Denied.'); include './xiunophp/form.func.php'; $action = param(1); if ($method == 'GET') { $badwords = kv_get('badwords'); $input_badword_on = form_radio_yes_no('badword_on', $conf['badword_on']); $badwords = badword_implode(':', ' ', $badwords); include './admin/view/badword.htm'; } elseif ($method == 'POST') { $badwords = param('badwords'); $badword_on = param('badword_on', 0); $badwords = str_replace(" ", ' ', $badwords); $badwords = str_replace(":", ':', $badwords); $badwords = str_replace(": ", ':', $badwords); $badwords = preg_replace('#\\s+#is', ' ', $badwords); $badwordarr = badword_explode(':', ' ', $badwords); kv_set('badwords', $badwordarr); conf_set('badword_on', $badword_on); message(0, '保存成功'); }
<?php // BEGIN KEEPOUT CHECKING // Add these lines to the very top of any file you don't want people to // be able to access directly. if (!defined('SAF_VERSION')) { header('HTTP/1.1 404 Not Found'); echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" . "<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n" . "The requested URL " . $PHP_SELF . " was not found on this server.<p>\n<hr>\n" . $_SERVER['SERVER_SIGNATURE'] . "</body></html>"; exit; } // END KEEPOUT CHECKING // custom application properties go here. // this helps centralize values that would be often referenced // in multiple places in your application. define('E_UNAUTHORIZED', 401); define('E_FORBIDDEN', 403); define('E_NOT_FOUND', 404); define('E_SERVER_ERROR', 500); conf_set('errors', array(E_UNAUTHORIZED => array('title' => 'Unauthorized', 'message' => 'You do not have the permission to view the requested document.'), E_FORBIDDEN => array('title' => 'Forbidden', 'message' => 'The requested document is forbidden.'), E_NOT_FOUND => array('title' => 'Not Found', 'message' => 'The requested document was not found on this server.'), E_SERVER_ERROR => array('title' => 'Server Error', 'message' => 'The server has encountered an unknown internal error.'))); formdata_set('provinces', array('Alberta', 'British Columbia', 'Manitoba', 'New Brunswick', 'Newfoundland', 'Northwest Territories', 'Nova Scotia', 'Nunavut', 'Ontario', 'Quebec', 'Prince Edward Island', 'Saskatchewan', 'Yukon Territories')); formrules_set('username', array(array('not empty', 'You must enter a username to continue.'), array('unique "sitellite_user/username"', 'The username you have chosen is already in use.'))); if (session_admin()) { page_add_style(site_prefix() . '/inc/html/admin/extra.css'); }
conf_set('mail.send', false); } if (!conf_has('mail.type')) { conf_set('mail.type', 'mail'); } if (!conf_has('mail.sendmail.path')) { conf_set('mail.sendmail.path', '/var/qmail/bin/sendmail'); } if (!conf_has('mail.smtp.port')) { conf_set('mail.smtp.port', 25); } if (!conf_has('mail.smtp.ssl')) { conf_set('mail.smtp.ssl', true); } if (!conf_has('mail.smtp.timeout')) { conf_set('mail.smtp.timeout', 30); } require_once S_BASE . 'core/functions.php'; $modules = conf('modules.autoload'); if (conf('use_cgi')) { require_once S_BASE . 'web/cgi.php'; SCGI::init(); } foreach ($modules as $name) { if (strpos($name, '/') !== false) { require_once S_BASE . $name . '.php'; } else { require_once S_BASE . $name . '/all.php'; } } if (conf('set_utf8')) {
<?php conf_set('debug', array_key_exists('gimmedebug', $_GET)); // conf_set('debug', true); conf_set('sitename', 'zame-dev.org'); conf_set('domain', 'localhost'); conf_set('http.root', '/simple/examples/01-simpliest-ever/'); conf_set('modules.autoload', array());
<?php conf_set('debug', array_key_exists('gimmedebug', $_GET)); // conf_set('debug', true); conf_set('sitename', 'zame-dev.org'); conf_set('domain', 'localhost'); conf_set('http.root', '/simple/examples/02-template/'); conf_set('modules.autoload', array('web/template'));