@if(auth()->user()->role == 'admin')
@if(env('ENABLE_THEME_UPDATER') == 'true')
Theme name: |
Update status: |
Version: |
0) {
$verNr = substr($matches[0][0],15);
}
}
$themeVe = NULL;
if(!isset($verNr)){$verNr = "error";};
if ($entry != "." && $entry != "..") {
echo '';
echo ''; print_r(ucfirst($entry));
echo ' | ';
echo '';
if(file_exists(base_path('themes') . '/' . $entry . '/readme.md')){
if(!strpos(file_get_contents(base_path('themes') . '/' . $entry . '/readme.md'), 'Source code:')){$hasSource = false;}else{
$hasSource = true;
$text = file_get_contents(base_path('themes') . '/' . $entry . '/readme.md');
$pattern = '/Source code:.*/';
preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE);
$sourceURL = substr($matches[0][0],13);
$replaced = str_replace("https://github.com/", "https://raw.githubusercontent.com/", trim($sourceURL));
$replaced = $replaced . "/main/readme.md";
if (strpos($sourceURL, 'github.com')){
ini_set('user_agent', 'Mozilla/4.0 (compatible; MSIE 6.0)');
try{
$textGit = file_get_contents($replaced);
$patternGit = '/Theme Version:.*/';
preg_match($patternGit, $textGit, $matches, PREG_OFFSET_CAPTURE);
$sourceURLGit = substr($matches[0][0],15);
$Vgitt = 'v' . $sourceURLGit;
$verNrv = 'v' . $verNr;
}catch(Exception $ex){
$themeVe = "error";
$Vgitt = NULL;
$verNrv = NULL;
}
if(trim($Vgitt) > trim($verNrv)){
$updateAv = true;
$GLOBALS['updateAv'] = true;
} else {
$updateAv = false;
}
} else {$themeVe = "error";}
}
}
if ($themeVe == "error") {
echo 'Error!';
} elseif ($hasSource == false) {
echo 'Update manually';
} elseif($updateAv == true) {
echo 'Update available';
} else {
echo 'Up to date';
}
echo ' | ';
echo '' . $verNr . ' | ';
echo '
';}
}} ?>
Update all themes
Update available';
}catch(Exception $ex){}
?>
@endif
@endif