Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Who's Online Enhancement 1.4


Guest

Recommended Posts

airolg,

 

Much earlier in this thread someone asked for the sound of "ka-ching" when a customer put something in their cart.

 

ed

 

It was probably me!!!! I know I asked about it some time back and I'm sure it would have been in this thread! I can't believe you remembered! I've been wanting it for a very long time.

 

I'd love a cowbell sound or a door opening sound whenever a new person came into the store, however, they don't always come through the front door so I'm not sure how to make it work. I wouldn't mind if it "clicked" a sound every time they clicked to a different page. I wouldn't mind a door closing when they leave, either. Don't forget, my store is not nearly busy enough for this to ever get annoying. :P It would definitely have to be a toggle on/off thing.

 

It would be nice for the ka-ching sound when an order is placed. I have Outlook play a sound whenever I get the new account email and the ka-ching for the Order Process emails. But that's way later in the process than I'd like. ;)

Link to comment
Share on other sites

I got this installed w/o a hitch and it seems to work perfectly except that EVERY user has an 'active cart' even if they have nothing in their cart. And the Shopping cart column is blank all the way down even if someone has something in their cart.

 

Any ideas?

 

Yes, prevent spider sessions is on.

I store session in my mysql db.

I have the latest spiders.txt from the contribution area.

Link to comment
Share on other sites

Ok, SOMETHING is going on here ... When I click on Who's Online about 50% of the time it will crash something ... It is either no data displaying and/or a SLOW or not at all page load or the whole admin will gl blank and you cannot get it back. I can switch browsers and MAYBE get it back but once I had to restart the httpd service on the server and clear all the cookies and cache on the browser before it would come back up. (The whole admin)

 

Also, when it is "acting up" you can click on orders and there are NONE. The page is not blank, there are just no orders showing. I am BESIDE myself ... cannot figure out what is going on. The only thing I can think of is that the Who's Online page is redefining some variable or something like that or just plain screwing up.

 

It only started with the new version.

 

Any ideas?

 

Craig

Link to comment
Share on other sites

I got this installed w/o a hitch and it seems to work perfectly except that EVERY user has an 'active cart' even if they have nothing in their cart. And the Shopping cart column is blank all the way down even if someone has something in their cart.

 

Any ideas?

 

Yes, prevent spider sessions is on.

I store session in my mysql db.

I have the latest spiders.txt from the contribution area.

Chris,

 

Do you have sessions set to 'mysql' in catalog/includes/configure.php AND admin/includes/configure.php? It has to be set the same in both files.

 

ed

 

Ok, SOMETHING is going on here ... When I click on Who's Online about 50% of the time it will crash something ... It is either no data displaying and/or a SLOW or not at all page load or the whole admin will gl blank and you cannot get it back. I can switch browsers and MAYBE get it back but once I had to restart the httpd service on the server and clear all the cookies and cache on the browser before it would come back up. (The whole admin)

 

Also, when it is "acting up" you can click on orders and there are NONE. The page is not blank, there are just no orders showing. I am BESIDE myself ... cannot figure out what is going on. The only thing I can think of is that the Who's Online page is redefining some variable or something like that or just plain screwing up.

 

It only started with the new version.

 

Any ideas?

 

Craig

Craig,

 

Does your supertracker use the whos_online table or the whos_online.php file on the catalog side? I'm wondering if there's a collision of contribs going on.

 

ed

Link to comment
Share on other sites

Chris,

 

Do you have sessions set to 'mysql' in catalog/includes/configure.php AND admin/includes/configure.php? It has to be set the same in both files.

 

ed

 

 

That was it...

It was set to 'mysql' in catalog/includes/configure.php but was left blank in admin/includes/configure.php

 

It works perfectly now...

 

Thanks!!!

Link to comment
Share on other sites

Firstly want to thank you for this contribution it is simply the best.

All is working well on this contribution except i am not able to see anything under "LAST URL"

 

have i got some thing wrong here?

// WOL 1.6 - Removes osCid from the Last Click URL and the link

if ( $osCsid_position = strpos($temp_url_display, "osCsid") )

$temp_url_display = substr_replace($temp_url_display, "", $osCsid_position - 1 );

if ( $osCsid_position = strpos($temp_url_link, "osCsid") )

$temp_url_link = substr_replace($temp_url_link, "", $osCsid_position - 1 );

?>

