Index: trunk/phase3/includes/SpecialAllpages.php |
— | — | @@ -5,11 +5,13 @@ |
6 | 6 | global $indexMaxperpage, $wgRequest; |
7 | 7 | $indexMaxperpage = 480; |
8 | 8 | $from = $wgRequest->getVal( 'from' ); |
9 | | - |
| 9 | + $namespace = $wgRequest->getVal( 'namespace' ); |
| 10 | + if ( is_null($namespace) ) { $namespace = 0; } |
| 11 | + |
10 | 12 | if( $par ) { |
11 | | - indexShowChunk( $par ); |
| 13 | + indexShowChunk( $par, $namespace ); |
12 | 14 | } elseif( !is_null( $from ) ) { |
13 | | - indexShowChunk( $from ); |
| 15 | + indexShowChunk( $from, $namespace ); |
14 | 16 | } else { |
15 | 17 | indexShowToplevel(); |
16 | 18 | } |
— | — | @@ -30,7 +32,7 @@ |
31 | 33 | $log->showAsDisabledPage(); |
32 | 34 | return; |
33 | 35 | } |
34 | | - |
| 36 | + |
35 | 37 | $dbr =& wfGetDB( DB_SLAVE ); |
36 | 38 | $cur = $dbr->tableName( 'cur' ); |
37 | 39 | $fromwhere = "FROM $cur WHERE cur_namespace=0"; |
— | — | @@ -41,7 +43,7 @@ |
42 | 44 | $count = $dbr->selectField( 'cur', 'COUNT(*)', $where, $fname ); |
43 | 45 | $sections = ceil( $count / $indexMaxperpage ); |
44 | 46 | $inpoint = $dbr->selectField( 'cur', 'cur_title', $where, $fname, $order ); |
45 | | - |
| 47 | + |
46 | 48 | $out .= "<table>\n"; |
47 | 49 | # There's got to be a cleaner way to do this! |
48 | 50 | for( $i = 1; $i < $sections; $i++ ) { |
— | — | @@ -91,16 +93,17 @@ |
92 | 94 | return "<tr><td align=\"right\">{$out}</td></tr>\n"; |
93 | 95 | } |
94 | 96 | |
95 | | -function indexShowChunk( $from ) |
| 97 | +function indexShowChunk( $from, $namespace = 0 ) |
96 | 98 | { |
97 | 99 | global $wgOut, $wgUser, $indexMaxperpage, $wgLang; |
98 | 100 | $sk = $wgUser->getSkin(); |
99 | 101 | $maxPlusOne = $indexMaxperpage + 1; |
| 102 | + $namespacee = intval($namespace); |
100 | 103 | |
101 | 104 | $out = ""; |
102 | 105 | $dbr =& wfGetDB( DB_SLAVE ); |
103 | 106 | $cur = $dbr->tableName( 'cur' ); |
104 | | - $sql = "SELECT cur_title FROM $cur WHERE cur_namespace=0 AND cur_title >= '" |
| 107 | + $sql = "SELECT cur_title FROM $cur WHERE cur_namespace=$namespacee AND cur_title >= '" |
105 | 108 | . $dbr->strencode( $from ) . "' ORDER BY cur_title LIMIT " . $maxPlusOne; |
106 | 109 | $res = $dbr->query( $sql, "indexShowChunk" ); |
107 | 110 | |
— | — | @@ -109,7 +112,7 @@ |
110 | 113 | $n = 0; |
111 | 114 | $out = "<table border=\"0\" width=\"100%\">\n"; |
112 | 115 | while( ($n < $indexMaxperpage) && ($s = $dbr->fetchObject( $res )) ) { |
113 | | - $t = Title::makeTitle( 0, $s->cur_title ); |
| 116 | + $t = Title::makeTitle( $namespacee, $s->cur_title ); |
114 | 117 | if( $t ) { |
115 | 118 | $link = $sk->makeKnownLinkObj( $t ); |
116 | 119 | } else { |