Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 06-21-2007, 12:37 PM
Mikhailtech Mikhailtech is offline
 
Join Date: Aug 2002
Location: USA
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 06-21-2007, 02:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 06-21-2007, 03:46 PM
Mikhailtech Mikhailtech is offline
 
Join Date: Aug 2002
Location: USA
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 06-22-2007, 03:53 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-22-2007, 04:29 PM
Mikhailtech Mikhailtech is offline
 
Join Date: Aug 2002
Location: USA
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:42 PM.


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.04778 seconds
  • Memory Usage 2,193KB
  • 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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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