getRow('SELECT * FROM `' . $db_mymps . 'news` WHERE id = \'' . $id . '\' AND iscommend > \'0\''))) { write_msg('您所指定的新闻不存在或者已被删除!'); exit(); } $news['view_url'] = $mymps_global['SiteUrl'] . '/news.php?id=' . $id; if ($news['redirect_url'] != '' && $news['isjump'] == 1) { write_msg('请稍候,当前页面正跳转至 ' . $news[redirect_url] . ' ', $news[redirect_url]); } $loc = get_location('channel', $news[catid], $news[title]); $location = $loc['location']; $page_title = $loc['page_title']; $advertisement = get_advertisement('other'); $adveritems = $advertisement['items']; $advertisement = $advertisement['all']; $news['keywords'] = $news['keywords'] ? $news['keywords'] : $news['title']; $news['description'] = mhtmlspecialchars(substring(clear_html($news['content']), 0, 250)); $news['content'] = replace_insidelink($news['content'], 'news'); } else if ($catid) { define('CURSCRIPT', 'news_list'); $catid = isset($catid) ? intval($catid) : 0; $channel = get_cat_info($catid, 'channel'); if (!$channel) { write_msg('您所指定的新闻栏目不存在或者已经删除!', '/'); } $loc = get_location('channel', $catid); $location = $loc['location']; $page_title = $loc['page_title']; $cat_children = get_channel_children($catid); $param = setParam(array('catid'), $rewrite, 'news-'); $rows_num = $db->getOne('SELECT COUNT(*) FROM `' . $db_mymps . 'news` AS a WHERE ' . $cat_children); $page1 = page1('SELECT * FROM ' . $db_mymps . 'news WHERE ' . $cat_children . ' ORDER BY id DESC', 10); foreach ($page1 as $kr => $r) { if (0 < $r['iscommend']) { $arr['begintime'] = $r['begintime']; $arr['hit'] = $r['hit']; $arr['title'] = $r['title']; $arr['iscommend'] = $r['iscommend']; $arr['content'] = clear_html($r['content']); $arr['uri'] = $r['isjump'] ? $r['redirect_url'] : Rewrite('news', array('id' => $r['id'])); $arr['imgpath'] = $r['imgpath'] ? $r['imgpath'] : '/images/nophoto.jpg'; $news[] = $arr; } } $advertisement = get_advertisement('other'); $adveritems = $advertisement['items']; $advertisement = $advertisement['all']; $cat_list = get_categories_tree($catid, 'channel'); $pageview = page2($rewrite); } else { define('CURSCRIPT', 'news_index'); $catquery = $db->query('SELECT catid,catname,html_dir FROM `' . $db_mymps . 'channel` WHERE parentid = \'0\' AND if_view = \'2\' ORDER BY catorder ASC'); while ($queryrow = $db->fetchRow($catquery)) { $_array['catid'] = $queryrow['catid']; $_array['catname'] = $queryrow['catname']; $_array['uri'] = Rewrite('news', array('catid' => $queryrow['catid'], 'html_dir' => $queryrow['html_dir'])); $channel[] = $_array; } for ($i = 0; $i < count($channel); $i++) { $do_sql = $db->query('SELECT iscommend,id,title,catid,begintime,isjump,redirect_url FROM `' . $db_mymps . 'news` WHERE ' . get_channel_children($channel[$i]['catid']) . ' ORDER BY begintime DESC LIMIT 0,8'); while ($row = $db->fetchRow($do_sql)) { if (0 < $row['iscommend']) { $arr['id'] = $row['id']; $arr['iscommend'] = $row['iscommend']; $arr['title'] = $row['title']; $arr['begintime'] = $row['begintime']; $arr['uri'] = $row['isjump'] == 1 ? $row['redirect_url'] : Rewrite('news', array('id' => $row['id'])); $channel[$i]['news'][] = $arr; } } } $loc = get_location('news', 0, '热点资讯'); $page_title = $loc['page_title']; $location = $loc['location']; $s = array(); $s['title'] = $pluginsettings['news']['seotitle']; $s['keywords'] = $pluginsettings['news']['seokeywords']; $s['description'] = $pluginsettings['news']['seodescription']; $advertisement = get_advertisement('other'); $adveritems = $advertisement['items']; $advertisement = $advertisement['all']; } globalassign(); include mymps_tpl(CURSCRIPT); is_object($db) && $db->Close(); ?>