vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Issue with vBulletin php include on non vb page (https://vborg.vbsupport.ru/showthread.php?t=192803)

DandD 10-06-2008 12:14 AM

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.

Lynne 10-06-2008 03:21 AM

Did you make sure to include the global.php in the page?

Marco van Herwaarden 10-06-2008 07:44 AM

Chdir() to the forum directory before including the calendar.php.

DandD 10-07-2008 03:37 AM

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.

Marco van Herwaarden 10-07-2008 10:07 AM

PHP Code:

chdir('/path/to/your/forum/'); 


DandD 10-07-2008 03:32 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1639228)
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

Dismounted 10-08-2008 05:50 AM

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.

DandD 10-08-2008 12:20 PM

Quote:

Originally Posted by Dismounted (Post 1640015)
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
:eek:

noppid 10-08-2008 01:29 PM

preface urls in your templates as...

HTML Code:

$vboptions[bburl]
Maybe?

DandD 10-08-2008 04:55 PM

Quote:

Originally Posted by noppid (Post 1640261)
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


All times are GMT. The time now is 01:02 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.02157 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete