Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please Help Regarding Who's Online Enhancement !


Elazar

Recommended Posts

Hi,

 

I upgraded who's online enhancement 3.2 (THE LAST CONTRIBUTION) from who's online enhancement 2.00 by azer

 

Then I get this error...

 

Fatal error: Cannot redeclare tep_get_ip_address() (previously declared in /home/XXXXX/public_html/admin/whos_online.php:23) in /home/XXXXX/public_html/admin/includes/functions/general.php on line 1379

 

Please note that the XXXXX = my user name

 

Did someone know how to fix it ??

 

Any advises please.. :'(

 

Elazar

Link to comment
Share on other sites

Hi,

 

I upgraded who's online enhancement 3.2 (THE LAST CONTRIBUTION) from who's online enhancement 2.00 by azer

 

Then I get this error...

 

Fatal error: Cannot redeclare tep_get_ip_address() (previously declared in /home/XXXXX/public_html/admin/whos_online.php:23) in /home/XXXXX/public_html/admin/includes/functions/general.php on line 1379

 

Please note that the XXXXX = my user name

 

Did someone know how to fix it ??

 

Any advises please.. :'(

 

Elazar

 

Find this code in /admin/includes/functions/general.php and delete it or comment it out with a /* at the beginning and a */ at the end. As the error says, it is now in the /admin/whos_online.php file and cannot be declared twice. Since I would guess future updates will keep it in the who_online.php file, it is probably best to remove or comment it out of the general.php since in the older versions it had to be added to this file.

 

 

function tep_get_ip_address() {

if (isset($_SERVER)) {

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {

$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];

} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {

$ip = $_SERVER['HTTP_CLIENT_IP'];

} else {

$ip = $_SERVER['REMOTE_ADDR'];

}

} else {

if (getenv('HTTP_X_FORWARDED_FOR')) {

$ip = getenv('HTTP_X_FORWARDED_FOR');

} elseif (getenv('HTTP_CLIENT_IP')) {

$ip = getenv('HTTP_CLIENT_IP');

} else {

$ip = getenv('REMOTE_ADDR');

}

}

 

return $ip;

}

Link to comment
Share on other sites

Find this code in /admin/includes/functions/general.php and delete it or comment it out with a /* at the beginning and a */ at the end. As the error says, it is now in the /admin/whos_online.php file and cannot be declared twice. Since I would guess future updates will keep it in the who_online.php file, it is probably best to remove or comment it out of the general.php since in the older versions it had to be added to this file.

function tep_get_ip_address() {

if (isset($_SERVER)) {

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {

$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];

} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {

$ip = $_SERVER['HTTP_CLIENT_IP'];

} else {

$ip = $_SERVER['REMOTE_ADDR'];

}

} else {

if (getenv('HTTP_X_FORWARDED_FOR')) {

$ip = getenv('HTTP_X_FORWARDED_FOR');

} elseif (getenv('HTTP_CLIENT_IP')) {

$ip = getenv('HTTP_CLIENT_IP');

} else {

$ip = getenv('REMOTE_ADDR');

}

}

 

return $ip;

}

And this solution was also given in the support thread for the contribution.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...