vBulletin は、「設定」テーブルから直接設定にアクセスしません。
この情報は vBulletin 4.x のものであり、他のバージョンと同じである場合と異なる場合があります。
設定が保存されると、それらはシリアル化され、「データストア」テーブルに保存されます。vBulletin は、アクティブな使用のために「データストア」テーブルからデータを取得します。
次の手順を使用する必要はありませんでしたが、PhpMyAdmin を介してデータストアと設定テーブルの両方で「bburl」エントリのプロトコルを変更してテストしました。
探している特定の設定はすべて「オプション」配列に格納されています。
変更する設定の現在のデータまたは変数名がわかっている場合は、シリアル化された文字列でそれらを検索し、新しい設定に置き換えることができます。
アクティブなボードの設定は次のようになります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>";
「datastore」テーブルに移動し、「title」フィールドで「options」エントリを見つけます。
「オプション」エントリに関連付けられた「データ」フィールドからシリアル化されたデータをコピーします。変更によって問題が発生した場合に備えて、必ずバックアップしてください。
変更する項目をデータ内で検索します。データを変更するときは、そのエントリに関連付けられている長さを更新して、正しいシリアル化された形式を使用していることを確認してください。
「datastore」テーブルの「options」エントリを、変更されたシリアル化されたデータで更新し、設定テーブルの個々のエントリを更新します。
「設定」テーブルと「データストア」テーブルを更新する関数は次の場所にあります。
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;
}