} else { $sql = $db->buildSel(array(array("name" => $setting['db']['pre_sub'] . "news_show", "idx" => "a", "col" => "*", "condition" => array("news_id", "n=", $news_id)), array("name" => $setting['db']['pre_sub'] . "news_detail", "idx" => "b", "col" => "sub_title,content", "join" => "news_id", "condition" => array("page", "n=", $page)))); $detail = getData($sql, "record", 1200); } if ($detail === false) { $goto_url = "/"; $mystep->pageEnd(); } $web_id = $setting['info']['web']['web_id']; $tpl_info['idx'] = $template[1]; $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info); if (!empty($cat_name)) { $tpl_tmp->Set_Variable('catalog_txt', ' - <a href="' . getUrl("list", $cat_idx, 1, $setting['info']['web']['web_id']) . '">' . $cat_name . '</a>'); } $tpl_tmp->Set_Variable('web_url', $setting['web']['url']); $tpl_tmp->Set_Variable('page_list', PageList($page, $page_count)); $tpl_tmp->Set_Variable('title', $setting['web']['title']); $tpl_tmp->Set_Variable('web_title', $setting['web']['title']); $tpl_tmp->Set_Variable('web_url', $setting['web']['url']); //if($setting['watermark']['mode'] & 1) $detail['content'] = html_watermark($detail['content'], true, $setting['watermark']['credit'], $setting['web']['url']); if ($setting['watermark']['mode'] & 1) { $script = <<<mystep <script language="JavaScript"> watermark(\$id('content'), 5, "{$setting['watermark']['credit']}", "{$setting['watermark']['txt']}"); </script> mystep; $mystep->setAddedContent("end", $script); } if (empty($detail['original'])) { $detail['original'] = $setting['language']['original']; }
$list_limit = array_values($setting['list']); $page_size = $list_limit[0]; $condition = array(); if (!empty($keyword)) { $condition[] = array("subject", "like", $keyword); } $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info); $sql = $db->buildSel(array(array("name" => $setting['db']['pre_sub'] . "news_show", "idx" => "a", "col" => "count(*)", "condition" => $condition), array("name" => $setting['db']['pre_sub'] . "news_cat", "idx" => "b", "join" => "cat_id"))); $news_count = getData($sql, "result"); if ($news_count > 0) { $db->update($setting['db']['pre'] . "search_keyword", array("amount" => $news_count), array("keyword", "=", $keyword)); } $tpl_tmp->Set_Variable('title', $setting['web']['title']); $tpl_tmp->Set_Variable('web_url', $setting['web']['url']); $tpl_tmp->Set_Variable('keyword', $keyword); $tpl_tmp->Set_Variable('page_list', PageList($page, ceil($news_count / $page_size))); $limit = ($page - 1) * $page_size . ", " . $page_size; $condition = $db->buildCondition($condition); $tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting')); unset($tpl_tmp); if (!empty($keyword)) { $setting['web']['title'] = $keyword . "_" . $setting['web']['title']; $setting['web']['keyword'] = $keyword; } $mystep->show($tpl); } } else { $goto_url = "/"; } if (!empty($goto_url)) { $setting['gen']['show_info'] = false;