dkgryf Posted March 10, 2007 Posted March 10, 2007 Please help me. I am not a programmar and i don´t know what i have to do now because i get this error: Fatal error: Cannot redeclare class messageStack in /mounted-storage/home28a/sub001/sc24474-TGCN/netshop4all.dk/includes/classes/message_stack.php on line 88 I hoe someone can help me. Thank you Best regards Mogens,DK
atomic tank tkr Posted March 28, 2007 Posted March 28, 2007 i am also new to osC and i am having a similar problem; i installed the newest version of STS and threw my template together. when i try to test on my localhost i get this error. Fatal error: Cannot redeclare class messageStack in C:\wamp\www\catalog\includes\classes\message_stack.php on line 88 <?php /* $Id: message_stack.php,v 1.1 2003/05/19 19:45:42 hpdl Exp $ 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; } } ?> any help would be very nice. thank you.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.