Index: trunk/extensions/RandomImageByCategory/RandomImageByCategory.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | } |
37 | 37 | |
38 | 38 | function getRandomImage( $input, $args, $parser ) { |
39 | | - global $wgOut, $wgMemc; |
| 39 | + global $wgMemc; |
40 | 40 | |
41 | 41 | wfProfileIn( __METHOD__ ); |
42 | 42 | |
— | — | @@ -60,8 +60,8 @@ |
61 | 61 | $image_list = array(); |
62 | 62 | if( !$data ) { |
63 | 63 | wfDebug( "Getting random image list from DB\n" ); |
64 | | - $p = new Parser(); |
65 | | - $ctg = $p->transformMsg( $categories, $wgOut->parserOptions() ); |
| 64 | + $ctg = $parser->replaceVariables( $categories ); |
| 65 | + $ctg = $parser->mStripState->unstripBoth( $ctg ); |
66 | 66 | $ctg = str_replace( "\,", '#comma#', $ctg ); |
67 | 67 | $aCat = explode( ',', $ctg ); |
68 | 68 | |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | $image_list = $data; |
101 | 101 | wfDebug( "Cache hit for random image list\n" ); |
102 | 102 | } |
103 | | - |
| 103 | +var_dump( $image_list ); |
104 | 104 | $random_image = ''; |
105 | 105 | $thumbnail = ''; |
106 | 106 | if( count( $image_list ) > 1 ) { |
— | — | @@ -117,4 +117,4 @@ |
118 | 118 | wfProfileOut( __METHOD__ ); |
119 | 119 | |
120 | 120 | return $thumbnail; |
121 | | -} |
\ No newline at end of file |
| 121 | +} |