vBulletin不直接從「設置」表訪問設置。
此信息用於vBulletin 4.x,它可能與其他版本相同,也可能不同。
保存設置後,它們將被序列化並存儲在「數據存儲」表中。 vBulletin從「數據存儲」表中提取數據以供活動使用。
我還沒有需要使用下面的步驟,但我通過改變「bburl」條目的協議都通過phpMyAdmin的數據存儲和設置表對它們進行測試。
您正在查找的特定設置都存儲在「選項」數組中。
如果您知道要更改的設置的當前數據或變量名稱,則可以在序列化的字符串中搜索它們並將其替換爲新設置。
一個活躍板的設置是這樣的:s:8:"bbactive";i:1;
的原因是這樣的:
s:14:"bbclosedreason";s:125:"<p>Sorry, the board is unavailable at the moment while we are testing some functionality.</p>
<p>We will be back soon...</p>";
轉到「數據存儲」表,發現在「選項」項中的「標題「字段。
從與「選項」條目關聯的「數據」字段複製序列化的數據。一定要備份它,以防您的更改導致問題。
在數據中搜索要更改的項目,當您更改數據時,請確保通過更新與該條目相關聯的長度來使用正確的序列化格式。
使用修改的序列化數據更新「數據存儲」表中的「選項」條目,並更新設置表中的單個條目。
,更新「設置」和「數據存儲」表就設在這裏的功能:
includes\adminfunctions.php
,大約在第號2474(取決於您的版本)。
// #############################################################################
/**
* Reads settings from the settings then saves the values to the datastore
*
* After reading the contents of the setting table, the function will rebuild
* the $vbulletin->options array, then serialize the array and save that serialized
* array into the 'options' entry of the datastore in the database
*
* @return array The $vbulletin->options array
*/
function build_options()
{
require_once(DIR . '/includes/adminfunctions_options.php');
global $vbulletin;
$vbulletin->options = array();
$settings = $vbulletin->db->query_read("SELECT varname, value, datatype FROM " . TABLE_PREFIX . "setting");
while ($setting = $vbulletin->db->fetch_array($settings))
{
$vbulletin->options["$setting[varname]"] = validate_setting_value($setting['value'], $setting['datatype'], true, false);
}
if (substr($vbulletin->options['cookiepath'], -1, 1) != '/')
{
$vbulletin->options['cookiepath'] .= '/';
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "setting
SET value = '" . $vbulletin->db->escape_string($vbulletin->options['cookiepath']) . "'
WHERE varname = 'cookiepath'
");
}
build_datastore('options', serialize($vbulletin->options), 1);
return $vbulletin->options;
}