This is a discussion on Please help... going nuts within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; Please help I have been going crazy trying to figure this one out for days now. I have read just ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Please help I have been going crazy trying to figure this one out for days now. I have read just about every post on this and other forum and I can not get it worked out. I have found other peoples posts that are having the same problem but no replys as to how to fix the problem. I can't believe that everyone just give up on this one. The problem that I am having is that if you click on any of the main Categories that have sub-categories I get the following error message and not the sub-category pictures; Fatal error: Cannot redeclare tep_db_connect() in /home/myusername/public_html/includes/functions/database.php on line 13 This is my database.php; <?php /* $Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } if ($$link) mysql_select_db($database); return $$link; } function tep_db_close($link = 'db_link') { global $$link; return mysql_close($$link); } function tep_db_error($query, $errno, $error) { die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>'); } function tep_db_query($query, $link = 'db_link') { global $$link; if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); } $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error()); if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { $result_error = mysql_error(); error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); } return $result; } function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { reset($data); if ($action == 'insert') { $query = 'insert into ' . $table . ' ('; while (list($columns, ) = each($data)) { $query .= $columns . ', '; } $query = substr($query, 0, -2) . ') values ('; reset($data); while (list(, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= 'now(), '; break; case 'null': $query .= 'null, '; break; default: $query .= '\'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ')'; } elseif ($action == 'update') { $query = 'update ' . $table . ' set '; while (list($columns, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= $columns . ' = now(), '; break; case 'null': $query .= $columns .= ' = null, '; break; default: $query .= $columns . ' = \'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ' where ' . $parameters; } return tep_db_query($query, $link); } function tep_db_fetch_array($db_query) { return mysql_fetch_array($db_query, MYSQL_ASSOC); } function tep_db_num_rows($db_query) { return mysql_num_rows($db_query); } function tep_db_data_seek($db_query, $row_number) { return mysql_data_seek($db_query, $row_number); } function tep_db_insert_id() { return mysql_insert_id(); } function tep_db_free_result($db_query) { return mysql_free_result($db_query); } function tep_db_fetch_fields($db_query) { return mysql_fetch_field($db_query); } function tep_db_output($string) { return htmlspecialchars($string); } function tep_db_input($string) { return addslashes($string); } function tep_db_prepare_input($string) { if (is_string($string)) { return trim(tep_sanitize_string(stripslashes($string))); } elseif (is_array($string)) { reset($string); while (list($key, $value) = each($string)) { $string[$key] = tep_db_prepare_input($value); } return $string; } else { return $string; } } ?> Does anyone know what might be causing this error and how can I fix this so that I will get my sub-category pictures? If you want to see what I'm talking about please visit www.giftsuniqueshop.com and click on any category with subcategory. Thank you for any and all help. |
|
#2
| ||||
| ||||
| Check your error logs to see if there is any more information. I will take a look at it tomorrow to see if I can find anything to help... It is late and I have had a long day today. Maybe with fresh eyes I can help you out... Look for an email tomorrow.
__________________ Michael Sasek osCMax Developer
|
|
#3
| |||
| |||
| Quote:
[Wed Jun 8 10:15:18 2005] [error] PHP Fatal error: Cannot redeclare tep_db_connect() in /home/giftttny/public_html/includes/functions/database.php on line 13 [Wed Jun 8 10:15:06 2005] [error] PHP Fatal error: Cannot redeclare tep_db_connect() in /home/giftttny/public_html/includes/functions/database.php on line 13 I'm also still looking at it. I'll let you know if I find anything. Please let me know if you find anything. Jose |
|
#4
| ||||
| ||||
| Jose, I fixed it for you. You had replaced the original template index.nested.tpl.php with a non-BTS compliant file, in fact it was a copy of an old default.php file from a really old version of osCommerce. I renamed it, and replaced the original osCMax v1.7 version of index.nested.tpl.php and everything is working again.
__________________ Michael Sasek osCMax Developer
|
|
#5
| |||
| |||
| Quote:
Thanks alot guy I appreciate it. Jose |
|
#6
| ||||
| ||||
| Jose, the original file was renamed to index.nested2.tpl.php and there was the other incorrect file index.nested.tpl.php in its place. So somewhere along the line you switched them (probably testing something) and you most likely forgot about the change. I do it all the time An error like that, where it says a function cannot be redelcared is usually not caused by the file where the error shows up. What happened is that your index.nested.tpl.php was calling database.php a second time when it was not supposed to. It was easy to track down when I compared your template files against the standard osCMax templates. Your index.nested.tpl.php was about 5 times larger in size than the correct template, so it stood out clearly.
__________________ Michael Sasek osCMax Developer
|
|
#7
| |||
| |||
| I have been testing a couple of different MOD's so it is highly possible that I switch it and forgot about it as you suggested. I will take a look at some of the MOD's that I was testing and let you know what I find. Again I thank you for pointing this out to me and for all your help. Jose |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I'm going nuts with this; lots of questions; I need help! | puggybelle | osCMax v2 Customization/Mods | 4 | 10-26-2005 10:45 AM |