Jump to content

  • twitter
  • youtube
  • googleplus
  • facebook
  • rss
  • newsletter


Issue information

  • #000118

  • 0 - None Assigned

  • Confirmed

  • 1.1.0

  • -


Issue Confirmations

  • Yes (0)No (0)
Photo

foreach error for empty setting

Posted by Michael on 18 September 2009 - 05:23 AM

Foreach error when setting Latest News (Left) is left empty. Ideally should include a check if array.

Manual Fix:

Open Admin CP > Look & Feel Tab > select skin > skin_news > menu

Find:
<div class='block_wrap'>
<h3 class='maintitle'>{$this->lang->words['title_latest_news']}</h3>
<table class='ipb_table'>
{parse striping="latest_row" classes="row1,row2"}
<foreach loop="latest_row:$menu['list'] as $a => $r">
<tr><td class='{parse striping="latest_row"} altorw'>
<a href='{parse url="do=view&amp;id={$r['id']}" seotitle="{$r['seo_title']}" template="viewnews" base="publicWithApp"}'><b>{$r['title']}</b></a><br />{parse date="$r['date']" relative="1" format="long"}</td></tr>
</foreach>
</table>
</div>

Replace With:

<if test="news_menu:|:is_array( $menu['list'] ) && count( $menu['list'] )">
<div class='block_wrap'>
<h3 class='maintitle'>{$this->lang->words['title_latest_news']}</h3>
<table class='ipb_table'>
{parse striping="latest_row" classes="row1,row2"}
<foreach loop="latest_row:$menu['list'] as $a => $r">
<tr><td class='{parse striping="latest_row"} altorw'>
<a href='{parse url="do=view&amp;id={$r['id']}" seotitle="{$r['seo_title']}" template="viewnews" base="publicWithApp"}'><b>{$r['title']}</b></a><br />{parse date="$r['date']" relative="1" format="long"}</td></tr>
</foreach>
</table>
</div>
</if>

Latest News (Right) is empty..






0 user(s) are reading this issue

0 members, 0 guests, 0 anonymous users