本文整理汇总了PHP中manageconfig::updateconfig方法的典型用法代码示例。如果您正苦于以下问题:PHP manageconfig::updateconfig方法的具体用法?PHP manageconfig::updateconfig怎么用?PHP manageconfig::updateconfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manageconfig
的用法示例。
在下文中一共展示了manageconfig::updateconfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateLanguageFiles
function updateLanguageFiles($ini)
{
$c = new manageconfig();
$codes = array();
$keys = array('language', 'language_de');
$codes = getLangCodesByKeys($keys);
$langcodes = getLangCodes();
foreach ($langcodes as $code => $lid) {
$ldat = explode('_', $code);
if (isset($codes[$ldat[0]])) {
$count = count($codes[$ldat[0]]);
if (in_array('', $codes[$ldat[0]])) {
$count--;
}
} else {
$count = -1;
}
if (isset($codes[$ldat[0]]) && !empty($ldat[1]) && in_array($ldat[1], $codes[$ldat[0]])) {
// Nehme Original
$src = 'language_' . $code;
} elseif (isset($codes[$ldat[0]]) && in_array('', $codes[$ldat[0]])) {
// Nehme gleichen Langcode, aber ohne Countrycode
$src = 'language_' . $ldat[0];
} elseif (isset($codes[$ldat[0]]) && $count > 0) {
// Nehme gleichen Langcode, aber falchen Countrycode
$src = 'language_' . $ldat[0] . '_' . reset($codes[$ldat[0]]);
} else {
// Nehme Standard
$src = 'language';
}
foreach ($ini as $file => $data) {
if (!isset($data[$src])) {
continue;
}
$c->getdata("language/{$lid}/{$file}.lng.php", 'lang');
foreach ($data[$src] as $varname => $text) {
if ($text === null) {
$c->delete($varname);
} else {
$c->updateconfig($varname, str, $text);
}
}
$c->savedata();
}
}
}
示例2: manageconfig
echo IMPTYPE_PACKAGE;
?>
"><?php
echo $lang->phrase('admin_packages_browser_details');
?>
</a>
</td>
</tr>
<?php
}
?>
</table>
<?php
$c = new manageconfig();
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('checked_package_updates', int, 1);
$c->savedata();
echo foot();
}
} elseif ($job == 'browser') {
$pb = $scache->load('package_browser');
$types = $pb->types();
$type = $gpc->get('type', int, IMPTYPE_PACKAGE);
$cats = $pb->categories($type);
if (count($cats) > 0) {
// Calculate random entry
unset($cat);
$i = 0;
do {
$keys = array_keys($cats);
shuffle($keys);
示例3: foot
</tr>
<td class="ubox" colspan="2" align="center"><input type="submit" name="Submit2" value="<?php
echo $lang->phrase('admin_form_submit');
?>
" /></td>
</tr>
</table>
</form>
<?php
echo foot();
} elseif ($job == 'admin2') {
echo head();
$server = trim($gpc->get('package_server', none));
$server = preg_replace("~(\r\n|\r|\n)~", ";", $server);
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('nav_interface', int);
$c->updateconfig('package_server', str, $server);
$c->updateconfig('nav_positions', str);
$temp = $gpc->get('temp', int);
if ($temp == 1) {
$my->settings['default_language'] = $gpc->get('default_language', int);
} else {
$c->updateconfig('default_language', int);
}
$c->savedata();
ok('admin.php?action=settings&job=settings');
} elseif ($job == 'ftp') {
$temp = $config;
if ($gpc->get('change', int) == 1) {
$temp['ftp_server'] = $gpc->get('ftp_server', none);
$temp['ftp_port'] = $gpc->get('ftp_port', int);
示例4: copyr
if (file_exists($tpldir)) {
$filesystem->chmod($tpldir, 0777);
} else {
$filesystem->mkdir($tpldir, 0777);
}
$temptpldir = "{$tempdir}templates/";
copyr($temptpldir, $tpldir);
rmdirr($temptpldir);
}
copyr($tempdir, $dir);
if (isset($ini['language']) && count($ini['language']) > 0) {
$result = $db->query("SELECT id FROM {$db->pre}language", __LINE__, __FILE__);
while ($row = $db->fetch_assoc($result)) {
$c->getdata("language/{$row['id']}/modules.lng.php", 'lang');
foreach ($ini['language'] as $varname => $text) {
$c->updateconfig($varname, str, $text);
}
$c->savedata();
}
}
if (isset($ini['php']) && count($ini['php']) > 0) {
foreach ($ini['php'] as $hook => $plugfile) {
if (isInvisibleHook($hook)) {
continue;
}
$result = $db->query("SELECT MAX(ordering) AS maximum FROM {$db->pre}plugins WHERE position = '{$hook}'", __LINE__, __FILE__);
$row = $db->fetch_assoc($result);
$priority = $row['maximum'] + 1;
$db->query("\n\t\t\t\tINSERT INTO {$db->pre}plugins \n\t\t\t\t(`name`,`module`,`ordering`,`active`,`position`) \n\t\t\t\tVALUES \n\t\t\t\t('{$ini['info']['title']}','{$packageid}','{$priority}','0','{$hook}')\n\t\t\t\t", __LINE__, __FILE__);
$filesystem->unlink('cache/modules/' . $plugins->_group($hook) . '.php');
}
示例5: trim
}
if (isset($_REQUEST['database'])) {
$config['database'] = trim($_REQUEST['database']);
}
if (isset($_REQUEST['pconnect'])) {
$config['pconnect'] = $_REQUEST['pconnect'];
}
if (isset($_REQUEST['dbprefix'])) {
$config['dbprefix'] = trim($_REQUEST['dbprefix']);
}
if (isset($_REQUEST['dbsystem'])) {
$config['dbsystem'] = $_REQUEST['dbsystem'];
}
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('host', str);
$c->updateconfig('dbuser', str);
$c->updateconfig('dbpw', str);
$c->updateconfig('database', str);
$c->updateconfig('pconnect', int);
$c->updateconfig('dbprefix', str);
$c->updateconfig('dbsystem', str);
$c->savedata();
?>
<div class="bfoot center">Database Settings saved!</div>
<?php
}
require '../data/config.inc.php';
require_once '../classes/database/' . $config['dbsystem'] . '.inc.php';
$db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], false, $config['dbprefix']);
$db->pre = $db->prefix();
示例6: foreach
$glob['editprofile_pic_delete'] = 'Delete Avatar';
$glob['forum_is_read_only'] = 'Sorry, but you are not allowed to write a post in this forum, because this forum is read only.';
$glob['no_board_rules_specified'] = 'No forum rules specified!';
$glob['no_existing_notices'] = 'You did not store any notes!';
$glob['showtopic_options_abo_remove'] = 'Unsubscribe from this topic';
$glob['subscribed_successfully'] = 'You successfully subscribed to this topic.';
$glob['unsubscribed_successfully'] = 'You successfully unsubscribed from this topic.';
$glob['upload_error_default'] = 'An unknown error occured while uploading.';
$glob['showtopic_prefix_title'] = '[{$prefix}] ';
$glob['upload_error_fileexists'] = 'File already exists.';
$glob['upload_error_maximagesize'] = 'Max. imagesize reached. Image is not allowed to be greater than {$miw} x {$mih}.';
$glob['upload_error_noaccess'] = 'Access denied. Could not copy file.';
foreach ($lngids as $lid) {
$c->getdata('../language/' . $lid . '/global.lng.php', 'lang');
foreach ($glob as $key => $val) {
$c->updateconfig($key, str, $val);
}
$c->savedata();
$c->getdata('../language/' . $lid . '/wwo.lng.php', 'lang');
foreach ($wwo as $key => $val) {
$c->updateconfig($key, str, $val);
}
$c->savedata();
}
// templates
$file = '../templates/editor/rte.css';
$edit = file_get_contents($file);
$edit = preg_replace("~(.rteBk tbody tr td, .rteBk tr td {[\r\n]+)~i", "\\1\tborder-width: 0px;\r\n", $edit);
$filesystem->chmod($file, 0666);
$filesystem->file_put_contents($file, $edit);
$dir = "../templates/";
示例7: foot
</table>
<?php
}
?>
<?php
echo foot();
} elseif ($job == 'design_default') {
echo head();
$id = $gpc->get('id', int);
$result = $db->query("SELECT publicuse FROM {$db->pre}designs WHERE id = '{$id}' LIMIT 1");
$info = $db->fetch_assoc($result);
if ($info['publicuse'] == 1) {
include 'classes/class.phpconfig.php';
$c = new manageconfig();
$c->getdata();
$c->updateconfig('templatedir', int, $id);
$c->savedata();
$delobj = $scache->load('loaddesign');
$delobj->delete();
ok('admin.php?action=designs&job=design');
} else {
error('admin.php?action=designs&job=design', $lang->phrase('admin_design_set_design_as_default_error'));
}
} elseif ($job == 'design_edit') {
$id = $gpc->get('id', int);
$result = $db->query("SELECT * FROM {$db->pre}designs WHERE id = '{$id}' LIMIT 1");
$info = $db->fetch_assoc($result);
$dir = "templates/";
$templates = array();
$d = dir($dir);
while (false !== ($entry = $d->read())) {
示例8: filesystem
<?php
include 'data/config.inc.php';
if (isset($_REQUEST['save']) && $_REQUEST['save'] == 1) {
require_once 'install/classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path'], $config['fpath']);
include 'install/classes/class.phpconfig.php';
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('fname', str);
$c->updateconfig('fname', str);
$c->updateconfig('fdesc', str);
$c->updateconfig('furl', str);
$c->updateconfig('fpath', str);
$c->updateconfig('forenmail', str);
$c->updateconfig('cookie_prefix', str);
$c->updateconfig('langdir', int);
$langdir = $c->data['langdir'];
if (empty($c->data['cryptkey']) == true) {
$c->updateconfig('cryptkey', str, md5(microtime()));
}
$c->updateconfig('foffline', int, 1);
$c->updateconfig('version', str, VISCACHA_VERSION);
if (!empty($c->data['forenmail']) && empty($c->data['pccron_sendlog_email'])) {
$c->updateconfig('pccron_sendlog_email', str, $c->data['forenmail']);
}
$c->savedata();
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('default_language', int, 0);
$c->savedata();
示例9: filesystem
echo $step - 1;
?>
">Go back</a></div>
<?php
} else {
$ftp->chdir('install');
$ftp->chmod('../data/config.inc.php', 0666);
$ftp->cdup();
$ftp->quit();
require_once '../classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path']);
include '../classes/class.phpconfig.php';
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('ftp_server', str);
$c->updateconfig('ftp_user', str);
$c->updateconfig('ftp_pw', str);
$c->updateconfig('ftp_path', str);
$c->updateconfig('ftp_port', int);
$c->savedata();
?>
</pre></div>
<div class="bfoot center">FTP Settings saved!<br />Connection: OK!</div>
<?php
}
}
}
}
if (!isset($filesystem)) {
include '../data/config.inc.php';
示例10: filesystem
if (!class_exists('filesystem')) {
require_once 'install/classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path'], $config['fpath']);
}
echo "- FTP class loaded and initialized.<br />";
if (!class_exists('DB')) {
require_once 'install/classes/database/' . $config['dbsystem'] . '.inc.php';
$db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['dbprefix']);
$db->setPersistence($config['pconnect']);
}
echo "- Database class loaded and initialized.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->savedata();
echo "- Configuration updated.<br />";
// Languages
$ini = array('settings' => array('language_de' => array('compatible_version' => VISCACHA_VERSION), 'language' => array('compatible_version' => VISCACHA_VERSION)), 'admin/frames' => array('language_de' => array('admin_scheduler_log' => 'Protokoll der geplanten Aufgaben')), 'classes' => array('language_de' => array('mailer_encoding' => 'Unbekanntes Encoding-Format: ', 'mailer_execute' => 'Konnte folgenden Befehl nicht ausführen: ', 'mailer_file_access' => 'Zugriff auf folgende Datei fehlgeschlagen: ', 'mailer_file_open' => 'Datei Fehler: Konnte folgende Datei nicht öffnen: ', 'mailer_from_failed' => 'Die folgende Absenderadresse ist nicht korrekt: ', 'mailer_recipients_failed' => 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ', 'mailer_signing' => 'Fehler beim Signieren: ', 'mailer_empty_message' => 'E-Mail Inhalt ist leer.', 'mailer_invalid_address' => 'E-Mail wird nicht gesendet, die Adresse ist ungültig.', 'mailer_smtp_connect_failed' => 'Verbindung zu SMTP Server fehlgeschlagen.', 'mailer_smtp_error' => 'Fehler vom SMTP Server: ', 'mailer_variable_set' => 'Kann Variable nicht setzen oder zurücksetzen: '), 'language' => array('mailer_authenticate' => 'SMTP Error: Could not authenticate.', 'mailer_connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'mailer_data_not_accepted' => 'SMTP Error: Data not accepted.', 'mailer_encoding' => 'Unknown encoding: ', 'mailer_execute' => 'Could not execute: ', 'mailer_file_access' => 'Could not access file: ', 'mailer_file_open' => 'File Error: Could not open file: ', 'mailer_from_failed' => 'The following From address failed: ', 'mailer_instantiate' => 'Could not instantiate mail function.', 'mailer_mailer_not_supported' => ' mailer is not supported.', 'mailer_provide_address' => 'You must provide at least one recipient email address.', 'mailer_recipients_failed' => 'SMTP Error: The following recipients failed: ', 'mailer_empty_message' => 'Message body empty', 'mailer_invalid_address' => 'Invalid address', 'mailer_smtp_connect_failed' => 'SMTP Connect() failed.', 'mailer_smtp_error' => 'SMTP server error: ', 'mailer_variable_set' => 'Cannot set or reset variable: ')), 'global' => array('language_de' => array('digest_d' => 'Tägliche E-Mail-Benachrichtigung', 'digest_none' => 'Keine Benachrichtigung', 'img_captcha_session_expired_error' => 'Seite aktualisieren', 'digest_f' => 'Nur Favorit'), 'language' => array('digest_none' => 'No notification', 'img_captcha_session_expired_error' => 'Refresh page', 'digest_f' => 'Favorite only')));
updateLanguageFiles($ini);
echo "- Language files updated.<br />";
$newCss = file_get_contents('temp/standard.css');
$dir = dir('designs');
while (false !== ($entry = $dir->read())) {
if (is_id($entry)) {
$path = "{$dir->path}/{$entry}/standard.css";
$css = file_get_contents($path);
if (!empty($css)) {
$css .= $newCss;
if (!$filesystem->file_put_contents($path, $css)) {
示例11: filesystem
require_once '../classes/class.phpconfig.php';
if (!class_exists('filesystem')) {
require_once '../classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path']);
}
if (!class_exists('DB')) {
require_once '../classes/database/' . $config['dbsystem'] . '.inc.php';
$db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], true, $config['dbprefix']);
$db->pre = $db->prefix();
$db->errlogfile = '../' . $db->errlogfile;
}
// data
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('disableregistration', int, 0);
$c->updateconfig('hidedesign', int, 0);
$c->updateconfig('hidelanguage', int, 0);
$c->updateconfig('mlist_fields', str, 'fullname,pm,regdate,hp,icq,yahoo,aol,msn,jabber,skype');
$c->updateconfig('mlist_filtergroups', int, 0);
$c->updateconfig('mlist_showinactive', int, 0);
$c->updateconfig('register_notification', str, '');
$c->updateconfig('updatepostcounter', int, 1);
$c->savedata();
$d = file('../data/cron/crontab.inc.php');
$d = array_map('trim', $d);
$d[] = '0 */6 * * * recountpostcounts.php #Recount User Post Counter';
$filesystem->file_put_contents('../data/cron/crontab.inc.php', implode("\n", $d));
$filesystem->unlink('../images/1/bbcodes/wiki.gif');
$db->query("ALTER TABLE `{$db->pre}forums` ADD `count_posts` enum('0','1') NOT NULL default '1' AFTER `last_topic`", __LINE__, __FILE__);
示例12: filesystem
require_once 'lib/function.variables.php';
if (!class_exists('filesystem')) {
require_once '../classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path']);
}
if (!class_exists('DB')) {
require_once '../classes/database/' . $config['dbsystem'] . '.inc.php';
$db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], true, $config['dbprefix']);
$db->pre = $db->prefix();
$db->errlogfile = '../' . $db->errlogfile;
}
include '../classes/class.phpconfig.php';
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('abozahl', int, 20);
$c->updateconfig('activezahl', int, 20);
$c->updateconfig('botgfxtest_colortext', int, 1);
$c->updateconfig('botgfxtest_format', str, 'jpg');
$c->updateconfig('botgfxtest_height', int, 50);
$c->updateconfig('botgfxtest_posts', int, 1);
$c->updateconfig('botgfxtest_posts_height', int, 40);
$c->updateconfig('botgfxtest_posts_width', int, 170);
$c->updateconfig('botgfxtest_quality', int, 80);
$c->updateconfig('botgfxtest_text_verification', int, 0);
$c->updateconfig('botgfxtest_width', int, 175);
$c->updateconfig('error_handler', int, 0);
$c->updateconfig('error_log', int, 0);
$c->updateconfig('guest_email_optional', int, 0);
$c->updateconfig('mineditlength', int, 0);
示例13: foot
</form>
<?php
echo foot();
}
elseif ($job == 'phrase_add2') {
echo head();
$source_id = $gpc->get('id', int);
$file = $gpc->get('file', path);
$varname = $gpc->get('varname', none);
$text = $gpc->get('text', none);
$language = $gpc->get('langt', arr_none);
$c = new manageconfig();
foreach ($language as $id => $t) {
$c->getdata("language/{$id}/{$file}.lng.php", 'lang');
$c->updateconfig($varname, str, iif(empty($t), $text, $t));
$c->savedata();
}
if ($file == 'javascript') {
$delobj = $scache->load('loadlanguage');
$delobj->delete();
}
if (is_id($source_id))
ok('admin.php?action=language&job=lang_array&id='.$source_id.'&file='.$file);
else
ok('admin.php?action=language&job=phrase_add&file='.$file);
}
else {
sendStatusCode(307, $config['furl'].'/admin.php?action=language&job=manage');
示例14: DB
$db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['dbprefix']);
$db->setPersistence($config['pconnect']);
}
echo "- Database class loaded and initialized.<br />";
$fields = array_map('strtolower', $db->list_fields($db->pre.'forums'));
if (!in_array('post_order', $fields)) {
$db->query("ALTER TABLE `{$db->pre}forums` ADD `post_order` enum('-1','0','1') NOT NULL DEFAULT '-1'");
}
echo "- Database structure updated.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('post_order', int, 0);
$c->savedata();
echo "- Configuration updated.<br />";
// Languages
$ini = array (
'admin/cms' =>
array (
'language_de' =>
array (
'admin_cms_nav_title_text' => 'Um Phrasen aus der benutzerdefinierten Sprachdatei für diesen Eintrag zu benutzen, ist der folgende Code vorgesehen: <code>lang->key</code>. Dabei ist <code>key</code> der Schlüssel (interne Name) der jeweiligen zu nutzenden Phrase. <a href="admin.php?action=language&job=phrase_file&file=Y3VzdG9tLmxuZy5waHA%3D" target="_blank">Öffne die Verwaltung für benutzerdefinierte Phrasen.</a><br />Die Titel der Dokumente können für die Verlinkung ebenfalls verwendet werden. Dazu einfach den Code <code>doc->ID</code> verwenden. <code>ID</code> ist dabei die ID des Dokuments, das Sie verlinken möchten. Dieser Code wird automatisch bei Auswahl über die Seite "Existierende Dokumente" erzeugt.',
),
'language' =>
array (
示例15: foot
<td class="mbox" width="50%"><input type="password" name="ftp_pw" value="<?php
echo $config['ftp_pw'];
?>
" size="50"></td>
</tr>
</tr>
<td class="ubox" width="100%" colspan="2" align="center"><input type="submit" name="Submit" value="Abschicken"></td>
</tr>
</table>
</form>
<?php
echo foot();
} elseif ($job == 'ftp2') {
echo head();
$c->getdata();
$c->updateconfig('ftp_server', str);
$c->updateconfig('ftp_user', str);
$c->updateconfig('ftp_pw', str);
$c->updateconfig('ftp_path', str);
$c->updateconfig('ftp_port', int);
$c->savedata();
ok('admin.php?action=settings&job=ftp');
} elseif ($job == 'posts') {
$config = $gpc->prepare($config);
echo head();
?>
<form name="form" method="post" action="admin.php?action=settings&job=posts2">
<table class="border" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="obox" colspan="2"><b>Beiträge & Themen</b></td>
</tr>