PDA

View Full Version : Add new page under "Information"



kelly34
07-28-2005, 02:41 AM
Hi,

I would like to add a size chart under the "Information" section. Can anyone help me with this. I tried placing it in like you would with the base install of OSC but it had errors coming up.

Regards

kelly34
07-28-2005, 03:10 AM
This is the error I get:

Warning: main(includes/header.php): failed to open stream: No such file or directory in /var/www/html/size_charts.php on line 29

Fatal error: main(): Failed opening required 'includes/header.php' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/size_charts.php on line 29

michael_s
07-28-2005, 09:35 AM
Nope. Can't do it like regular osc. You should read the docs before attempting this. It makes things much easier.

osCDox wiki pages (http://oscdox.com/modules.php?op=modload&name=phpWiki&file=index&pagename=Ms2MaxMods)
(http://oscdox.com/modules.php?op=modload&name=phpWiki&file=index&pag ename=Ms2MaxMods)

kelly34
07-29-2005, 04:11 AM
Unfortunately the docs do not clearly state each step and seem to be missing something. Could someone please assist me in adding a new page to my information box.

Thankyou

kelly34
07-29-2005, 05:35 AM
I now have Size Charts coming up under the information box. When I click on it it goes to size_chart.php however the content on the page is linking to PRIVACY. I think it has somthing to do with this part
$content_template = TEMPLATENAME_PRIVACY; under the main size_chart.php I created. If I change the "PRIVACY" to "SIZE_CHART" it brings up errors instead of the Size Chart content. The error I get is
Fatal error: main(): Failed opening required '' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/templates/aabox/main_page.tpl.php on line 116 If anyone can help it would be greatly appreciated.

michael_s
07-29-2005, 06:04 AM
If you change PRIVACY to SIZE_CHART, you have to tell BTS what the value of TEMPLATENAME_SIZE_CHART is. Define this constant in includes/filenames.php Your new constant has no value until you define it.

Doing a search across files in osCMax for TEMPLATENAME_PRIVACY would have told you exactly where to put your new constant. Ultra-Edit is a great text editor that allows searching across files. I suggest you get a tool for doing this (like Ultra Edit) and whenver you need to find something, just do a quick search for it across all the osCMax files. It takes seconds to do and you will learn a lot about where things go and how it is put together.

See this too:
http://oscdox.com/PNphpBB2-viewtopic-t-4842.html
http://oscdox.com/modules.php?op=modload&name=phpWiki&file=index&pag ename=BtsDocumentation

kelly34
07-29-2005, 07:11 AM
Thanks for your help but I have already defined all the lines that need to be defined in includes/filenames.php

This is what I have: (I made a copy of the privacy parts and changed them)

define('CONTENT_SIZE_CHART', 'size_chart');
define('CONTENT_SIZE_CHART_CONTENT', 'size_chart');

define('FILENAME_SIZE_CHART', CONTENT_SIZE_CHART . '.php');
define('FILENAME_SIZE_CHART_CONTENT', CONTENT_SIZE_CHART_CONTENT . '.php');

kelly34
07-29-2005, 07:50 AM
sorry I forgot to mention after defining them I am still getting the same error message

michael_s
07-29-2005, 08:16 AM
You missed a step somewhere. Retrace your steps:

1. Create the new file in the catalog dir - size_chart.php
2. Create new file in /[templatename]/content dir - size_chart.tpl.php
3. Add contstants that define the new filename and content:


define('CONTENT_SIZE_CHART', 'size_chart');
define('FILENAME_SIZE_CHART', 'size_chart.php');



4. Change the contents of size_chart.php to match your new contstants as per the instructions in the guide here :

http://oscdox.com/phpWiki-index-pagename-BtsDocumentation.html



<?php
/*
$Id: privacy.php,v 1.3.2.1 2005/06/12 00:03:43 Michael Sasek Exp $

osCMax Power E-Commerce
http://oscdox.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

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

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SIZE_CHART));

$content = CONTENT_SIZE_CHART;
$content_template = TEMPLATENAME_STATIC;

include (bts_select('main', $content_template)); // BTSv1.5

require(DIR_WS_INCLUDES . 'application_bottom.php');
?>


5. Add a language file for your new page. Copy /includes/languages/english/privacy.php to /includes/languages/english/size_chart.php and edit the contents to look like this:



<?php
/*
$Id: privacy.php,v 1.1.1.1.2.1 2005/06/12 00:04:34 Michael Sasek Exp $

osCMax Power E-Commerce
http://oscdox.com

Copyright (c) 2005 osCMax, 2002 osCommerce

Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'Size Chart');
define('HEADING_TITLE', 'Size Chart');

define('TEXT_INFORMATION', 'Put here your Size chart info here.');
?>


6. Add a link to the information box by editing /includes/boxes/information.php. Copy the second to the last link defined and paste it in directly below the original. Change the constants to your filename constant and change the box constant text to whatever your text is. Alternately, you can add a box text constant to english.php and call the constant instead of adding custom text.


Ok, so now I have done all the work for you. Please send payment to... ;)

kelly34
07-29-2005, 08:35 AM
Thankyou for your help. It works now. I copied the piece of the code for the main size_chart.php you had and replaced mine with it. 10 hours later and it finally works!

Thanks

newzen
09-01-2005, 07:57 AM
HOW I HAVE TO DO FOR THE NEW PAGE CAN BE MODIFY BY FCK EDITOR :(

jpf
09-03-2005, 11:13 AM
newzen - What language are you tring to type? no cent made....

If you want to modify the main page?

Admin > Catalog > Define MainPage

Sander
09-07-2005, 11:37 PM
i am trying this too, and i have done every step like you said but i get this error in my shop:


Fatal error: main(): Failed opening required '' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site21/fst/var/www/html/catalog/templates/fallback/main_page.tpl.php on line 104


how come?

cacooke
09-11-2005, 08:58 AM
Sander,
I'm having basically the same problem.
Have you found a resolution yet?

cacooke
09-11-2005, 01:27 PM
Sander,
Try this, it worked for me...

Make sure that the file you created in your catalog directory has the line:
$content_template = TEMPLATENAME_STATIC;

NOT

$content_template = TEMPLATENAME_YOURPAGE;


Like I said, it worked for me...

Sander
09-12-2005, 01:52 AM
hmm works pretty good, how did you find it out?

next problem is the backend, i want to be able to edit the page via WYSIWYG, but when i enter the editor it says i dont have permission.

i have copied the editor files from the shippind page editor..

cacooke
09-12-2005, 09:26 AM
Sander,
I just spent time playing with it... but here is the REAL fix:
They left a step out somewhere...
You also need to modify the configure_bts.php file.
add a line like this:
define('TEMPLATENAME_TESTPAGE', 'testpage.tpl.php');
then u can change the template name in testpage.php (or whatever u have it named) from TEMPLATENAME_STATIC to the correct template name... That will work perfect.

Like u, I also want to use the backend WYSIWYG editor to edit these files... I have changed everything I can find to add the pages to the menu list, but can't even get them to show up in the menu... if u can figure this one out let me know...

If u are using a linux server, then u probably need to set the permissions for the file ur trying to edit -
like thru ur FTP program - CHMOD 777 will allow anything u need to do to the file...

Sander
09-12-2005, 10:45 PM
works perfectly, i am impressed.

ye im having the same problem too, i cant even make the link show up in the backend, but when i go to my own define_xxxx.php page, it opens up and then says it does not have permission!

ill let you know if i find anythin!

Sander
09-12-2005, 11:03 PM
i got it!!!

admin/includes/general.php on line 22, add your file for the define part there:

&& $filename != 'define_inbouwtips.php'

now if you type it in the browser you can access the wysiwyg and it works fine!

only thing left now if manually make a link in the backend i guess!

Sander
09-12-2005, 11:06 PM
you can add the link like this in admin/includes/boxes/catalog.php:

'<a href="define_inbouwtips.php">Define Inbouwtips</a><br>' .

feels good when it finally works after 3 days!

[wicked]
10-22-2005, 02:36 PM
Ok guys & gals,

This is what I am looking for and have submitted elswhere. woOOHOO!! I found it! ;) ..
NOW...

I get these two errors. (well, one isn't really)

1) in my information box, instead of saying size_chart it says: BOX_INFORMATION_SIZE_CHART

2) when I click it I get:
Not Found
The requested URL /shop/FILENAME_SIZE_CHART was not found on this server.

Any help please????

[wicked]
10-23-2005, 04:39 PM
Please!... any help at all???

michael_s
10-23-2005, 05:59 PM
You need to define both BOX_INFORMATION_SIZE_CHART (english.php) and FILENAME_SIZE_CHART (filenames.php)

GeekItUp
11-04-2005, 06:01 PM
Sander,
Try this, it worked for me...

Make sure that the file you created in your catalog directory has the line:
$content_template = TEMPLATENAME_STATIC;

NOT

$content_template = TEMPLATENAME_YOURPAGE;


Like I said, it worked for me...

Thanks for that, worked for me also :)

bkpie
11-11-2005, 01:29 PM
Sender:

Ok I got the new information page in and working but am still having trouble getting it into admin to edit wysiwyg Exactly what files did you modify in Admin. also when you said admin/includes/general.php under includes I only had general.js Thanks in advance

Blayne

bkpie
11-12-2005, 02:02 PM
Ok I finally have the wysiwyg editor working with my new page but by using the browser. I have tried editing the admin/includes/boxes/catalog.php file a bunch of times doing what sender said and at from another poster elswhere and I can not get a link to show up in admin for my company page. I have tried

'<a href="define_company.php">Define Company</a><br>' .

and this way.

'<a href="' . tep_href_link('define_company.php', '', 'NONSSL') . '"
class="menuBoxContentLink">Define Company</a><br>'.

So everything works except having a link :( Anyone have a suggestion?

Thank you

Blayne

groggory
02-14-2006, 12:41 AM
if you do your editing in dreamweaver cs2 it does a great job of site-wide searches. And not only that, but it has a great PHP coloring scheme, lookup, etc. Give it a try.

snobba
03-30-2006, 04:56 AM
Hi there everyone!

So did someone fix so you could edit the pages in the admin? There is two messages on how to solve this...

Thankful for any help!

/ Snobba

FlipC
09-26-2006, 04:03 PM
I will add to the wiki or something on this ASAP and post link here

FlipC
09-27-2006, 12:31 AM
ANSWER IS HERE!

http://www.oscdox.com/?op=modload&name=phpWiki&file=index&pagename=Infor mation%20Box

Finally finished it.
Freaking WIKI VISUAL MODE F!d me all up. Took allot of time getting it all together only to have that trash it. So I made it an html page and served it up.

Hope it helps someone.