About the Anleitungen / Nützliche PHP Skripte category

Tauschen Sie wertvolle Skripte/Ideen aus (KEINE FRAGEN!)

Hi,
Seit IPS 6.0 haben Scripte ja auch ein Änderungsdatum. Hier ein kleines Script das die 10 Scripte ausgibt die zuletzt geändert worden sind. Außer mir gibt es bestimmt noch 1 oder 2 Leute die davor sitzen und Fragen „was habe ich zuletzt geändert?“ Das Script gibt bei IPS die Antwort.

<?php
$scriptList = IPS_GetScriptList();
$scripte = array();
$Index = 0;
foreach ($scriptList as $id) {
    $script = IPS_GetScript($id);
    $scripte[$Index]['ID'] = $script['ScriptID'];
    $scripte[$Index]['Update'] = $script['ScriptUpdated'];
    $Index++;
}
$Update = array_column($scripte, 'Update');
array_multisort($Update, SORT_DESC, $scripte);
$count = count($scripte);
for ($i=0; $i<10; $i++){
    $script = IPS_GetScript($scripte[$i]['ID']);
    echo 'Scriptename:' . $script['ScriptFile']. '  letzte Änderung:'. date('d.m.Y H:i', $script['ScriptUpdated']) . PHP_EOL;
}
?>

Ralf

1 „Gefällt mir“