PDA

View Full Version : Who's Online 3.4 ~ OSCMax



ALElder
03-10-2008, 07:33 AM
Can someone please help me this mod is only 3 files and my client wants me to update to the new ver. But having some problems.

osCommerce Community Add-Ons (http://addons.oscommerce.com/info/824)

I can get everything to work with the exception on the cart content

Thanks,

Adam

MindTwist
03-12-2008, 02:26 PM
I have to ask, why upgrade? What does 3.4 have that can make it worth it changing the who's online on the default 2.2 installation?

With the one that comes with OSCMAX you can already see the customers shopping cart.

ALElder
03-12-2008, 04:36 PM
I would think the same thing but their are in fact some new updates:

1. You can see who are true customers / bots / other
2. Auto refreshs
3. Can click on IP and find out who is that IP
4. Current status with lights also if items are in the cart will show that with a shopping cart
5. All in all not much but should be an easy update.

Thanks,

Adam

MindTwist
03-13-2008, 01:08 AM
Just installed it and no problems over here, cart contents seem to be showing correctly.

The only weird thing is that I am showing up with IP 192.168.1.4 and not my public IP...?? I opened the store on another browser on another connection, and I am seeing that IP correctly, go figure. I add products to my cart and see them on "who's online". I remove them, and after a few seconds they are gone since I have set it to update every 30 sec.

All in all, it seems to be a nice and easy upgrade from stock OSCMAX, I am only missing the spanish language file.

bkpie
03-16-2008, 08:59 AM
Interesting, The 192.168 IP is usually an ip connection for your router. As far as the cart not showing in Adams and is showing in Mindtwist I think you will find that it is a php4 versus a php5 issue It is my bet that Mindtwist is php4 and Adam is php 5. A small change to the code in the whosonline.php will be neccessary. I will see if I can find it later.

MindTwist
03-16-2008, 09:13 AM
Version PHP: 5.2.2 (Zend: 2.2.0)

I haven't looked at the code, but seeing myself with the private IP on who's online is quite strange... It makes it even more strange that my network setups are similar here and at the office, and I am actually seeing myself with my office connection with the public IP, how it should be, and with the default OSCMAX who's online module my IP at home was also the right one.

bkpie
03-16-2008, 04:16 PM
What did you use when you changed for register globals to switch to php5 with register globals off? This is since that contribution works for me with 4 but not 5 although everything else works. I saw someone in the osc forums that had the private IP issue and I am trying to track that down again to see if they applied a fix.

MindTwist
03-16-2008, 04:35 PM
Can't help you much, since I didn't do anything. Just installed the contribution on the first post, and it worked without touching anything else. register_globals is ON on my host, php5 as stated. This store has always been running on this same host, I'd say it has been php5 from the first day.

MindTwist
03-16-2008, 04:44 PM
Doh, so I guess that the support thread for this contribution is this one...

Who's Online Enhancement 1.4 - osCommerce Community Support Forums (http://forums.oscommerce.com/index.php?showtopic=124853)

60 pages of posts, which would make it kinda boring to find out why I am being shown as 192.168.1.2 instead of with my public IP :D

bkpie
03-16-2008, 04:49 PM
Ok thank you for that. Now it makes more sense because if I turn register globals on the cart works in that version of whos online but does not with reg glo off. So then it is most likely a session problem in the code. For Adam while I look at this some more make sure the configure.php files in both admin/includes and catalog/includes have store sessions set to mysql. If files are different that could cause the problem

ALElder
03-18-2008, 06:43 AM
Thanks for both your help I had to change the:

In OSCMAX ~ you will need to review setting of STORE_SESSIONS files "includes/configure.php and admin/includes/configure.php." I needed to change the '' to 'mysql' for both.

That fixed the cart problem still is a little slow on the load time.

Adam

ALElder
03-18-2008, 07:02 PM
A new project_project entry has been added:
Who's Online 3.4 ~ OSCMax - osCMax - osCommerce Maximized (http://www.oscmax.com/forums/../../project/Whos_Online)



1. You can see who are true customers / bots / other
2. Auto refreshs
3. Can click on IP and find out who is that IP
4. Current status with lights also if items are in the cart will show that with a shopping cart
5. All in all not much but should be an easy update.

Gizmor
03-20-2008, 04:23 PM
No url in you message ?

ALElder
03-21-2008, 05:15 AM
Who's Online 3.4 ~ OSCMax - osCMax - osCommerce Maximized (http://www.oscmax.com/project/Whos_Online)

What do you mean no URL?

Adam

ALElder
03-21-2008, 05:16 AM
Just an FYI if anyone whats this please use the link below:

Who's Online 3.4 ~ OSCMax - osCMax - osCommerce Maximized (http://www.oscmax.com/project/Whos_Online)

Adam

Gizmor
03-21-2008, 11:54 AM
hmm for some reason i didnt see the download url yesterday no i do gonna try it out :D

/edit
just installed it, it's easy to do and working great. thnx

JohnW
03-31-2008, 06:54 PM
I just stumbled on version 3.4 today and it's definitely one of the easiest contributions to add on although I had not althered these files before. I still have register_globals on with 5.25 & mysql 5.045 on Apache 2.2 and this contribution works perfectly.

minuteman1970
02-23-2009, 08:18 AM
I am considering installing this contribution, but noticed there have been a few version updates on the official osc contribution website (latest is v3.5.4). Was this enhancement modified for OscMax in any way, or can I just install the latest official Osc contribution?
Thanks.

JohnW
02-23-2009, 08:40 AM
I'm running 3.5.4 and you don't have to modify it at all for OscMax. One note about this is phpsuhosin will block some functions on this module. Check the main forum and he discusses but if it doesn't work correctly that is a probable cause. It will make hang and time out on a few functions.

ridexbuilder
05-05-2009, 01:05 AM
Just for some clarity:
It appears that suhosin php-hardening is the cause behind cart contents not being viewable.

ridexbuilder
05-13-2009, 03:52 AM
Anyone figured out how to allow the cart to display - maybe by substitution of the function call with a suhosin compatible one?

jpf
05-13-2009, 05:56 AM
if you read the notes:

4. This contribution is not completely compatible with the "suhosin PHP security patch from the Hardened-PHP Project". Cart contents will not display.

If you have that installed - do not install this contrib. Will not work. Or uninstall the suhosin patch.

ridexbuilder
05-13-2009, 06:01 AM
Thanks jpf,
I had read the notes but things move on (sometimes) :p
I'm forever hopeful ;)

EJ

JohnW
05-13-2009, 07:02 AM
I find Who's Online 3.5.4 to be a very useful tool and I use it often, but the phpsuhosin problem has existed for over a year with it.

ridexbuilder
05-13-2009, 07:06 AM
Yep, one of my clients loves it - can't stay away ;) Just a change of hosting provider recently, brought the issue into focus. It's a PITA that it doesn't work - hence my asking if a workaround had been found. :) It's still a worthwhile contrib. to add but is a lot better when the cart shows ;)

JohnW
05-13-2009, 07:33 AM
It took me quite a while to figure out what was causing my problem, but it had worked on earlier versions of suhosin. I'm on a dedicated server so I have suhosin off for the time being but if your client is on a box running Mod_SuPhp it is possible to run a unique php.ini for his account if they allow it. I have 3 different php.ini for my live site and 2 test sites. You can put this in his .htaccess and give it a try, but you have to put all the php.ini details in his file or it will go with default settings. Just remove the sushosin extension for his.

suPHP_ConfigPath /home/username/public_html
<Files php.ini>
order allow,deny
deny from all
</Files>


Suhosin also caused problems with my quick updates that I was using a lot because I modified it to change dimensions and weight for UPSxml. I updated mine to full dimension support in 2006 so using quick updates for it really helped me along a lot because the packing routine was new and JanZ was tweaking it from my feedback. It used to put items that wouldn't fit in a box.

ridexbuilder
05-13-2009, 08:09 AM
You, my friend, are a flippin' star! :-) :trampolin:
Looks as though it's only required at the Admin level - though a bit too soon to be certain.

Ta muchly
Have a good one. :cheers:
EJ

JohnW
05-13-2009, 08:41 AM
Actually, I just played with this after I wrote that and it works perfectly and yes you only need to change it at admin level. Honestly, I hadn't thought about this for suhosin until I was writing my last post and it came to me at the time. I did it originally in working on register_globals. So, right now on my server I have the main php.ini with
; Directory in which the loadable extensions (modules) reside.
extension = "homeloader.so"
extension = "suhosin.so"
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
and on my live site using who's online

; Directory in which the loadable extensions (modules) reside.
extension = "homeloader.so"
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"

But, make sure you put an entire php.ini and not just want you want to change because it will assume default settings for the rest. There is some info out there saying to just put what you want to change but you need a full file. It only needs a permission of 400 after it's set.

I can't believe I didn't think of this before but I guess that's proof that we can help ourselves by answering others. Let me know if you have any questions.

ridexbuilder
05-13-2009, 08:48 AM
Kinda lost me with that lot :confused::D

All I done was added the code you supplied (replacing the userid) to the top of .htaccess in the admin directory - shazzam! :-D

[If I recall, there's an extensive top level php.ini, with a suhosin directive in it, that was supplied by my hosting provider - it made not a jot of difference, until...]

EJ

[Amazing how thinking on one problem/challenge sparks up an idea in another one ;)]

JohnW
05-13-2009, 09:35 AM
EJ,

I meant it only needs chmod at 400 not 644 or 444 when running mod_suphp.

The above code was only the part of the ini that is changed but you need to put a full ini and not just the change, so copy the host's php.ini and only change the suhosin or the php will use php default settings which is not a good for production servers. I made this mistake myself at first. The top level php.ini is overwritten entirely for the folder you put it in so you want to duplicate it and only change the suhosin directive IMHO.

My understanding is some host will block the ability to do this because of problems they've had.

JohnW
09-07-2009, 05:12 PM
Hey EJ,

There have been some substantial updates to who's online and I have it running with Suhosin enabled and showing carts, so you don't have to work around Suhosin anymore. There are now icons for browser, os, referer and such. Check it out.

Who's online v 3.65 (http://addons.oscommerce.com/info/824)

ALElder
09-08-2009, 09:54 AM
For anyone that cant get the map feature to work on the new version you can edit the Admin/whos_online.php

Do a search for ' . GOOGLE_MAPS_KEY . ' and replace with the code from Google upload file.

Hope this helps someone,

Adam

JohnW
09-08-2009, 12:48 PM
The map seemed pretty easy to get working but it can be leftoff if not using it. While it's kind of neat I don't find it super useful:).

The map has a check on/off switch so it can be turned off but it's fast and easy to get the access key from Google and it's added in the admin/configuration file.

wkdwich
04-12-2010, 05:07 PM
running oscmax 2.0.25 with a dev cart and a live (as of this AM) cart.. the dev cart whos_online.php comes up fine.. but the live one is a no go.. a totally blank page.. what might cause that?? I repaired the database.. I did get a google maps API key and installed that on the live cart, the dev one doesnt have a key installed..

michael_s
04-12-2010, 06:37 PM
Check your php error logs for anything related to whos_online.php. That would be the first place to check.

wkdwich
04-12-2010, 08:51 PM
every other little thing is logged but for the life of me I can not find the php log or the log in which it does write the errors.. I will hunt that down and or turn it on.. thanks Michael.. odd thing is this site and the dev site are on the same box., I have done a beyond compare of the 2 and the only differences I see are language files and other minor stuff non of whoch have anything to do with whos_online as far as I can tell

michael_s
04-13-2010, 07:22 AM
That is why you need the error logs. Typically you will see the exact location of the problem.

wkdwich
04-14-2010, 07:28 PM
Houston we have a problem..

I have now fully enabled ALL php error logging, tried that whos-online page again and nothing gets logged.. now where do I go with this??? so frustrating..

wkdwich
04-14-2010, 07:36 PM
and just to add I am tailing the error_log fixing some things coming up in there and it is logging OTHER php errors.. just not his error..

wkdwich
04-15-2010, 06:47 AM
OK Call off the dogs, I just removed the one entry in the whos_online table in the DB and bingo the page comes up now :)

BUT now I went to the public site myself and refreshed, blank again.. something wrong with the table I assume .. checking that out

exported entire table structure and did a compare - identical

same blank page result in FF or MSIE

so now where else can I look???

wkdwich
04-21-2010, 12:10 PM
OK I really need help on this one please.. I just checked the admin/whos_online.php again on cart 1 and the page came up, showed no one online.. had a friend go to the cart and refreshed and blank page again..

I now checked admin/whos_online.php in cart 2 - it also came up, showed no one online, I had him now go to this cart, refreshed and whamo blank page again

I have compared:
admin/whos_online.php
admin/includes/functions/general.php
admin/includes/functions/whos_online.php
admin/includes/application_top.php

All are identical..

what now????

wkdwich
06-17-2010, 08:32 PM
is no one else having an issue with a blank whos_online page?? Just installed (upgraded really not new install) to latest version, and once again I have this blank page issue.. I have checked the logs and nothing is showing up there at all

I will tell you the admin/whos_online file I am using has not be tweaked in any way shape or form from the original

JohnW
06-18-2010, 05:03 AM
You can put something like this in application_top or probably in the file itself it you like.

error_reporting(E_ALL);
ini_set('error_log', DIR_WS_INCLUDES . 'wkdwich_errors.log');

Or, however you want to do it, but you can get some errors this way.

Check all your permissions that are involved in case one is set incorrectly that can give you a 500 error.

Or, phpsuhosin may be preventing it from running.

wkdwich
06-18-2010, 06:28 AM
ok got something to work with now.. I put that set of lines directly in whos_online.php


Fatal error: Cannot instantiate non-existent class: simplexmlelement in /home/wkdwich/public_html/shoppeNEW/admin/whos_online.php on line 109


Lines 106-110

$answer = new SimpleXMLElement($backup);
if (!$backup) return false; // Failed to open connection
}else{
$answer = new SimpleXMLElement($d);
}


I thought the fact I had not changed permission on the backup folder might be the answer, but no that wasn't it.

I tried various combinations of commenting out those lines, changing it to:


// $answer = new SimpleXMLElement($backup);
// if (!$backup) return false; // Failed to open connection
// }else{
// $answer = new SimpleXMLElement($d);
}

Did bring up the page but with left navigation and the content itself had a slew of other errors..

I searched the forums here and at oscommerce.com and found this post:
Who's Online Enhancement 1.4 - osCommerce Community Support Forums - Page 79 (http://forums.oscommerce.com/topic/124853-whos-online-enhancement-14/page__st__1560)

unfortuantely that again gave me the page, left navigation & content but with a whole slew of errors..

FYI I do not have suhosin installed
running PHP Version 4.4.7

Further in the same thread:

If you are still getting this error there is a fix that was posted but was not correct in how to comment it out.

The correct way is to do this..

//$answer = new SimpleXMLElement($backup);
//if (!$backup) return false; // Failed to open connection
}//else{
//$answer = new SimpleXMLElement($d);
//}

Notice the line }//else{ If you put the // in front of the } you will get another error.


but that did not work either, page comes up, but same slew of errors in the left nav and content..

where do I go from here???

I forgot to add that in admin/functions/whos_online.php I added:

if(!function_exists('stripos')) {
function stripos($haystack, $needle, $offset = 0) {
return strpos(strtolower($haystack), strtolower($needle), $offset);
}
}

as was instructed in the thread @ forums.oscommerce.com

Thats when I started to get the page displaying but with loads of other errors

JohnW
06-18-2010, 09:42 AM
Why are you still using php 4??????????????

The SimpleXML extension requires PHP 5.

I'm not sure if you realize it or not but the blank screen is an error but if you aren't printing the errors to the screen then you can't see them, which is good because printing errors to the screen gives hackers information. You should set up a test site that is password protect by Apache to help troubleshoot problems.

Get PHP 5+

wkdwich
06-23-2010, 07:56 AM
Why are you still using php 4??????????????

The SimpleXML extension requires PHP 5.

I'm not sure if you realize it or not but the blank screen is an error but if you aren't printing the errors to the screen then you can't see them, which is good because printing errors to the screen gives hackers information. You should set up a test site that is password protect by Apache to help troubleshoot problems.

Get PHP 5+

Yes I am aware the blank screen is screaming at me ERROR BUZZ BUZZ ERROR :)

My issue was the variety of php apps running on the server. I have now set up a test site at a free hosting place and was able to test many of the other apps to see if they rill break or not on php5.. good news is 90% will not break, the remaining either I could not get the settings right at 4a to test or they flat out refused to corporate.. so I will be upgrading ASAP..

For the time being though I did just upload the old whos_opnline.php and at least it gave me some info there..