Jump to content
medvid

Who's Online Enhancement 1.4

Recommended Posts

P.S (to the above). Also the Indicator light reports "Active No Cart"

John,

 

Very strange. i've switched over to files for the last 24 hours and it works just fine. Did you have cart contents for version 1.5? I'm using the exact same cart code. No changes there except that I DON'T change the curly braces like 1.5b_2.

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
Mike,

 

Could you test the following?  I don't have a Windows server...

 

In catalog/includes/functions/whos_online.php, add the following just above function tep_update_whos_online():

function request_uri() { 

?if (isset($_SERVER['REQUEST_URI'])) { 
? ?$uri = $_SERVER['REQUEST_URI']; 
?} 
?else { 
? ?if (isset($_SERVER['argv'])) { 
? ? ?$uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0]; 
? ?} 
? ?else { 
? ? ?$uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING']; 
? ?} 
?} 

?//return check_url($uri);
?return $uri; 
}

Then, find:

$wo_last_page_url = getenv('request_uri');

and replace it with:

$wo_last_page_url = request_uri();

I found some documentation that says request_uri is only available on Linux.  This function tries other possible ways to get the URL.

 

ed

 

I was having the same problem with the last URL clicked not working but I am on a Linux server, I made the mods and it works fine now

 

Shane

Share this post


Link to post
Share on other sites
John,

 

Try setting:

Check IP Address: False

Recreate Session: False

 

Are you on Windows or Unix?

 

ed

 

Ed

 

Changed the above to to False as suggested but no change, No cart contents.

 

And to your post above, yes the cart contents did show.

 

John

Share this post


Link to post
Share on other sites
Scott,

 

In the Last URL column, do you see /index.php or /catalog/index.php?  The code takes HTTP_SERVER from admin\includes\configure.php and adds whatever is shown in the Last URL column.  If there's a "/catalog" in HTTP_SERVER AND Last URL, you need to figure out a way to remove one of them.

 

ed

 

 

I see:

/catalog/index.php?..........

 

My admin/includes/configure.php has this in it:

define('HTTP_MAIN_HOME', 'http://www.popthetop.com');

define('HTTP_SERVER', 'http://www.popthetop.com');

define('HTTPS_SERVER', 'https://www.popthetop.com');

define('ENABLE_SSL', true);

define('HTTP_COOKIE_DOMAIN', 'www.popthetop.com');

define('HTTPS_COOKIE_DOMAIN', 'www.popthetop.com');

define('HTTP_COOKIE_PATH', '/catalog/');

define('HTTPS_COOKIE_PATH', '/catalog/');

define('DIR_WS_HTTP_CATALOG', '/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/catalog/');


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Ed

 

A late update.

I don't know exactly what happened but I swtitched back the sessions to Mysql and the error is gone and it's reporting the full shopping cart contents and everthing is working correctly.

Share this post


Link to post
Share on other sites
I see:

/catalog/index.php?..........

 

My admin/includes/configure.php has this in it:

  define('HTTP_MAIN_HOME', 'http://www.popthetop.com');

  define('HTTP_SERVER', 'http://www.popthetop.com');

  define('HTTPS_SERVER', 'https://www.popthetop.com');

  define('ENABLE_SSL', true);

  define('HTTP_COOKIE_DOMAIN', 'www.popthetop.com');

  define('HTTPS_COOKIE_DOMAIN', 'www.popthetop.com');

  define('HTTP_COOKIE_PATH', '/catalog/');

  define('HTTPS_COOKIE_PATH', '/catalog/');

  define('DIR_WS_HTTP_CATALOG', '/catalog/');

  define('DIR_WS_HTTPS_CATALOG', '/catalog/');

 

What your showing here is catalog/includes/configure.php, not the admin one.

Share this post


Link to post
Share on other sites
Andrea,

 

Forget whos online for a minute.  Please try the following:

Create directory catalog\sessions - set perms to 777

Set Admin->Configuration->Sessions->Session Directory to "sessions" - no slashes

Edit both catalog\includes\configure.php and admin\includes\configure.php to say: define('STORE_SESSIONS', '');

Browse your shop a few clicks and add something to the cart.

 

I know you've tried this before but please try one more time.  Now, check if there are actually session files being created in the catalog\sessions directory.  Check their date/time to make sure their new.

 

IF you have current files, check whos online and see if it's working.

IF you don't have current files, the problem is there.

 

ed

 

 

I just tried that and for my sessions to work, it had to be set as:

/home/popthet/public_html/catalog/sessions

 

I have never been able to get them stup correctly until now. Thanks!


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
P.S (to the above). Also the Indicator light reports "Active No Cart"

 

 

With my sessions being saved to the sessions folder, I have the very same problem as you.

 

WHen I set both configure.php files to define('STORE_SESSIONS', 'mysql'); then everything works great.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
What your showing here is catalog/includes/configure.php, not the admin one.

 

 

Sorry...

define('HTTP_SERVER', 'http://www.popthetop.com/catalog');

define('HTTPS_SERVER', 'https://www.popthetop.com/catalog');

define('HTTP_CATALOG_SERVER', 'http://www.popthetop.com');

define('HTTPS_CATALOG_SERVER', 'https://www.popthetop.com');

define('ENABLE_SSL_CATALOG', 'true');

define('DIR_FS_DOCUMENT_ROOT', '/home/popthet/public_html/catalog'); // $DOCUMENT_ROOT - where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)

define('DIR_WS_ADMIN', '/admin/');

define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);

define('DIR_WS_CATALOG', '/catalog/');

define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
What your showing here is catalog/includes/configure.php, not the admin one.

 

 

I got it to work now that I understand...

 

If I remove the extra /catalog for the path settings, it does not work because the links for the LAST URL adds an extra /catalog to the link.

 

I canged it to all another setting already in the admin/configure.php file as follows and it works great now:

 

<?php echo (($request_type == 'SSL') ? HTTPS_CATALOG_SERVER : HTTP_CATALOG_SERVER) . $temp_url_link; ?>


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

thank you so much ed, that cracked it :)

 

i can get hooked again on watching people in the store

 

mike


"because it'll hurt more"- the greatest film of all time?

Share this post


Link to post
Share on other sites

Ok this is weird...

 

Last night, this was working just fine. Then this morning when I got up, it started to work fine, but when I click on one of the lines to highlight a certain one, I now get the following error...

 

Warning: main(includes/languages/): failed to open stream: No such file or directory in /home/popthet/public_html/catalog/admin/includes/application_top.php on line 128

Warning: main(includes/languages/): failed to open stream: No such file or directory in /home/popthet/public_html/catalog/admin/includes/application_top.php on line 128

Fatal error: main(): Failed opening required 'includes/languages/</a>' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/popthet/public_html/catalog/admin/includes/application_top.php on line 128

 

I checked and yes, I do have whos_online.php in the admin/includes/languages/ folder and I even uploaded it once more to be certain that is was not corrupted.

 

My configure.php settings are as follows:

  define('HTTP_SERVER', 'http://www.popthetop.com/catalog');
 define('HTTPS_SERVER', 'https://www.popthetop.com/catalog');
 define('HTTP_CATALOG_SERVER', 'http://www.popthetop.com');
 define('HTTPS_CATALOG_SERVER', 'https://www.popthetop.com');
 define('ENABLE_SSL_CATALOG', 'true');
 define('DIR_FS_DOCUMENT_ROOT', '/home/popthet/public_html/catalog');
 define('DIR_WS_ADMIN', '/admin/');
 define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);
 define('DIR_WS_CATALOG', '/catalog/');
 define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
 define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
 define('DIR_FS_BACKUP', '/home/popthet/public_html/catalog/admin/backups/');

 

And my application_top.php - line 128 is

require(DIR_WS_LANGUAGES . $language . '.php'); of:

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');
 $current_page = basename($PHP_SELF);
 if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
   include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
 }

 

Any clues? Now remember... This only happens when I click on the line (not link) to highlight/show a certain line.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Now I have problems as well that I did not have with 1.5.

- cannot see always the cart

- cannot see always bots

- some time cannot see registered customer

 

I will look at the code later.. I will let you know.

Share this post


Link to post
Share on other sites

One more problem just noticed...

 

A few minutes later, there were no one visting my store. Then as soon as a new visitor came along it showed the new guest.

 

1 minute later it refreshed and where the icon is supposed to be shown, I get this error:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/popthet/public_html/catalog/admin/includes/functions/database.php on line 45
0 - 

select session_id, time_entry, time_last_click from whos_online where session_id='3d79acce220e4dc0cb14ebcbb684cd8f'

 

 

Line 45 of admin/includes/functions/database.php:

    $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

 

 

In my whos_online.php, that part of the HTML code is this:

    if ($whos_online['session_id'] == $info) {
      if($whos_online['http_referer'] != "")
      {
       $http_referer_url = $whos_online['http_referer'];
      }
     echo '<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
   } else {
     echo '<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_WHOS_ONLINE, tep_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online['session_id'], 'NONSSL') . '\'">' . "\n";
   }

  // 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;
     // Admin detection
   } elseif ($whos_online['ip_address'] == tep_get_ip_address() ) { //$_SERVER["REMOTE_ADDR"]) {
     $total_admin++;
     $fg_color = $fg_color_admin;
     $is_admin = true;
   // 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++;
   }
?>
               <!-- Status Light Column -->
               <td class="dataTableContent" align="left" valign="top"><?php echo ' ' . tep_check_cart($whos_online['session_id'], $whos_online['customer_id'], $whos_online['session_id']); ?></td>

Any ideas on this one too?


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

This is one more update. When I go my my catalog as a guest, whos_online.php is fine. Then when I log in, that too is fine in the whos_online.php

 

I can click on any line to highlight it, rather it be guest or my account. The icons also show fine.

 

And last night, I had many visits from msnbot and everything worked fine then too.

 

But this morning when new visitors came along, that is when whos_online.php started to freak out.

 

Any ideas?


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

For All those using Mysql database sessions and having the below problem:

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/popthet/public_html/catalog/admin/includes/functions/database.php on line 45
0 - 

select session_id, time_entry, time_last_click from whos_online where session_id='3d79acce220e4dc0cb14ebcbb684cd8f'

 

Go to the Configuration Menu Select Sessions, change "Check IP Address" to False.

 

This should fix it.

 

As to why this is causing a problem, especially periodically I don't know. That is really a problem that Ed might be able to sort out.

 

John

Edited by Gob

Share this post


Link to post
Share on other sites

John,

 

Don't give me that much credit. However, I did set "Check IP Address" to True to see if I got the same problems you did. I didn't, at first. Many hours later, I started to get the dreaded: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource... for the very first time in a year of playing with this code.

 

Switching "Check IP Address" to False did not clear it up at first, but hours later, it's OK again. I have NO CLUE what that's about. Also, I was storing sessions in files. Still am. The line of code that triggers the error is looking up the whos_online data, not the session data.

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
This is one more update. When I go my my catalog as a guest, whos_online.php is fine. Then when I log in, that too is fine in the whos_online.php

 

I can click on any line to highlight it, rather it be guest or my account. The icons also show fine.

 

And last night, I had many visits from msnbot and everything worked fine then too.

 

But this morning when new visitors came along, that is when whos_online.php started to freak out.

 

Any ideas?

 

Scott,

Set "Check IP Address" to False under Admin->Configuration->Sessions. Then wait a few hours and try again. I think the reason you need to wait, and probably not "hours", is that any sessions still alive may cause the error again. You have to wait until any active sessions at the time of the change are gone, including any in your own browser you were testing whos online with by browsing your site. Close all browser windows to make sure your sessions are removed.

 

Unless of course, you already have "Check IP Address" set to False...

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites

Folks,

 

I want to thank everyone who has been putting in time and effort to test v1.6 Beta and comment here. I really appreciate it.

 

v1.6 was a Beta because I was writing code that was supposed to fix the session/cart problems people noted in v1.5. Here's what I've learned from the test feedback:

 

Install:

1) 2 lines were missing from the language files.

2) A function that needs to be added to admin/includes/functions/general.php was missing.

3) The ReadMe was missing.

 

Fix:

1) A fix for some people who couldn't see Last URL was identified.

 

Testing:

1) WOE is Very dependent on the site environment.

2) Storing sessions in mySQL is pretty foolproof, but possibly slower.

3) Storing sessions in files is a little more problematic, but faster.

4) The STORE_SESSIONS value in catalog/includes/configure.php and admin/includes/configure.php MUST be the same.

5) If sessions are stored in files, the WOE code looks in folder: DIR_FS_CATALOG/Session Directory. DIR_FS_CATALOG is defined in admin/includes/configure.php. Session Directory is defined in Admin->Configuration->Sessions->Session Directory.

6) I think you need to set Admin->Configuration->Sessions->Check IP Address = False.

 

If anyone has anything else they can add, please add it.

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
For All those using Mysql database sessions and having the below problem:

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/popthet/public_html/catalog/admin/includes/functions/database.php on line 45
0 - 

select session_id, time_entry, time_last_click from whos_online where session_id='3d79acce220e4dc0cb14ebcbb684cd8f'

 

Go to the Configuration Menu Select Sessions, change "Check IP Address" to False.

 

This should fix it.

 

John

 

 

Thanks guys, but that has always been the setting. It has always been set to FALSE.

 

But I now remember that the night before, I had tried setting my sessions to files storage instead of mysql storage. It did not work so I changed it back to mysql storage.

 

The following day is when all my errors were starting to popup. Errors were even popping up this morning.

 

But I have not been online since about 3:00 pm today and it is now 11:20 pm and I just seen that the WOL is working great. Even with visitors / guests with different IP addresses.

 

I will keep testing and see what happens.

Edited by PopTheTop

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

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

×