The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
requireing global.php
Hi all I got a quick and simple question.... I do not know if this is possible.... However I need to require_once the global.php file from vbulletin into a script that resides outside the directory.
When I require it it fails to work due to the fact that the scripts IT requires are no longer requiring from the correct directory.... I'm coding my own CMS so to speak into a website that lives outside the directory... and It needs to be able to parse vbulletin BB code. Here is an excert of what I got so far... (v2 is the directory to vbulletin) Code:
require_once ('v2/global.php'); require_once ('v2/includes/class_bbcode.php'); getHeader(); $allnews = mysql_query("SELECT * FROM dwvulcan_vbulletin.thread WHERE forumid = '2' ORDER BY threadid DESC LIMIT 6", $dbh); while($news = mysql_fetch_assoc($allnews)){ $postid = $news[firstpostid]; $post = mysql_fetch_assoc(mysql_query("SELECT * FROM dwvulcan_vbulletin.post WHERE postid = '$postid'", $dbh)); $text = $post[pagetext]; $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $parsed_text = $parser->do_parse($text); echo "<h2>" . $news[title] . "<font class=\"date\">" . date("m-d-y",$news[dateline]) . "</font><br /></h2><p><span class=\"poster\">Posted by: " . $news[postusername] . "</span><br />" . $parsed_text . "</p><br />"; } Ok I have fixed my problem on my own XD.. I'm just letting everyone know for future reference what they can do.... Basically I added a file into the directory of the global.php file that process all the information there and then echoed out the results.... I then required the url of that file to retrieve the results... like so.. <--index.php--> Code:
require_once ("required.inc.php"); getHeader(); require_once ("http://www.dominionwarriors.net/testsite/v2/newsinfo.php"); Code:
include '../config.php'; require_once ('global.php'); require_once ('includes/class_bbcode.php'); $allnews = mysql_query("SELECT * FROM dwvulcan_vbulletin.thread WHERE forumid = '2' ORDER BY threadid DESC LIMIT 6", $dbh); while($news = mysql_fetch_assoc($allnews)){ $postid = $news[firstpostid]; $post = mysql_fetch_assoc(mysql_query("SELECT * FROM dwvulcan_vbulletin.post WHERE postid = '$postid'", $dbh)); $text = $post[pagetext]; $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $parsed_text = $parser->do_parse($text); echo "<h2>" . $news[title] . "<font class=\"date\">" . date("m-d-y",$news[dateline]) . "</font><br /></h2><p><span class=\"poster\">Posted by: " . $news[postusername] . "</span><br />" . $parsed_text . "</p><br />"; } |
#2
|
||||
|
||||
You could have just used chdir() to goto the correct directory.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|