Difference between revisions of "Template:Unique values"
From HodHood
P.Astakhov (talk | contribs) |
P.Astakhov (talk | contribs) (restore) |
||
(14 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <phptag> | + | <includeonly><phptag> |
global $count; | global $count; | ||
$page = $argv[1]; | $page = $argv[1]; | ||
Line 5: | Line 5: | ||
foreach ( $val as $v ) { | foreach ( $val as $v ) { | ||
if ( isset( $count[$v] ) ) { | if ( isset( $count[$v] ) ) { | ||
− | $count[$v]++; | + | $count[$v]['count']++; |
} else { | } else { | ||
− | $count[$v] = 1; | + | $count[$v]['count'] = 1; |
+ | $show = "{{#show: $v | ?category |link=none }}"; | ||
+ | $category = transclude( false, [], $show ); | ||
+ | $count[$v]['category'] = $category; | ||
} | } | ||
//$count[$v][] = $page; | //$count[$v][] = $page; | ||
Line 13: | Line 16: | ||
//var_dump( $argv[1] ); | //var_dump( $argv[1] ); | ||
//var_dump( $val ); | //var_dump( $val ); | ||
− | </phptag> | + | </phptag></includeonly> |