Guest Posted November 11, 2006 Posted November 11, 2006 I need some help with the Enhancement Who's In Shop. When I install this I get the following error message: Fatal error: Call to undefined function: tep_get_ip_address() in /hsphere/local/home/xxx/xxx/admin/whos_online.php on line 377 This is the code: // Display Status // Check who it is and set values $is_bot = $is_admin = $is_guest = $is_account = false; // Bot detection if ($whos_online['customer_id'] < 0) { $total_bots++; $fg_color = $fg_color_bot; $is_bot = true; [b] // Admin detection } elseif ($whos_online['ip_address'] == tep_get_ip_address() ) { //$_SERVER["REMOTE_ADDR"]) { $total_admin++; $fg_color = $fg_color_admin; $is_admin = true;[/b] // Guest detection (may include Bots not detected by Prevent Spider Sessions/spiders.txt) } elseif ($whos_online['customer_id'] == 0) { $fg_color = $fg_color_guest; $is_guest = true; $total_guests++; // Everyone else (should only be account holders) } else { $fg_color = $fg_color_account; $is_account = true; $total_loggedon++; } Anybody please help me with this?? This is line 377 -> [b] // Admin detection } elseif ($whos_online['ip_address'] == tep_get_ip_address() ) { //$_SERVER["REMOTE_ADDR"]) { $total_admin++; $fg_color = $fg_color_admin; $is_admin = true;[/b]
natewlew Posted November 11, 2006 Posted November 11, 2006 You need to add this code to the bottom of your: /admin/includes/functions/general.php 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; } Other great Open Source (Free) programs: (Free as in free speech not free beer) The Gimp - An image program. | Firefox - All you have to do is add the Web Developer add-on to make this web browser complete. | FileZilla - An ftp program. | Inkscape - A good program to create images with. | Thunderbird - An email program. | Openoffice.org - An office suite that is compatible with MS Office. | Abiword - Another office suite. | Audacity - A sound recording tool. | ddp's Picks | Wordpress - An easy to use blogging software. | Joomla - An easy to use CMS that has ecommerce plug-ins. | Drupal - Another CMS How do I find these programs? Google Search!
Guest Posted November 11, 2006 Posted November 11, 2006 There it worked :) Thank you for your help :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.