From 22ab0f8ea7cae4ace50b9605f193b3e3d643d463 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 25 Jun 2005 09:20:34 +0000 Subject: [PATCH] Reverting this for the moment. It doesn't really fit in Special:Export but would make a great standalone extension. --- includes/DefaultSettings.php | 4 --- includes/SpecialExport.php | 55 ++---------------------------------- 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0581906bac..402b7d0e12 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1540,9 +1540,5 @@ $wgTrustedMediaFormats= array( */ $wgAllowSpecialInclusion = true; -/** - * Allow Special:Export to search/return a list of articles changed since XXX - */ -$wgAllowArticleList = false ; ?> diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index 77a0a3ee2d..1d517ca762 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -29,13 +29,9 @@ require_once( 'Revision.php' ); * */ function wfSpecialExport( $page = '' ) { - global $wgOut, $wgLang, $wgRequest, $wgAllowArticleList; + global $wgOut, $wgLang, $wgRequest; - if( $wgAllowArticleList AND $wgRequest->getVal( 'action' ) == 'list') { # Return list of articles changed since XXX - $since = $wgRequest->getText( 'since' ) ; - print getListOfChangedArticlesSince ( $since ) ; - exit ( 0 ) ; - } else if( $wgRequest->getVal( 'action' ) == 'submit') { + if( $wgRequest->getVal( 'action' ) == 'submit') { $page = $wgRequest->getText( 'pages' ); $curonly = $wgRequest->getCheck( 'curonly' ); } else { @@ -71,53 +67,6 @@ function wfSpecialExport( $page = '' ) { " ); } -/** - * This function returns a XML list with all article titles and namespaces changed since {$since} - * Using WikiExporter for this seems overkill, as the SQL query is pretty simple -*/ -function getListOfChangedArticlesSince ( $since ) { - if ( TRUE != preg_match ( "/^[0-9]{14,14}$/" , $since ) ) return "INVALID DATE!" ; - - global $wgLang ; - $fname = "getListOfChangedArticlesSince" ; - wfProfileIn( $fname ); - - $ret = "" ; - $dbr =& wfGetDB( DB_SLAVE ); - $sql = "SELECT page_namespace,page_title FROM page WHERE page_touched >= \"{$since}\"" ; - $res = $dbr->query ( $sql , $fname ) ; - - header( "Content-type: application/xml; charset=utf-8" ); - $ret .= "" ; - $ret .= "" ; - - while( $obj = $dbr->fetchObject( $res ) ) { - $t = Title::newFromText ( $obj->page_title , $obj->page_namespace ) ; - $ret .= "
getPrefixedDBkey() ) ; - $ret .= "\" title=\"" ; - $ret .= fixTitle4XML ( $t->getDBkey() ) ; - $ret .= "\" namespace_id=\"" ; - $ret .= $obj->page_namespace ; - $ret .= "\" namespace_name=\"" ; - $ret .= fixTitle4XML ( $wgLang->getNsText ( $obj->page_namespace ) ) ; - $ret .= "\"/>" ; - } - - $ret .= "" ; - $ret .= "" ; - - wfProfileOut( $fname ); - return $ret ; -} - -function fixTitle4XML ( $t ) { - $t = str_replace ( "&" , "&" , $t ) ; - $t = str_replace ( ">" , ">" , $t ) ; - $t = str_replace ( "<" , "<" , $t ) ; - return $t ; -} - define( 'MW_EXPORT_FULL', 0 ); define( 'MW_EXPORT_CURRENT', 1 ); -- 2.20.1