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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-06-2008, 12:14 AM
DandD DandD is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Issue with vBulletin php include on non vb page

We have a new site on which we use a php include to display calendar.php on the home page. It seems to work well with two exceptions. Fist, we noticed the calendar view links are not in the proper place and second, the user login status is incorrect (user is not shown as logged in when he is). These problems are on the home page (root folder - index.php), but the calendar.php page in the forum folder works correctly.

The site home page is: www.lahabraevents.com
The calendar page is: www.lahabraevents.com/forum/calendar.php

We suspect the problem is a sessions issue due to the home page being in the root folder rather than the forum folder, but we need help from someone a little more knowledgable. Any help is appreciated.
Reply With Quote
  #2  
Old 10-06-2008, 03:21 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you make sure to include the global.php in the page?
Reply With Quote
  #3  
Old 10-06-2008, 07:44 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Chdir() to the forum directory before including the calendar.php.
Reply With Quote
  #4  
Old 10-07-2008, 03:37 AM
DandD DandD is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the replies.

Lynne, yes we included global.php both on the page and it is also in the calendar.php include but no joy.

Marco, we tried using Chdir but we aren't familiar enough to know how to use it properly. If you could give us some guidance, that would be great. When we tried, we got the dreaded "Unable to add cookies, header already sent." message.

Thanks in advance for any help.
Reply With Quote
  #5  
Old 10-07-2008, 10:07 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
chdir('/path/to/your/forum/'); 
Reply With Quote
  #6  
Old 10-07-2008, 03:32 PM
DandD DandD is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
PHP Code:
chdir('/path/to/your/forum/'); 
Hi Marco,

Thanks for the reply. Unfortunately, that is the code I have tried before in numerous variations along with other coded edits - full paths, relative paths, etc. - with no success. Either I still have the original problems at best, or worse, some sort of error code. Any further help is certainly appreciated. Here is the current code for the page (if I don't include the base href, I lose the CSS). BTW, this is a test page in the same directory as index.php. The url is http://www.lahabrevents.com/index-test.php.:

<base href="http://www.lahabraevents.com/forum/" />
<?php chdir('/forum/'); include ("http://www.lahabraevents.com/forum/calendar.php"); ?>

thanks,
David
Reply With Quote
  #7  
Old 10-08-2008, 05:50 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why do you include the whole calendar.php page - this will most likely create errors. either replicate calendar.php's code, or modify it to meet your needs.
Reply With Quote
  #8  
Old 10-08-2008, 12:20 PM
DandD DandD is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
Why do you include the whole calendar.php page - this will most likely create errors. either replicate calendar.php's code, or modify it to meet your needs.
Hi Dismounted,

Thanks for the thoughts. Admittedly I am a novice, so please bear with me. It seems the problem is due to relative paths in all the files. The site home page (the page in question) is in the root folder. The calendar.php file is in the /forum/ folder. If I understand your suggestion correctly, I can copy the calendar.php code into the home page rather than using an include. I tried this and modified the paths on all the includes for that file accordingly. But we then have the same problem with the first file called down the line - in this case my modified code can now find /forum/global.php but returns an error because /includes/init.php can't be found. I would then need to modify the path in global.php and so on back to who knows where. That seems more than a little convoluted, not to mention opening the door to other issues.

Hopefully I am missing something simple. As you can tell I could really use some guidance.

Thanks for any help.
David
Reply With Quote
  #9  
Old 10-08-2008, 01:29 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

preface urls in your templates as...

HTML Code:
$vboptions[bburl]
Maybe?
Reply With Quote
  #10  
Old 10-08-2008, 04:55 PM
DandD DandD is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by noppid View Post
preface urls in your templates as...

HTML Code:
$vboptions[bburl]
Maybe?
Hi noppid,

Thanks for that. Tried it with same result. It appears I would need to modify all the include files and still not sure if that would work.

David
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 10:34 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.06886 seconds
  • Memory Usage 2,257KB
  • 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
  • (2)bbcode_html
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete