Vorlage:Target: Unterschied zwischen den Versionen
Aus Afterbuy-Wiki
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
<phptag> | <phptag> | ||
+ | <?php | ||
+ | |||
if(isset($argv) && !empty($argv) && isset($argv[1]) && !empty($argv[1])){ | if(isset($argv) && !empty($argv) && isset($argv[1]) && !empty($argv[1])){ | ||
− | + | $parts=$argv; | |
− | + | $headline=trim($argv[1]); | |
− | + | unset($parts[0],$parts[1]); | |
− | + | $stepnumber=1; | |
− | + | $laststep=$stepnumber; | |
− | + | $steps=[]; | |
− | + | foreach($parts as $steptext){ | |
− | + | if(trim($steptext)!=""){ | |
− | + | $steps[$stepnumber]=trim($steptext); | |
− | + | $laststep=$stepnumber; | |
− | + | $stepnumber++; | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
− | + | } | |
− | + | if($headline!='' && $steps!=''){ | |
+ | $out= '<div class="h6 mt-5">'.$headline.'</div><table>'; | ||
+ | if(count($steps)>1){ | ||
+ | foreach($steps as $number=>$step){ | ||
+ | |||
+ | if(trim($step)!=""){ | ||
+ | $borderclass="border-bottom "; | ||
+ | if($number==$laststep){ | ||
+ | $borderclass=""; | ||
+ | } | ||
+ | $out.='<tr class="'.$borderclass.' mb-2 pb-2"><td width="1%" class="p-3 m-3" valign="top"><span class="fa-stack fa-lg" style="color:#edb800"><span class="fa fa-circle fa-stack-2x" style="color:#edb800"></span><strong class="fa-stack-1x" style="color:white;font-size:20px;">'.intval($number).'</strong></span></td><td>'; | ||
+ | $out.=trim($step).'</td></tr>'; | ||
+ | } | ||
+ | } | ||
+ | } else { | ||
+ | foreach($steps as $number=>$step){ | ||
+ | if(trim($step)!=""){ | ||
+ | $out=.'<tr class="mb-2 pb-2"><td>'; | ||
+ | $out.=trim($step).'</td></tr>'; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | $out.='</table>'; | ||
+ | echo $out; | ||
+ | } | ||
} | } | ||
+ | |||
+ | |||
</phptag> | </phptag> |
Version vom 19. November 2021, 12:16 Uhr
PhpTags Parse error: syntax error, unexpected '<' in Vorlage:Target on line 2