osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Please help... going nuts

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 06-07-2005, 08:30 PM
Active Member
 
Join Date: May 2003
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
judoka
Default Please help... going nuts

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 06-07-2005, 10:10 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,328
Thanks: 68
Thanked 322 Times in 305 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default RE: Please help... going nuts

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


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 06-08-2005, 07:26 AM
Active Member
 
Join Date: May 2003
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
judoka
Default Re: RE: Please help... going nuts

Quote:
Originally Posted by msasek
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.
Thanks Michael I appreciate the help. I just looked at my error log and didn't see anything new there either just the same error message. This is from the error log;

[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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 06-08-2005, 08:23 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,328
Thanks: 68
Thanked 322 Times in 305 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default RE: Re: RE: Please help... going nuts

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


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 06-08-2005, 09:15 AM
Active Member
 
Join Date: May 2003
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
judoka
Default Re: RE: Re: RE: Please help... going nuts

Quote:
Originally Posted by msasek
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.
Thank You Michael Your The Man you don't know how this has been driving me crazy. Since the error message was saying that the problem was in my database.php file I just kept going over it again and again and....... I don't know how I got the wrong index.nested.tpl.php but I will certainly take a look at it to make sure it hopefully doesn't happen again.
Thanks alot guy I appreciate it.
Jose
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 06-08-2005, 09:28 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,328
Thanks: 68
Thanked 322 Times in 305 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default RE: Re: RE: Re: RE: Please help... going nuts

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


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 06-08-2005, 09:41 AM
Active Member
 
Join Date: May 2003
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
judoka
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 09:59 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax