Jump to content
medvid

Who's Online Enhancement 1.4

Recommended Posts

I have the same error:

 

Fatal error: Call to a member function on a non-object in /.../catalog/admin/whos_online.php on line 797

 

 echo '<td valign="top">' . "\n";
  $box = new box;
  echo $box->infoBox($heading, $contents);
  echo tep_draw_separator('pixel_black.gif', '100%', '1');
[b] 797---> [/b] echo '<div class="smalltext"><b>' . TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency) . '</b></div>';
  echo '</td>' . "\n";
?>

 

Any idea?

 

 

I have the same problem too. I thnk this code is just getting the sub total price right?? I think commenting the code out by putting // this in front of that line helps solve that problem. But not sure if this is the correct method of solving it. Would like to know the reason for this and if possible a solution.

Share this post


Link to post
Share on other sites
I have the same problem too. I thnk this code is just getting the sub total price right?? I think commenting the code out by putting // this in front of that line helps solve that problem. But not sure if this is the correct method of solving it. Would like to know the reason for this and if possible a solution.

The code has to be rewriteen as follows:

 

if (is_object($cart)) {

$products = $cart->get_products();

for ($i = 0, $n = sizeof($products); $i < $n; $i++) {

$contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);

}

 

if (sizeof($products) > 0) {

$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));

$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));

} else {

$contents[] = array('text' => ' ');

}

}

 

good luck!

Share this post


Link to post
Share on other sites
The code has to be rewriteen as follows:

 

if (is_object($cart)) {

$products = $cart->get_products();

for ($i = 0, $n = sizeof($products); $i < $n; $i++) {

$contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);

}

 

if (sizeof($products) > 0) {

$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));

$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));

} else {

$contents[] = array('text' => ' ');

}

}

 

good luck!

 

works

thanks

Share this post


Link to post
Share on other sites
I think the contribution is not working well. I think it should not consider the admin a real customer.

whosonlineui8.png

If you don't want the admin to be considered a real customer search for:

  // Subtract Bots and Me from Real Customers.  Only subtract me once as Dupes will remove others
 $total_cust = $total_sess - $total_bots - ($total_admin > 1? 1 : $total_admin);
//  $total_cust = $total_sess - $total_dupes - $total_bots - ($total_admin > 1? 1 : $total_admin);

and Replace with:

  // Subtract Bots and Me from Real Customers.  Only subtract me once as Dupes will remove others
// $total_cust = $total_sess - $total_bots - ($total_admin > 1? 1 : $total_admin);
$total_cust = $total_sess - $total_dupes - $total_bots - ($total_admin > 1? 1 : $total_admin);

Share this post


Link to post
Share on other sites
The code has to be rewriteen as follows:

 

if (is_object($cart)) {

$products = $cart->get_products();

for ($i = 0, $n = sizeof($products); $i < $n; $i++) {

$contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);

}

 

if (sizeof($products) > 0) {

$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));

$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));

} else {

$contents[] = array('text' => ' ');

}

}

 

i dont undertand it, i tried it and followed the instructions, but i get an error:

 

Parse error: syntax error, unexpected $end in /websites/LinuxPackage02/en/ig/ma/enigmabunny.co.uk/public_html/admin/whos_online.php on line 814

Edited by enigmabunny

Share this post


Link to post
Share on other sites
Latest Version installed, but it displays not IP-Address.

Instead of IP-Adress I can see $IP

 

Any Help?

hey tommick!

 

I had the same problem but figure out what was the problem...

around line 500 you'll find

   }
			echo gethost($whos_online['ip_address']);			
			// previous code before Whos online fix (as per mrcold213 17 July 2007) echo gethostbyaddr($whos_online['ip_address']);

 

if you comment the first line and uncomment the second line (removing of course "previous code before Whos online fix (as per mrcold213 17 July 2007)"

you'll have the IP address with server address...

if instead you just have

 

echo $whos_online['ip_address'];

 

then you'll obatin the ip addy ;)

Share this post


Link to post
Share on other sites

i didnt get any basket informations :(

 

i have changed the

 

echo '<div class="smalltext"><b>' . TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency) . '</b></div>';

echo '</td>' . "\n";

 

to

 

if (is_object($cart)) {

$products = $cart->get_products();

for ($i = 0, $n = sizeof($products); $i < $n; $i++) {

$contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);

}

 

if (sizeof($products) > 0) {

$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));

$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));

} else {

$contents[] = array('text' => ' ');

}

}

 

 

same effect

Share this post


Link to post
Share on other sites

Well, in line 784 I replaced:

 

	  if (is_object($cart)) {
	$products = $cart->get_products();
	for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
	  $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);
	}
}
 }
}

with

 

	  if (is_object($cart)) {
	$products = $cart->get_products();
	for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
	  $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);
	}
}

	if (sizeof($products) > 0) {
	$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));
	$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));
	} else {
	$contents[] = array('text' => ' ');
	}
 }
}

 

But I'm still getting the "show_total() on a non-object" fatal error.

 

I tried this contribution with a MS2 store and It worked great, but I haven't been able to use it on a RC1 store. Maybe that's the problem?

Share this post


Link to post
Share on other sites

Ok, managed to get rid of the error, fix the IP, but, still not showing anyone with a shopping cart and I have tried it with me having items in my shopping cart but it still does not show...

 

 

 

Any ideas?

 

 

 

 

Thanks

Share this post


Link to post
Share on other sites

I have just posted v3.3 of Who's Online. This is based on v3.21 and is a comprehensive update that includes the following fixes:

 

Many fixes for HTML 4.01 DTD conformance

Rewrote product/category name display for robustness

Added product/category name display for Ultimate SEO URLs

Fixed gethostbyname errors

Rewrote duplicate counting code

 

I have tested this with both MS2 and RC1, and it appears to work correctly. Please let me know if you encounter any problems.

 

The update can be found at http://addons.oscommerce.com/info/824

--Glen

Edited by SteveDallas

Share this post


Link to post
Share on other sites

Hi thanks for the update.

 

Just installed v3.3 and all works fine except when I click on an ip address instead of taking me to dns stuff it takes me to my custom not found page!

 

other than that all seems to work just fine. any ideas?

 

Thanks

 

P.S.

 

This is how the link looks when I hover my cursor over an ip address

 

http://www.mysite.com/myadmin/%3C http://www.showmyip.com/?ip=68.207.180.79&get=nmap>

 

old way was:

 

http://www.showmyip.com/?ip=68.207.180.79

 

so it looks like I need remove the first part but not sure how.

Edited by dawnmariegifts

DawnMarieGifts

Share this post


Link to post
Share on other sites
Hi thanks for the update.

 

Just installed v3.3 and all works fine except when I click on an ip address instead of taking me to dns stuff it takes me to my custom not found page!

 

Sorry about that. Here is the fix:

 

Find this line:

							  echo '<a href="<http://www.showmyip.com/?ip=' . $whos_online['ip_address'] . '&get=nmap>" target="_blank">';

Change to this:

							  echo '<a href="http://www.showmyip.com/?ip=' . $whos_online['ip_address'] . '&get=nmap" target="_blank">';

 

I'm not sure how I missed that; I don't remember adding the angle brackets during editing.

 

I have re-uploaded the package as v3.3.1.

 

--Glen

Share this post


Link to post
Share on other sites
Sorry about that. Here is the fix:

 

Find this line:

							  echo '<a href="<http://www.showmyip.com/?ip=' . $whos_online['ip_address'] . '&get=nmap>" target="_blank">';

Change to this:

							  echo '<a href="http://www.showmyip.com/?ip=' . $whos_online['ip_address'] . '&get=nmap" target="_blank">';

 

