Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
vB functions in non vb pages. Details »»
vB functions in non vb pages.
Version: , by Darkling Darkling is offline
Developer Last Online: Oct 2004 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-21-2003 Last Update: Never Installs: 0
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-26-2003, 05:17 PM
MindTrix's Avatar
MindTrix MindTrix is offline
 
Join Date: Apr 2002
Location: United Kingdom
Posts: 1,833
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 12-26-2003, 07:24 PM
Darkling's Avatar
Darkling Darkling is offline
 
Join Date: Aug 2003
Location: w/ the bats in the attic.
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 12-26-2003, 07:28 PM
MindTrix's Avatar
MindTrix MindTrix is offline
 
Join Date: Apr 2002
Location: United Kingdom
Posts: 1,833
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08137 seconds
  • Memory Usage 2,219KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete