Moderators: jmacgreg, michael, jheckman, barbarah, btbell, bdgregg, asmecher
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticles =& $publishedArticleDao->getPublishedArticlesByJournalId($journal->getId());
$templateMgr->assign_by_ref('publishedArticles', $publishedArticles);
while ($article =& $publishedArticles->next()) {
... do something with $article here ...
} $articleArray =& $publishedArticles->toArray()// get all published articles, put them into $publishedArticles array and assign it to template responsible for homepage rendering
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticles =& $publishedArticleDao->getPublishedArticlesByJournalId($journal->getId());
$publishedArticles =& $publishedArticles->toArray();
$templateMgr->assign('publishedArticles', $publishedArticles);
{if $publishedArticles}
{* Displays all articles ever published in journal *}
<h3>Recently Published Articles</h3>
{foreach from=$publishedArticles item=article}
{assign var=articlePath value=$article->getBestArticleId($currentJournal)}
<ul>
<li>
<span>
<a href="{url page="article" op="view" path=$articlePath}" name="{$article->getLocalizedTitle()|strip_unsafe_html}" title="{$article->getLocalizedTitle()|strip_unsafe_html}">
{$article->getLocalizedTitle()|strip_unsafe_html}
</a>
</span>
<br/>
<span>
{if (!$section.hideAuthor && $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_DEFAULT) || $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_SHOW}
{foreach from=$article->getAuthors() item=author name=authorList}
{$author->getFullName()|escape}{if !$smarty.foreach.authorList.last},{/if}
{/foreach}
{else}
{/if}
</span>
</li>
</ul>
{/foreach}
{/if}
Return to OJS Technical Support
Users browsing this forum: Google [Bot] and 5 guests