Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2007, 12:30 PM
kourou kourou is offline
 
Join Date: Feb 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to include php files on vBulletin?

Hello there.

I recently installed vBulletin and i would like to integrate it with the rest of my site.
What I'd like to do is to include the header of my site to any page of vBulletin (showpowst, showthread, index, personal messages etc.). I guess I'm going to use the include() function of php. Could you please tell which file to edit and where to add the include() function?

Thank you.

So...

I'm trying to include a .php file (adding a new pluggin to global_start) but there are some issues with the relative paths. vBulletin is installed on public_html/modules/vbulletin/ and the file i want to include is on public_html/

If i try to include it using include("file.php") then it looks for it at public_html/modules/vbulletin/ (that's wrong). If I try to include it using include("../../file.php") it's get included some way but the links are not correct (for example instead for a link to point at index.php, it's pointing at public_html/modules/vbulletin/index.php).

Could you pleeeeease help me?

Thanks.
Reply With Quote
  #2  
Old 02-18-2007, 03:48 PM
firstrebel's Avatar
firstrebel firstrebel is offline
 
Join Date: Dec 2005
Location: West London
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.vbulletin.com/forum/showthread.php?p=1066718#post1066718" target="_blank">http://www.vbulletin.com/forum/showt...18#post1066718</a>

Bob
Reply With Quote
  #3  
Old 02-18-2007, 03:53 PM
kourou kourou is offline
 
Join Date: Feb 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes i've already read that manual but i have problems with the relative paths.

vBulletin is installed on public_html/modules/vbulletin/ and the file i want to include is on public_html/

If i try to include it using include("file.php") then it looks for it at public_html/modules/vbulletin/ (that's wrong). If I try to include it using include("../../file.php") it's get included some way but the links are not correct (for example instead for a link to point at index.php, it's pointing at public_html/modules/vbulletin/index.php).

The problem is the paths of the files i want to include.

Could you please help me?
Reply With Quote
  #4  
Old 02-18-2007, 07:58 PM
firstrebel's Avatar
firstrebel firstrebel is offline
 
Join Date: Dec 2005
Location: West London
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The path to file.php must be correct, otherwise it won't find it - /public_html/file.php.

Try it with and without the first /.

Also if you have hyperlinks in file.php make sure they are absolute not relative, eg http://domain.com/file.html not file.html.

Bob
Reply With Quote
  #5  
Old 02-19-2007, 12:13 AM
kourou kourou is offline
 
Join Date: Feb 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem is that the file (file.php) i'd like to include to the vBulletin pages, also includes other files. So even if I try to include it with the absolute path (for example: include('http://www.domain.com/file.php') i get many errors for include() functions inside the file file.php (which are relative and not absolute - it's really hard to make all these paths absolute because there are so many files).

For any other page on my site the function include('file.php') includes the file file.php which is located on the home directory of my site. On vBulletin pages that doesn't work. Is there any way to solve it?

Thanks.
Reply With Quote
  #6  
Old 02-19-2007, 12:42 PM
firstrebel's Avatar
firstrebel firstrebel is offline
 
Join Date: Dec 2005
Location: West London
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you saying you want to include a file that itself has includes?

Bob
Reply With Quote
  #7  
Old 02-19-2007, 12:43 PM
kourou kourou is offline
 
Join Date: Feb 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by firstrebel View Post
Are you saying you want to include a file that itself has includes?

Bob
Yes, that's right.
Reply With Quote
Reply


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 08:47 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.04145 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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