我想要实现的是将 vBulletin 集成到 PHP 页面中,或者其他任何东西。我不想重新创建一个看起来像网站的皮肤,我或多或少希望论坛与网站 100% 集成,现在显然皮肤需要改变等等,所以它看起来很重要,但我会怎么做整合它,iframe 将无法处理它吗?罗斯
问问题
624 次
2 回答
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') . '");');
于 2011-09-07T01:27:05.633 回答
1
最常见的方法是在插件或类似工具中重新定义$header
and变量。$footer
global_setup_complete
例如,如果您已经有来自另一个系统的 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
and$footer
变量中。
于 2011-08-28T19:31:53.427 回答