PHP programming

Post Reply
LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

PHP programming

Post by LeShark1205 » Tue Dec 18, 2018 12:10 pm

Can someone tell me how I can represent the "bold" made different colored posts?

$ valuecbiwd = array ();
$ valuecbiwd [0] = lang("very low risk", "c");
$ valuecbiwd [1] = lang("low risk", "c");
$ valuecbiwd [2] = lang("medium danger", "c");
$ valuecbiwd [3] = lang("high risk", "c");
$ valuecbiwd [4] = lang("Very high danger", "c");

Thanks in advance

greeting
Harry

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 11:11 am

LeShark1205 wrote: Tue Dec 18, 2018 12:10 pm Can someone tell me how I can represent the "bold" made different colored posts?

$ valuecbiwd = array ();
$ valuecbiwd [0] = lang("very low risk", "c");
$ valuecbiwd [1] = lang("low risk", "c");
$ valuecbiwd [2] = lang("medium danger", "c");
$ valuecbiwd [3] = lang("high risk", "c");
$ valuecbiwd [4] = lang("Very high danger", "c");

Thanks in advance

greeting
Harry
Hello!

I'm not sure if this script will accept html code but you could try:

Code: Select all

$ valuecbiwd [0] = lang("color="#00ff00">[b]very low risk<[/b]", "c");
#00ff00 is green by the way.
$ valuecbiwd [0] = lang("color="#00ff0">very low risk<", "c");
If it works you can google "html code or css code" for color, font etc.

Andy
Last edited by andyk1 on Fri Dec 21, 2018 11:49 am, edited 1 time in total.
Image

LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

Re: PHP programming

Post by LeShark1205 » Fri Dec 21, 2018 11:49 am

andyk1 wrote: Fri Dec 21, 2018 11:11 am
LeShark1205 wrote: Tue Dec 18, 2018 12:10 pm Can someone tell me how I can represent the "bold" made different colored posts?

$ valuecbiwd = array ();
$ valuecbiwd [0] = lang("very low risk", "c");
$ valuecbiwd [1] = lang("low risk", "c");
$ valuecbiwd [2] = lang("medium danger", "c");
$ valuecbiwd [3] = lang("high risk", "c");
$ valuecbiwd [4] = lang("Very high danger", "c");

Thanks in advance

greeting
Harry
Hello!

I'm not sure if this script will accept html code but you could try:

Code: Select all

$ valuecbiwd [0] = lang("color="#00ff00>[b]very low risk<[/b]", "c");
#00ff00 is green by the way.

If it works you can google "html code or css code" for color, font etc.

Andy
Sorry, that does not work! Then get this error message:
Parse error: syntax error, unexpected 'valuecbiwd' (T_STRING), expecting variable (T_VARIABLE) or '$' in /var/www/vhosts/euro-picture.de/httpdocs/hiltenfingen/template/plugins/fireDanger/fireDanger.php on line 116

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 11:51 am

You may need to try the css code then.
Image

LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

Re: PHP programming

Post by LeShark1205 » Fri Dec 21, 2018 11:56 am

andyk1 wrote: Fri Dec 21, 2018 11:51 am You may need to try the css code then.
I think I leave it as it is :!: :?:

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 11:59 am

Parse error: syntax error, unexpected 'valuecbiwd'
means the format is incorrect. look up html code for the correct color format you need. There are different formats to entry the color codes you need.
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 12:01 pm

Ask Jachym since he wrote this. I'm sure he would know the correct color format
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 12:03 pm

or look through some of his PHP files to find how he entered the color format in them and copy his format method.
Image

LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

Re: PHP programming

Post by LeShark1205 » Fri Dec 21, 2018 12:04 pm

I'll do it, now come the holidays, there's certainly some time! Wish you and your family a Merry Christmas

best regards
Harry

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 12:11 pm

I see what you are doing and it's a good idea. Different colors for different warning levels. I'll try and find how he did it but I see now he did it in a sophisticated way by which you chose your colors i.e. light, dark backrounds which he is using CSS code so the best way would be ask him. I'd like to see if it works. Let me know as I may try it also. Again... good idea.

Andy
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 12:12 pm

LeShark1205 wrote: Fri Dec 21, 2018 12:04 pm I'll do it, now come the holidays, there's certainly some time! Wish you and your family a Merry Christmas

best regards
Harry
Back at you. Wish you the best.

Andy
Image

LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

Re: PHP programming

Post by LeShark1205 » Fri Dec 21, 2018 12:14 pm

You are welcome to sign up in my guestbook, have not set it free in vain

http://wetter-hiltenfingen.euro-picture.de

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 12:23 pm

LeShark1205 wrote: Fri Dec 21, 2018 12:14 pm You are welcome to sign up in my guestbook, have not set it free in vain

http://wetter-hiltenfingen.euro-picture.de
Am at your site and changed it to English as I do not speak German and can not find Guestbook. Your site looks Awesome by the way.

Can you tell me what block or plugin you are trying to change the colors in so I can look at the php code please...
Image

LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

Re: PHP programming

Post by LeShark1205 » Fri Dec 21, 2018 12:33 pm

The guestbook is under "info / Gästebuch"
The code is in the plugin folder "fireDanger" (fireDanger.php)

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 12:35 pm

Got it. I sent a message to your contacts block but not sure it worked since I couldn't click on the "I am not a robot" I sent it anyway so you can check if it worked.
Image

LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

Re: PHP programming

Post by LeShark1205 » Fri Dec 21, 2018 12:53 pm

andyk1 wrote: Fri Dec 21, 2018 12:35 pm Got it. I sent a message to your contacts block but not sure it worked since I couldn't click on the "I am not a robot" I sent it anyway so you can check if it worked.
I did not receive a file! Send by mail to the mail-adress in your guestbook

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 1:12 pm

Ok I see now what you are trying to do. In fireDangerBlock.php The colors are in the code.

Code: Select all

if($CBI<50){
		$severity = 0;
		$severityText = lang('low','c');
		$severityBg = "#ffe8e8";  
		$severityColor = "black";
	}
	else if($CBI>=50 && $CBI<75){
		$severity = 1;
		$severityText = lang('moderate','c');
		$severityBg = "#ffb5b5";  
		$severityColor = "black";
	}
	else if($CBI>=75 && $CBI<90){
		$severity = 2;
		$severityText = lang('high','c');
		$severityBg = "#ff7c7c";  
		$severityColor = "black";
	}
	else if($CBI>=90 && $CBI<97.5){
		$severity = 3;
		$severityText = lang('very high','c');
		$severityBg = "#d82d2d";  
		$severityColor = "white";
	}
	else{
		$severity = 4;
		$severityText = lang('extreme','c');
		$severityBg = "#a00606";
		$severityColor = "white";
	}
	$CBI = round($CBI);

	$color1 = $theme=="dark" ? "white" : "black";
$severityBg = "#d82d2d"; = the background color is a specific shade of red.
$severityColor = "white"; = the Text color white.

Find the html color codes and you should have what your looking for. Try at:
https://www.computerhope.com/cgi-bin/ht ... l?c=D82D2D
Or google html color code to find a site easier to use.

Andy
Image

LeShark1205
Observer
Observer
Posts: 27
Joined: Fri Nov 23, 2018 12:24 pm
Station model: WH-3080
Software: Cumulus

Re: PHP programming

Post by LeShark1205 » Fri Dec 21, 2018 2:00 pm

Have the code changed, let's see what happens when the fire danger in spring rises, if then what changes! Have you sent a message regarding your FlagCounter!

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 2:23 pm

My flag counter? Not sure what you mean by if I sent a message?

Andy
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: PHP programming

Post by andyk1 » Fri Dec 21, 2018 2:26 pm

LeShark1205 wrote: Fri Dec 21, 2018 12:53 pm
andyk1 wrote: Fri Dec 21, 2018 12:35 pm Got it. I sent a message to your contacts block but not sure it worked since I couldn't click on the "I am not a robot" I sent it anyway so you can check if it worked.
I did not receive a file! Send by mail to the mail-adress in your guestbook
OK I posted a message in your guest book and it went through as far as I could tell. A message sent to your contact me block did not seem to work.
Image

User avatar
captainjackfan10
Observer
Observer
Posts: 32
Joined: Fri May 31, 2019 5:33 pm
Location: Napoleon, Ohio USA
Station model: Acurite Atlas
Software: WU
Contact:

Re: PHP programming

Post by captainjackfan10 » Sat Jun 29, 2019 12:59 am

How about making some new blocks I have one I think would be great! Well a couple to be honest with you! 1st one I have a Netgear Arlo Cam and I would love to use the blocks for webcam and timelapse but have no idea how to get arlo web came by Netmaster to transfer live feed or even snap shots from my cam. I heard there was a script from my IP CAM Arlo a user said on WxForum suppose to be Python? I have no clue he said it was for WU. I can use that to to put up on my WU station site. But I could use both. There has to be a way to get these feed on my website and WU.

Ok and another idea for a block script or meteotemplate main setup area add on is this site right here they allow a free API you can get to share forecasts and other weather data.

https://openweathermap.org/
Douglas E. Cobb

Image

Come Join My Facebook Weather Group! :D
:arrow: https://www.facebook.com/groups/6008536 ... =bookmarks

Post Reply