2012-10-11 51 views
1

這是一個永遠存在多個vBulletin數據庫的問題。我無法編輯數據庫來更改設置,如cookiepath,bburl或其是否處於活動狀態。我的意思是,我可以使用PHPMyAdmin來改變它們,但是網站上的效果沒有改變。編輯vBulletin數據庫對站點沒有任何影響

現在,我失去了訪問一箇舊的安裝,並需要改變封閉的原因,bburl等我改變了文本的封閉的原因,但它仍然顯示的文字,以前,董事會仍然關閉和bburl仍然是錯誤的。

我已經驗證它是正確的DB和正確的服務器,因爲這已經發生了很多次。也許我在這裏錯過了一些東西?我不知道。

回答

2

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; 
} 
相關問題