我想要实现的目标是将 vBulletin 集成到 PHP 页面中,或者其他任何东西。我不想重新创建一个看起来像网站的皮肤,我或多或少希望论坛与网站 100% 集成,现在显然皮肤需要改变等等,所以它看起来很像,但我怎么会集成它,iframe 将无法处理它,对吗? 罗斯
最佳答案
将您的 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') . '");');
关于php - 有没有办法将 vBulletin 集成到 PHP 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7098034/