Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Reference to includes/column_left.php in the Knowledge Base Infobox tutorial


Fuzzbutt.co.uk

Recommended Posts

Posted

I've just followed this tutorial to add a new Infobox, as I've got the hang of adding pages to existing infoboxes. However, the tutorial makes reference to the includes/column_left.php:

 

For this example, the new box will be included before the Information box on the left side column in includes/column_left.php:

 

<?php

require(DIR_WS_BOXES . 'categories.php');

require(DIR_WS_BOXES . 'manufacturers.php');

require(DIR_WS_BOXES . 'whats_new.php');

require(DIR_WS_BOXES . 'search.php');

require(DIR_WS_BOXES . 'my_new_box.php');

require(DIR_WS_BOXES . 'information.php');

?>

 

However, this coding is in ADMIN/includes/column_left.php though, *not* the other includes/column_left.php. So I added a new line require(DIR_WS_BOXES . 'fun_stuff.php'); here and followed the rest of the tutorial to a T, and still I have no extra infobox appearing. I've checked and double checked, what am I missing?

Imperial Sandtrooper TD-2441, UK Garrison

Ghostbuster "Dr Smith"

Posted

the column_left.php in the main site (i.e. not the admin one) has some code which displays certain infoboxes depending on what page is shown.

 

You're probably best off posting your column_left.php here for checking

 

You did copy the new infobox to the boxes directory as well right? :)

Posted

Yes, fun_stuff.php has been copied to the includes/boxes dir.

 

 

 

<?php

/*

$Id: column_left.php,v 1.13 2002/06/16 22:08:05 lango Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

$column_query = tep_db_query('select configuration_column as cfgcol, configuration_title as cfgtitle, configuration_value as cfgvalue, configuration_key as cfgkey, box_heading from ' . TABLE_THEME_CONFIGURATION . ' order by location');

while ($column = tep_db_fetch_array($column_query)) {

 

$column['cfgtitle'] = str_replace(' ', '_', $column['cfgtitle']);

$column['cfgtitle'] = str_replace("'", '', $column['cfgtitle']);

 

if ( ($column[cfgvalue] == 'yes') && ($column[cfgcol] == 'left')) {

 

define($column['cfgkey'],$column['box_heading']);

 

if ( file_exists(DIR_WS_BOXES . $column['cfgtitle'] . '.php') ) {

require(DIR_WS_BOXES . $column['cfgtitle'] . '.php');

}

}

}

?>

 

Here is the admin/includes/column_left.php. The fun stuff box line has been commented out cos every time i *uncomment* it then my entiire admin panel breaks and you can't view any content! It also doesn't make my Fun Stuff box appear either :(

 

<?php

/*

$Id: column_left.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

require(DIR_WS_BOXES . 'configuration.php');

require(DIR_WS_BOXES . 'catalog.php');

require(DIR_WS_BOXES . 'modules.php');

require(DIR_WS_BOXES . 'customers.php');

require(DIR_WS_BOXES . 'taxes.php');

require(DIR_WS_BOXES . 'localization.php');

require(DIR_WS_BOXES . 'reports.php');

require(DIR_WS_BOXES . 'tools.php');

require(DIR_WS_BOXES . 'info_boxes.php');

//require(DIR_WS_BOXES . 'fun_stuff.php'); //Rache added

?>

Imperial Sandtrooper TD-2441, UK Garrison

Ghostbuster "Dr Smith"

Posted

The code in the tutorial is not in admin column_left.php.

 

Tutorial

<?php

require(DIR_WS_BOXES . 'categories.php');

require(DIR_WS_BOXES . 'manufacturers.php');

require(DIR_WS_BOXES . 'whats_new.php');

require(DIR_WS_BOXES . 'search.php');

require(DIR_WS_BOXES . 'my_new_box.php');

require(DIR_WS_BOXES . 'information.php');

?>

 

Your admin/column_left.php

 

 

require(DIR_WS_BOXES . 'configuration.php');

require(DIR_WS_BOXES . 'catalog.php');

require(DIR_WS_BOXES . 'modules.php');

require(DIR_WS_BOXES . 'customers.php');

require(DIR_WS_BOXES . 'taxes.php');

require(DIR_WS_BOXES . 'localization.php');

require(DIR_WS_BOXES . 'reports.php');

require(DIR_WS_BOXES . 'tools.php');

require(DIR_WS_BOXES . 'info_boxes.php');

 

Replace the last ?> in

 

includes/column_left.php with

 

require(DIR_WS_BOXES . 'fun_stuff.php'); //Rache added

?>

 

Make sure funstuff.php is in /includes/boxes

 

If that fails post includes/column_left.php

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted

Excellent, that works :)

 

But doesn't this piece of code in includes\column_left.php

 

if ( file_exists(DIR_WS_BOXES . $column['cfgtitle'] . '.php') ) {

require(DIR_WS_BOXES . $column['cfgtitle'] . '.php');

 

sort of do a loop to root out all the box files and display then? Why do I need to hard code any new box I put on?

Imperial Sandtrooper TD-2441, UK Garrison

Ghostbuster "Dr Smith"

Posted

Single quote the array key names:

if ( ($column['cfgvalue'] == 'yes') && ($column['cfgcol'] == 'left')) {

Check any error logs for messages.

 

Consider using an absolute address for the file test,

if ( file_exists(DIR_FS_CATALOG . DIR_WS_BOXES . $column['cfgtitle'] . '.php') ) {

Post back if you continue to have difficulties.

For ALL problems, please review this link first -> osCommerce Knowledge Base

Posted

The code you posted does not loop round at all. It only tests for one value.

 

It might be contained in a loop but can't tell from code posted.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Archived

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

×
×
  • Create New...