Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools

    $ukthreat=str_replace(" from international terrorism","",$ukthreat[0]);
    $ukthreat=Trim(str_replace("The current","",$ukthreat));
    if(strpos($ukthreat,"LOW")!==false) { $FC="#00FF00"; }
    if(strpos($ukthreat,"MODERATE")!==false) { $FC="#D7DF01"; }
    if(strpos($ukthreat,"SUBSTANTIAL")!==false) { $FC="#FFBF00"; }
    if(strpos($ukthreat,"SEVERE")!==false) { $FC="#FF0040"; }
    if(strpos($ukthreat,"CRITICAL")!==false) { $FC="#DF01D7"; }
    echo "<span style=\"color:".$FC."\"><strong>".$ukthreat."</strong></span>";

MI5 expose an API to capture the current UK Terror Threat Level, this short PHP snipped grabs that status and output's it to the web page. If your using Joomla and want to include this little snippet then we strongly recommend RegularLabs Sourcer which will allow you to embed this into a custom HTML Module and stick it anywhere. If your more experienced with Joomla development then you'll be able to quickly knock up a module.

Besides having the status on your website, you can of course use the status to display selected content depending on the level. This can be done in sourcer, with a php header set OR in a module/component.

/home/ · Last modified: 2019/05/20 10:13 by genadmin