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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2005, 12:52 PM
ChrisBaktis ChrisBaktis is offline
 
Join Date: Mar 2004
Location: CT
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default chdir help

On my site, www.rustysoaptraders.com, we receive and review a lot of products...because of my lack of knowledge with vbulletin, I currently have all the .php files calling the review pages in the main 'rustysoaptraders.com/forums' directory. I would like to keepo these seperate via year...for example all reviews done in 2005 I would like to keep the .php files in 'rustysoaptraders.com/forums/reviews/2005' keeping the main forums directory uncluttered with 100's of .php files. I think this is a chdir command but not sure how or where this would go in the .php that calls that review page...also im not sure what exactly goes in the command.

Can I get some help?
Reply With Quote
  #2  
Old 01-11-2005, 10:23 PM
ChrisBaktis ChrisBaktis is offline
 
Join Date: Mar 2004
Location: CT
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #3  
Old 01-12-2005, 12:18 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The command looks like this:

PHP Code:
chdir('/home/www/public_html/forum'); 
It's the server path to the directory.
When you insert it, the code below will assume it is in that directory.

So normally for an image located in your review directory you may currently use img src="../../images/file.jpg" After adding chdir('/home/www/public_html'); to the php file, you will only need "images/file.jpg" because the file assumes it's pulling links from /home/www/public_html

I'm sure others could explain it better.
Reply With Quote
  #4  
Old 01-12-2005, 01:33 AM
ChrisBaktis ChrisBaktis is offline
 
Join Date: Mar 2004
Location: CT
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All im trying to do is get the .php files out of the main Forums directory - this way I can keep them organized.

What you are saying is I should put the .php file that calls up the template for the review in the directory reviews2005 (forums/reviews2005).

Then all I would need to do is add chdir('www/forums/reviews2005') & when I link from the forums to that review i should link to
Code:
www.rustysoaptraders.com/forums/reviews2005/filename.php
?

And in the 'filename.php' is where I put the chdir command? and I put that file in the reviews2005 directory?

Chris
Reply With Quote
  #5  
Old 01-20-2005, 01:42 AM
ChrisBaktis ChrisBaktis is offline
 
Join Date: Mar 2004
Location: CT
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #6  
Old 01-20-2005, 01:46 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems like I understand nothing
Can you attach one of those >100's of PHP files< you want to get organized?
Reply With Quote
  #7  
Old 01-20-2005, 02:29 AM
ChrisBaktis ChrisBaktis is offline
 
Join Date: Mar 2004
Location: CT
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is one of them - currently this .php is in the main forums directory...I would like to be able to put this in a forums/reviews2005 directory.

Code:
<?php 

// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS', 1); 
define('THIS_SCRIPT', '04fleergotgcs'); // change this depending on your filename 

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array( 

); 

// get special data templates from the datastore 
$specialtemplates = array( 
     
); 

// pre-cache templates used by all actions 
$globaltemplates = array( 
    '04fleergotgcs', 
); 

// pre-cache templates used by specific actions 
$actiontemplates = array( 

); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php'); 

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$navbits = array(); 
$navbits[$parent] = '2004 Fleer Greats of the Game Cut Signature Ed. Review'; 

$navbits = construct_navbits($navbits); 
eval('$navbar = "' . fetch_template('navbar') . '";'); 
eval('print_output("' . fetch_template('04fleergotgcs') . '");'); 

?>
Reply With Quote
  #8  
Old 01-20-2005, 02:38 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You've got a PHP file for every review?

I'd suggest to use an articles or CMS system for that, as your current solution seems to be way to complicated.

If you want to keep it this way, place

PHP Code:
chdir('..'); 
above

PHP Code:
require_once('./global.php'); 
Then you can keep the files in level 1 subdirs of your forum root.
Reply With Quote
  #9  
Old 01-20-2005, 02:56 AM
ChrisBaktis ChrisBaktis is offline
 
Join Date: Mar 2004
Location: CT
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you for the help - after reading your post I am going to look into an article hack...I do think that will be much easier - thank you!
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 06:54 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.04212 seconds
  • Memory Usage 2,243KB
  • Queries Executed 13 (?)
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_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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