【发布时间】:2009-03-09 22:53:18
【问题描述】:
我正在开发一个类似 Digg 的网站,我希望 cmets 页面的标题与链接标题相匹配,这里是 cmets 文件代码:
class CommentsPage extends Page {
function __construct($title = '')
{
$this->setTitle($title);
}
function header()
{
parent::header();
}
function showAllComments($article_id, $param)
{
$article = Article::getById($article_id);
if(!empty($article))
{
?>
<div class="news_item">
<a href="/index.php?action=vote¶m=<?php echo $article->getId(); ?>"><img alt="vote button" class="vote_button" height="10" src="assets/images/vote2.png" width="10" class="border_less" /></a>
<h2 class="news_item_title"><b><a href = "<?php echo $article->getUrl(); ?>"><?php echo $article->getTitle(); ?></a></b></h2>
<span class="news_item_url">(<?php echo $article->getUrlDomain(); ?>)</span>
<div class="news_item_info"><?php $points = $article->getPoints(); echo $points > 1 ? "$points points" : "$points point"; ?> by <a href="/index.php?action=user¶m=<?php echo $article->getUsername(); ?>"><?php echo $article->getUsername(); ?></a> <?php echo $article->getElapsedDateTime(); ?></div>
<p class="news_item_content"><?php echo $article->getDescription(); ?></p>
</div>
<?php
$this->showSubmitForm($article);
}
我知道我必须更改“$this->setTitle($title);”对于这样的东西: $article->getTitle();但我尝试了不同的方法,只是显示错误。
我想我不够清楚:页面顶部的标题要更改并与该页面的新闻标题相同(这是网站:kiubbo.com)谢谢
【问题讨论】: