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

0 Members and 1 Guest are viewing this topic.

Offline xcom

  • Forecaster
  • *****
  • Posts: 988
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #50 on: July 08, 2013, 09:19:21 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 only a couple of days ago. Look at my posts.

Sorry I quoted the wrong post :) . Ok so that confirms that that is not Kens modified version of the header file. That's the original. I am going to try that line.
Thanks for the reply.
« Last Edit: July 08, 2013, 09:21:26 AM by xcom »

----
Davis Vantage Vue|Meteohub 5.0l (Build 7293) Running on Debian 7.9 x86 (oVirt)|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095

Offline Tailspin45

  • Member
  • *
  • Posts: 43
    • Carlsbad Science and Technology Observatory
Re: Whos Online PHP Script for your template site
« Reply #51 on: July 08, 2013, 01:39:00 PM »
Tried the line you mentioned, xcom, and thought it fixed the problem. Trashed the cache, went through a bunch of pages with no problem. But went back an hour later and home page displayed the usual error. ](*,)
« Last Edit: July 08, 2013, 02:05:22 PM by Tailspin45 »

Offline xcom

  • Forecaster
  • *****
  • Posts: 988
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #52 on: July 08, 2013, 01:40:53 PM »
Tried the line you mentioned, xcom, and thought it fixed the problem. Trashed the cache, went through a bunch pf pages with no problem. But went back an hour later and home page displayed the usual error. ](*,)

Same issue here. I just can see how gluepack fixed it without thew page.... He add it code to his page so something there fixed it...


----
Davis Vantage Vue|Meteohub 5.0l (Build 7293) Running on Debian 7.9 x86 (oVirt)|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095

Offline mkutche

  • Forecaster
  • *****
  • Posts: 839
    • GosportWx.com
Re: Whos Online PHP Script for your template site
« Reply #53 on: July 08, 2013, 03:46:23 PM »
can someone help me make a mysql table im having trouble.

Mike
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportINWX
-----------------------------------------------------------

Offline Tailspin45

  • Member
  • *
  • Posts: 43
    • Carlsbad Science and Technology Observatory
Re: Whos Online PHP Script for your template site
« Reply #54 on: July 08, 2013, 03:57:21 PM »
Why don't you start a new thread, so it doesn't get lost in this one which is on an entirely different topic?

Offline xcom

  • Forecaster
  • *****
  • Posts: 988
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #55 on: July 08, 2013, 10:51:28 PM »
gluepack can you share your include-whos-online-header.php file please.

Thanks.

----
Davis Vantage Vue|Meteohub 5.0l (Build 7293) Running on Debian 7.9 x86 (oVirt)|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #56 on: July 09, 2013, 08:00:20 AM »
The header php?

The only difference is that I have added align="center" to line 741

The original file is time-stamped 01/09/2009 15:52

Can't the author help?

Anyway, I'm still interested in.....
Quote
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?
Each time you change a parameter the whole page refreshes.
and
Quote
I would like some defaults established, especially when logging on

e.g. Refresh Rate: 0:30, Profile Display: All, Show Bots: checked

The problem, as I see it, is that the code is written to display the/a default and collect the response in one statement/parameter
so I can't, for example, replace the $_GET['refresh'] in the call to draw_pull_down_menu with a default value (despite that being the parameter position for "default") because then the variable never actually gets set to that and, also, it can't be changed. The same, basically, if I add "checked" to the Bots checkbox parameters.

Can the author help?

Oh, the other thing that I am interested in is, as I alluded to in a previous post, how the Last URL can be /index.php when it doesn't exist on my site. I thought that it might have derived from a bad "refer"ral on my part but looking at the Referer in each case, apart from there being no commonality, except my signature, invariably the only link is from my banner which is correct.
« Last Edit: July 09, 2013, 09:52:34 AM by gluepack »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6989
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Whos Online PHP Script for your template site
« Reply #57 on: July 09, 2013, 11:35:25 AM »
On looking at the docs for PHP, I found
Quote
Description

mixed end ( array &$array )

end() advances array's internal pointer to the last element, and returns its value.


Parameters


array
The array. This array is passed by reference because it is modified by the function.
This means you must pass it a real variable and not a function returning an array because only actual variables may be passed by reference.



Return Values

Returns the value of the last element or FALSE for empty array.

Which seems to indicate that a construct like

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

or

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

will both cast a Strict: error because the end() function is not being passed a 'real variable', but instead is passed the return array from the explode() function.

