Page 1 of 1

PHP programming

Posted: Tue Dec 18, 2018 12:10 pm
by LeShark1205
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

Re: PHP programming

Posted: Fri Dec 21, 2018 11:11 am
by andyk1
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

Re: PHP programming

Posted: Fri Dec 21, 2018 11:49 am
by LeShark1205
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

Re: PHP programming

Posted: Fri Dec 21, 2018 11:51 am
by andyk1
You may need to try the css code then.

Re: PHP programming

Posted: Fri Dec 21, 2018 11:56 am
by LeShark1205
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 :!: :?:

Re: PHP programming

Posted: Fri Dec 21, 2018 11:59 am
by andyk1
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.

Re: PHP programming

Posted: Fri Dec 21, 2018 12:01 pm
by andyk1
Ask Jachym since he wrote this. I'm sure he would know the correct color format

Re: PHP programming

Posted: Fri Dec 21, 2018 12:03 pm
by andyk1
or look through some of his PHP files to find how he entered the color format in them and copy his format method.

Re: PHP programming

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

best regards
Harry

Re: PHP programming

Posted: Fri Dec 21, 2018 12:11 pm
by andyk1
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

Re: PHP programming

Posted: Fri Dec 21, 2018 12:12 pm
by andyk1
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

Re: PHP programming

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

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

Re: PHP programming

Posted: Fri Dec 21, 2018 12:23 pm
by andyk1
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...

Re: PHP programming

Posted: Fri Dec 21, 2018 12:33 pm
by LeShark1205
The guestbook is under "info / Gästebuch"
The code is in the plugin folder "fireDanger" (fireDanger.php)

Re: PHP programming

Posted: Fri Dec 21, 2018 12:35 pm
by andyk1
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.

Re: PHP programming

Posted: Fri Dec 21, 2018 12:53 pm
by LeShark1205
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

Re: PHP programming

Posted: Fri Dec 21, 2018 1:12 pm
by andyk1
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

Re: PHP programming

Posted: Fri Dec 21, 2018 2:00 pm
by LeShark1205
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!

Re: PHP programming

Posted: Fri Dec 21, 2018 2:23 pm
by andyk1
My flag counter? Not sure what you mean by if I sent a message?

Andy

Re: PHP programming

Posted: Fri Dec 21, 2018 2:26 pm
by andyk1
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.

Re: PHP programming

Posted: Sat Jun 29, 2019 12:59 am
by captainjackfan10
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/