Difference between revisions of "Template:Quran Sura InfoBox"

From HodHood
Jump to: navigation, search
($fl = $value[0];)
(global $suraIndexOfSubjects;)
 
(4 intermediate revisions by the same user not shown)
Line 231: Line 231:
  
 
<phptag>
 
<phptag>
 +
global $suraIndexOfSubjects;
 +
 
if ( !isset( $argv['sura-index-of-subjects'] ) ) {
 
if ( !isset( $argv['sura-index-of-subjects'] ) ) {
 +
    $suraIndexOfSubjects = false;
 
     break;
 
     break;
 
}
 
}
  
 
$a = explode( ', ', $argv['sura-index-of-subjects'] );
 
$a = explode( ', ', $argv['sura-index-of-subjects'] );
 +
asort( $a );
  
$return = [];
+
$suraIndexOfSubjects = [];
 
foreach ( $a as $value ) {
 
foreach ( $a as $value ) {
 
   $fl = $value[0]; // $fl = strtolower( $value[0] );
 
   $fl = $value[0]; // $fl = strtolower( $value[0] );
   $return[$fl][] = $value;
+
   $suraIndexOfSubjects[$fl][] = "[[Has Sura Index of Subjects::$value]]";
 
}
 
}
var_dump( $return );
 
 
echo '
 
<div class="infobox infobox-800 mw-collapsible mw-collapsed" style="clear: right">
 
<big>Surah Index of Subjects</big>
 
<div class="mw-collapsible-content">
 
{{#regex:{{{sura-index-of-subjects}}}|%\s*\K\[*([^\],]+)\]*%|[[Has Sura Index of Subjects::$1]]}}
 
</div>
 
</div>';
 
 
</phptag>
 
</phptag>

Latest revision as of 16:13, 2 April 2018

Sura Attributes

HodHoodQuranLogo.PNG