Difference between revisions of "Template:Quran Sura InfoBox"

From HodHood
Jump to: navigation, search
(global $suraIndexOfSubjects;)
 
(15 intermediate revisions by 2 users not shown)
Line 29: Line 29:
 
<th>Number of Prostration</th>
 
<th>Number of Prostration</th>
 
<td>{{#regex:{{{number-of-prostration}}}|%\s*\K([^,]+)%|[[Has Number of Prostration::$1]]}}</td>
 
<td>{{#regex:{{{number-of-prostration}}}|%\s*\K([^,]+)%|[[Has Number of Prostration::$1]]}}</td>
</tr>}}
 
 
{{#if:{{{sura-index-of-subjects|}}}|<tr>
 
<th>Surah Index of Subjects</th>
 
<td>{{#regex:{{{sura-index-of-subjects}}}|%\s*\K\[*([^\],]+)\]*%|[[Has Sura Index of Subjects::$1]]}}</td>
 
 
</tr>}}
 
</tr>}}
  
Line 131: Line 126:
 
<th>Tribes Name</th>
 
<th>Tribes Name</th>
 
<td>{{#regex:{{{tribes-name}}}|%\s*\K([^,]+)%|[[Has Tribes Name::$1]]}}</td>
 
<td>{{#regex:{{{tribes-name}}}|%\s*\K([^,]+)%|[[Has Tribes Name::$1]]}}</td>
</tr>}}
 
 
{{#if:{{{astronomical-body|}}}|<tr>
 
<th>Astronomical Body</th>
 
<td>{{#regex:{{{astronomical-body}}}|%\s*\K([^,]+)%|[[Has Astronomical Body::$1]]}}</td>
 
 
</tr>}}
 
</tr>}}
  
Line 239: Line 229:
  
 
</table></div></div>[[Sura Serial Number::{{{qs_sernumber|}}}| ]][[Is Sura Text::true| ]][[Category:Quran English Translation]]
 
</table></div></div>[[Sura Serial Number::{{{qs_sernumber|}}}| ]][[Is Sura Text::true| ]][[Category:Quran English Translation]]
 +
 +
<phptag>
 +
global $suraIndexOfSubjects;
 +
 +
if ( !isset( $argv['sura-index-of-subjects'] ) ) {
 +
    $suraIndexOfSubjects = false;
 +
    break;
 +
}
 +
 +
$a = explode( ', ', $argv['sura-index-of-subjects'] );
 +
asort( $a );
 +
 +
$suraIndexOfSubjects = [];
 +
foreach ( $a as $value ) {
 +
  $fl = $value[0]; // $fl = strtolower( $value[0] );
 +
  $suraIndexOfSubjects[$fl][] = "[[Has Sura Index of Subjects::$value]]";
 +
}
 +
</phptag>

Latest revision as of 16:13, 2 April 2018

Sura Attributes

HodHoodQuranLogo.PNG