I am developing a Digg like site and I want the title of the comments page to match the link title, here its the comments file code:
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);
}
I understand I have to change "$this->setTitle($title);" for something with this: $article->getTitle(); but I have tried different things and just shows errors.
I think I was not clear enough: the title on top of the page to change and be the same as the news item title for that page (this is the site: kiubbo.com) Thx