public function index_f() { $pageurl = $this->url('tag'); //获取当前系统拥有Tag数 $keywords = $this->get('keywords'); $condition = "1=1"; if ($keywords) { $condition .= " AND title LIKE '%" . $keywords . "%' "; $pageurl .= "&title=" . rawurlencode($keywords); } $psize = $this->config['psize'] ? $this->config['psize'] : 30; $pageid = $this->get($this->config['pageid'], 'int'); if (!$pageid) { $pageid = 1; } $offset = ($pageid - 1) * $psize; $total = $this->model('tag')->get_total($condition); if ($total > 0) { $rslist = $this->model('tag')->get_list($condition, $offset, $psize); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("rslist", $rslist); $this->assign('pagelist', $pagelist); } $this->view('tag_index'); }
public function index_f() { if (!$this->popedom["list"]) { error(P_Lang('您没有权限执行此操作'), '', 'error'); } $this->phpok_autoload(); $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $keywords = $this->get("keywords"); $pageurl = $this->url("call"); $condition = ""; if ($keywords) { $this->assign("keywords", $keywords); $pageurl .= "&keywords=" . rawurlencode($keywords) . "&"; $condition = " (title LIKE '%" . $keywords . "%' OR note LIKE '%" . $keywords . "%' OR identifier LIKE '%" . $keywords . "%') "; } $rslist = $this->model('call')->get_list($condition, $pageid); $this->assign("rslist", $rslist); $total = $this->model('call')->get_count($condition); $this->assign("total", $total); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $this->psize, $string); $this->assign("pagelist", $pagelist); $attrlist = $this->model('list')->attr_list(); $this->assign("attrlist", $attrlist); $this->view("phpok_index"); }
public function index_f() { $site_id = $_SESSION["admin_site_id"]; if ($site_id) { $condition = "site_id IN(" . $site_id . ",0)"; } else { $condition = "site_id=0"; } $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = $this->config["psize"] ? $this->config["psize"] : 30; $offset = ($pageid - 1) * $psize; $rslist = $this->model('email')->get_list($condition, $offset, $psize); $this->assign("rslist", $rslist); $total = $this->model('email')->get_count($condition); //读取模块总数 $pageurl = $this->url("email"); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); if ($pagelist) { $this->assign("pagelist", $pagelist); } $this->view("email_list"); }
public function index_f() { if (!$this->popedom["list"]) { error(P_Lang('您没有权限执行此操作'), '', 'error'); } $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = $this->config["psize"]; if (!$psize) { $psize = 30; } $offset = ($pageid - 1) * $psize; $condition = "1=1"; $keywords = $this->get("keywords"); $pageurl = $this->url("admin"); if ($keywords) { $condition .= " AND account LIKE '%" . $keywords . "%' "; $pageurl .= '&keywords=' . rawurlencode($keywords); } $rslist = $this->model('admin')->get_list($condition, $offset, $psize); $total = $this->model('admin')->get_total($condition); if ($total > $psize) { $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); } $this->assign("rslist", $rslist); $this->view("admin_list"); }
function index_f() { if (!$this->popedom["list"]) { error(P_Lang('您没有权限执行此操作'), '', 'error'); } $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = $this->config["psize"]; if (!$psize) { $psize = 30; } $keywords = $this->get("keywords"); $page_url = $this->url("user"); $condition = "1=1"; if ($keywords) { $this->assign("keywords", $keywords); $condition .= " AND u.user LIKE '%" . $keywords . "%'"; $page_url .= "&keywords=" . rawurlencode($keywords); } $offset = ($pageid - 1) * $psize; $rslist = $this->model('user')->get_list($condition, $offset, $psize); $count = $this->model('user')->get_count($condition); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=3'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($page_url, $count, $pageid, $psize, $string); $this->assign("total", $count); $this->assign("rslist", $rslist); $this->assign("pagelist", $pagelist); $list = $this->lib('xml')->read($this->dir_root . 'data/xml/admin_user.xml'); $this->assign("arealist", $list); $grouplist = $this->model('usergroup')->get_all("", "id"); $this->assign("grouplist", $grouplist); $this->view("user_list"); }
public function list_f() { $psize = $this->config['psize'] ? $this->config['psize'] : 30; $pageid = $this->get($this->config['pageid'], 'int'); if (!$pageid) { $pageid = 1; } $offset = ($pageid - 1) * $psize; $rslist = $this->model('workflow')->get_all('admin_id=' . $_SESSION['admin_id'], $offset, $psize); $this->assign('rslist', $rslist); $total = $this->model('workflow')->total('admin_id=' . $_SESSION['admin_id']); $pageurl = $this->url('workflow', 'list'); $this->assign('total', $total); $this->assign('psize', $psize); $this->assign('pageid', $pageid); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign('pagelist', $pagelist); $this->view('workflow_list'); }
public function comment_f() { $id = $this->get('id', 'int'); if (!$id) { error(P_Lang('未指定ID'), '', 'error'); } $rs = $this->model('list')->get_one($id); if (!$rs) { error(P_Lang('数据不存在'), '', 'error'); } $this->popedom_auto($rs['project_id']); if (!$this->popedom['comment']) { error(P_Lang('您没有权限执行此操作'), '', 'error'); } $this->assign("rs", $rs); $pageurl = $this->url("list", "comment", "id=" . $id); $condition = "tid='" . $id . "' AND parent_id=0"; $keywords = $this->get("keywords"); $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = $this->config["psize"] ? $this->config["psize"] : 30; $total = $this->model('reply')->get_total($condition); if ($total > 0) { $offset = ($pageid - 1) * $psize; $rslist = $this->model('reply')->get_list($condition, $offset, $psize, "id"); if ($rslist) { $uidlist = array(); foreach ($rslist as $key => $value) { if ($value["uid"]) { $uidlist[] = $value["uid"]; } } $idlist = array_keys($rslist); $condition = "tid='" . $tid . "' AND parent_id IN(" . implode(",", $idlist) . ")"; $sublist = $this->model('reply')->get_list($condition, 0, 0); if ($sublist) { foreach ($sublist as $key => $value) { if ($value["uid"]) { $uidlist[] = $value["uid"]; } $rslist[$value["parent_id"]]["sublist"][$value["id"]] = $value; } } if ($uidlist && count($uidlist) > 0) { $uidlist = array_unique($uidlist); $ulist = $this->model('user')->get_all_from_uid(implode(",", $uidlist), 'id'); if (!$ulist) { $ulist = array(); } foreach ($rslist as $key => $value) { if ($value["uid"]) { $value["uid"] = $ulist[$value["uid"]]; } if ($value["sublist"]) { foreach ($value["sublist"] as $k => $v) { if ($v) { $v["uid"] = $ulist[$v["uid"]]; } $value["sublist"][$k] = $v; } } $rslist[$key] = $value; } } $this->assign("rslist", $rslist); } if ($total > $psize) { $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); } $this->assign("total", $total); } $this->view("list_comment"); }
function list_f() { $pid = $this->get("pid", "int"); $group_id = $this->get("group_id", "int"); if (!$group_id && !$pid) { error(P_Lang('未指定选项组'), $this->url("opt")); } if ($pid) { $p_rs = $this->model('opt')->opt_one($pid); if (!$p_rs) { error(P_Lang('操作异常,请检查'), $this->url("opt")); } $group_id = $p_rs["group_id"]; $list[0] = $p_rs; if ($p_rs["parent_id"]) { $this->model('opt')->opt_parent($list, $p_rs["parent_id"]); } krsort($list); $this->assign("lead_list", $list); $this->assign("p_rs", $p_rs); $this->assign("pid", $pid); } $this->assign("group_id", $group_id); $rs = $this->model('opt')->group_one($group_id); $psize = $this->config["psize"]; $pageid = $this->get($this->config["pageid"], "int"); $offset = $pageid ? ($pageid - 1) * $psize : 0; $pageurl = $this->url("opt", "list"); $keywords = $this->get("keywords"); $condition = "group_id='" . $group_id . "'"; if ($pid) { $condition .= " AND parent_id='" . $pid . "' "; $pageurl .= "&pid=" . $pid; } else { $pageurl .= "&group_id=" . $group_id; $condition .= " AND parent_id='0' "; } if ($keywords) { $condition .= " AND (title LIKE '%" . $keywords . "%' OR val LIKE '%" . $keywords . "%') "; $pageurl .= "&keywords=" . rawurlencode($keywords); } $rslist = $this->model('opt')->opt_list($condition, $offset, $psize); $total = $this->model('opt')->opt_count($condition); # 传参数给分页 $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); $this->assign("rslist", $rslist); $this->assign("rs", $rs); $this->view("opt_list"); }
function user2_f() { $id = $this->get("id"); if (!$id) { $id = "user"; } $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = 39; $keywords = $this->get("keywords"); $page_url = $this->url("open", "user2", "id=" . $id); $condition = "1=1"; if ($keywords) { $this->assign("keywords", $keywords); $condition .= " AND u.user LIKE '%" . $keywords . "%'"; $page_url .= "&keywords=" . rawurlencode($keywords); } $offset = ($pageid - 1) * $psize; $rslist = $this->model('user')->get_list($condition, $offset, $psize); $count = $this->model('user')->get_count($condition); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=2'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("total", $count); $this->assign("rslist", $rslist); $this->assign("id", $id); $this->assign("pagelist", $pagelist); $this->view("open_user_list2"); }
public function url_f() { $id = $this->get("id"); if (!$id) { $id = "content"; } $this->assign("id", $id); $pid = $this->get("pid"); if ($pid) { $p_rs = $this->model('project')->get_one($pid); $type = $this->get("type"); if (!$p_rs) { error_open(P_Lang('项目不存在')); } if ($type == "cate" && $p_rs["cate"]) { $catelist = $this->model('cate')->get_all($p_rs["site_id"], 1, $p_rs["cate"]); $this->assign("rslist", $catelist); $this->assign("p_rs", $p_rs); $this->view("open_url_cate"); } else { $pageid = $this->get($this->config["pageid"], "int"); $psize = $this->config["psize"]; if (!$psize) { $psize = 20; } if (!$pageid) { $pageid = 1; } $offset = ($pageid - 1) * $psize; $pageurl = $this->url("open", "url", "pid=" . $pid . "&type=list&id=" . $id); $condition = "l.site_id='" . $p_rs["site_id"] . "' AND l.project_id='" . $pid . "' AND l.parent_id='0' "; $keywords = $this->get("keywords"); if ($keywords) { $condition .= " AND l.title LIKE '%" . $keywords . "%' "; $pageurl .= "&keywords=" . rawurlencode($keywords); $this->assign("keywords", $keywords); } $rslist = $this->model('list')->get_list($p_rs["module"], $condition, $offset, $psize, $p_rs["orderby"]); if ($rslist) { $sub_idlist = array_keys($rslist); $sub_idstring = implode(",", $sub_idlist); $con_sub = "l.site_id='" . $p_rs["site_id"] . "' AND l.project_id='" . $pid . "' AND l.parent_id IN(" . $sub_idstring . ") "; $sublist = $this->model('list')->get_list($p_rs["module"], $con_sub, 0, 0, $p_rs["orderby"]); if ($sublist) { foreach ($sublist as $key => $value) { $rslist[$value["parent_id"]]["sonlist"][$value["id"]] = $value; } } } //读子主题 $total = $this->model('list')->get_total($p_rs["module"], $condition); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=3'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); $this->assign("p_rs", $p_rs); $this->assign("rslist", $rslist); $this->view("open_url_list"); } } else { $condition = " p.status='1' "; $rslist = $this->model('project')->get_all_project($_SESSION["admin_site_id"], $condition); $this->assign("rslist", $rslist); } $this->assign("id", $id); $this->view("open_url"); }
private function content_list($project_rs) { if (!$project_rs) { error(P_Lang('项目信息不能为空'), '', 'error'); } $pid = $project_rs["id"]; $mid = $project_rs["module"]; $site_id = $project_rs["site_id"]; $orderby = $project_rs["orderby"]; if (!$pid || !$mid || !$site_id) { error(P_Lang('数据异常'), '', 'error'); } //内容布局维护 $layout = $m_list = array(); $m_rs = $this->model('module')->get_one($mid); $m_list = $this->model('module')->fields_all($mid, "identifier"); if ($m_rs["layout"]) { $layout = explode(",", $m_rs["layout"]); } $this->assign("m_rs", $m_rs); //布局 $layout_list = array(); foreach ($layout as $key => $value) { if ($value == "hits") { $layout_list[$value] = P_Lang('查看次数'); } elseif ($value == "dateline") { $layout_list[$value] = P_Lang('发布时间'); } elseif ($value == 'user_id') { $layout_list['user_id'] = P_Lang('会员账号'); } else { $layout_list[$value] = $m_list[$value]["title"]; } } $this->assign("ext_list", $m_list); $this->assign("layout", $layout_list); unset($layout_list); $psize = $this->config["psize"] ? $this->config["psize"] : "30"; if (!$this->config["pageid"]) { $this->config["pageid"] = "pageid"; } $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $offset = ($pageid - 1) * $psize; $condition = "l.site_id='" . $site_id . "' AND l.project_id='" . $pid . "' AND l.parent_id='0' "; $pageurl = $this->url("list", "action", "id=" . $pid); $cateid = $this->get("cateid", "int"); if ($cateid) { $cate_rs = $this->model('cate')->get_one($cateid); $catelist = array($cate_rs); $this->model('cate')->get_sublist($catelist, $cateid); $cate_id_list = array(); foreach ($catelist as $key => $value) { $cate_id_list[] = $value["id"]; } $cate_idstring = implode(",", $cate_id_list); if ($project_rs['cate_multiple']) { $condition .= " AND c.cate_id IN(" . $cate_idstring . ")"; } else { $condition .= " AND l.cate_id IN(" . $cate_idstring . ")"; } $pageurl .= "&cateid=" . $cateid; $this->assign("cateid", $cateid); } else { if (!$_SESSION['admin_rs']['if_system'] && $project_rs['cate']) { $cate_rs = $this->model('cate')->get_one($project_rs['cate']); $catelist = array($cate_rs); $this->model('cate')->get_sublist($catelist, $project_rs['cate']); $cate_id_list = array(); foreach ($catelist as $key => $value) { $cate_id_list[] = $value["id"]; } $cate_idstring = implode(",", $cate_id_list); if ($project_rs['cate_multiple']) { $condition .= " AND c.cate_id IN(" . $cate_idstring . ")"; } else { $condition .= " AND l.cate_id IN(" . $cate_idstring . ")"; } } } $keywords = $this->get("keywords"); if ($keywords) { $keywords = trim($keywords); } if ($keywords) { $condition .= " AND (l.title LIKE '%" . $keywords . "%' OR l.tag LIKE '%" . $keywords . "%' OR l.seo_keywords LIKE '%" . $keywords . "%' OR l.seo_desc LIKE '%" . $keywords . "%' OR l.seo_title LIKE '%" . $keywords . "%'"; //搜索扩展字段 if ($m_list) { foreach ($m_list as $key => $value) { if ($value['field_type'] != 'longtext' && $value['field_type'] != 'longblob') { $condition .= " OR ext." . $key . " LIKE '%" . $keywords . "%' "; } } } $condition .= ") "; $pageurl .= "&keywords=" . rawurlencode($keywords); $this->assign("keywords", $keywords); } $attr = $this->get("attr"); if ($attr) { if (is_array($attr) && count($attr) > 0) { $attr_list = array(); foreach ($attr as $key => $value) { $attr_list[] = "l.attr LIKE '%" . $attr . "%'"; $pageurl .= "&attr[]=" . $value; } $attr_string = implode(" OR ", $attr_list); $condition .= " AND (" . $attr_string . ") "; $this->assign("attr", $attr); } else { $condition .= " AND l.attr LIKE '%" . $attr . "%'"; $pageurl .= "&attr=" . $attr; $this->assign("attr", array($attr)); } } $status = $this->get('status'); if ($status) { if ($status == 1) { $condition .= ' AND l.status=1 '; } else { $condition .= ' AND l.status=0 '; } $pageurl .= "&status=" . $status; $this->assign('status', $status); } //取得列表信息 $total = $this->model('list')->get_total($mid, $condition); if ($total > 0) { $rslist = $this->model('list')->get_list($mid, $condition, $offset, $psize, $orderby); $sub_idlist = $rslist ? array_keys($rslist) : array(); $extcate_ids = $sub_idlist; $sub_idstring = implode(",", $sub_idlist); $condition = "l.site_id='" . $site_id . "' AND l.project_id='" . $pid . "' AND l.parent_id IN(" . $sub_idstring . ") "; $sublist = $this->model('list')->get_list($mid, $condition, 0, 0, $orderby); if ($sublist) { foreach ($sublist as $key => $value) { $rslist[$value["parent_id"]]["sonlist"][$value["id"]] = $value; $extcate_ids[] = $value['id']; } } $extcate_ids = array_unique($extcate_ids); if ($project_rs['cate'] && $project_rs['cate_multiple']) { $clist = $this->model('list')->catelist($extcate_ids); $this->assign('clist', $clist); } unset($sublist, $sub_idstring, $sub_idlist); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); $this->assign("rslist", $rslist); } $attrlist = $this->model('list')->attr_list(); $this->assign("attrlist", $attrlist); return true; }
public function info_f() { $pageurl = $this->url("uedit", "info"); $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = 28; $offset = ($pageid - 1) * $psize; //读取所有项目 $projectlist = $this->model('project')->get_all_project($_SESSION['admin_site_id']); $this->assign("projectlist", $projectlist); //读取全部列表 $condition = "l.site_id=" . $_SESSION['admin_site_id']; $project_id = $this->get('project_id', 'int'); if ($project_id) { $p_rs = $this->model('project')->get_one($project_id); if ($p_rs) { $condition .= " AND l.project_id=" . $project_id; $pageurl .= "&project_id=" . $project_id; $cate_id = $this->get('cate_id', 'int'); if ($cate_id && $p_rs['cate']) { $cate_rs = $this->model('cate')->get_one($cate_id); $catelist = array($cate_rs); $this->model('cate')->get_sublist($catelist, $cate_id); $cate_id_list = array(); foreach ($catelist as $key => $value) { $cate_id_list[] = $value["id"]; } $cate_idstring = implode(",", $cate_id_list); $condition .= " AND l.cate_id IN(" . $cate_idstring . ")"; $pageurl .= "&cate_id=" . $cate_id; $this->assign("cate_id", $cate_id); } $this->assign("project_id", $project_id); } } $keywords = $this->get("keywords"); if ($keywords) { $condition .= " AND (l.title LIKE '%" . $keywords . "%' OR l.tag LIKE '%" . $keywords . "%' OR l.seo_keywords LIKE '%" . $keywords . "%' OR l.seo_desc LIKE '%" . $keywords . "%' OR l.seo_title LIKE '%" . $keywords . "%') "; $pageurl .= "&keywords=" . rawurlencode($keywords); $this->assign("keywords", $keywords); } $total = $this->model('list')->get_all_total($condition); if ($total > 0) { $rslist = $this->model('list')->get_all($condition, $offset, $psize); $this->assign("rslist", $rslist); $this->assign("total", $total); if ($total > $psize) { $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=3'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); } } $this->view("edit_title"); }
function list_f() { $goback = $_SESSION["last_page_url"] ? $_SESSION["last_page_url"] : ($_SERVER["HTTP_REFERER"] ? $_SERVER["HTTP_REFERER"] : $this->url("reply")); if (!$this->popedom["list"]) { error(P_Lang('您没有权限执行此操作'), '', 'error'); } $tid = $this->get("tid", "int"); if (!$tid) { error(P_Lang('未指定ID'), $goback, "error"); } $rs = $this->model('list')->get_one($tid); $this->assign("rs", $rs); $pageurl = $this->url("reply", "list", "tid=" . $tid); $status = $this->get('status', "int"); $condition = "tid='" . $tid . "' AND parent_id=0"; if ($status) { $n_status = $status == 1 ? "1" : "0"; $condition .= " AND status='" . $n_status . "'"; $pageurl .= "&status=" . $status; $this->assign("status", $status); } $keywords = $this->get("keywords"); if ($keywords) { $condition .= " AND (content LIKE '%" . $keywords . "%' OR adm_content LIKE '%" . $keywords . "%') "; $pageurl .= "&keywords=" . rawurlencode($keywords); $this->assign("keywords", $keywords); } $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = $this->config["psize"] ? $this->config["psize"] : 30; $total = $this->model('reply')->get_total($condition); if ($total > 0) { $offset = ($pageid - 1) * $psize; $rslist = $this->model('reply')->get_list($condition, $offset, $psize, "id"); if ($rslist) { $uidlist = array(); foreach ($rslist as $key => $value) { if ($value["uid"]) { $uidlist[] = $value["uid"]; } } $idlist = array_keys($rslist); $condition = "tid='" . $tid . "' AND parent_id IN(" . implode(",", $idlist) . ")"; $sublist = $this->model('reply')->get_list($condition, 0, 0); if ($sublist) { foreach ($sublist as $key => $value) { if ($value["uid"]) { $uidlist[] = $value["uid"]; } $rslist[$value["parent_id"]]["sublist"][$value["id"]] = $value; } } if ($uidlist && count($uidlist) > 0) { $uidlist = array_unique($uidlist); $ulist = $this->model('user')->get_all_from_uid(implode(",", $uidlist), 'id'); if (!$ulist) { $ulist = array(); } foreach ($rslist as $key => $value) { if ($value["uid"]) { $value["uid"] = $ulist[$value["uid"]]; } if ($value["sublist"]) { foreach ($value["sublist"] as $k => $v) { if ($v) { $v["uid"] = $ulist[$v["uid"]]; } $value["sublist"][$k] = $v; } } $rslist[$key] = $value; } } } $this->assign("rslist", $rslist); if ($total > $psize) { $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); } } $this->assign("total", $total); $this->view("reply_list"); }
function pl_f() { if (!$this->popedom["pl"]) { error(P_Lang('您没有权限执行此操作'), '', 'error'); } $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = 240; $pageurl = $this->url("res", "pl"); $offset = ($pageid - 1) * $psize; # 附件分类 $catelist = $this->model('res')->cate_all(); $this->assign("catelist", $catelist); $condition = "1=1"; $tmp_c = $this->condition($condition, $pageurl); $condition = $tmp_c["condition"]; $pageurl = $tmp_c["pageurl"]; $rslist = $this->model('res')->get_list($condition, $offset, $psize); $this->assign("rslist", $rslist); $total = $this->model('res')->get_count($condition); $this->assign("total", $total); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=5'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); # 存储当前的URL信息 $myurl = $pageurl . "&" . $this->config["pageid"] . "=" . $pageid; $_SESSION["admin_return_url"] = $myurl; $this->view("res_list"); }
function title_f() { $psize = $this->config["psize"]; if (!$psize) { $psize = 30; } $pageid = $this->config["pageid"] ? $this->config["pageid"] : "pageid"; $pageid = $this->get($pageid, "int"); if (!$pageid || $pageid < 1) { $pageid = 1; } $offset = ($pageid - 1) * $psize; $input = $this->get("identifier"); if (!$input) { error_open("未指定表单ID", "error"); } $multi = $this->get("multi", "int"); $pageurl = $this->url("inp", "title") . "&identifier=" . rawurlencode($input); if ($multi) { $pageurl .= "&multi=1"; } $project_id = $this->get("project_id"); if (!$project_id) { error_open("未指定项目ID", "error"); } $tmp = explode(",", $project_id); $lst = array(); foreach ($tmp as $key => $value) { $value = intval($value); if ($value) { $lst[] = $value; } } $lst = array_unique($lst); $project_id = implode(",", $lst); if (!$project_id) { error_open("指定项目异常", "error"); } $pageurl .= "&project_id=" . rawurlencode($project_id); $condition = "l.project_id IN(" . $project_id . ") AND l.status='1'"; $total = $this->model('list')->get_all_total($condition); if ($total < 1) { error("没有内容信息"); } $rslist = $this->model('list')->get_all($condition, $offset, $psize); $this->assign("total", $total); $this->assign("rslist", $rslist); $pagelist = phpok_page($pageurl, $total, $pageid, $psize, "home=首页&prev=上一页&next=下一页&last=尾页&half=5&add=(total)/(psize)&always=1"); $this->assign("pagelist", $pagelist); $this->assign("multi", $multi); $this->assign("input", $input); $this->tpl->path_change(""); $this->view($this->dir_phpok . "view/inp_title.html", "abs-file"); }
function thumb_f() { $id = $this->get('id'); if (!$id) { $id = 'add'; } $formurl = $pageurl = $this->url("order", "thumb", "id=" . $id); $pageid = $this->get($this->config["pageid"], "int"); if (!$pageid) { $pageid = 1; } $psize = 32; $offset = ($pageid - 1) * $psize; $condition = "ext IN ('gif','jpg','png','jpeg') "; $cate_id = $this->get("cate_id", "int"); if ($cate_id) { $condition .= " AND cate_id='" . $cate_id . "' "; $pageurl .= "&cate_id=" . $cate_id; $this->assign("cate_id", $cate_id); } $keywords = $this->get("keywords"); if ($keywords) { $condition .= " AND (title LIKE '%" . $keywords . "%' OR name LIKE '%" . $keywords . "%' OR id LIKE '%" . $keywords . "%') "; $pageurl .= "&keywords=" . rawurlencode($keywords); $this->assign("keywords", $keywords); } $total = $this->model('res')->get_count($condition); if ($total > 0) { $rslist = $this->model('res')->get_list($condition, $offset, $psize, false); $this->assign("rslist", $rslist); $this->assign("pageurl", $pageurl); $string = 'home=' . P_Lang('首页') . '&prev=' . P_Lang('上一页') . '&next=' . P_Lang('下一页') . '&last=' . P_Lang('尾页') . '&half=4'; $string .= '&add=' . P_Lang('数量:') . '(total)/(psize)' . P_Lang(',') . P_Lang('页码:') . '(num)/(total_page)&always=1'; $pagelist = phpok_page($pageurl, $total, $pageid, $psize, $string); $this->assign("pagelist", $pagelist); } $this->assign("formurl", $formurl); $this->assign("id", $id); //读取附件分类 $catelist = $this->model('res')->cate_all(); $this->assign("catelist", $catelist); $config = $this->model('res')->type_list(); $file_type = "*.*"; $file_type_desc = P_Lang('文件'); if ($type && $config['picture']) { $file_type = $config[$type]["type"]; $file_type_desc = $config[$type]["name"]; } $this->assign("file_type", $file_type); $this->assign("file_type_desc", $file_type_desc); $this->view("order_picture"); }