<a HREF="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . $temp_url_link; ?>" target=\"_blank\">

<font color="<?php echo $fg_color; ?>">

<?php

echo $temp_url_display;

?>

</font>

</a>

</td>

 

<!-- osCsid? Column -->

<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">

<?php

if($whos_online['session_id'] != "") {

echo 'Y';

} else {

echo " ";

}

?>

</font></td>

 

<!-- Referer? Column -->

<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">

<?php

if($whos_online['http_referer'] == "") {

echo ' ';

} else {

echo TEXT_HTTP_REFERER_FOUND;

}

?>

</font></td>

</tr>

 

<tr class="dataTableRow">

<td class="dataTableContent" colspan="3"></td>

<td class="dataTableContent" colspan="6"><font color="<?php echo $fg_color; ?>">

<?php

// Display Details for All

if ( $_SERVER["QUERY_STRING"] == showAll ) {

display_details();

}

// Display Details for Bots

else if( $_SERVER["QUERY_STRING"] == showBots ){

if ( $is_bot ) {

display_details();

}

}

// Display Details for Customers

else if( $_SERVER["QUERY_STRING"] == showCust ){

if ( $is_guest || $is_account || $is_admin ) {

display_details();

}

}

?>

</font></td>

</tr>

 

<?php

$old_array = $whos_online;

}

 

if (!$i) {

$i=0;

}

$total_dupes = $i;

$total_sess = tep_db_num_rows($whos_online_query);

// WOL 1.4 - Subtract Bots and Me from Real Customers. Only subtract me once as Dupes will remove others

$total_cust = $total_sess - $total_dupes - $total_bots - ($total_admin > 1? 1 : $total_admin);

// WOL 1.4 eof

?>

<?php

if(isset($http_referer_url))

{

?>

<tr>

<td class="smallText" colspan="9"><?php echo '<strong>' . TEXT_HTTP_REFERER_URL . ':</strong> ' . $http_referer_url; ?></td>

</tr>

<?php

}

?>

<tr>

<!-- WOL 1.4 - Added Bot and Me counts -->

<td class="smallText" colspan="9"><br><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess); print "<br>Duplicate IPs: $total_dupes<br>Bots: $total_bots<br>Me!: $total_admin<br>Real customers: $total_cust<br><br>Your IP Address: ".tep_get_ip_address();?></td><!-- //$_SERVER["REMOTE_ADDR"];?></td> -->

<!-- WOL 1.4 eof -->

</tr>

</table></td>

 

<?php

$heading = array();

$contents = array();

$heading[] = array('text' => '<b>' . TABLE_HEADING_SHOPPING_CART . '</b>');

if (isset($info)) {

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(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $info)) && (filesize(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $info) > 0) ) {

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

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

}

}

 

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();

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' => 'Empty');

}

}

 

Appreciate your help?

Kunal

Link to comment
Share on other sites

Though I am only 'copy and paste' programmer, I have this mod installed and am loving it! I can't thank you enough for making this available.

I am curious though, if someone could help me make a small tweek... I would like to see the number of orders each customer has placed. I have figured out how to make the number of log-ins show but the number of orders just will not show no matter "what" I try.... Any Suggestions?

Thank you!

Deb

At least 90% of my programming problems lie somewhere between my keyboard and my chair.

Link to comment
Share on other sites

Hi,

 

Thanks so much for this great contrib. And sorry if this has been addressed already in any of the 35 pages of posts. :rolleyes:

 

The contrib works fine so far, except for one minor glitch. When I choose "None" under "Profile Display" AND click on any entry; i.e, Name, IP Address, Last URL, ... my browser, Netscape 7.1 keeps going into a refresh loop. It does not do this when I choose any of the other profile displays such as All, Bots, Customers, and it does not do this in IE 6.0. Any ideas?

Link to comment
Share on other sites

Hello,

 

Every time spider visits my store, it gets a session. At least this is what I see in admin/Who's online, it's Y for spider's session:

Online Full Name IP Address Entry Time Last Click Last URL Session? Referer URL

00:00:06 googlebot 66.249.66.140 15:26:44 15:26:50 /osCommerce/index.php?cPath=1_20&language=en&page=1&sort=2d Y

 

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

Currently there are 1 customers online

Duplicate IPs:0

Bots: 1

Me!: 0

Real Customers: 0

Why is this happening?

 

Thanks.

