vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Help please! I'm clueless about chdir paths (https://vborg.vbsupport.ru/showthread.php?t=150277)

Mikhailtech 06-21-2007 12:37 PM

Help please! I'm clueless about chdir paths
 
I'm trying to get "latest threads" to show up on my main site (external location from the forums) but I'm having trouble. I've done some research and it seems there are 2 ways to do this: either via hard coding, or a plugin (VBExternal seems to be the popular choice). I'm trying to get VBExternal to run and I posted in the mod thread but haven't gotten a response. I think my problem is simple, but I can't figure it out due to my lack of coding knowledge. Here's what is says I need to do to make it work:

PHP Code:

How To Use vBExternal:

First the webpage you use it on must be php, if it is .htm/.html just re-name the extension to .php Next step is to call the file, in this example we assume that your site is: http://hello.com, and your forum is located at: http://hello.com/forums, so insert this code at the very top of our php file:

<?php
chdir
('./forums');
require_once(
'./vBExternal.php');
?>

However, although my forum is located 1 folder deep in the root directory (public_html/forum), it's located in a sub-domain, http://forum.mikhailtech.com. I'm not sure if this has anything to do with anything, but typing ./forum doesn't seem to work. Can anyone help me out?

Lynne 06-21-2007 02:59 PM

Basically you just need to change directories to the directory that vBExternal.php is located in. So, if your 'page' is in the same directory, then you don't need to change directories. What does your directory structure look like in regards to this page you are creating and the vBExternal.php script?

Mikhailtech 06-21-2007 03:46 PM

The page where I want the "latest threads" to appear is located in the root folder, so /public_html/

The forum is located 1 folder deep in /public_html/forum/vBExternal.php

(however the link to the forum is http://forum.mikhailtech.com not mikhailtech.com/forum .. if that matters at all)

Go to http://www.mikhailtech.com and check out the source code near the bottom of the page. You'll find this code:

PHP Code:

<?php
chdir
('./forum');
require_once(
'vBExternal.php');
?>        </div>

I can't figure out why it's not working though.

Lynne 06-22-2007 03:53 AM

Ahhhh, it looks like you added that code to a template or in the middle of the page where there is already < php > tags and that is not where it needs to be added. It needs to go into the php page - in this case I guess your public_html/index.php page. If you add it to that page and you are already between the < php > tags, then you only need to add the lines beginning with "chdir" and "require_once" and that needs to be at the beginning of that page.

Mikhailtech 06-22-2007 04:29 PM

I tried something else. I made a table at the bottom of my index.php page and put the code in there. Now when you go to http://www.mikhailtech.com and view the source (scroll down to the bottom), you'll see an empty table. The same php code is there, but it's not showing up in the source so I'm guessing it's being executed ... but no content is showing up. What else could be wrong?

Nevermind I'm an idiot ... I didn't post the optional code parts. Doh.


All times are GMT. The time now is 07:06 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.00966 seconds
  • Memory Usage 1,724KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete