Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Who is online -- guest?


Guest

Recommended Posts

PS: There are actually 6 files named whos_online.php

 

/cart/sqadmin

/cart/sqadmin/includes/languages/english

/cart/includes/functions

/oscommerce/admin

/oscommerce/admin/includes/languages/english

/oscommerce/catalog/includes/functions

Link to comment
Share on other sites

  • Replies 100
  • Created
  • Last Reply

Ok, you're on the right trail. You've noticed that alot of files we use are located in the includes directory.

 

In this case, though, that in

 

require(DIR_WS_FUNCTIONS . 'whos_online.php');

 

The 'path' of the file is in the variable DIR_WS_FUNCTIONS. Look in your configure.php (I think its still called that. If not maybe a file called filenames.php?) file to find what that path is set to, and you'll know where to look for the whos_online.php file.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Okay, let me catch up on a few things.

 

The session time can be changed using in the httpd.conf file and the php.ini (or by setting the value in the .htaccess file or via code).

 

The standard time is 20 minutes but can be changed to whatever value you like.

 

Everything for Pam's site is in the cart folder. The oscommerce folder is from the install package.

 

The functions define is in cart/admin/includes/configure.php and should look like:

  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

 

I think that it everything that I can help out on. ;)

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

The functions define is in cart/admin/includes/configure.php and should look like:

  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

 

I think that it everything that I can help out on. ;)

 

Ugh, thanks

 

I checked in configure.php as told and came up with this

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

 

so I assumed the whos_online.php was under /cart/functions, which is the file I have open now

 

:(

 

under /cart/sqadmin/includes there is no whos_online.php file

Link to comment
Share on other sites

Is there a cart/sqadmin/whos_online.php file?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Pam,

 

You're getting warmer.

 

It should actually be in /cart/includes/functions/whos_onine.php

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Yep :)

 

Here are the 'sql' references

 

if (STORE_SESSIONS == 'mysql') {

$session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $info . "'");

$session_data = tep_db_fetch_array($session_data);

$session_data = trim($session_data['value']);

} else {

if ( (file_exists(tep_session_save_path() . '/sess_' . $info)) && (filesize(tep_session_save_path() . '/sess_' . $info) > 0) ) {

$session_data = file(tep_session_save_path() . '/sess_' . $info);

$session_data = trim(implode('', $session_data));

}

}

Link to comment
Share on other sites

I'm afraid I'm familiar with an older version of OSC, so perhaps I should defer to Jim.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Yeah, and what you posted really isn't relevent.

 

For me, in my shop, the file is /public_html/includes/functions/whos_online.php

 

And the relevent line here is

tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . $wo_customer_id . "', '" . $wo_full_name . "', '" . $wo_session_id . "', '" . $wo_ip_address . "', '" . $current_time . "', '" . $current_time . "', '" . $wo_last_page_url . "')");

 

 

Can you see if you have that file and that line?

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

} else {

tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . $wo_customer_id . "', '" . $wo_full_name . "', '" . $wo_session_id . "', '" . $wo_ip_address . "', '" . $current_time . "', '" . $current_time . "', '" . $wo_last_page_url . "')");

}

}

?>

Link to comment
Share on other sites

Great!

 

Now, if you'll notice, the 'full_name' column in that table is being populated by the variable "$wo_full_name".

 

Let's look for all instances of $wo_full_name, and see if we can find all instances of where it is being set equals to something.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

$wo_full_name not found in whos_online.php

 

Great!

 

Now, if you'll notice, the 'full_name' column in that table is being populated by the variable "$wo_full_name".

 

Let's look for all instances of $wo_full_name, and see if we can find all instances of where it is being set equals to something.

Link to comment
Share on other sites

Well, it has to be in there at least once, because you pasted it above.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

$wo_full_name = addslashes($customer['customers_firstname'] . ' ' . $customer['customers_lastname']);

} else {

$wo_customer_id = '';

$wo_full_name = 'Guest';

}

Link to comment
Share on other sites

Exactly!

 

OK, now we really need to see the "if" condition here, because from the way your cart id behaving, we know that it is *always* inserting "Guest" here. In other words, it is failing the 'if' condtion.

 

So just above the code you ahve posed here, lets look for the 'if' conditon and post it here.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

if (tep_session_is_registered($customer_id)) {

$wo_customer_id = $customer_id;

 

$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");

$customer = tep_db_fetch_array($customer_query);

Link to comment
Share on other sites

OK, so all of this is saying "IF the customers session is registered THEN insert the customer name and id into the whos_online tales, ELSE add gues instead."

 

Now to be completly honest, I dont know a whole lot about registering sessions, and I had a feeling that this was headed in this direction. We might need to ask for further help in this matter from someone with more experience.

 

I do know that in your admin, you should be able to define whether you store sessions in php or in the database. It could be that the problem is caused by your shop trying to store seesions in a tmp file some where and is having trouble accessing them to register them. I would advise that you swithc where your sessions are stored to the database (MySQL).

 

See if you can find that, and see if it makes a difference.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

BTW, in my store, the change is made in the cart/includes/configure.php

 

It looks like this

 

define('STORE_SESSIONS', 'mysql');

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Checking in configuration, I see nothing that would require me to check off php or mySQL.

 

I have 'logging' and 'cache' but it doesn't seem to be in there.

 

Under 'cache' the directory is listed as /tmp/ and is set to 'false'.

 

Under 'logging' I have 'store database queries' set to false, and when I click to edit it, I see this

 

"Store Database Queries

Store the database queries in the page parse time log (PHP4 only)"

 

Mine is set to 'false'. Is that what needs to be changed?

 

(my PHP versions: PHP Version: 4.2.2 (Zend: 1.2.0) )

 

I do know that in your admin, you should be able to define whether you store sessions in php or in the database. It could be that the problem is caused by your shop trying to store seesions in a tmp file some where and is having trouble accessing them to register them. I would advise that you swithc where your sessions are stored to the database (MySQL).

 

See if you can find that, and see if it makes a difference.

Link to comment
Share on other sites

What he is referring to is in both of your includes/configure.php files. At the bottom of the file the last entry should be STORE_SESSSIONS. Enter mysql as the value.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

What he is referring to is in both of your includes/configure.php files. At the bottom of the file the last entry should be STORE_SESSSIONS. Enter mysql as the value.

 

I can't believe that this still isn't in the admin >> configuration >> mystore.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Wait wait wait

 

Didn't we go through this on the weekend?

 

You had me put in mysql, Jim, and something broke?? Remember??

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...