vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   chdir help (https://vborg.vbsupport.ru/showthread.php?t=74002)

ChrisBaktis 01-08-2005 12:52 PM

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?

ChrisBaktis 01-11-2005 10:23 PM

anyone?

Jolten 01-12-2005 12:18 AM

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.

ChrisBaktis 01-12-2005 01:33 AM

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

ChrisBaktis 01-20-2005 01:42 AM

anyone?

Andreas 01-20-2005 01:46 AM

Seems like I understand nothing :)
Can you attach one of those >100's of PHP files< you want to get organized?

ChrisBaktis 01-20-2005 02:29 AM

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') . '");');

?>


Andreas 01-20-2005 02:38 AM

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.

ChrisBaktis 01-20-2005 02:56 AM

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!


All times are GMT. The time now is 08:39 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.01030 seconds
  • Memory Usage 1,736KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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