<?php

/**
 * 最新文章; 首页调用;
 */
$a = intval($a);
$b = intval($b);
$key = 'home_new_article_kdsf_' . $a;
if (cache_exists($key))
{
    $arr = $cache[$key];
} else
{
    $arr = array();
    $rs = $db->query('select title,article.post_time,article.post_id from (' . PF .
        'article as article left join ' . PF . 'posts as post on article.menu_id=' . $a .
        ' && article.post_id=post.id) left join ' . PF .
        'user as user on post.authorid=user.id where menu_id="' . $a .
        '" order by post.post_time desc LIMIT 0,' . $b);
    while ($row = $db->fetch_array($rs))
    {
        $arr[$row['post_id']] = array('title' => unserialize($row['title']), 'post_time' =>
            $row['post_time'], );
    }
    set_cache($key, $arr, 20);
}
if (empty($arr))
    return;
echo '<div class="ayaya_home_list"><h2>' . htmlxlang($conf['sys_menus'][$a]['name']) .
    '</h2>
      <p>';
echo html(xstr(xlang($conf['sys_menus'][$a]['doc']), 60, true));
echo '</p>
      <ul>';
foreach ($arr as $k => $v)
{
    echo '<li><a href="' . url(RPG . 'article/show/' . $a . '/' . $k . '/') . '">',
        html(xstr(xlang($v['title']), 20, true)), '</a></li>';
}
echo '</ul>
      <div class="clear"></div>';
echo '<a class="ayaya_home_list_more" href="' . url(RPG . 'article/' . $a . '/') .
    '">', htmlmlang('更多', 'article'), '...</a>';
echo '</div>';
return;

?>