Author Topic: Whos Online PHP Script for your template site  (Read 33847 times)

0 Members and 1 Guest are viewing this topic.

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #25 on: July 03, 2013, 11:14:44 PM »
Ken,

For example your code ends at:

Code: [Select]
function gethost_lin ($ip,$timeout_secs = 2) {

 // linux gethostbyaddr with timeout by mike challis

 $time_start = microtime(true); // set a timer

 @exec('host -W '.escapeshellarg($timeout_secs).' '.escapeshellarg($ip), $output); // plan a

 $time_end = microtime(true);  // check the timer

 if(($time_end - $time_start) > $timeout_secs) return 'n/a'; // bail because it timed out

 if (empty($output)) return gethostbyadd

Note how there is no closing statement for php and also I think there is a lot missing after "gethostbyadd" which should be "gethostbyaddr"
Also there is a lot of spaces between your if statement's.

I re-download it the page and I have the same issue. If I put that page on my server it brakes the the site.

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Whos Online PHP Script for your template site
« Reply #26 on: July 03, 2013, 11:22:31 PM »
Very strange... maybe the attachment was truncated.

Try the .zip of the .php attached.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #27 on: July 03, 2013, 11:28:12 PM »
Very strange... maybe the attachment was truncated.

Try the .zip of the .php attached.

Best regards,
Ken


It sure was truncated. All the code is now in there.
Thanks!!! :D

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #28 on: July 04, 2013, 03:26:09 AM »
Funny, because I downloaded mine on the 2nd and it was perfectly ok.

Offline Tailspin45

  • Member
  • *
  • Posts: 43
    • Carlsbad Science and Technology Observatory
Re: Whos Online PHP Script for your template site
« Reply #29 on: July 05, 2013, 09:34:45 AM »
Replaced include-whos-online-header.php with one Ken sent a few days ago and it seemed to solve the problem. But then it started again, sporadically. However if I reload the page, the message (below) goes away. Trashed browser cache but problem persists. I'm baffled (but that's easy).

Quote
Strict Standards: Only variables should be passed by reference in /home/tailspin/carlsbadwx.com/include-whos-online-header.php on line 1061

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/tailspin/carlsbadwx.com/include-whos-online-header.php:1061) in /home/tailspin/carlsbadwx.com/Settings.php on line 331

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/tailspin/carlsbadwx.com/include-whos-online-header.php:1061) in/home/tailspin/carlsbadwx.com/Settings.php on line 331

Warning: Cannot modify header information - headers already sent by (output started at /home/tailspin/carlsbadwx.com/include-whos-online-header.php:1061) in /home/tailspin/carlsbadwx.com/top.php on line 43
« Last Edit: July 05, 2013, 12:49:27 PM by Tailspin45 »

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #30 on: July 05, 2013, 03:13:28 PM »
Only a wild guess because my brain is hurting but you haven't added the 3 lines of code that goes into Settings.php twice have you? The reason I say it is that line 331 in my Settings.php is 3 lines after the line of code that I would associate with your error message.

Offline Tailspin45

  • Member
  • *
  • Posts: 43
    • Carlsbad Science and Technology Observatory
Re: Whos Online PHP Script for your template site
« Reply #31 on: July 05, 2013, 04:12:19 PM »
Good thought, but no. Checked every file on my site for the phrase 'include-whos-online-header' and it only appears once, in Settings.php.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Whos Online PHP Script for your template site
« Reply #32 on: July 05, 2013, 04:22:09 PM »
If you're still seeing the Strict: message, then it is likely that the copy of include-whos-online-header.php on your website is really the older one, not the updated one .. I'd suggest downloading the .zip, unpacking it, and uploading it again :)

The other Warning: messages are artifacts of having the Strict: message appear and will go away when the Strict: message is gone.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #33 on: July 05, 2013, 04:41:24 PM »
If you're still seeing the Strict: message, then it is likely that the copy of include-whos-online-header.php on your website is really the older one, not the updated one .. I'd suggest downloading the .zip, unpacking it, and uploading it again :)

The other Warning: messages are artifacts of having the Strict: message appear and will go away when the Strict: message is gone.

Best regards,
Ken

Ken,

I am not sure about that. I got 1061 again today even with your copy of the php.... Though it could of have been a cache thing...

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline Tailspin45

  • Member
  • *
  • Posts: 43
    • Carlsbad Science and Technology Observatory
Re: Whos Online PHP Script for your template site
« Reply #34 on: July 05, 2013, 04:44:12 PM »
I did that, Ken. I trashed cache and installed the one you sent me by email a couple of days ago.

But thinking I may have screwed up, I also downloaded the zip you posted here earlier and installed that file, too.

My line 1061 (top) and yours (bottom) look like this:

Quote
$host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues
$host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues

The full path for my file, copied from BBEdit, is
Quote
ftp://username:@host//carlsbadwx.com/include-whos-online-header.php
so I'm not looking at the file on my system as I stupidly did once before.
« Last Edit: July 06, 2013, 06:28:01 PM by Tailspin45 »

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #35 on: July 05, 2013, 08:37:13 PM »
I can confirm that even with the fix the 1061 comes back to haunt u :(

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #36 on: July 07, 2013, 01:30:30 PM »
As is my wont, I've played around with the script to tidy up a few things, mainly associated with wrapping (I've moved the Last URL to a separate line, for example).
If anyone is interested in looking at what I have done, you can access it (under Status) on my website http://www.jerbils.info/saratoga/wxindex.php. For a limited time you can sign in as guest, password guest (lol, I hope that is ok).
I'm still tinkering with it as I have the map on the same page and want to pump that up a bit and I want to add some more detail to pad out the page, mainly because I am not expecting that many visitors (at the moment bots, many of them Chinese that seem to want to know what my weather is like in 2017, seem to outnumber visitors 4 to 1 and I am the 1, lol).
« Last Edit: July 07, 2013, 01:32:39 PM by gluepack »

