本文整理汇总了PHP中rebuild_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP rebuild_settings函数的具体用法?PHP rebuild_settings怎么用?PHP rebuild_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rebuild_settings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_ip_with_dnsbl_deactivate
function check_ip_with_dnsbl_deactivate()
{
global $db;
$db->delete_query("settinggroups", "name = 'checkipwithdnsbl'");
$db->delete_query("settings", "name LIKE ('checkipwithdnsbl_%')");
rebuild_settings();
}
示例2: tags_activate
function tags_activate()
{
global $mybb, $db;
require_once MYBB_ROOT . 'inc/adminfunctions_templates.php';
// add settings
$query = $db->simple_select('settinggroups', 'gid', "name='tags'");
$gid = $db->fetch_field($query, 'gid');
$i = 0;
$settings = array(array("name" => "tags_enabled", "title" => "Enable Plugin", "description" => $db->escape_string('Set to "on" if you want Enable this plugin.'), "optionscode" => "onoff", "value" => tags_setting_value("tags_enabled", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_droptable", "title" => $db->escape_string('Drop table?'), "description" => $db->escape_string('Do you want the "tags" table droped when you uninstall this plugin?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_droptable", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_seo", "title" => "SEO Friendly URL", "description" => $db->escape_string('Do you want to use SEO URLs (ex: tag-***.html) for tags?<br />
You must add these codes to ".htaccess" file before set it to "On":
<pre style="background: #f7f7f7;border: 1px solid #ccc;padding: 6px;border-radius: 3px;direction: ltr;text-align: left;font-size: 12px;">
RewriteEngine <strong>on</strong>
RewriteRule <strong>^tag-(.*?)\\.html$ tag.php?name=$1</strong> <em>[L,QSA]</em>
RewriteRule <strong>^tag\\.html$ tag.php</strong> <em>[L,QSA]</em>
</pre>'), "optionscode" => "yesno", "value" => tags_setting_value("tags_seo", 0), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_forceseo", "title" => "Force users to use seo URLs?", "description" => $db->escape_string('Do you want to force users to use SEO URLs (ex: tag-***.html) for tags?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_forceseo", 0), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_urlscheme", "title" => "Tags URL scheme", "description" => $db->escape_string('Enter the Tag URL scheme. By default this is tag-{name}.html. Please note that if you change this, you will also need to add a new rewrite rule in your .htaccess file.'), "optionscode" => "text", "value" => tags_setting_value("tags_urlscheme", 'tag-{name}.html'), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_per_page", "title" => "Tags per page", "description" => $db->escape_string('How many tags shown in "Tags" page?'), "optionscode" => "text", "value" => tags_setting_value("tags_per_page", 10), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_limit", "title" => $db->escape_string('Limit Tags in "Index Page" and "Forum Display Page"'), "description" => $db->escape_string('How many tags shown in "Index Page" and "Forum Display Page" ?'), "optionscode" => "text", "value" => tags_setting_value("tags_limit", 50), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_index", "title" => $db->escape_string('Show tags in Index Page?'), "description" => $db->escape_string('Do you want tags shown in Index Page?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_index", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_forumdisplay", "title" => $db->escape_string('Show tags in "Forum Display" Page?'), "description" => $db->escape_string('Do you want tags shown in "Forum Display" Page?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_forumdisplay", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_max_thread", "title" => $db->escape_string('Maximun tags for a thread'), "description" => $db->escape_string('Please enter the maximum number of tags for threads. Set it to 0 for unlimited.'), "optionscode" => "text", "value" => tags_setting_value("tags_max_thread", 20), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_groups", "title" => $db->escape_string('Tags Moderators'), "description" => $db->escape_string('Please select the groups can edit "tags". please note who can edit tags, that can edit thread.'), "optionscode" => "groupselect", "value" => tags_setting_value("tags_groups", -1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_bad", "title" => $db->escape_string('Bad Tags'), "description" => $db->escape_string('Please enter the bad tags, this tags don\'t shown in tags list. enter each tags in new line'), "optionscode" => "textarea", "value" => tags_setting_value("tags_bad", ''), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_maxchars", "title" => $db->escape_string('Maximum tag length'), "description" => $db->escape_string('Please enter the maximum length that a tag can have'), "optionscode" => "text", "value" => tags_setting_value("tags_maxchars", 20), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_minchars", "title" => $db->escape_string('Minimum tag length'), "description" => $db->escape_string('Please enter the minimum length that a tag can have'), "optionscode" => "text", "value" => tags_setting_value("tags_minchars", 0), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_charreplace", "title" => $db->escape_string('Character Translation'), "description" => $db->escape_string('If you want translate some characters to other characters, you can use this setting.<br />
For example if you want replace "a" to "b" and "c" to "d" use this code:<br />
<pre style="background: #f7f7f7;border: 1px solid #ccc;padding: 6px;border-radius: 3px;direction: ltr;text-align: left;font-size: 12px;">
a=>b
c=>d
</pre>'), "optionscode" => "textarea", "value" => tags_setting_value("tags_charreplace", ''), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_disallowedforums", "title" => $db->escape_string('Disallowed forums'), "description" => $db->escape_string('Please select the forums you want "Tags" don\'t work on these.'), "optionscode" => "forumselect", "value" => tags_setting_value("tags_disallowedforums", 0), "disporder" => ++$i, "gid" => $gid));
$db->delete_query('settings', "gid = '{$gid}'");
$db->insert_query_multiple("settings", $settings);
rebuild_settings();
find_replace_templatesets('newthread', '#' . preg_quote('{$posticons}') . '#', '{$tags}{$posticons}');
find_replace_templatesets('editpost', '#' . preg_quote('{$posticons}') . '#', '{$tags}{$posticons}');
find_replace_templatesets('showthread', '#' . preg_quote('{$ratethread}') . '#', '{$ratethread}{$tags}');
find_replace_templatesets('showthread', '#' . preg_quote('{$headerinclude}') . '#', '<meta name="keywords" content="{$thread[\'tags_meta\']}" />{$headerinclude}');
find_replace_templatesets('index', '#' . preg_quote('{$forums}') . '#', '{$forums}{$tags}');
find_replace_templatesets('forumdisplay', '#' . preg_quote('{$threadslist}') . '#', '{$threadslist}{$tags}');
}
示例3: user_tagging_uninstall
function user_tagging_uninstall()
{
global $db;
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name IN ('user_tagging_on','user_tagging_subject','user_tagging_body')");
$db->query("DELETE FROM " . TABLE_PREFIX . "settinggroups WHERE name='user_tagging'");
rebuild_settings();
}
示例4: rpgsuite_activate
/**
Activate Plugin
*/
function rpgsuite_activate()
{
global $db;
reverse_template_edits();
apply_template_edits();
// Add any tables for upgrading
if (!$db->table_exists("otms")) {
$db->write_query("CREATE TABLE " . TABLE_PREFIX . "otms (id int(11) NOT NULL AUTO_INCREMENT, name VARCHAR(500), type VARCHAR(100), value VARCHAR(2000), PRIMARY KEY(id))");
}
// If we have new settings, add them!
$settinggroup = $db->simple_select('settinggroups', 'gid', 'name = \'rpgsuite\'');
$group = $db->fetch_array($settinggroup);
$settings = build_settings($group['gid']);
foreach ($settings as $setting) {
$settingquery = $db->simple_select('settings', 'sid', 'name = \'' . $setting['name'] . '\'');
if (!$settingquery->num_rows) {
$db->insert_query('settings', $setting);
}
}
rebuild_settings();
// If we have new templates, add them, but only if they exist!
// Lonely Thread Templates
require_once MYBB_ROOT . "/inc/plugins/rpg_suite/templatesets/class_LonelyThreadSet.php";
$templateset = new LonelyThreadSet($db);
$templateset->create();
// OTM Templates
require_once MYBB_ROOT . "/inc/plugins/rpg_suite/templatesets/class_OtmSet.php";
$templateset = new OtmSet($db);
$templateset->create();
}
示例5: smash_christmas_lights_uninstall
function smash_christmas_lights_uninstall()
{
global $db;
$db->delete_query('settings', "name IN ('scl_lights_smashable','scl_lights_size','scl_sounds_enable')");
$db->delete_query('settinggroups', "name = 'smash_christmas_lights_settings'");
rebuild_settings();
}
示例6: PHP_files_cleaner_deactivate
function PHP_files_cleaner_deactivate()
{
global $db;
$db->delete_query('settings', "name LIKE 'PHP\\_files\\_cleaner\\_%'");
$db->delete_query('settinggroups', "name = 'PHP_files_cleaner'");
rebuild_settings();
}
示例7: update
private function update()
{
global $db, $mybb, $cache, $lang;
$new_settings = $drop_settings = array();
// Get the gid
$query = $db->simple_select("settinggroups", "gid", "name='mytwconnect'");
$gid = (int) $db->fetch_field($query, "gid");
// 1.0.2
if (version_compare($this->old_version, '1.0.1', "<")) {
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
find_replace_templatesets('mytwconnect_usercp_settings', '#' . preg_quote('<input type="submit" value="{$lang->mytwconnect_settings_save}" />') . '#i', '<input type="submit" class=\\"button\\" value="{$lang->mytwconnect_settings_save}" />{$unlink}');
}
// 2.0
if (version_compare($this->old_version, '2.0', "<")) {
$new_settings[] = array("name" => "mytwconnect_twavatar", "title" => $db->escape_string($lang->setting_mytwconnect_twavatar), "description" => $db->escape_string($lang->setting_mytwconnect_twavatar_desc), "optionscode" => "yesno", "value" => 1, "disporder" => 30, "gid" => $gid);
$new_settings[] = array("name" => "mytwconnect_tweet", "title" => $db->escape_string($lang->setting_mytwconnect_tweet), "description" => $db->escape_string($lang->setting_mytwconnect_tweet_desc), "optionscode" => "yesno", "value" => 0, "disporder" => 31, "gid" => $gid);
$new_settings[] = array("name" => "mytwconnect_tweet_message", "title" => $db->escape_string($lang->setting_mytwconnect_tweet_message), "description" => $db->escape_string($lang->setting_mytwconnect_tweet_message_desc), "optionscode" => "textarea", "value" => $lang->mytwconnect_default_tweet, "disporder" => 32, "gid" => $gid);
// Let's at least try to change that, anyway, 2.0 has backward compatibility so it doesn't matter if this fails
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
find_replace_templatesets('header_welcomeblock_guest', '#' . preg_quote('twlogin') . '#i', 'login');
}
if ($new_settings) {
$db->insert_query_multiple('settings', $new_settings);
}
if ($drop_settings) {
$db->delete_query('settings', "name IN ('mytwconnect_" . implode("','mytwconnect_", $drop_settings) . "')");
}
rebuild_settings();
// Update the current version number and redirect
$this->plugins[$this->info['name']] = array('title' => $this->info['name'], 'version' => $this->version);
$cache->update('shade_plugins', $this->plugins);
flash_message($lang->sprintf($lang->mytwconnect_success_updated, $this->old_version, $this->version), "success");
admin_redirect($_SERVER['HTTP_REFERER']);
}
示例8: chatcat_deactivate
function chatcat_deactivate()
{
global $db;
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name IN ('chatcat_enable','chatcat_enable_api', 'chatcat_secret','chatcat_enable_login','chatcat_enable_register','chatcat_enable_primary')");
$db->query("DELETE FROM " . TABLE_PREFIX . "settinggroups WHERE name='chatcat'");
rebuild_settings();
}
示例9: yuieditor_uninstall
function yuieditor_uninstall()
{
global $db;
$groupid = $db->fetch_field($db->simple_select('settinggroups', 'gid', "name='yuieditor'"), 'gid');
$db->delete_query('settings', 'gid=' . $groupid);
$db->delete_query("settinggroups", "name = 'yuieditor'");
rebuild_settings();
}
示例10: cloudflare_uninstall
function cloudflare_uninstall()
{
global $db;
$db->query("DELETE FROM " . TABLE_PREFIX . "settinggroups WHERE name='cloudflare'");
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name LIKE 'cloudflare_%'");
$db->query("DELETE FROM " . TABLE_PREFIX . "datacache WHERE title='cloudflare_calls'");
rebuild_settings();
}
示例11: reportthread_uninstall
function reportthread_uninstall()
{
global $db;
$db->query("DELETE FROM `" . TABLE_PREFIX . "settinggroups` WHERE `name` = 'reportthread' LIMIT 1;");
$db->query("DELETE FROM `" . TABLE_PREFIX . "settings` WHERE `name` = 'rtt_enabled' LIMIT 1;");
$db->query("DELETE FROM `" . TABLE_PREFIX . "settings` WHERE `name` = 'rtt_fid' LIMIT 1;");
rebuild_settings();
}
示例12: purgesoftdeleted_deactivate
function purgesoftdeleted_deactivate()
{
global $db, $mybb;
// Remove task from task manager
$db->delete_query('tasks', 'file=\'purgesoftdeleted\'');
// Delete Purge soft deleted task
// Rebuild settings
rebuild_settings();
}
示例13: miunashoutbox_uninstall
function miunashoutbox_uninstall()
{
global $db;
//Delete Settings
$groupid = $db->fetch_field($db->simple_select('settinggroups', 'gid', "name='miunashoutbox'"), 'gid');
$db->delete_query('settings', 'gid=' . $groupid);
$db->delete_query("settinggroups", "name = 'miunashoutbox'");
rebuild_settings();
}
示例14: ragtek_eventcalendar_activate
function ragtek_eventcalendar_activate()
{
global $db;
$eventcalendar_group = array("gid" => "NULL", "name" => "eventcalendar_settings", "title" => "Eventkalender Einstellungen", "description" => "Einstellungen", "disporder" => "3", "isdefault" => "no");
$db->insert_query("settinggroups", $eventcalendar_group);
$gid = $db->insert_id();
$eventcalendar_setting_1 = array("sid" => "NULL", "name" => "eventcal_id", "title" => "Mit welchem Forum soll der Kalender verbunden werden", "description" => "Geben Sie hier die Foren ID ein.", "optionscode" => "text", "value" => '', "disporder" => '1', "gid" => intval($gid));
$db->insert_query("settings", $eventcalendar_setting_1);
rebuild_settings();
}
示例15: jrs_presentation_deactivate
function jrs_presentation_deactivate()
{
global $db, $message, $lang;
$lang->load('jrs_presentation');
$db->delete_query('settinggroups', "name = 'Jrs- Presentation'");
$db->delete_query('settings', "name = 'jrs_presentation_active_message'");
$db->delete_query('settings', "name = 'jrs_presentation_fid'");
$db->delete_query('settings', "name = 'jrs_presentation_message'");
$message = $lang->jrs_message_deactivate;
rebuild_settings();
}