修改 class/view/defaultview.class.php
function _addShowMoreLink()
{
$posts = $this->_params->getValue( 'posts' );
$locale = $this->_blogInfo->getLocale();
//$textFilter = new TextFilter();
$modifPosts = Array();
$rg = RequestGenerator::getRequestGenerator( $this->_blogInfo );
foreach( $posts as $post ) {
if( $post->hasExtendedText()) {
$result = $post->getIntroText();
$showMoreText = $locale->tr( 'read_more' );
+ // patch for read more text focus by ericj.
! $showMoreLink = " <a href=\"".$rg->postPermalink($post)."#More\">".$showMoreText."</a>";
$post->setText( $result. $showMoreLink );
}
array_push( $modifPosts, $post );
}
view/viewarticleview.class.php
function render()
{
// if our view is cached, there is not much to do here...
if( $this->isCached()) {
parent::render();
return true;
}
// get the next and previous articles, based on the article we're going to show
$article = $this->getValue( 'post' );
// notify of certain events
$postText = $article->getIntroText();
+ // patch for focus by ericj
! $postExtendedText = "<a name="."\"More\"></a>".$article->getExtendedText();
#$postExtendedText = $article->getExtendedText();
$this->_pm->notifyEvent( EVENT_TEXT_FILTER, Array( 'text' => &$postText ));
$this->_pm->notifyEvent( EVENT_TEXT_FILTER, Array( 'text' => &$postExtendedText ));
$article->setIntroText( $postText );
$article->setExtendedText( $postExtendedText );
// and yet one event more
$this->_pm->notifyEvent( EVENT_POST_LOADED, Array( 'article' => &$article ));
// once ready, put the article back to the context of the view
$this->setValue( 'post', $article );
$this->setValue( 'comments', $article->getComments());
$this->setValue( 'user', $article->getUser());
$this->setValue( 'trackbacks', $article->getTrackbacks());
// render the main view
parent::render();
}