Guest Posted October 3, 2008 Posted October 3, 2008 this is an error i have got after sstupisly playing around with things again. Fatal error: Class 'tableBox' not found in /home/mysakab1/public_html/mysakab/includes/classes/message_stack.php on line 20 <?php /* $Id: message_stack.php 1740 2007-12-20 14:57:13Z hpdl $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2002 osCommerce Released under the GNU General Public License Example usage: $messageStack = new messageStack(); $messageStack->add('general', 'Error: Error 1', 'error'); $messageStack->add('general', 'Error: Error 2', 'warning'); if ($messageStack->size('general') > 0) echo $messageStack->output('general'); */ class messageStack extends tableBox { // class constructor function messageStack() { global $messageToStack; $this->messages = array(); if (tep_session_is_registered('messageToStack')) { for ($i=0, $n=sizeof($messageToStack); $i<$n; $i++) { $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']); } tep_session_unregister('messageToStack'); } } // class methods function add($class, $message, $type = 'error') { if ($type == 'error') { $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . ' ' . $message); } elseif ($type == 'warning') { $this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $message); } elseif ($type == 'success') { $this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . ' ' . $message); } else { $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => $message); } } function add_session($class, $message, $type = 'error') { global $messageToStack; if (!tep_session_is_registered('messageToStack')) { tep_session_register('messageToStack'); $messageToStack = array(); } $messageToStack[] = array('class' => $class, 'text' => $message, 'type' => $type); } function reset() { $this->messages = array(); } function output($class) { $this->table_data_parameters = 'class="messageBox"'; $output = array(); for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) { if ($this->messages[$i]['class'] == $class) { $output[] = $this->messages[$i]; } } return $this->tableBox($output); } function size($class) { $count = 0; for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) { if ($this->messages[$i]['class'] == $class) { $count++; } } return $count; } } ?> I would be forever greatful to anyone that can help me. I have used the back up file that i made of the code i was trying to change and each time i fix one it leads me to another that is wrong. this one has me stumped.
lindsayanng Posted October 3, 2008 Posted October 3, 2008 i guess you need to go to catalog/includes/classes/boxes and look to see if you have a class called tableBox. you must have added a new class to your message_stack.php file, but didnt add it to the classes/boxes.php file. You should also always keep ONE clean backup in its own folder so you can scrap everything and start over. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 3, 2008 Posted October 3, 2008 yep.. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.