I suggest trying the @ operator to suppress the message.  So something like


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

and see if that squashes the Strict: (and the resultant Warning: about the headers already output) messages.

Or, rewrite the code as

 if(isset($output[0])) {
   $tIP = explode (' ', $output[0]);
   $host = end($tIP);
  } else {
  $host = $ip; }

which would work the same and satisfy the end() requirement for an real variable array to be passed to it.


Best regards,
Ken

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

Offline Tailspin45

  • Member
  • *
  • Posts: 43
    • Carlsbad Science and Technology Observatory
Re: Whos Online PHP Script for your template site
« Reply #58 on: July 09, 2013, 12:22:55 PM »
Who-hoo! Thanks Ken.

Will give it a shot and report back after a suitable period since the error seemed to go away but reappear after a while.

UPDATE: Zipped through all my pages and didn't hit the error speed bump. Trashed cache, still no problems.

Have we successfully put a stake through it's heart?
« Last Edit: July 09, 2013, 02:17:15 PM by Tailspin45 »

Offline xcom

  • Forecaster
  • *****
  • Posts: 988
    • Texas Weather
Re: Whos Online PHP Script for your template site
« Reply #59 on: July 09, 2013, 02:15:24 PM »
Ken,

Thanks!!!! :D
I just did

Code: [Select]
$host = isset($output[0]) ? @end ( explode (' ', $output[0])) : $ip; // plan a continues
Now waiting if it comes back to hunt me.... So far all ok :)

----
Davis Vantage Vue|Meteohub 5.0l (Build 7293) Running on Debian 7.9 x86 (oVirt)|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #60 on: July 09, 2013, 05:27:01 PM »
Well that answers one of my questions,idly wandering through the settings file.....
'thermometer.php' => '/index.php'
'settings.php'    => '/index.php'


Also, I wondered why it looked weird. Whatever you specify for the wordwrap count for Last URL (at least) doesn't necessarily manifest itself in the resulting output. I don't know if that is because of the use of the htmlspecialchars function or not but, as well, sometimes it shows &amp; and other times it shows & and sometimes it puts a spurious ; in the text. The href for the link is fine it is what is displayed is a problem. I have wordrap set to 100 for example and it does it around 77.

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Whos Online PHP Script for your template site
« Reply #61 on: August 07, 2013, 02:11:00 PM »
The Geolite database that gets updated each month is supposed to be available from the first Tuesday of the month but the current one appears to be dated 3rd July still (which was a Wednesday, so I guess it may be available later today).

Also, are there any changes to the whosonline scripts, apart from the hard-coded name, that have to be made, if you want to switch over to V6?

Offline andro700

  • Chuck
  • Senior Contributor
  • ****
  • Posts: 265
    • Chuck's Weather Page
Re: Whos Online PHP Script for your template site
« Reply #62 on: August 11, 2013, 01:45:06 PM »
Having issues with my update page. Here is what it is showing when I update. Any idea's?

Checking for updates for the Maxmind GeoLiteCity database...
Connecting to this URL: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz


Please allow plenty of time for the approximately 19meg file to download (the time needed depends on your server download speed)...
A timeout can happen if the connection is really slow causing this to take more than 3 minutes...

Warning: set_time_limit() has been disabled for security reasons in /virtual/users/e14497-14796/web/wo-update.php on line 385
Download begins(counting megs)...(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)
Warning: set_time_limit() has been disabled for security reasons in /virtual/users/e14497-14796/web/wo-update.php on line 417
...download complete.
Download success, uncompressing file...

Warning: fopen(GeoLiteCity.dat) [function.fopen]: failed to open stream: Permission denied in /virtual/users/e14497-14796/web/wo-update.php on line 201
unzip error: opening GeoLiteCity.dat file

Chuck

Offline sacreyweather

  • Echo Valley Weather
  • Forecaster
  • *****
  • Posts: 1712
    • Echo Valley Weather
Re: Whos Online PHP Script for your template site
« Reply #63 on: August 11, 2013, 01:59:50 PM »
Chuck,

Looks like everything is working, except your blog.
CWOP: D2073, GR2AE, GR3, Cumulus, PWSweather,  CoCoRaHS: AR-SL-23  

Saline Weather on Twitter
Blitzortung Station 1387

Offline scottct1

  • Member
  • *
  • Posts: 21
    • Newington, CT Weather
Re: Whos Online PHP Script for your template site
« Reply #64 on: February 19, 2014, 01:45:48 PM »
I am not sure what happened this was working great but now when I look at whos online all the people connected are showing the same IP address and that address is the IP of my server, not the IP they are connecting from.

I am not sure why this is happening, I even uninstalled and reinstalled it with the same issue.

Any ideas??

Offline n7xrd

  • Forecaster
  • *****
  • Posts: 339
    • Beachhouse Weather
Re: Whos Online PHP Script for your template site
« Reply #65 on: February 22, 2014, 08:22:20 AM »
New Install and I am getting this message
Fatal error: Call to undefined function check_for_settings() in       can't seem to find the issue

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1160
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Whos Online PHP Script for your template site
« Reply #66 on: February 23, 2014, 10:26:32 PM »
Decided to give this another try tonight and can't even get past the DB. Get the following SQL error when trying to run Mike's provided code...

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM DEFAULT CHARSET=utf8' at line 23

Thoughts appreciated.
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3318
    • Carson Valley Weather
Re: Whos Online PHP Script for your template site
« Reply #67 on: February 24, 2014, 11:15:55 AM »
You might want to contact Mike Challis directly from his website. He hasn't been active on this forum since August 12, 2012 so I doubt he will be aware you folks are having problems.

Mike's scripts are available here:
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37s85,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline sacreyweather

  • Echo Valley Weather
  • Forecaster
  • *****
  • Posts: 1712
    • Echo Valley Weather
Re: Whos Online PHP Script for your template site
« Reply #68 on: February 24, 2014, 12:05:18 PM »
Hi John,

I've seen this error before, but I don't exactly remember what the fix was. I'll have to look when I get home.

John
CWOP: D2073, GR2AE, GR3, Cumulus, PWSweather,  CoCoRaHS: AR-SL-23  

Saline Weather on Twitter
Blitzortung Station 1387

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1160
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Whos Online PHP Script for your template site
« Reply #69 on: February 24, 2014, 12:21:58 PM »
Hi John,

Been pouring through everything I can find online but no luck so far. Have a feeling it's actually annoyed with the line directly above that one, but not sure.

Also missing wo-us-map.png which he calls out in the readme-install file.

Just downloaded again directly from his site and have the same problems.

Thanks!
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline sacreyweather

  • Echo Valley Weather
  • Forecaster
  • *****
  • Posts: 1712
    • Echo Valley Weather
Re: Whos Online PHP Script for your template site
« Reply #70 on: February 24, 2014, 12:58:54 PM »
Hi John,

I think I found it. Change

from:

TYPE=MyISAM DEFAULT CHARSET=utf8

to

ENGINE=MyISAM DEFAULT CHARSET=utf8

I think this resolves that.

John
CWOP: D2073, GR2AE, GR3, Cumulus, PWSweather,  CoCoRaHS: AR-SL-23  

Saline Weather on Twitter
Blitzortung Station 1387

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1160
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Whos Online PHP Script for your template site
« Reply #71 on: February 24, 2014, 02:52:16 PM »
Hi John,

Perfect! Changed all 3 instances (1 for each table). Worked exactly as advertised. THANK YOU!

If I may, would you happen to have wo-us-map.png hanging around?

'preciate...  :grin:
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline sacreyweather

  • Echo Valley Weather
  • Forecaster
  • *****
  • Posts: 1712
    • Echo Valley Weather
Re: Whos Online PHP Script for your template site
« Reply #72 on: February 24, 2014, 02:59:56 PM »
I think these are the ones.
CWOP: D2073, GR2AE, GR3, Cumulus, PWSweather,  CoCoRaHS: AR-SL-23  

Saline Weather on Twitter
Blitzortung Station 1387

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1160
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Whos Online PHP Script for your template site
« Reply #73 on: February 24, 2014, 04:28:46 PM »
Those two I have in /readme-files/optional-region-maps/ (odd place). But in the readme-install he specifically calls out wo-us-map.png.

Regardless, the basics are now working in the footer, along with http://tiggrweather.net/whos-online.php (not yet in the nav bar).
On occasion get the strict errors mentioned here but am using Ken's mod. Have to fix that and then to the options - oh boy.

Thanks again, John. Wouldn't have gotten this far without your SQL fix.
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1160
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Whos Online PHP Script for your template site
« Reply #74 on: February 25, 2014, 06:00:57 PM »
Finally got this thing working last night. Everything appears OK and no validation errors.

However, at the same time this came online the Cloud Level graphic went away and hasn't been back since. Anybody know of any problems in this area?

Thanks.
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

 

anything