Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Guest

Who's Online Enhancement 1.4

Recommended Posts

I was wondering if it is possible to modify who's online so it updates the database once every time period. For example, update every hour.

 

The reason behind this is that then one can take more advantage of SQl query caching (since cache is flushed on every insert statement). This would still allow the store owner to get a snapshot of the traffic on the site through out the day.

 

Any ideas on how I could one go about accomplishing this?

 

I can easily enable or disable who's online by adding a true/false setting, but how to have osc automatically change the setting. For example, if we want to update who's online every hour, then enable who's online at X:05 time and disable every X:05+Y (allowing Y minutes to get a better sample of who's online). So at 10:05am who's online is enabled then at 10:07am it is disabled. It will take another sample at 11:05. So if the store owner checks who's online in admin at 11:30, he will have the sample from 11:05.

 

If anyone has any ideas on how to approach this, I would love to hear them. Again, my main issue is with figuring out when to enable disable the setting. Thanks.

Share this post


Link to post
Share on other sites
Guest

Safoo,

 

What your suggesting is a cron job. Whos online currently works by updating the database everytime a user (or Bot) clicks on a link. It also removes entries for sessions that haven't changed in 15 minutes (default). You could change that to be greater than 1 hour (look for "900" in the code. That's seconds, not minutes.) You could change the refresh time in the admin screen. Otherwise, you're talking about a cron job.

 

ed

Share this post


Link to post
Share on other sites
Guest

Folks,

 

I'm on vacation through the end of July. See you in 1 1/2 weeks. B)

 

ed

Share this post


Link to post
Share on other sites
Guest
Folks,

 

I'm on vacation through the end of July.  See you in 1 1/2 weeks.  B)

 

ed

 

See ya Ed :)

 

Some people get good don't they.

What I wouldn't give for a real holiday. :rolleyes:

Share this post


Link to post
Share on other sites

I have a problem with Who's online contribution....

Sometimes, all is ok...

But other times, all the lines aren't written, I've "<font color=" " written at the end end no more lines after that...

Or an error :

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/virtual/site156/fst/var/www/html/admin/includes/functions/database.php on line 45

0 -

 

select time_entry, time_last_click from whos_online where session_id='1bfe48d22b7bb0e09c7f145ea97f6161'

 

[TEP STOP]

 

Worse than that... Sometimes, when I attempt to see who's online, the page don't load and create 2 differents problems :

- I can't no more see my admin page, I have a database.php error...

- Or, I can see my admin page but... No more orders listed on it !!! And they are on my database, but invisibles here...

After a while, this 2 problems disappears... But can reappear if I choose the "who's online" page again...

 

Have I a ghost in my machine ? ;)

 

Plz help...

Share this post


Link to post
Share on other sites

does this contribution support on the fly ip banning? i heard it was in the works, but i don't know if it was ever implemented.


Most likely your question has been answered, please do a search first.

Share this post


Link to post
Share on other sites
Guest
Have I a ghost in my machine ? ;)

 

Plz help...

 

I think you have a ghost in your setup.

You clearly have some enormouse problems with either your settings for a number of things and or problems with your files.

 

The only thing I can really say is, I hope you have backups.

 

Sorry but this is to much for any real help here over this duscussion board like this.

Share this post


Link to post
Share on other sites
Guest
does this contribution support on the fly ip banning?  i heard it was in the works, but i don't know if it was ever implemented.

 

No it does not support ip banning, never has nor ever has it ever been intended to.

As far as I've ever known.

Share this post


Link to post
Share on other sites

Hallo,

 

ich habe whos online 1.7.1 installiert und leider bekomme ich im admin diese Fehlermeldung:

 

Fatal error: Call to undefined function: tep_get_ip_address() in /mnt/ja2/01/626/00000005/htdocs/os/catalog/admin/whos_online.php on line 551

 

kann mir jemand helfen?

 

