Jump to content

CRUZN8R

Members
  • Content count

    9
  • Joined

  • Last visited

Profile Information

  • Real Name
    Mike Challis
  1. CRUZN8R

    Who's Online Enhancement 1.4

    Yes I would try it. I have PHP5 and it works. (also works on PHP4) Your timeout problem is probably due to a non-resolving IP address. Non-resolving IP address lookups are actually quite common. Some servers are setup with a long timeout. I have the automatic ip address lookup feature turned off on my who's online page, you still see the IP addresses and if you really want to see the resolved IP, then click on the IP address link to do a lookup on that single IP. You have noting to lose by trying it. Just backup your current file in case.If you try it, please reply here, thanks.
  2. CRUZN8R

    Who's Online Enhancement 1.4

    Here is a feature enhancement to add wordwrap to HTTP Referrer URL sometimes HTTP Referrer URL is very long and makes the pace scroll at the bottom open the file /admin/whos_online.php for edit (3.4 was the latest at time I added) find: <td class="smallText" colspan="9"><?php echo '<strong>' . TEXT_HTTP_REFERER_URL . ':</strong><a href="' . htmlspecialchars($http_referer_url) . '" target="_blank">' . htmlspecialchars($http_referer_url) . '</a>'; replace with <td class="smallText" colspan="9"><?php # mjc mike challis added wordwrap to referrer url (change 150 to the number of chars you want before wrap) echo '<strong>' . TEXT_HTTP_REFERER_URL . ':</strong> <a href="' . htmlspecialchars($http_referer_url) . '" target="_blank">' . wordwrap(htmlspecialchars($http_referer_url), 150, "<br>", true) . '</a>'; ?></td>
  3. CRUZN8R

    Who's Online Enhancement 1.4

    I have the fix for this bug in vers 3.4: open the file /admin/whos_online.php for edit find code inside function tep_check_cart: if ($length = strlen($session_data)) { if (PHP_VERSION < 4) { $start_id = strpos($session_data, 'customer_id[==]s'); $start_cart = strpos($session_data, 'cart[==]o'); $start_currency = strpos($session_data, 'currency[==]s'); $start_country = strpos($session_data, 'customer_country_id[==]s'); $start_zone = strpos($session_data, 'customer_zone_id[==]s'); } else { $start_id = strpos($session_data, 'customer_id|s'); $start_cart = strpos($session_data, 'cart|O'); $start_currency = strpos($session_data, 'currency|s'); $start_country = strpos($session_data, 'customer_country_id|s'); $start_zone = strpos($session_data, 'customer_zone_id|s'); } for ($i=$start_cart; $i<$length; $i++) { if ($session_data[$i] == '{') { if (isset($tag)) { $tag++; } else { $tag = 1; } } elseif ($session_data[$i] == '}') { $tag--; } elseif ( (isset($tag)) && ($tag < 1) ) { break; } } $session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1)); $session_data_cart = substr($session_data, $start_cart, $i); $session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1)); $session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1)); $session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1)); session_decode($session_data_id); session_decode($session_data_currency); session_decode($session_data_country); session_decode($session_data_zone); session_decode($session_data_cart); if (PHP_VERSION < 4) { $broken_cart = $cart; $cart = new shoppingCart; $cart->unserialize($broken_cart); } if (is_object($cart)) { $products = $cart->get_products(); } } replace with this code: # mjc mike challis bof added to fix shopping cart indicator bug # the bug was .. When one of the visitors has an item in their cart, # every "customer" has the Active with Cart or Inactive with Cart icon blinking. # big chunk of nonesense code deleted and replaced with this: $products =0; if ($length = strlen($session_data)) { #contents";a:0: <= no products in cart #contents";a:5: <= 5 products in cart preg_match('|contents";a:(\d+):|i',$session_data, $find); $products = $find[1]; } # mjc mike challis eof added to fix shopping cart indicator bug find this code: // Determine active/inactive and cart/no cart status // no cart if ( sizeof($products) == 0 ) { replace with this code: // Determine active/inactive and cart/no cart status // no cart if ($products == 0 ) { # mjc modified to fix shopping cart indicator bug do not modify the other similar code section at the bottom of the file! Now the shopping cart indicator lights will work correctly :lol:
  4. CRUZN8R

    Who's Online Enhancement 1.4

    I have a feature enhancement that will be useful to you or anybody else having hangups on IP lookups. put this code in the configuration section of /admin/whos_online.php // mjc mike challis speed mod (added option to disable mass ip lookups that hang on some busy systems) $mass_lookup_ip = false; // <= set to true to enble, false to disable find this code: if ($whos_online['ip_address'] == 'unknown') { $hostname = $whos_online['ip_address']; } else { $hostname = gethostbyaddr($whos_online['ip_address']); } replace with this code: if ($whos_online['ip_address'] == 'unknown') { $hostname = $whos_online['ip_address']; } else { # mjc speed mod (added option to disable mass ip lookups that hang on some busy systems) $hostname = $whos_online['ip_address']; $mass_lookup_ip and $hostname = gethostbyaddr($whos_online['ip_address']); }
  5. CRUZN8R

    Register Globals Support

    I coded my own fix: catalog/includes/functions/sessions.php There are four calls to array_keys $session_keys = array_keys($_SESSION); There needs to be an is_array check on $_SESSION before calling array_keys like this: if(is_array($_SESSION)) { $session_keys = array_keys($_SESSION); put the closing curly bracket after the foreach closing curly bracket reapeat this for each of the four $session_keys = array_keys($_SESSION); in the file. Another note about the google spider: I was getting google spider stuck on cookie_usage.php quite often so I added Disallow: /catalog/shopping_cart.php Disallow: /catalog/login.php to my robots.txt
  6. CRUZN8R

    Register Globals Support

    I have the register Globals off mod installed Google is flooding my error logs with every request. Anybody have any ideas? Only google generates the errors in the log, not other users. I watched google spider my site in whos online and tail the logs and see the error append with every google request. I have "Prevent spider sessions" set to True, all other session variables set False. I am using the mysql sessions instead of the file type Linux Red Hat apache system with PHP 4.3.9 [Tue Nov 02 10:03:32 2004] [error] [client 66.249.78.54] PHP Warning: array_keys(): The first argument should be an array in /var/www/mysite/catalog/includes/functions/sessions.php on line 311 [Tue Nov 02 10:03:32 2004] [error] [client 66.249.78.54] PHP Warning: Invalid argument supplied for foreach() in /var/www/mysite/catalog/includes/functions/sessions.php on line 313 Thanks for any help
×