vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   vB functions in non vb pages. (https://vborg.vbsupport.ru/showthread.php?t=59315)

Darkling 12-21-2003 12:31 PM

vB functions in non vb pages.
 
I'm having trouble including vB files in pages outside the vB directory.
When those included pages themselves include other pages I get errors.

e.g.

A page on my site may need search functions so I add:

chdir('forums');
include('./global.php');
require_once('./includes/functions_search.php');
chdir('../');

I then get an error like:

Warning: fetch_search_forumids(./includes/functions_misc.php): failed to open stream: No such file or directory in /hsphere/local/home/neocivit/darkdelight.net/forums/includes/functions_search.php on line 561

Fatal error: fetch_search_forumids(): Failed opening required './includes/functions_misc.php' (include_path='.:/usr/local/lib/php') in /hsphere/local/home/neocivit/darkdelight.net/forums/includes/functions_search.php on line 561

Can you help me fix this?

Thanks.

MindTrix 12-26-2003 05:17 PM

Im guessing your running vB3 GAMMA? If thats the case im not sure if we can help you here as vB3 hacking etc is not allowed until RC1

Darkling 12-26-2003 07:24 PM

Quote:

Originally Posted by MindTrix
Im guessing your running vB3 GAMMA? If thats the case im not sure if we can help you here as vB3 hacking etc is not allowed until RC1

Hi MindTrix.

This is a bit of a grey area.
I would not call this vB hacking as I have not altered vB's files in the slightest.
All I have done is included them wholesale in other pages on my site.

Anyway, I found out what was going wrong
I used chdir('forums'); to change to the directory with all the vB files,
then require_once('./includes/functions_search.php'); or what ever other file had the
vB stuff I wanted,
and finally chdir('../'); to get back to the directory above.

What happened was that when functions in the included vB files later tried to include other vB files the chdir('../'); had already taken effect and vB's relative links were broken.

What I found works is to change to the vB directory and stay there, Only changing to other directories to include other scripts and returning to the vB directory.
Combined with setting the base tag to the vB directory and addressing files from the sites root with a preceding /


Never mind, I think I got this sorted now, but thanks anyway.

MindTrix 12-26-2003 07:28 PM

Glad to hear you sorted it out ;)

I understand what you was saying though, its just that because it involved Editing and vB3 GAMMA im not sure whether it was allowed here etc :) Who knows i could be wrong. Bottom line is you got it all by youself, its more rewarding that way anyway ;)


All times are GMT. The time now is 12:18 AM.

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.00913 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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