2011-08-17 105 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

相关问题