var $mParserOptions;
var $mShowFeedLinks = false;
var $mEnableClientCache = true;
+ var $mArticleBodyOnly = false;
/**
* Constructor
function getScript() { return $this->mScripts; }
function setETag($tag) { $this->mETag = $tag; }
+ function setArticleBodyOnly($only) { $this->mArticleBodyOnly = $only; }
+ function getArticleBodyOnly($only) { return $this->mArticleBodyOnly; }
function addLink( $linkarr ) {
# $linkarr should be an associative array of attributes. We'll escape on output.
# Wed, 20 Aug 2003 06:51:19 GMT; length=5202
# this breaks strtotime().
$modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
- $ismodsince = wfTimestamp( TS_MW, strtotime( $modsince ) );
+ $modsinceTime = strtotime( $modsince );
+ $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 );
wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false );
wfDebug( "-- we might send Last-Modified : $lastmod\n", false );
if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) ) {
$this->sendCacheControl();
wfDebug( "CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp\n", false );
$this->disable();
+ @ob_end_clean(); // Don't output compressed blob
return true;
} else {
wfDebug( "READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp\n", false );
setcookie( $name, $val, $exp, '/' );
}
- wfProfileIn( 'Output-skin' );
- $sk->outputPage( $this );
- wfProfileOut( 'Output-skin' );
+ if ($this->mArticleBodyOnly) {
+ $this->out($this->mBodytext);
+ } else {
+ wfProfileIn( 'Output-skin' );
+ $sk->outputPage( $this );
+ wfProfileOut( 'Output-skin' );
+ }
$this->sendCacheControl();
ob_end_flush();
}
/**
- * This function takes the existing and broken links for the page
+ * This function takes the title (first item of mGoodLinks), categories, existing and broken links for the page
* and uses the first 10 of them for META keywords
*/
function addMetaTags () {
global $wgLinkCache , $wgOut ;
+ $categories = array_keys ( $wgLinkCache->mCategoryLinks ) ;
$good = array_keys ( $wgLinkCache->mGoodLinks ) ;
$bad = array_keys ( $wgLinkCache->mBadLinks ) ;
- $a = array_merge ( $good , $bad ) ;
+ $a = array_merge ( array_slice ( $good , 0 , 1 ), $categories, array_slice ( $good , 1 , 9 ) , $bad ) ;
$a = array_slice ( $a , 0 , 10 ) ; # 10 keywords max
$a = implode ( ',' , $a ) ;
$strip = array(
/**
* Turn off regular page output and return an error reponse
* for when rate limiting has triggered.
- * @todo: i18n
+ * @todo i18n
* @access public
*/
function rateLimited() {