Thread:Extension talk:LiquidThreadsOverview/Check on existing pages

Hi,

Thank you for this extension. Really helpful. The only thing is that it also returns links to already deleted pages. So, I've added some code to prevent from showing these pages. Could you please review this?

foreach( $res as $row ) { $namespace=$lang->getNsText($row->thread_article_namespace); $article=str_replace("_"," ",$row->thread_article_title); $pagelink=Linker::link(Title::newFromText($namespace.':'.$article),$article); $threadlink=Linker::link(Title::newFromText($namespace.':'.$article.'#'.$row->thread_subject.'_'.$row->thread_id),$row->thread_subject); $userlink=Linker::link(Title::newFromText($lang->getNsText(NS_USER).':'.$row->thread_author_name),$row->thread_author_name); $icontitletext=$lang->getNsText(NS_FILE).':Icon '.$namespace.'.'.$wglqtoIconType; $icontitle=Title::newFromText($icontitletext); //$iconlink= Linker::makeImageLink($wgParser,$icontitle,wfLocalFile($icontitle),null,Array('height'=>'20px','width'=>'20px')); $iconlink="";//$wgParser->parse("20x20px|link=",$wgParser->getTitle,new ParserOptions)->getText;

$titleArticle = Title::newFromText($article); $title = new Article ($titleArticle); if ( is_null( $title ) ) { print "Couldn't create article"; return false; }			// Only show existing articles if($title->exists) {

$output.=" "; if($wglqtoUseIcons) { $output.=" $iconlink "; }				$output.=" $pagelink "; $output.=" $threadlink "; $output.=" $userlink "; $output.=" ".$row->thread_replies.' '; $output.=" ".$this->formattime($row->thread_created).' '; $output.=" ".$this->formattime($row->thread_modified).' '; if($summarized=='') { $s=wfMessage( 'lqto-summaryno'); if($row->thread_summary_page!=null) $s=wfMessage( 'lqto-summaryyes'); $output.=" $s "; }			}		}		$output.=" "; $wgOut->addHTML( $output ); }