Php 编辑vBulletin数据库对网站没有影响
这是我在使用多个vBulletin数据库时一直遇到的问题。我无法编辑数据库以更改设置,例如cookiepath、bburl或它是否处于活动状态。我的意思是,我可以使用PHPMyAdmin更改它们,但效果在站点上没有更改 现在,我失去了对旧安装的访问,需要更改关闭原因、bburl等。我更改了关闭原因的文本,但它仍然显示以前的文本,电路板仍然关闭,bburl仍然错误Php 编辑vBulletin数据库对网站没有影响,php,mysql,serialization,vbulletin,Php,Mysql,Serialization,Vbulletin,这是我在使用多个vBulletin数据库时一直遇到的问题。我无法编辑数据库以更改设置,例如cookiepath、bburl或它是否处于活动状态。我的意思是,我可以使用PHPMyAdmin更改它们,但效果在站点上没有更改 现在,我失去了对旧安装的访问,需要更改关闭原因、bburl等。我更改了关闭原因的文本,但它仍然显示以前的文本,电路板仍然关闭,bburl仍然错误 我已经验证了它是正确的数据库和服务器,因为这种情况已经发生了很多次。也许我只是错过了什么?我不知道。vBulletin不直接从“设置”
我已经验证了它是正确的数据库和服务器,因为这种情况已经发生了很多次。也许我只是错过了什么?我不知道。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>";
// #############################################################################
/**
* 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;
}