Example #1
0
$id = $_GET['id'];
if (!is_numeric($id)) {
    exit('wrong ID');
}
$html = dirname(__FILE__) . '/questions_show.html';
if (file_exists($html) && $genpage != 1) {
    include $html;
    exit;
}
require_once SLINEINC . "/listview.class.php";
$pv = new View($typeid);
Helper_Archive::loadModule('common');
$_leaveModule = new CommonModule('sline_question');
$row = $_leaveModule->getOne('id=' . $id);
$where = 'status=1 and webid=' . $GLOBALS['sys_child_webid'];
$count = $_leaveModule->getCount($where);
$totalcount = $_leaveModule->getCount("id is not null and webid={$GLOBALS['sys_child_webid']}");
$row['title'] = $row['questype'] == 0 ? get_productname($row['typeid'], $row['productid']) : $row['title'];
$pv->Fields['seotitle'] = $row['title'];
foreach ($row as $k => $v) {
    $pv->Fields[$k] = $v;
    //模板变量赋值
}
//模板选择
$templet = Helper_Archive::getUseTemplet('questions_show');
//获取使用模板
$templet = !empty($templet) ? $templet : SLINETEMPLATE . "/" . $cfg_df_style . "/" . "questions/" . "questions_show.htm";
//默认模板
$pv->SetTemplet($templet);
$pv->Display();
exit;
Example #2
0
$pv->Fields['seodescription'] = !empty($pv->Fields['seodescription']) ? "<meta name=\"description\" content=\"" . $pv->Fields['seodescription'] . "\"/>" : "";
$pv->Fields['seotitle'] = !empty($pv->Fields['seotitle']) ? $pv->Fields['seotitle'] : $pv->Fields['shortname'];
Helper_Archive::loadModule('common');
$typename = GetTypeName($typeid);
$_leaveModule = new CommonModule('sline_question');
//获取结果集
$where = 'status=1 and webid=' . $GLOBALS['sys_child_webid'];
$tableorder = "replytime desc";
$pagesize = 12;
//每页数量
$pageno = empty($pageno) ? 1 : $pageno;
//第几页
$offset = ($pageno - 1) * $pagesize;
$count = $_leaveModule->getCount($where);
$totalcount = $_leaveModule->getCount("id is not null and webid={$GLOBALS['sys_child_webid']}");
$list = $_leaveModule->getAll($where, $tableorder, "{$offset},{$pagesize}");
foreach ($list as $k => $v) {
    $list[$k]['title'] = $v['questype'] == 0 ? get_productname($v['typeid'], $v['productid']) : $v['title'];
}
$pagestr = page($count, $pageno, $pagesize, '/questions/{page}', 5, '/questions');
if ($User->IsLogin()) {
    $userinfo = $User->getInfoByMid($User->uid);
}
//模板选择
$templet = Helper_Archive::getUseTemplet('questions_index');
//获取使用模板
$templet = !empty($templet) ? $templet : SLINETEMPLATE . "/" . $cfg_df_style . "/" . "questions/" . "questions_index.htm";
//默认模板
$pv->SetTemplet($templet);
$pv->Display();
exit;