2011-08-17 102 views
1

即將到達的內容是將vBulletin整合到一個PHP頁面中,或者是什麼。我不想重新創建一個看起來像網站的皮膚,我或多或少想要論壇與網站100%整合,現在顯然皮膚需要改變等,所以它看起來的部分,但我將如何整合它,iframes將無法處理它嗎? 羅斯有沒有辦法將vBulletin整合到PHP中?

回答

1

最常見的方式做,這是重新定義在一個插件global_setup_complete或類似的$header$footer變量。

例如,如果你已經有了從另一個系統中的header.php文件:

ob_start(); 
include('/path/to/your/header/file.php'); 
$header = ob_get_contents(); 
ob_end_clean(); 

ob_start(); 
include('/path/to/your/footer/file.php'); 
$footer = ob_get_contents(); 
ob_end_clean(); 

這將這些文件的輸出加載到$header$footer變量。

5

將您的PHP頁面集成到vBulletin可能比嘗試將vBulletin集成到您的PHP頁面更容易。

然後,你可以做一個PHP文件中像這樣在您的論壇根目錄(或路徑更改爲必填項):

// ######################## SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// ##################### DEFINE IMPORTANT CONSTANTS ####################### 
define('THIS_SCRIPT', 'myscript'); 

// #################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array(); 

// get special data templates from the datastore 
$specialtemplates = array(); 

// pre-cache templates used by all actions 
$globaltemplates = array('MYPAGE'); 

// pre-cache templates used by specific actions 
$actiontemplates = array(); 

// ########################## REQUIRE BACK-END ############################ 
require_once('./global.php'); 

// ... your PHP code goes here 
// ... you can use vBulletin's database classes and security mechanisms in your page 
// ... you can also use vBulletin's headers/footers and other templates too 
// example (assuming you've already created a template called MYPAGE): 

eval('print_output("' . fetch_template('MYPAGE') . '");'); 
+0

真。無論如何,大多數頁面模板都支持PHP。有數百個關於VBORG的教程 – TheBlackBenzKid

相關問題