Sorry my englisch is very bad :(

 

Gruss

Stephan

Share this post


Link to post
Share on other sites
Guest
Hallo,

 

ich habe whos online 1.7.1 installiert und leider bekomme ich im admin diese Fehlermeldung:

 

Fatal error: Call to undefined function: tep_get_ip_address() in /mnt/ja2/01/626/00000005/htdocs/os/catalog/admin/whos_online.php on line 551

 

kann mir jemand helfen?

 

Sorry my englisch is very bad  :(

 

Gruss

Stephan

Stephan

 

That error looks to me like it may be a Session directory path error, or an error in your catalog/includes/config.php file or the catalog/admin/includes/config.php file.

Check your URL's etc in these.

 

This looks very wrong "/htdocs/os/catalog/".

This looks wrong also "/mnt/ja2/01/626/00000005/" and I'm not sure what to make of it, surely that is not your real home path?

 

Hope this gets you started in the right direction anyway.

 

John

Share this post


Link to post
Share on other sites
I think you have a ghost in your setup.

You clearly have some enormouse problems with either your settings for a number of things and or problems with your files.

 

The only thing I can really say is, I hope you have backups.

 

Sorry but this is to much for any real help here over this duscussion board like this.

 

Can't you guide me a little from where I've to begin to correct it ?

I have no backup BEFORE the add of who's online contribution as I was thinking all was working correctly before the time I have visits and encounter this kinf of errors !! :(

 

Please, if you can give me some advices, I will follow them to the letter ^^

 

Thank you very much for help

Edited by littleneo

Share this post


Link to post
Share on other sites
Guest
Can't you guide me a little from where I've to begin to correct it ?

I have no backup BEFORE the add of who's online contribution as I was thinking all was working correctly before the time I have visits and encounter this kinf of errors !! :(

 

Please, if you can give me some advices, I will follow them to the letter ^^

 

Thank you very much for help

 

Have checked all your setup details, most specifically as outline in the last couple of pages here?

 

Your Sessions directory and path settings?

It kind of looks like you may not have setup your session directory or not correctly.

Check your Admin configuration settings. (as outlined on the previous page)

 

If non of this helps please post what you have done so far and settings.

And what you think the problem may be, you might know and not realise it.

John

Share this post


Link to post
Share on other sites
Hallo,

 

ich habe whos online 1.7.1 installiert und leider bekomme ich im admin diese Fehlermeldung:

 

Fatal error: Call to undefined function: tep_get_ip_address() in /mnt/ja2/01/626/00000005/htdocs/os/catalog/admin/whos_online.php on line 551

 

kann mir jemand helfen?

 

Sorry my englisch is very bad  :(

 

Gruss

Stephan

 

I think you forgot to put the following line in your admin/includes/functions/general.php

 

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;

}

 

 

 

Good luck

 

Don

Share this post


Link to post
Share on other sites

Hello Don,

 

yes i forgot the code, but i become now this error:

 

Parse error: parse error, unexpected T_VARIABLE in /mnt/ja2/01/626/00000005/htdocs/os/catalog/admin/includes/functions/general.php on line 401

 

Thank you for help and soory for my bad englisch.

 

Stephan

Share this post


Link to post
Share on other sites
Guest
Hello Don,

 

yes i forgot the code, but i become now this error:

 

Parse error: parse error, unexpected T_VARIABLE in /mnt/ja2/01/626/00000005/htdocs/os/catalog/admin/includes/functions/general.php on line 401

 

Thank you for help and soory for my bad englisch.

 

Stephan

 

Stephan

Where did you insert that extra code general.php file?

It's supposed to be at the very bottom. If added at the bottom I don't see how you could get that problem half way threw the file.

 

Also if the above is not the problem post the lines in your general.php slightly above and below line 401 and indicat which is the 401.

Share this post


Link to post
Share on other sites

Hallo,

 

Problem ist gel?st, es lag daran das ich die Dateien mit dem Dateimanager ge?ndert hatte anstatt mit Editor und FTP, das f?hrte zu den Fehlermeldungen.

 

Danke f?r euere Hilfe.

 

Gruss

Stephan

Share this post


Link to post
Share on other sites

Hello,

 

sometimes I get an error where the shopping cart should be saying:

 

Fatal error: Call to a member function on a non-object in /home/myshop/public_html/shop/admin/whos_online.php on line 639

 

It's seems like this is only coming on when customers are selected, not on bot's.

 

Any idea what this is?

Share this post


Link to post
Share on other sites
Guest
Hallo,

 

Problem ist gel?st, es lag daran das ich die Dateien mit dem Dateimanager ge?ndert hatte anstatt mit Editor und FTP, das f?hrte zu den Fehlermeldungen.

 

Danke f?r euere Hilfe.

 

Gruss

Stephan

 

Stephan you will have to translate this for me I can't understand any past "Problem".

 

Sorry

 

John

Share this post


Link to post
Share on other sites
Guest
Hello,

 

sometimes I get an error where the shopping cart should be saying:

 

Fatal error: Call to a member function on a non-object in /home/myshop/public_html/shop/admin/whos_online.php on line 639

 

It's seems like this is only coming on when customers are selected, not on bot's.

 

Any idea what this is?

 

What is on your line 639 of this file?

Share this post


Link to post
Share on other sites
What is on your line 639 of this file?

 

Line 635 - 641:

   // Show shopping cart contents for selected entry
  echo '            <td valign="top">' . "\n";

  $box = new box;
  echo $box->infoBox($heading, $contents);

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

 

Where this is line 639:

echo $box->infoBox($heading, $contents);

Share this post


Link to post
Share on other sites
Have checked all your setup details, most specifically as outline in the last couple of pages here?

 

Your Sessions directory and path settings?

It kind of looks like you may not have setup your session directory or not correctly.

Check your Admin configuration settings. (as outlined on the previous page)

 

If non of this helps please post what you have done so far and settings.

And what you think the problem may be, you might know and not realise it.

John

 

Hi,

 

I take time to answer to be sure I verify all stuffs indicated in this pages...

 

I continue to have the problems after I've verified, it seems, all...

 

The files in the temp directory don't seems to be deleted and my shop is no more working in this case it seems...

 

I have this configure.php from includes and admin/includes :

define('STORE_SESSIONS', 'mysql');

 

The fields in my who's online database are :

Champ Type Interclassement Attributs Null D?faut

customer_id int(11) Oui NULL

full_name varchar(64) latin1_swedish_ci No

session_id varchar(128) latin1_swedish_ci No

ip_address varchar(15) latin1_swedish_ci No

time_entry varchar(14) latin1_swedish_ci No

time_last_click varchar(14) latin1_swedish_ci No

last_page_url varchar(64) latin1_swedish_ci No

http_referer varchar(255) latin1_swedish_ci No

user_agent varchar(255) latin1_swedish_ci No

 

The settings in my admin/sessions configuration are :

Session Directory /home/virtual/onveut.com/var/www/html/tempo

Force Cookie Use False

Check SSL Session ID True

Check User Agent False

Check IP Address False

Prevent Spider Sessions True

Recreate Session True

 

 

The session directory /home/virtual/onveut.com/var/www/html/tempo seems well configurated and is CHMOD 777 and without trailing slash at the end in sessions' configuration. Too, it's created specifically for the sessions and don't used by other programs.

 

I can't create it before /www/, I haven't permission.

 

 

I continue to have different errors like :

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/virtual/site156/fst/var/www/html/admin/includes/functions/database.php on line 45

0 -

 

select time_entry, time_last_click from whos_online where session_id='a4d1fc572173703333d63228fb4b9f7a'

 

The line 45 of database.php is :

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

 

What am I doing wrong ?

 

Thank you very much.

Share this post


Link to post
Share on other sites

Again the same error :

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/virtual/site156/fst/var/www/html/admin/includes/functions/database.php on line 45

0 -

 

select time_entry, time_last_click from whos_online where session_id='a4d1fc572173703333d63228fb4b9f7a'

 

The line 45 of database.php is :

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

 

Then, after that, can't go to my admin page because of error :

Warning: main(includes/languages/4): failed to open stream: No such file or directory in /home/virtual/site156/fst/var/www/html/admin/includes/application_top.php on line 140

 

Fatal error: main(): Failed opening required 'includes/languages/4' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site156/fst/var/www/html/admin/includes/application_top.php on line 140

 

What's this path ? : (include_path='.:/php/includes:/usr/share/php')

 

And I've just verified, the temp directory attributed in sessions is empty...

 

Don't understand anything...

Share this post


Link to post
Share on other sites

On bold is line 140 of application_top.php

 

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

}

Share this post


Link to post
Share on other sites

Different but similar error when I attempt to return to admin :

 

Warning: main(includes/languages/4): failed to open stream: Aucun fichier ou répertoire de ce type in /home/virtual/site156/fst/var/www/html/admin/includes/application_top.php on line 140

 

Fatal error: main(): Failed opening required 'includes/languages/4' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site156/fst/var/www/html/admin/includes/application_top.php on line 140

The language 4 is for my language (french)...

 

If I wait a certain time, the admin page will work again...

 

If I go to see who's online page, can work, but after a while, if I refresh by example, hop... Bug again...

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

×