Create cards with MeteoAlarm

Hi everyone, this morning I thought I wanted to create some meteoalarm tiles/cards one under the other, I’ll try to explain myself better, giving an example: Each rectangular card will have the color of the alert and inside the writing “Alert Yellow Wind”.

I’ve been trying since this morning, except that the only thing I’m currently unable to insert is the warning text in the center of the rectangle. How can I do it?

I’ll attach the file in question if anyone can give me an indication. You can also find the link to the work in progress.
(https://www.ombarcellonapg.com/saratoga/MeteoAlarmCard/wxadvisory.php)
File get-meteoalarm-warning-inc.php : Deleted
A thousand thanks.

Can anyone help me with this script please?

Is this a (PHP?) script you’ve written and you’re looking for some programming advice, or is it a script from elsewhere that you’re adapting? I know PWSWD has a MeteoAlarm component but I don’t know if that’s what you’re trying to use?

HI,
thanks for the reply, it’s the Meteoalarm script that I’m trying to adapt and modify to create badges, as you can see in the link, I managed to give it the shape. Now I would like to put the warning type writing in the center of the badge. I’m not very expert in html and php, so I was asking if someone could kindly help me.

If you can make the script available again (the original upload has been deleted) I can take a quick look to see if I can explain how you would do it.

Of course, here is the file I’m working on and I’ve already achieved the result you can find at the link to my site, which I put in the first post.

I would like to include in each badge the example writing: Orange Wind Alert and its validity over time at the top.

If I go to that link I get…

Try this, I changed host site for the file:

That’s a very long script! Can you let me know what part of the code you’ve been changing that would help a lot.

tif (count($CountryWarnings) < 1) {
	$ownpagehtml = "<!-- get-meteoalarm-warning-inc: begin  $warn_details -->".PHP_EOL;
	$ownpagehtml .= '<div align="center" style="box-shadow: 0px 2px 3px 1px #dedede; background-color: #29d660; width: 400px !important; height:110px !important; border-radius: 5px; margin: 0 auto !important; font-family: sans-serif; font-weight: 500; font-size: 25px; color: #f8f8ff; line-height: 100px;">'.PHP_EOL;
	$ownpagehtml .= '<!-- Fetch Status:'.PHP_EOL.$Status.PHP_EOL.' -->'.PHP_EOL;
	$ownpagehtml .= langtransstr('Nessuna Allerta').PHP_EOL;
	$ownpagehtml .= "</div><!--  get-meteoalarm-warning-inc: end  $warn_details -->".PHP_EOL;
	if (file_put_contents($warn_details,$ownpagehtml.PHP_EOL)) {
		print "<!-- get-meteoalarm-warning-inc: saved details to $warn_details file -->".PHP_EOL;
	} else {
		print "<!-- get-meteoalarm-warning-inc: unable to save details to $warn_details -->".PHP_EOL;
	}
	$ownpagehtml = "<!-- get-meteoalarm-warning-inc: begin $warn_summary -->".PHP_EOL;
	$ownpagehtml .= '<div align="center" style="box-shadow: 0px 2px 3px 1px #dedede; background-color: #29d660; width: 400px !important; height:110px !important; border-radius: 5px; margin: 0 auto !important; font-family: sans-serif; font-weight: 500; font-size: 25px; color: #f8f8ff; line-height: 100px">'.PHP_EOL;
	$ownpagehtml .= '<!-- Fetch Status:'.PHP_EOL.$Status.PHP_EOL.' -->'.PHP_EOL;
	$ownpagehtml .= langtransstr('Nessuna Allerta').PHP_EOL;
	$ownpagehtml .= "</div><!--  get-meteoalarm-warning-inc: end  $warn_summary -->".PHP_EOL;
	if (file_put_contents($warn_summary,$ownpagehtml.PHP_EOL)) {
		print "<!-- get-meteoalarm-warning-inc: saved summary to $warn_summary file -->".PHP_EOL;
	} else {
		print "<!-- get-meteoalarm-warning-inc: unable to save summary to $warn_summary -->".PHP_EOL;
	}
	
  return false;
}

# new Summary warnings to be saved with links to $warn_summary
$wrnStrings =  "<!-- get-meteoalarm-warning-inc: begin summary $warn_summary -->".PHP_EOL;
$wrnStrings .= '<div align="center" style="text-align: left; font-weight: bold; font-size: 20px; background-color: trasparent; width:100%; margin: 0 auto !important;">';
//$wrnStrings .= '<p style="text-align: center;width: 99%;"><strong>'.langtransstr('Avvisi Meteoalarm').'</strong></p>'.PHP_EOL;
//$wrnStrings .= '<table>'.PHP_EOL;


	  
$alertdivstyle = 'box-shadow: 0px 2px 3px 1px #dedede; width:400px; !important; height:110px; !important; border-radius:5px; margin: 0 auto !important; display: block; Float: none, ';
$alerticonstyle = 'margin-top: 35px; width: 40px; height: 40px;';

ype or paste code here

Up to now I have made the changes in this piece of code, but in order to insert both the text referring to the alert and its validity, I think we need to take pieces of code in another part of the page.

Has anyone managed to take the file and figure out where to go to edit to insert what I was telling you?

I’ve downloaded the file and had a quick look at it. It’s a long script and won’t be simple to understand. I’m in the middle of a significant project at the moment (see elsewhere in the forum) and don’t have enough free time to try to figure it out just at the moment. Maybe I’ll have more time when I’ve finished the big project, but that’s going to be more than a few days.

Ok thank you very much, as soon as you are free next month and can take a look at it, I would be grateful. In the meantime, if any other user can help me, I thank you.