Link to comment
Share on other sites

I seem to have this error after installing this contrib:

 

Fatal error: Call to undefined function: tep_get_ip_address() in /content/StartupHostPlus/s/o/website.co.uk/web/catalog/admin/whos_online.php on line 374

 

Any ideas?

Thanks

 

Ignore that. How do I add my IP address so it comes up as Me!: rather than Real Customer??

Link to comment
Share on other sites

Firstly want to thank you for this contribution it is simply the best.

All is working well on this contribution except i am not able to see anything under "LAST URL"

 

have i got some thing wrong here?

Appreciate your help?

Kunal

Kunal,

 

It looks fine to me. Have you looked into the database to see if the URL is really being written into the whos_online.php table? Did you update the catalog/includes/whos_online.php when you did the admin side?

 

ed

 

I am curious though, if someone could help me make a small tweek... I would like to see the number of orders each customer has placed. I have figured out how to make the number of log-ins show but the number of orders just will not show no matter "what" I try.... Any Suggestions?

Thank you!

Deb

Deb,

 

Presumably you've played with some SQL to do a join with the appropriate order table. I would suggest posting your best guess at the SQL. Then we can troubleshoot it.

 

ed

Link to comment
Share on other sites

The contrib works fine so far, except for one minor glitch. When I choose "None" under "Profile Display" AND click on any entry; i.e, Name, IP Address, Last URL, ... my browser, Netscape 7.1 keeps going into a refresh loop. It does not do this when I choose any of the other profile displays such as All, Bots, Customers, and it does not do this in IE 6.0. Any ideas?

Jim,

 

This is a new one. My guess is that Netscape 7.1 isn't handling what appears to be a badly formed URL. I don't have Netscape 7.1, but, I selected a display Customer (not None like you did) and then selected a bot (Yahoo) info line. The URL created was:

http://www.myshop.com/admin/whos_online.php?showCust=&info=202.160.180.117

That's not a proper URL. It should be more like:

http://www.myshop.com/admin/whos_online.php?profile=showCust&info=202.160.180.117

So, I think that's a bug. My guess is that newer browser's are handling the bad URL better, so they aren't complaining.

 

ed

 

Every time spider visits my store, it gets a session. At least this is what I see in admin/Who's online, it's Y for spider's session:

Irina,

You need to turn Prevent Spider Sessions on. It's in the Admin panel under Configuration->Sessions. Also, make sure you have an updated spiders.txt. You can download it from the contributions.

 

ed

 

Ignore that. How do I add my IP address so it comes up as Me!: rather than Real Customer??

Andy,

 

This is supposed to happen automagically. The code is suppose to check your URL (you, meaning the IP address of the computer looking at Who's Online on the admin panel) and compare it to the IP addresses in the whos_online table. If they match (meaning you were on the catalog side a few minutes ago or have it open in a seperate browser window) then it should count that entry under Me! instead of Customer.

 

Do you show up in the table of visitor's (Status, IP, Last URL, etc.) as Guest with an IP address or as Guest with Admin in the IP column?

 

ed

Edited by medvid
Link to comment
Share on other sites

ed

Irina,

You need to turn Prevent Spider Sessions on. It's in the Admin panel under Configuration->Sessions. Also, make sure you have an updated spiders.txt. You can download it from the contributions.

 

ed

Thanks for your reply, medvid. My Prevent Spider Sessions are ON and I have an up to date spiders.txt. Any other ideas?

 

Thanks,

Irina.

Link to comment
Share on other sites

Thanks for your reply, medvid. My Prevent Spider Sessions are ON and I have an up to date spiders.txt. Any other ideas?

Irina,

 

The only other possibility that I am aware of is that the search engine has the osCsid in the index. This would happen if spider came by when Prevent Spider Sessions was turned off. In that case, the spider would get a session and store it as part of your site's URL in the index. It could take a month or more before the spider re-indexes your site and removes/replaces the URL+Session in the index.

 

The only 2 fixes are time or one of the SEO optimization contribs that change your product URLs via rewrites (of course, this takes time too). Those usually also send a message to the Spider to update their index now (Now being relative to when they visit.)

 

ed

Link to comment
Share on other sites

OK I have noted..

 

4) You may need to add the following code to the bottom (just before the final ?> tag) of admin\includes\functions\general.php:

function tep_get_ip_address() {

if (isset($_SERVER)) {

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {

$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];

} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {

$ip = $_SERVER['HTTP_CLIENT_IP'];

} else {

$ip = $_SERVER['REMOTE_ADDR'];

}

} else {

if (getenv('HTTP_X_FORWARDED_FOR')) {

$ip = getenv('HTTP_X_FORWARDED_FOR');

} elseif (getenv('HTTP_CLIENT_IP')) {

$ip = getenv('HTTP_CLIENT_IP');

} else {

$ip = getenv('REMOTE_ADDR');

}

}

 

return $ip;

}

 

And it is already there so did not add it.

 

But I get..

 

Fatal error: Call to undefined function: tep_get_ip_address() in /usr/wwwroot/ddehek/newzealandnz/admin/whos_online.php on line 374

 

Any ideas?

Danny de Hek

Managing Director

 

New Zealand's Information Network

 

officecam.jpg

Link to comment
Share on other sites

Andy,

 

This is supposed to happen automagically. The code is suppose to check your URL (you, meaning the IP address of the computer looking at Who's Online on the admin panel) and compare it to the IP addresses in the whos_online table. If they match (meaning you were on the catalog side a few minutes ago or have it open in a seperate browser window) then it should count that entry under Me! instead of Customer.

 

Do you show up in the table of visitor's (Status, IP, Last URL, etc.) as Guest with an IP address or as Guest with Admin in the IP column?

 

ed

 

I show up as Real Customer. It states: Your IP Address: 65..... but then it says Guest and comes up with a different IP address (82.....). I am on a linksys router.

Link to comment
Share on other sites

I show up as Real Customer. It states: Your IP Address: 65..... but then it says Guest and comes up with a different IP address (82.....). I am on a linksys router.

 

Andy

What is your IP address when you are connected to the internet (eg: if a broadband connection, Static IP)?

What is your Computers IP address?

 

I may be wrong but I'm suspecting you are not working behind a NAT firewall and hence Admin is picking one or the other IP's and the shop side the other IP.

 

I would suggest you check these things but in particular that you are working behind the NAT firewall which would then only submit to the internet one IP address, but most importantly not leave your computer open to the world for attack.

 

Just a thought.

 

John

Link to comment
Share on other sites

Irina,

 

The only other possibility that I am aware of is that the search engine has the osCsid in the index. This would happen if spider came by when Prevent Spider Sessions was turned off. In that case, the spider would get a session and store it as part of your site's URL in the index. It could take a month or more before the spider re-indexes your site and removes/replaces the URL+Session in the index.

 

The only 2 fixes are time or one of the SEO optimization contribs that change your product URLs via rewrites (of course, this takes time too). Those usually also send a message to the Spider to update their index now (Now being relative to when they visit.)

 

ed

Is there any way I might have my files misconfigured somehow? What files are responsible for preventing sessions to spiders?

 

Thanks,

Irina.

Link to comment
Share on other sites

OK I have noted..

And it is already there so did not add it.

 

But I get..

 

Fatal error: Call to undefined function: tep_get_ip_address() in /usr/wwwroot/ddehek/newzealandnz/admin/whos_online.php on line 374

 

Any ideas?

Danny,

 

You need to add it to admin/includes/function/general.php.

 

ed

 

Is there any way I might have my files misconfigured somehow? What files are responsible for preventing sessions to spiders?

 

Thanks,

Irina.

Irina,

 

spiders.txt must be in catalog/includes folder. Is it there or in the catalog/ folder?

 

ed

Link to comment
Share on other sites

Andy

What is your IP address when you are connected to the internet (eg: if a broadband connection, Static IP)?

What is your Computers IP address?

 

I may be wrong but I'm suspecting you are not working behind a NAT firewall and hence Admin is picking one or the other IP's and the shop side the other IP.

 

I would suggest you check these things but in particular that you are working behind the NAT firewall which would then only submit to the internet one IP address, but most importantly not leave your computer open to the world for attack.

 

Just a thought.

 

John

 

It says my IP is: 62.254.64.15

Then when I go onto my website and back to admin it shows me as: 82.12.138.145

 

I am very confused :huh:

Link to comment
Share on other sites

It says my IP is: 62.254.64.15

Then when I go onto my website and back to admin it shows me as: 82.12.138.145

 

I am very confused :huh:

 

 

What says your IP is 62.254.64.15 ?

 

Do you know how to see what your computers IP is?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...