本文整理汇总了PHP中manageconfig::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP manageconfig::delete方法的具体用法?PHP manageconfig::delete怎么用?PHP manageconfig::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manageconfig
的用法示例。
在下文中一共展示了manageconfig::delete方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: pluginSettingGroupUninstall
function pluginSettingGroupUninstall($pluginid)
{
global $db;
$result = $db->query("SELECT id, name FROM {$db->pre}settings_groups WHERE name = 'module_{$pluginid}' LIMIT 1");
$row = $db->fetch_assoc($result);
$c = new manageconfig();
$c->getdata();
$result = $db->query("SELECT name FROM {$db->pre}settings WHERE sgroup = '{$row['id']}'");
while ($row2 = $db->fetch_assoc($result)) {
$c->delete(array($row['name'], $row2['name']));
}
$c->savedata();
$db->query("DELETE FROM {$db->pre}settings WHERE sgroup = '{$row['id']}'", __LINE__, __FILE__);
$db->query("DELETE FROM {$db->pre}settings_groups WHERE id = '{$row['id']}'", __LINE__, __FILE__);
}
示例3: foreach
}
}
foreach ($delete as $phrase) {
foreach ($langkeys as $key) {
unset($ini[$key][$phrase]);
}
}
$myini->write("modules/{$data['id']}/plugin.ini", $ini);
$result = $db->query('SELECT * FROM ' . $db->pre . 'language ORDER BY language', __LINE__, __FILE__);
$c = new manageconfig();
while ($row = $db->fetch_assoc($result)) {
$path = "language/{$row['id']}/modules.lng.php";
if (file_exists($path)) {
$c->getdata($path, 'lang');
foreach ($delete as $phrase) {
$c->delete($phrase);
}
$c->savedata();
}
}
ok('admin.php?action=packages&job=plugins_language&id=' . $data['id'], $lang->phrase('admin_packages_ok_selected_phrase_were_successfully_deleted'));
} elseif ($job == 'plugins_language_edit') {
echo head();
$phrase = $gpc->get('phrase', none);
$id = $gpc->get('id', int);
$result = $db->query("SELECT id, title FROM {$db->pre}packages WHERE id = '{$id}' LIMIT 1", __LINE__, __FILE__);
if ($db->num_rows($result) != 1) {
echo head();
error('javascript: self.close();', $lang->phrase('admin_packages_err_specified_package_foo_does_not_exist'));
}
$data = $db->fetch_assoc($result);
示例4: ok
$c->updateconfig(array($row['groupname'], $row['name']), none);
}
$c->savedata();
ok('admin.php?action=settings&job=custom&id=' . $id . '&package=' . $package);
} elseif ($job == 'delete') {
echo head();
$name = $gpc->get('name', str);
$id = $gpc->get('id', int);
$package = $gpc->get('package', int);
$db->query("DELETE FROM {$db->pre}settings WHERE name = '{$name}' AND sgroup = '{$id}' LIMIT 1");
$upd = $db->affected_rows();
if ($upd == 1) {
$result = $db->query("SELECT name FROM {$db->pre}settings_groups WHERE id = '{$id}'");
$row = $db->fetch_assoc($result);
$c->getdata();
$c->delete(array($row['name'], $name));
$c->savedata();
if ($package > 0) {
$ini = $myini->read("modules/{$package}/package.ini");
unset($ini['setting_' . $name]);
$myini->write("modules/{$package}/package.ini", $ini);
}
ok('admin.php?action=settings&job=custom&id=' . $id . '&package=' . $package, $lang->phrase('admin_setting_deleted'));
} else {
error('admin.php?action=settings&job=custom&id=' . $id . '&package=' . $package, $lang->phrase('admin_setting_not_available'));
}
} elseif ($job == 'delete_group') {
echo head();
$id = $gpc->get('id', int);
$package = $gpc->get('package', int);
$result = $db->query("\n\tSELECT s.name, g.name AS groupname\n\tFROM {$db->pre}settings AS s\n\t\tLEFT JOIN {$db->pre}settings_groups AS g ON s.sgroup = g.id\n\tWHERE s.sgroup = '{$id}'");
示例5: elseif
$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) {
$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();
}
}
echo "- Language files updated.<br />";
// Set incompatible packages inactive
setPackagesInactive();
echo "- Incompatible Packages set as 'inactive'.<br />";
// Refresh Cache
$dirs = array('../cache/', '../cache/modules/');
foreach ($dirs as $dir) {
if ($dh = @opendir($dir)) {
示例6:
$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);
$c->updateconfig('memberrating', int, 0);
$c->updateconfig('memberrating_counter', int, 0);
$c->updateconfig('postrating', int, 1);
$c->updateconfig('postrating_counter', int, 5);
$c->delete('register_text_verification');
$c->updateconfig('searchzahl', int, 10);
$c->updateconfig('smileypath', str, 'images/smileys');
$c->updateconfig('smileyurl', str, 'images/smileys');
$c->updateconfig('spider_logvisits', int, 1);
$c->updateconfig('spider_pendinglist', int, 0);
$c->updateconfig(array('module_1', 'relatednum'), int, 5);
$c->updateconfig(array('module_3', 'items'), int, 5);
$c->updateconfig(array('module_3', 'teaserlength'), int, 300);
$c->updateconfig(array('module_4', 'title'), str, 'Ticker');
$c->updateconfig(array('module_4', 'feed'), int, 1);
$c->updateconfig(array('module_7', 'text'), str, 'Willkommen in Ihrer <a href="http://www.viscacha.org" target="_blank">Viscacha</a>-Installation!');
$c->updateconfig(array('module_7', 'title'), str, 'Wichtige Nachricht!');
$c->updateconfig(array('module_9', 'topicnum'), int, 10);
$c->updateconfig(array('module_10', 'repliesnum'), int, 5);
$c->savedata();
示例7: manageconfig
$c = new manageconfig();
$c->getdata("language/{$id}/{$file}.lng.php", 'lang');
foreach ($sent as $post => $key) {
$c->updateconfig($key, str, $_REQUEST[$post]);
}
$c->savedata();
// Delete phrases from all languages
if (count($delete) > 0) {
$result = $db->query('SELECT * FROM '.$db->pre.'language ORDER BY language');
while($row = $db->fetch_assoc($result)) {
$path = "language/{$row['id']}/{$file}.lng.php";
if (file_exists($path)) {
$c->getdata($path, 'lang');
foreach ($delete as $key) {
$c->delete($key);
}
$c->savedata();
}
}
}
if ($file == 'javascript') {
$delobj = $scache->load('loadlanguage');
$delobj->delete();
}
ok('admin.php?action=language&job=lang_array&id='.$id.'&file='.$file.'&page='.$page);
}
elseif ($job == 'lang_default') {
echo head();
示例8: manageconfig
echo "- Hooks updated.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('fname', html_enc);
$c->updateconfig('fdesc', html_enc);
$c->updateconfig('spider_logvisits', int, 2);
$c->updateconfig('vote_change', int, 0);
$c->updateconfig('botgfxtest_width', int, 150);
$c->updateconfig('botgfxtest_height', int, 40);
$c->updateconfig('botgfxtest_recaptcha_private', str, '');
$c->updateconfig('botgfxtest_recaptcha_public', str, '');
$c->updateconfig('local_mode', int, 0);
$c->updateconfig('multiple_instant_notifications', int, 0);
$c->delete('always_send_js');
$c->delete('pdfcompress');
$c->delete('pdfdownload');
$c->delete('allow_http_auth');
$c->delete('botgfxtest_text_verification');
$c->delete('botgfxtest_posts_width');
$c->delete('botgfxtest_posts_height');
$c->savedata();
$c = new manageconfig();
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('checked_package_updates', int, 0);
$c->savedata();
echo "- Configuration updated.<br />";
// Old files
$filesystem->unlink('templates/lang2js.php');
$filesystem->unlink('classes/feedcreator/mbox.inc.php');
示例9: file
$db->setPersistence($config['pconnect']);
}
echo "- FTP class loaded, Database connection started.<br />";
// Hooks
$hooks = array_map('trim', file('admin/data/hooks.txt'));
removeHook($hooks, 'components_');
$hooks[] = '';
$hooks[] = 'admin/packages_admin.php';
$filesystem->file_put_contents('admin/data/hooks.txt', implode("\r\n", $hooks));
echo "- Hooks updated.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('spider_logvisits', int, 2);
$c->delete('always_send_js');
$c->savedata();
$c = new manageconfig();
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('checked_package_updates', int, 0);
$c->savedata();
echo "- Configuration updated.<br />";
// Old files
$filesystem->unlink('templates/lang2js.php');
$filesystem->unlink('classes/feedcreator/mbox.inc.php');
$feeds = file_get_contents('data/feedcreator.inc.php');
$feeds = preg_replace('~[\\r\\n]+MBOX\\|mbox\\.inc\\.php\\|MBox\\|\\d\\|\\d~i', '', $feeds);
$filesystem->file_put_contents('data/feedcreator.inc.php', $feeds);
$dir = dir('language');
while (false !== ($entry = $dir->read())) {
$path = "{$dir->path}/{$entry}";
示例10: elseif
} elseif ($job == 'custom2') {
echo head();
$c->getdata();
$result = $db->query("SELECT * FROM {$db->pre}settings ORDER BY name");
while ($row = $db->fetch_assoc($result)) {
$c->updateconfig($row['name'], str);
}
$c->savedata();
ok('admin.php?action=settings&job=custom');
} elseif ($job == 'delete') {
$name = $gpc->get('name', str);
$db->query("DELETE FROM {$db->pre}settings WHERE name = '{$name}' LIMIT 1");
$upd = $db->affected_rows();
if ($upd == 1) {
$c->getdata();
$c->delete($name);
$c->savedata();
ok('admin.php?action=settings&job=custom', 'Custom Setting deleted!');
} else {
error('admin.php?action=settings&job=custom', 'Custom setting not available or belongs to core settings.');
}
} elseif ($job == 'new') {
echo head();
?>
<form action="admin.php?action=settings&job=new2" method="post">
<table border="0" align="center" class="border">
<tr>
<td class="obox" colspan="2">Add Setting</td>
</tr>
<tr>
<td class="mbox" width="40%">Setting Title</td>
示例11: implode
removeHook($hooks, 'editprofile_copy_');
removeHook($hooks, 'popup_hlcode_');
removeHook($hooks, 'popup_code_');
insertHookAfter($hooks, 'showtopic_entry_added', 'showtopic_attachments_prepared');
$filesystem->file_put_contents('admin/data/hooks.txt', implode("\r\n", $hooks));
echo "- Hooks updated.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('doclang', int, $config['langdir']);
$c->updateconfig('error_reporting', str, 'E_ALL');
$c->updateconfig('login_attempts_blocktime', int, 60);
$c->updateconfig('login_attempts_max', int, 5);
$c->updateconfig('login_attempts_time', int, 60);
$c->delete('check_filesystem');
$c->delete('enable_jabber');
$c->delete('jabber_server');
$c->delete('jabber_user');
$c->delete('jabber_pass');
$c->delete('pspell');
$c->delete('smileysperrow');
$c->delete('spellcheck');
$c->delete('spellcheck_ignore');
$c->delete('spellcheck_mode');
$c->delete('vcard_dl');
$c->delete('vcard_dl_guests');
$c->savedata();
$c = new manageconfig();
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('checked_package_updates', int, 0);