Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OK I give up. Can anyone see my error?


JustPhish

Recommended Posts

OK, I tried a contribution for the first time called New Page. I wanted to use it to create a couple of new pages for my information box. The first one I tried to make is the About Us page.

 

The readme file is short and is as follows:

 

1. Rename the enclosed page (catalog/new_page.php) to whatever you need e.g foobar.php. Open it and change the 2 occurances of FILENAME_NEW_PAGE to match your chosen page name e.g FILENAME_FOOBAR. Upload to your catalog/ directory

 

2. Rename the enclosed new_page.php in catalog/includes/languages/english/

to your new name e.g foobar.php (Dont forget to add your contents!) Now upload to your server into catalog/includes/languages/english/

 

 

3. add to application_top.php the following

 

Define('FILENAME_FOOBAR', 'foobar.php');

 

Changing 'foobar' for your own chosen name of course!

 

4. in catalog/includes/boxes

 

add to information.php (or whichever box you want the new link to go into)a new line

 

'<a href="' . tep_href_link(FILENAME_FOOBAR, '', 'NONSSL') . '">' . BOX_INFORMATION_FOOBAR . '</a><br>' .

 

5. In catalog/includes/languages/english.php add new line

 

define('BOX_INFORMATION_FOOBAR', 'Foobar');

 

Again, change foobar to your own name.

 

Your done.

--------------------------

 

So, I follow the directions to the letter. I go to my site and see the new page listed in in the information box. Click here for the webpage. However when I click on it, I get a file not found error.

 

I notice that the file the link is pointing to is named Filename_about_us, which does not exist. But I can't figure out how that file got that name or where in the files it points to that. I have tried changing many things, every time just changing one thing at a time to see if it worked but nothing has worked yet. I have compared all the code to the pre existing code and everything matches up as far as I can see.

 

I have tried emailing the originator of the contribution but it has bounced. I tried searching here, but with the limit on three letter search words, I get more than 200 pages to look through and I can't find any info.

 

What if anything must I post here for you folks to see in order to fix this problem?

 

Thanks

Link to comment
Share on other sites

Also, this is the link the About Us heading points to:

 

http://www.netropicals.com/catalog/FILENAME_ABOUT_US

 

if I alter that link by removing the FILENAME_ and make the ABOUT_US lowercase, I get this error:

 

Warning: main(includes/languages/english/FILENAME_ABOUT_US): failed to open stream: No such file or directory in /home/netropic/public_html/catalog/about_us.php on line 15

 

Warning: main(includes/languages/english/FILENAME_ABOUT_US): failed to open stream: No such file or directory in /home/netropic/public_html/catalog/about_us.php on line 15

 

Fatal error: main(): Failed opening required 'includes/languages/english/FILENAME_ABOUT_US' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/netropic/public_html/catalog/about_us.php on line 15

 

 

So when I go to /catalog/about_us.php and open that file, line 15 including all the empty lines (not sure if you count those) is this one:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ABOUT_US);

 

I have tried altering that line by removing the FILENAME_ and uploading the new file but I still get the very same error.

 

Thanks.

Link to comment
Share on other sites

looks like step 5 isnt working . .

 

5. In catalog/includes/languages/english.php add new line

 

define('BOX_INFORMATION_FOOBAR', 'Foobar');

Link to comment
Share on other sites

in application top have:

 

Define('FILENAME_ABOUT_US', 'about_us.php');

 

in root have about_us.php

in languages have about_us.php language file

 

in box add:

 

'<a href="' . tep_href_link(FILENAME_ABOUT_US, '', 'NONSSL') . '">' . BOX_ABOUT_US . '</a><br>' .

Your online success is Paramount.

Link to comment
Share on other sites

OK this is still not working. Where in the application_top.php file must I add that line? And when I add it must I start it with //? Since I couldn't find anything in that file that already looked like what I was adding I put it at the end like this:

 

// Define('FILENAME_ABOUT_US', 'about_us.php');

 

Also, when I pasted in your last line, it caused the link in the box to read exactly BOX_ABOUT_US.

 

I see the other links in the file are done the exact same way but the word BOX does not print out in the actual store like it does for ABOUT_US

Link to comment
Share on other sites

OK I have discovered what the problem was with a ton of personal help from databuilders.

 

The problem was in step 4. The directions were to include this line:

 

'<a href="' . tep_href_link(FILENAME_FOOBAR, '', 'NONSSL') . '">' . BOX_INFORMATION_FOOBAR . '</a><br>' .

 

 

The line should have read:

 

'<a href="' . tep_href_link(FILENAME_FOOBAR.php, '', 'NONSSL') . '">' . BOX_INFORMATION_FOOBAR . '</a><br>' .

 

Thanks for the help.

Link to comment
Share on other sites

That will only work if you have defined it that way as in

define('FILENAME_FOOBAR.php', 'foobar.php');

If that is the case, then it looks like you mis-read the instructions where it says

Define('FILENAME_FOOBAR', 'foobar.php');

Just letting you know because an error like this can come back and cause you a lot of trouble later on.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

OK I have discovered what the problem was with a ton of personal help from databuilders.

 

The problem was in step 4.  The directions were to include this line:

 

'<a href="' . tep_href_link(FILENAME_FOOBAR, '', 'NONSSL') . '">' . BOX_INFORMATION_FOOBAR . '</a><br>' .

The line should have read:

 

'<a href="' . tep_href_link(FILENAME_FOOBAR.php, '', 'NONSSL') . '">' . BOX_INFORMATION_FOOBAR . '</a><br>' .

 

Thanks for the help.

 

Nope, that's not it at all. It was right the way it was. What I don't understand is why you aren't listening to the people in this thread that know what they are doing, and that are telling you what's wrong.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Hmmm, not exactly the reply I thought I would get. Figured I would post how it worked out in the end in case others ran across the same thing one day.

 

As for listening. I did listen. And if you had read my third post in this thread you would see that changing things to the way that the person here recommended, DIDN'T work. I followed the directions exactly. They didn't work either which is what brought me to post here. I might have been better served if you had offered some help before instead of attacking me now.

 

I changed it to the way it currently sits and it works.

Link to comment
Share on other sites

Fine, do it your way. I'm sure you know best.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...