if ($key == 0) { $fp = fopen($htmlpath . '/' . $syear . '/' . $smoon . '/' . $catarr[$news['catid']]['pre_html'] . $itemid . '.html', 'w'); } else { $fp = fopen($htmlpath . '/' . $syear . '/' . $smoon . '/' . $catarr[$news['catid']]['pre_html'] . $itemid . '_' . ($key + 1) . '.html', 'w'); } //清理输出 obclean(); include template('newsview'); $content = ob_get_contents(); obclean(); fwrite($fp, $content); fclose($fp); unset($multipage); } } else { $news = makenews($multi_news[0], $attacharr, $itemid); //评论处理 $listcount = $news['replynum']; $_SCONFIG['viewspace_pernum'] = intval($_SCONFIG['viewspace_pernum']); if ($listcount) { $query = $_SGLOBAL['db']->query('SELECT c.* FROM ' . tname('spacecomments') . ' c WHERE c.itemid=\'' . $news['itemid'] . '\' ORDER BY c.dateline DESC LIMIT 0, ' . $_SCONFIG['viewspace_pernum']); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['message'] = snl2br($value['message']); if (empty($value['author'])) { $value['author'] = 'Guest'; } $commentlist[] = $value; } } //查看页相关资讯处理 if (!empty($news['relativeitemids'])) {
function jsf_makenews($i_args, &$o_out) { if (!is_array($i_args)) { $o_out['error'] = 'News function argument should be an array.'; return; } $count = count($i_args); if ($count == 0) { $o_out['error'] = 'News function argument array has zero length.'; return; } for ($i = 0; $i < $count; $i++) { makenews($i_args[$i], $o_out); } }