I really need help with debug errors I am getting. I know it must be from the add on - News Article Summary.
PHP Warning: Missing argument 2 for newsDisplay::newsHeader(), called in /includes/templates/mytempname/templates/tpl_news_article_default.php on line 35 and defined in /includes/classes/news.php on line 27
Here is tpl_news_article_default.php some before and after line 35:
HTML Code:
<?php
// Start the news display class
$newsDisplay = new newsDisplay();
// News header
$newsDisplay->newsHeader(HEADING_TITLE);
// Set article heading
$newsDisplay->articleHeading($articleName);
// Set by line
$newsDisplay->articleByLine(sprintf(TEXT_ARTICLE_BY_LINE, $articleAuthor), $commentsURL, (($comments > 0) ? sprintf(TEXT_POST_COMMENT_1, $comments) : TEXT_POST_COMMENT_2));
// Set article main text
$newsDisplay->articleText($articleText, $articleImage);
// Set article links
$newsDisplay->articleLinksBlock($articleLinks);
$newsDisplay->articleSplit();
// News SubFooter
$newsDisplay->articleFooter(sprintf(TEXT_NEWS_FOOTER_OTHER, $newsSubFooterDate), $newsSubFooter, $newsSubFooterDateURL, sprintf(TEXT_NEWS_FOOTER_URL, $newsSubFooterDate));
// News Footer
$newsDisplay->articleFooter(sprintf(TEXT_NEWS_FOOTER, $newsFooterDate), $newsFooter, $newsFooterDateURL, sprintf(TEXT_NEWS_FOOTER_URL, $newsFooterDate));
// Recent News Footer
$newsDisplay->articleFooter(TEXT_RECENT_NEWS, $newsRecentFooter);
// Archive link
$newsDisplay->archiveLink(zen_href_link(FILENAME_NEWS_ARCHIVE), TEXT_NEWS_ARCHIVE_LINK);
// Display this news page
// New page content is output in valid XHTML
// You can change how it displays in the stylesheet_news.css file
$newsDisplay->displayNewsPage();
?></div>
Here is /includes/classes/news.php on line 27:
PHP Code:
}
function newsHeader($header, $date, $links_array = false) {
$this->news_page .= '<div class="newsHeader"><h1>' . $header . '</h1></div>' . "\n";
$this->news_page .= '<div class="newsHeadlineText">' . $date;
if ($links_array && is_array($links_array)) {
foreach ($links_array as $link) {
$this->news_page .= ' | <a href="' . $link['link'] . '">' . $link['text'] . '</a>';
}
}
PHP Warning: Invalid argument supplied for foreach() in /includes/classes/news.php on line 103
Line 103 and little before it and after looks like this:
HTML Code:
}
function articleLinksBlock($links_block) {
foreach ($links_block as $links) {
$this->news_page .= '<ul class="articleLinkList">' . "\n";
// Offsite Links
foreach ($links['offsiteLinks'] as $thisLink) {
$this->news_page .= ' <li><a href="' . $thisLink['link'] . '" target="_blank">' . $thisLink['text'] . '</a></li>' . "\n";
}
Hope this helps! Kim
Bookmarks