Index: trunk/extensions/BotQuery/query.php |
— | — | @@ -244,14 +244,18 @@ |
245 | 245 | 'allpages' => array( |
246 | 246 | GN_FUNC => 'genMetaAllPages', |
247 | 247 | GN_ISMETA => true, |
248 | | - GN_PARAMS => array( 'aplimit', 'apfrom', 'apnamespace' ), |
249 | | - GN_DFLT => array( 50, '', 0 ), |
| 248 | + GN_PARAMS => array( 'aplimit', 'apfrom', 'apnamespace', 'apfilterredir' ), |
| 249 | + GN_DFLT => array( 50, '', 0, |
| 250 | + array( GN_ENUM_DFLT => 'all', |
| 251 | + GN_ENUM_ISMULTI => false, |
| 252 | + GN_ENUM_CHOICES => array('all', 'redirects', 'nonredirects') )), |
250 | 253 | GN_DESC => array( |
251 | 254 | "Enumerates all available pages to the output list.", |
252 | 255 | "Parameters supported:", |
253 | 256 | "aplimit - How many total pages to return", |
254 | 257 | "apfrom - The page title to start enumerating from.", |
255 | 258 | "apnamespace - Limits which namespace to enumerate. Default 0 (Main)", |
| 259 | + "apfilterredir- Which pages to list: 'all' (default), 'redirects', or 'nonredirects'", |
256 | 260 | "Example: query.php?what=allpages&aplimit=50", |
257 | 261 | )), |
258 | 262 | 'nolanglinks' => array( |
— | — | @@ -908,6 +912,11 @@ |
909 | 913 | $where = array( 'page_namespace' => intval($apnamespace) ); |
910 | 914 | if( $apfrom !== '' ) $where[] = 'page_title>=' . $this->db->addQuotes($apfrom); |
911 | 915 | |
| 916 | + if ($apfilterredir === 'redirects') |
| 917 | + $where['page_is_redirect'] = 1; |
| 918 | + else if ($apfilterredir === 'nonredirects') |
| 919 | + $where['page_is_redirect'] = 0; |
| 920 | + |
912 | 921 | $this->startDbProfiling(); |
913 | 922 | $res = $this->db->select( |
914 | 923 | 'page', |