yanarasod Posted May 30, 2006 Posted May 30, 2006 i want to have a glossary list like this site's http://www.allfoodbusiness.com/Tea_Glossary.php just did want to ask should i make simple html tables and insert the contents in the file catalog/includes/languages/english/myfile.php is it the right procdure.
kgt Posted May 30, 2006 Posted May 30, 2006 Yes you can do that. You want to create a language file and a code file (use conditions.php for a template), an entry in includes/filenames.php, and a line in includes/column_left.php to add the link to the left side boxes. Contributions Discount Coupon Codes Donations
yanarasod Posted May 30, 2006 Author Posted May 30, 2006 thanks, just had another question, how do i make my new file take for example filename.php i want it under a folder newfolder/filename.php so the url will be www.mystore.com/newfolder/filename.php i have my catalog installed on the root domain, do you have any ideas how i can achieve it.
kgt Posted May 30, 2006 Posted May 30, 2006 Depends on what you're doing with it. If you just want another folder, you can actually include the folder name in the filename definition: includes/filenames.php define( 'MY_FILE', 'newfolder/filename.php' ); Contributions Discount Coupon Codes Donations
yanarasod Posted May 30, 2006 Author Posted May 30, 2006 didnt understand this "Depends on what you're doing with it" i just want another folder with and in the file under it includes/header.php, and all those things required for a normal page as conditions.php
yanarasod Posted May 30, 2006 Author Posted May 30, 2006 ok i created a file url http://www.bhuratea.com/where_to_buy/locate_a_store.php and the error which i get is in the url
kgt Posted May 30, 2006 Posted May 30, 2006 Yeah, it won't work without major revision. You'll need to put in the root directory. Contributions Discount Coupon Codes Donations
yanarasod Posted May 30, 2006 Author Posted May 30, 2006 does that mean making changes to application_top.php. is there any other way as i have more than 20 pages that need to be under different folders.
kgt Posted May 30, 2006 Posted May 30, 2006 Yes, you would need to adjust the paths of all the included files from yourfilesdir/yourfile.php. If you change application_top.php and all the others to include files using absolute paths instead of relative paths, then you wouldn't need to worry unless you changed servers. You need to make sure that DIR_FS_CATALOG has the correct value. Replace all instances of require( 'somefile.php' ); with require( DIR_FS_CATALOG.'somefile.php' ); and include( 'somefile.php' ); with include( DIR_FS_CATALOG.'somefile.php' ); You will want to do this on a test site because you will run into lots of path issues trying to get everything right. Contributions Discount Coupon Codes Donations
kgt Posted May 30, 2006 Posted May 30, 2006 just didn't get anything into my head. The problem you're running into is this: Your site has the following structure: account.php account_edit.php account_history.php etc. includesapplication_bottom.php application_top.php column_left.php etc. All files that are called use the catalog root - in your case it's the same as the site root. Since there are certain files needed to run OSC (includes/configure.php with the database connection information, etc), you need the includes directory and subdirectories. If I'm pointing my browser to account.php in the root, account.php needs to include includes/application_top.php (which in turn includes configure.php). In this case, includes/ is a relative path. It's finding the application_top.php by looking in a subdirectory of the current directory called includes. If you point your browser to mydir/somefile.php, then we're no longer in the root. So include('includes/application_top.php') will fail because there is no subdirectory of mydir called includes. In order to get the correct directory included, you can use the full (absolute) path to the includes/ directory. Contributions Discount Coupon Codes Donations
user99999999 Posted May 30, 2006 Posted May 30, 2006 You can make it work by using chdir() to navigate to the correct directory before including application_top. chdir('..'); require('includes/application_top.php');
kgt Posted May 30, 2006 Posted May 30, 2006 You can make it work by using chdir() to navigate to the correct directory before including application_top. chdir('..'); require('includes/application_top.php'); True! This is a great suggestion. Contributions Discount Coupon Codes Donations
yanarasod Posted May 31, 2006 Author Posted May 31, 2006 ok here was what i did, i added the chdir('..'); in front of require('includes/application_top.php'); , the page now doesnt even load. do i need to replace the .. of chdir('..'); with includes/application_top.php <?php /* $Id: newsroom.php,v 1.22 2003/06/05 23:26:23 hpdl Exp $ */ chdir('..'); require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOCATE_A_STORE); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_INFO)); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_LOCATE_A_STORE)); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: Header Tag Controller v2.5.7 if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } // EOF: Header Tag Controller v2.5.7 ?>
kgt Posted May 31, 2006 Posted May 31, 2006 Now you're getting an error because you haven't created the language file. You include it: require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOCATE_A_STORE); But it doesn't exist. Create a language file (or remove this line if you don't need one): includes/languages/english/where_to_buy/locate_a_store.php Contributions Discount Coupon Codes Donations
yanarasod Posted May 31, 2006 Author Posted May 31, 2006 THANKS, very much, worked like a charm, had been searching for it for almost 1 month in different forums thanks, so including chdir('..'); did the trick, but just to be sure will it cause session loss or any other errors. thanks again i will be glad if you could take a look at this topic, all my categories behave differently, i am unable to find a way out http://www.oscommerce.com/forums/index.php?showtopic=211947
yanarasod Posted June 2, 2006 Author Posted June 2, 2006 back to the issue: is there any way to make my url directly to sub-folder www.site.com/subfolder instead of www.site.com/subfolder/index.php i tried define('FILENAME_FILE', 'subfolder'); instead of define('FILENAME_FILE', 'subfolder/index.php'); but was of no help, by typing in the url in the address bar one can get there, but how do i make a link in the page itself.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.