I'm not sure how I missed that; I don't remember adding the angle brackets during editing.

 

I have re-uploaded the package as v3.3.1.

 

--Glen

 

 

Yup!

 

That did it, great job and; Thanks for your contribution.


DawnMarieGifts

Share this post


Link to post
Share on other sites

I installed the lastest version today. Lots of nice features!

 

But... I get no listing of user's carts. Even the plain stock version did that.

Any idea what's wrong?

Thanks.

Share this post


Link to post
Share on other sites
I installed the lastest version today. Lots of nice features!

 

But... I get no listing of user's carts. Even the plain stock version did that.

Any idea what's wrong?

Thanks.

 

It displays carts for me. What osC version are you using? If you click on "Profile Display: All", does it display session IDs (osCsid)?

 

Is there anything non-standard about your setup? I'd like to help you determine whether this is a problem with the module, or something in your setup that is causing the carts not to display. Any information you can provide will help me get it sorted out for you.

 

--Glen

Share this post


Link to post
Share on other sites
It displays carts for me. What osC version are you using? If you click on "Profile Display: All", does it display session IDs (osCsid)?

 

Is there anything non-standard about your setup? I'd like to help you determine whether this is a problem with the module, or something in your setup that is causing the carts not to display. Any information you can provide will help me get it sorted out for you.

 

--Glen

 

From /includes/application_top.php:

'PROJECT_VERSION', 'osCommerce 2.2-MS2');

 

When I click on "Profile Display: All" I get this:

osCsid: c0b6a1bfac6770145115d3758582f6f3

 

I have lot's of contribs installed and most of them I have tweaked. I did a lot of work on how invoices and packing slips are handled on my own.

 

But again, the cart contents were shown in detail with the original Who's Shopping.

Thanks.

Share this post


Link to post
Share on other sites

As mentioned earlier in this thread I have terrible problems with the who's online not loading every now and again, column left will load but then sometimes it gets stuck. Is this a common problem and does anyone else have it? Thanks.


Thanks for any help/comments.

 

Regards,

 

Lewis Hill

Share this post


Link to post
Share on other sites

I have posted what I hope will be the last update for a while. I found and corrected the error that caused carts not to display under certain circumstances. I also included the French language file provided by delete13.

 

What happened was that the code was trying to pull the cart information from the database regardless of the setting of STORE_SESSIONS. I believe that the prior contributor did this to resolve what was actually a configuration error in his shop.

 

STORE_SESSIONS is set for users in catalog/includes/configure.php, but whos_online.php pulls it from catalog/admin/includes/configure.php. If they are not the same, you will not see carts in whos_online.php. Version 2.0ec's behavior basically ignored the setting and used the method for STORE_SESSIONS='mysql', no matter how you configured it, so you only saw cart information if catalog/includes/configure.php had STORE_SESSIONS='mysql'. Version 3.3.2 restores the original behavior and follows the setting of STORE_SESSIONS.

 

I hope that makes some sense.

 

To update, simply replace admin/whos_online.php. No other changes were made to the files.

 

--Glen

Edited by SteveDallas

Share this post


Link to post
Share on other sites
As mentioned earlier in this thread I have terrible problems with the who's online not loading every now and again, column left will load but then sometimes it gets stuck. Is this a common problem and does anyone else have it? Thanks.

 

I occasionally see a long delay before the table is completed if no reverse DNS information exists for an address. The table is eventually drawn, though. Could this be your problem?

Share this post


Link to post
Share on other sites
I occasionally see a long delay before the table is completed if no reverse DNS information exists for an address. The table is eventually drawn, though. Could this be your problem?

 

Could be - any way to disable this and tell for sure?

 

You say yours loads eventually whereas mine sometimes doesn't load at all!


Thanks for any help/comments.

 

Regards,

 

Lewis Hill

Share this post


Link to post
Share on other sites

i have the same problem .. and then later it says down below .. "mysql has gone away" ...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×