X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialRandompage.php;h=7cd7ff0f9a4aa3701b3528b9f8b92a0a3cd38d0d;hb=3f7fe13247c19fc02e48c9b50bafb9e1c0d07700;hp=62269ec59d758ff865c461922a78ea40188005af;hpb=4b42f18b66e843f362e5e159d95fee9d2c26ef9c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialRandompage.php b/includes/SpecialRandompage.php index 62269ec59d..7cd7ff0f9a 100644 --- a/includes/SpecialRandompage.php +++ b/includes/SpecialRandompage.php @@ -24,25 +24,25 @@ function wfSpecialRandompage() { $randstr = wfRandom(); $db =& wfGetDB( DB_SLAVE ); - $use_index = $db->useIndexClause( 'cur_random' ); - $cur = $db->tableName( 'cur' ); + $use_index = $db->useIndexClause( 'page_random' ); + $page = $db->tableName( 'page' ); if ( $wgExtraRandompageSQL ) { $extra = "AND ($wgExtraRandompageSQL)"; } else { $extra = ''; } - $sqlget = "SELECT cur_id,cur_title - FROM $cur $use_index - WHERE cur_namespace=0 AND cur_is_redirect=0 $extra - AND cur_random>$randstr - ORDER BY cur_random + $sqlget = "SELECT page_id,page_title + FROM $page $use_index + WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0 $extra + AND page_random>$randstr + ORDER BY page_random LIMIT 1"; $res = $db->query( $sqlget, $fname ); $title = null; if( $s = $db->fetchObject( $res ) ) { - $title =& Title::makeTitle( NS_MAIN, $s->cur_title ); + $title =& Title::makeTitle( NS_MAIN, $s->page_title ); } if( is_null( $title ) ) { # That's not supposed to happen :)