vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   requireing global.php (https://vborg.vbsupport.ru/showthread.php?t=203347)

vulcandth 01-28-2009 07:26 AM

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 />";
                                }

--------------- Added [DATE]1233136334[/DATE] at [TIME]1233136334[/TIME] ---------------

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");

<--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 />";
                                }


Dismounted 01-28-2009 10:02 AM

You could have just used chdir() to goto the correct directory.


All times are GMT. The time now is 06:03 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01072 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete