本文整理汇总了PHP中loadsettings函数的典型用法代码示例。如果您正苦于以下问题:PHP loadsettings函数的具体用法?PHP loadsettings怎么用?PHP loadsettings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadsettings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: demo_process_thread
function demo_process_thread($act, $outformat, $lastid, $isuser, $canpost, $istyping, $postmessage)
{
global $kind_for_agent, $kind_info, $kind_events, $kind_user, $kind_agent, $webimroot, $settings;
loadsettings();
if ($act == "refresh" || $act == "post") {
$lastid++;
if ($outformat == "xml") {
start_xml_output();
print "<thread lastid=\"{$lastid}\" typing=\"" . ($istyping ? 1 : 0) . "\" canpost=\"" . ($canpost ? 1 : 0) . "\">";
} else {
start_html_output();
$url = "{$webimroot}/thread.php?act=refresh&thread=0&token=123&html=on&user=" . ($isuser ? "true" : "false");
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . "<html>\n<head>\n" . "<link href=\"{$webimroot}/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n" . "<meta http-equiv=\"Refresh\" content=\"" . $settings['updatefrequency_oldchat'] . "; URL={$url}&sn=11\">\n" . "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" . "<title>chat</title>\n" . "</head>\n" . "<body bgcolor='#FFFFFF' text='#000000' link='#C28400' vlink='#C28400' alink='#C28400'>" . "<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td valign='top' class='message'>";
}
if ($lastid == 1) {
demo_print_message(array('ikind' => $kind_for_agent, 'created' => time() - 15, 'tname' => '', 'tmessage' => getstring2('chat.came.from', array("http://google.com"))), $outformat);
demo_print_message(array('ikind' => $kind_info, 'created' => time() - 15, 'tname' => '', 'tmessage' => getstring('chat.wait')), $outformat);
demo_print_message(array('ikind' => $kind_events, 'created' => time() - 10, 'tname' => '', 'tmessage' => getstring2("chat.status.operator.joined", array("Administrator"))), $outformat);
demo_print_message(array('ikind' => $kind_agent, 'created' => time() - 9, 'tname' => 'Administrator', 'tmessage' => getstring("demo.chat.welcome")), $outformat);
demo_print_message(array('ikind' => $kind_user, 'created' => time() - 5, 'tname' => getstring("chat.default.username"), 'tmessage' => getstring("demo.chat.question")), $outformat);
if ($canpost && $outformat == 'xml') {
demo_print_message(array('ikind' => $kind_info, 'created' => time() - 5, 'tname' => '', 'tmessage' => 'Hint: type something in message field to see typing notification'), $outformat);
}
}
if ($act == 'post') {
demo_print_message(array('ikind' => $isuser ? $kind_user : $kind_agent, 'created' => time(), 'tmessage' => $postmessage, 'tname' => $isuser ? getstring("chat.default.username") : "Administrator"), $outformat);
}
if ($outformat == "xml") {
print "</thread>";
} else {
print "</td></tr></table><a name='aend'></a>" . "</body></html>";
}
}
}
示例2: getInstruments
public function getInstruments()
{
//$instruments = [];
$settings = loadsettings();
$instruments = $settings['oanda']['pairs'];
return $instruments;
}
示例3: setUp
public function setUp()
{
// load the $settings
require_once __DIR__ . '/../loadsettings.php';
$settings = loadsettings();
$this->settings = $settings;
$setup['settings'] = $settings;
$container = new Container($setup);
$this->container = $container;
// Set up dependencies
require_once __DIR__ . '/../dependencies.php';
}
示例4: setup_operator_settings_tabs
function setup_operator_settings_tabs($opId, $active)
{
global $page, $webimroot, $settings;
loadsettings();
if ($opId) {
if ($settings['enablegroups'] == '1') {
$page['tabs'] = array(getlocal("page_agent.tab.main") => $active != 0 ? "{$webimroot}/operator/operator.php?op={$opId}" : "", getlocal("page_agent.tab.avatar") => $active != 1 ? "{$webimroot}/operator/avatar.php?op={$opId}" : "", getlocal("page_agent.tab.groups") => $active != 2 ? "{$webimroot}/operator/opgroups.php?op={$opId}" : "", getlocal("page_agent.tab.permissions") => $active != 3 ? "{$webimroot}/operator/permissions.php?op={$opId}" : "");
} else {
$page['tabs'] = array(getlocal("page_agent.tab.main") => $active != 0 ? "{$webimroot}/operator/operator.php?op={$opId}" : "", getlocal("page_agent.tab.avatar") => $active != 1 ? "{$webimroot}/operator/avatar.php?op={$opId}" : "", getlocal("page_agent.tab.permissions") => $active != 3 ? "{$webimroot}/operator/permissions.php?op={$opId}" : "");
}
} else {
$page['tabs'] = array();
}
}
示例5: setup_operator_settings_tabs
function setup_operator_settings_tabs($opId, $active)
{
global $page, $mibewroot, $settings;
loadsettings();
if ($opId) {
if ($settings['enablegroups'] == '1') {
$page['tabs'] = array(array('title' => getlocal("page_agent.tab.main"), 'link' => "{$mibewroot}/operator/operator.php?op={$opId}"), array('title' => getlocal("page_agent.tab.avatar"), 'link' => "{$mibewroot}/operator/avatar.php?op={$opId}"), array('title' => getlocal("page_agent.tab.groups"), 'link' => "{$mibewroot}/operator/opgroups.php?op={$opId}"), array('title' => getlocal("page_agent.tab.permissions"), 'link' => "{$mibewroot}/operator/permissions.php?op={$opId}"));
} else {
$page['tabs'] = array(array('title' => getlocal("page_agent.tab.main"), 'link' => "{$mibewroot}/operator/operator.php?op={$opId}"), array('title' => getlocal("page_agent.tab.avatar"), 'link' => "{$mibewroot}/operator/avatar.php?op={$opId}"), array('title' => getlocal("page_agent.tab.permissions"), 'link' => "{$mibewroot}/operator/permissions.php?op={$opId}"));
if ($active == 3) {
$active--;
}
}
$page['tabselected'] = $active;
} else {
$page['tabs'] = array();
}
}
示例6: getsetting
function getsetting($settingname, $default)
{
global $settings;
global $DB_USEDATACACHE, $DB_DATACACHEPATH;
if ($settingname == "usedatacache") {
return $DB_USEDATACACHE;
} elseif ($settingname == "datacachepath") {
return $DB_DATACACHEPATH;
}
if (!isset($settings[$settingname])) {
loadsettings();
} else {
return $settings[$settingname];
}
if (!isset($settings[$settingname])) {
savesetting($settingname, $default);
return $default;
} else {
return $settings[$settingname];
}
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:21,代码来源:settings.php
示例7: getsetting
function getsetting(string $settingname, $default)
{
global $settings, $DB_USEDATACACHE, $DB_DATACACHEPATH;
if ($settingname == 'usedatacache') {
return $DB_USEDATACACHE;
} else {
if ($settingname == 'datacachepath') {
return $DB_DATACACHEPATH;
}
}
if (!isset($settings[$settingname])) {
loadsettings();
} else {
return $settings[$settingname];
}
if (!isset($settings[$settingname])) {
savesetting($settingname, $default);
return $default;
} else {
return $settings[$settingname];
}
}
示例8: check_status
function check_status()
{
global $page, $webimroot, $settings, $dbversion;
$page['done'][] = getlocal2("install.0.php", array(phpversion()));
if (!check_webimroot()) {
return;
}
if (!check_files()) {
return;
}
$link = check_connection();
if (!$link) {
return;
}
if (!check_database($link)) {
mysql_close($link);
return;
}
if (!check_tables($link)) {
mysql_close($link);
return;
}
if (!check_columns($link)) {
mysql_close($link);
return;
}
check_sound();
$page['done'][] = getlocal("installed.message");
if (!check_admin($link)) {
$page['nextstep'] = getlocal("installed.login_link");
$page['nextnotice'] = getlocal2("installed.notice", array("{$webimroot}/install/"));
$page['nextstepurl'] = "{$webimroot}/operator/login.php?login=admin";
}
$page['show_small_login'] = true;
mysql_close($link);
loadsettings();
$settings['dbversion'] = $dbversion;
update_settings();
}
示例9: getchatstyle
function getchatstyle()
{
global $settings;
$chatstyle = verifyparam("style", "/^\\w+\$/", "");
if ($chatstyle) {
return $chatstyle;
}
loadsettings();
return $settings['chatstyle'];
}
示例10: setup_chatview_for_operator
function setup_chatview_for_operator($thread, $operator)
{
global $page, $webimroot, $company_logo_link, $company_name, $settings;
loadsettings();
$page = array();
$page['agent'] = true;
$page['user'] = false;
$page['canpost'] = $thread['agentId'] == $operator['operatorid'];
$page['ct.chatThreadId'] = $thread['threadid'];
$page['ct.token'] = $thread['ltoken'];
$page['ct.user.name'] = htmlspecialchars(topage(get_user_name($thread['userName'], $thread['remote'], $thread['userid'])));
$page['chat.title'] = topage($settings['chattitle']);
setup_logo();
if ($settings['sendmessagekey'] == 'enter') {
$page['send_shortcut'] = "Enter";
$page['ignorectrl'] = 1;
} else {
$page['send_shortcut'] = is_mac_opera() ? "⌘-Enter" : "Ctrl-Enter";
$page['ignorectrl'] = 0;
}
if ($settings['enablessl'] == "1" && !is_secure_request()) {
$page['sslLink'] = get_app_location(true, true) . "/operator/agent.php?thread=" . $thread['threadid'] . "&token=" . $thread['ltoken'];
}
$page['isOpera95'] = is_agent_opera95();
$page['neediframesrc'] = needsFramesrc();
$page['historyParams'] = array("userid" => "" . $thread['userid']);
$page['historyParamsLink'] = add_params($webimroot . "/operator/userhistory.php", $page['historyParams']);
$predefinedres = "";
$canned_messages = load_canned_messages($thread['locale'], $thread['groupid']);
foreach ($canned_messages as $answer) {
$predefinedres .= "<option>" . htmlspecialchars(topage($answer['vcvalue'])) . "</option>";
}
$page['predefinedAnswers'] = $predefinedres;
$params = "thread=" . $thread['threadid'] . "&token=" . $thread['ltoken'];
$page['redirectLink'] = "{$webimroot}/operator/agent.php?" . $params . "&act=redirect";
$page['namePostfix'] = "";
$page['frequency'] = $settings['updatefrequency_chat'];
}
示例11: prepare_menu
function prepare_menu($operator, $hasright = true)
{
global $page, $settings, $can_administrate, $can_viewnotifications;
$page['operator'] = topage(get_operator_name($operator));
if ($hasright) {
loadsettings();
$page['showban'] = $settings['enableban'] == "1";
$page['showgroups'] = $settings['enablegroups'] == "1";
$page['showstat'] = $settings['enablestatistics'] == "1";
$page['shownotifications'] = is_capable($can_viewnotifications, $operator);
$page['showadmin'] = is_capable($can_administrate, $operator);
$page['currentopid'] = $operator['operatorid'];
}
}
示例12: getsetting
function getsetting($settingname, $default)
{
global $settings;
loadsettings();
if (!isset($settings[$settingname])) {
savesetting($settingname, $default);
return $default;
} else {
if (trim($settings[$settingname]) == "") {
$settings[$settingname] = $default;
}
return $settings[$settingname];
}
}
示例13: insertobject
function insertobject($object, $taglevel, $charinfo = array(), $offset = 0)
{
global $settings, $cfg;
if (!preg_match('/^([0-9]+),([0-9]+)$/', $object->coords, $coords)) {
return;
}
//not be able to set object properly without coords
loadsettings($object, $taglevel);
foreach ($object->attributes() as $attributeskey => $attributesvalue) {
$attributes[$attributeskey] = "" . $attributesvalue;
}
switch ($attributes['class']) {
case "symbol_land":
$picture = "symbol_land";
break;
case "symbol_sea":
$picture = "symbol_sea";
break;
case "symbol_class":
if (!$charinfo['jobclass']) {
return;
}
switch ($charinfo['jobclass']) {
case "Saint":
$picture = "class_s";
break;
case "Shaman":
$picture = "class_s";
break;
case "Priest":
$picture = "class_s";
break;
case "Noble":
$picture = "class_n";
break;
case "Court Magician":
$picture = "class_n";
break;
case "Magic Knight":
$picture = "class_n";
break;
case "Mercenary":
$picture = "class_w";
break;
case "Guardian Swordsman":
$picture = "class_w";
break;
case "Gladiator":
$picture = "class_w";
break;
case "Explorer":
$picture = "class_e";
break;
case "Sniper":
$picture = "class_e";
break;
case "Excavator":
$picture = "class_e";
break;
default:
return;
}
break;
default:
return;
}
$picture = $cfg['signature_abs'] . "/objects/" . $picture;
if (!is_file($picture)) {
return;
}
// load objectpicture
global $Teilgrafik;
$info = getimagesize($picture);
if ($info[2] == 2) {
//JPEG / JPG
$objectpicture = imagecreatefromjpeg($picture);
} elseif ($info[2] == 3) {
//PNG
$objectpicture = imagecreatefrompng($picture);
} elseif ($info[2] == 1) {
// GIF
$objectpicture = imagecreatefromgif($picture);
} else {
//BMP
require_once $cfg['root_abs'] . "/convertbmp.php";
$objectpicture = imagecreatefrombmp($picture);
}
//some global options (not in loadsettings()?)
// if (isset($object->transparency) && 0<intval($object->transparency)) {
// $transparency = $object->transparency+0;
// }
// else { $transparency = 100; }
$width = imagesx($objectpicture);
$height = imagesy($objectpicture);
if (isset($object->height) && 0 < intval($object->height)) {
$height = $object->height + 0;
if (!$object->width) {
//if only height set, resize in width
$width = ceil(imagesx($objectpicture) * ($height / imagesy($objectpicture)));
}
//.........这里部分代码省略.........
示例14: loadsettings
<?php
function loadsettings()
{
// Instantiate the app
$path = __DIR__ . '/../app/settings.php';
if (!file_exists($path)) {
$settings = (require __DIR__ . '/../app/settings_dist.php');
} else {
$settings = (require $path);
}
return $settings;
}
$settings = ['settings' => loadsettings()];
示例15: workers
public function workers(Request $request, Response $response, array $args)
{
$data = [];
$settings = loadsettings();
$REDIS_BACKEND = $settings['resque']['REDIS_BACKEND'];
if (!empty($REDIS_BACKEND)) {
\Resque::setBackend($REDIS_BACKEND);
}
$workerlist = \Resque_Worker::all();
$workers = [];
foreach ($workerlist as $worker) {
$job = $worker->job();
if (empty($job)) {
$job = "Idle";
}
$workers[] = ['name' => (string) $worker, 'job' => $job];
}
$data['workers'] = $workers;
$this->view->render($response, 'workers.twig', $data);
return $response;
}