vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP Include errors (https://vborg.vbsupport.ru/showthread.php?t=207008)

testbot 03-03-2009 03:56 PM

Quote:

Originally Posted by Lynne (Post 1759340)
So you have a page that works fine as a standalone page. Exactly what code are you using to put it somewhere else? What hook location, what code, etc.

if i take that page and include it in our cms like the following i get that error.

<div>
<?php include '../community/cforumstats.php'; ?>
</div>

or if i add the code directly into the page like:

<div>
<?php
error_reporting(E_ALL & ~E_NOTICE);

// # DEFINE IMPORTANT CONSTANTS
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'cforumstats');

// # REQUIRE BACK-END
$curdir = getcwd();
chdir('/home/***/public_html/community');
require_once('global.php');

// # START MAIN SCRIPT
$navbits = array();
eval('print_output("' . fetch_template('cforumstats') . '");');
chdir($curdir);
?>
</div>


for an update, i saw in the german vbulletin forum someone had the same problem but i can't read german so i don't know if it was solved or not. it looked like they were talking about cookeis.

Marco van Herwaarden 03-04-2009 07:18 AM

You should ask at the support thread/site of your CMS.

Mr-Moo 03-04-2009 03:51 PM

PHP Code:

<?php include '../community/cforumstats.php'?>

That is your answer, you have to remove the "../". PHP does not call directories like HTML or other languages do. Remove that small snippet and put your full root path and it should work :). Or at least that is my understanding, I remember when I transferred from HTML to PHP I was baffled at why my images and whatnot were not being displayed properly. I was told it was due to the ../ not moving directories as it does with HTML.

Should look like:
PHP Code:

<? include "/home/***/public_html/community/cforumstats.php';" ?>


testbot 03-06-2009 01:30 AM

Quote:

Originally Posted by Marco van Herwaarden (Post 1759883)
You should ask at the support thread/site of your CMS.

they'll tell me it's not their code causing the problem. i'll give it a try though.



Quote:

Originally Posted by Mr-Moo (Post 1760258)
PHP Code:

<?php include '../community/cforumstats.php'?>

That is your answer, you have to remove the "../". PHP does not call directories like HTML or other languages do. Remove that small snippet and put your full root path and it should work :). Or at least that is my understanding, I remember when I transferred from HTML to PHP I was baffled at why my images and whatnot were not being displayed properly. I was told it was due to the ../ not moving directories as it does with HTML.

Should look like:
PHP Code:

<? include "/home/***/public_html/community/cforumstats.php';" ?>



no luck. same error. ;)

Dismounted 03-06-2009 03:50 AM

Which error(s) are you getting specifically? The same few on the first page?

testbot 03-06-2009 11:36 AM

first, thanks for everyone's replies so far. some boards will just ignore you or just tell you to move on. i appreciate everyone's input so far.

i get this error:
Fatal error: Call to a member function query_first_slave() on a non-object in /home/***/public_html/community/includes/functions.php on line 1368

Dismounted 03-07-2009 10:30 AM

That error usually occurs when vBulletin's global.php is included inside of a function.

testbot 03-07-2009 12:25 PM

so since it's not inside a function withing my cforumstats.php file you think the cms is executing a function to include that code maybe? did that make sense?

--------------- Added [DATE]1236457601[/DATE] at [TIME]1236457601[/TIME] ---------------

actually, it doesn't seem to work anywhere outside the forum directory. i don't get any errors when i try outside the cms but the page just won't load. i think it might have to do with the 'Product' i'm trying to call.
$cybtopstats == Cyb - Advanced Forum Statistics.

not sure why the developer keeps ignoring my questions when it says in the description that what i'm trying to do can be done and that it's a supported Mod.

Dismounted 03-08-2009 04:59 AM

Try adding this to the top of your headinclude template:
HTML Code:

<base href="http://www.yoursite.com/forum" />

testbot 03-22-2009 11:37 AM

i seem to have this working anywhere outside the forum directory now.

it still won't work in the only place i need it though and that's the cms.

i'm guessing the cms is forcing it to be a nested function. is there anyway to get around the nested function thing?

thanks for stickin with me on this. :)


All times are GMT. The time now is 11:17 PM.

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.01241 seconds
  • Memory Usage 1,742KB
  • 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_html_printable
  • (4)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