Offline AWL

  • Forecaster
  • *****
  • Posts: 727
    • Ardmore Weather Live
Re: Whos Online PHP Script for your template site
« Reply #37 on: July 07, 2013, 01:52:09 PM »
If anyone is interested in looking at what I have done, you can access it (under Status) on my website

Good job  =D>, in fact you entire site looks very well put together.

Doug

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #38 on: July 07, 2013, 02:06:49 PM »
If anyone is interested in looking at what I have done, you can access it (under Status) on my website

Good job  =D>, in fact you entire site looks very well put together.

Doug

A good job indeed!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #39 on: July 07, 2013, 02:32:47 PM »
As is my wont, I've played around with the script to tidy up a few things, mainly associated with wrapping (I've moved the Last URL to a separate line, for example).
If anyone is interested in looking at what I have done, you can access it (under Status) on my website http://www.jerbils.info/saratoga/wxindex.php. For a limited time you can sign in as guest, password guest (lol, I hope that is ok).
I'm still tinkering with it as I have the map on the same page and want to pump that up a bit and I want to add some more detail to pad out the page, mainly because I am not expecting that many visitors (at the moment bots, many of them Chinese that seem to want to know what my weather is like in 2017, seem to outnumber visitors 4 to 1 and I am the 1, lol).

We must have different versions of php. If I get rid of line 1061 all my issues go away.

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #40 on: July 07, 2013, 02:54:01 PM »
Not quite.....

Strict Standards: Only variables should be passed by reference in /var/www/include-whos-online-header.php on line 1062


Mine is 5.3.24 btw
« Last Edit: July 07, 2013, 02:56:59 PM by gluepack »

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #41 on: July 07, 2013, 02:55:11 PM »
Not quite.....

Strict Standards: Only variables should be passed by reference in /var/www/include-whos-online-header.php on line 1062

GOSH! :(
That is so annoying...

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #42 on: July 07, 2013, 03:10:31 PM »
oh btw... look at my 1061 in include-whos-online-header.php compared to yours....

$host = (($output[0] ? end ( explode (' ', $output[0])) : $ip)); // plan a continues

$host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues

...are you sure you have the right file?

My line 13 says...
Version: 2.25 - 01-Sep-2009 see changelog.txt for changes
« Last Edit: July 07, 2013, 03:13:26 PM by gluepack »

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #43 on: July 07, 2013, 03:23:41 PM »
I have the file uploaded by Ken.

Code: [Select]
$host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues
Is the correct change made by Ken and is what I have.

Code: [Select]
$host = (($output[0] ? end ( explode (' ', $output[0])) : $ip)); // plan a continues
Is the old line.

My version is:
Code: [Select]
Version: 2.25 - 01-Sep-2009 see changelog.txt for changes

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #44 on: July 07, 2013, 03:37:35 PM »
one more time... I just dl the zip file and unzip it on my dir.

Lets see if anything changes.

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline Tailspin45

  • Member
  • *
  • Posts: 43
    • Carlsbad Science and Technology Observatory
Re: Whos Online PHP Script for your template site
« Reply #45 on: July 07, 2013, 06:29:00 PM »
Mine says 2.25 and 2009 too, but I know Ken has tweaked it since then to include this version of line 1061

Quote
$host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues


Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #46 on: July 07, 2013, 06:31:13 PM »
Mine says 2.25 and 2009 too, but I know Ken has tweaked it since then to include this version of line 1061

Quote
$host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues



That is correct. and mine still complaints about that line. Though is states 1062 because I add it a line to my php file to silent errors... Still I am unable to get rid of that message...

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #47 on: July 08, 2013, 06:50:23 AM »
Can I remove the

 echo '<meta http-equiv="refresh" ....
statement and just refresh the

<?php include($C['files_path'].'include-whos-online-page.php'); ?>
statement somehow, if refresh is set,

so that the whole page doesn't refresh?

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #48 on: July 08, 2013, 08:37:19 AM »
Can I remove the

 echo '<meta http-equiv="refresh" ....
statement and just refresh the

<?php include($C['files_path'].'include-whos-online-page.php'); ?>
statement somehow, if refresh is set,

so that the whole page doesn't refresh?

gluepack,

You didn't point out which line your file has.
Yours "works" and you claim you got the same copy.... But the line you posted is not the same as the Ken source.
Can you confirm please.

Thanks!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #49 on: July 08, 2013, 09:16:01 AM »
Sorry, the post that you have quoted is nothing to do with your error messages. It is a request for a mod to change the method of refreshing.

If you look at an earlier post, you will see what I have for line 1061..

Mine: $host = (($output[0] ? end ( explode (' ', $output[0])) : $ip)); // plan a continues

Yours: $host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues

I downloaded my version, from the regular download place, and that was on the 2nd.
« Last Edit: July 08, 2013, 09:20:12 AM by gluepack »