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?
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.
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.
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.