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