diff --git a/d/js/js/search_news1.js b/d/js/js/search_news1.js
index 76e2b4f..217f5bb 100644
--- a/d/js/js/search_news1.js
+++ b/d/js/js/search_news1.js
@@ -1 +1 @@
-function search_check(obj){if(obj.keyboard.value.length==0){alert('请输入搜索关键字');return false;}return true;}document.write("
");
\ No newline at end of file
+function search_check(obj){if(obj.keyboard.value.length==0){alert('请输入搜索关键字');return false;}return true;}document.write("");
\ No newline at end of file
diff --git a/d/js/js/search_news2.js b/d/js/js/search_news2.js
index 28859c4..59f4492 100644
--- a/d/js/js/search_news2.js
+++ b/d/js/js/search_news2.js
@@ -1 +1 @@
-function search_check(obj){if(obj.keyboard.value.length==0){alert('请输入搜索关键字');return false;}return true;}document.write("");
\ No newline at end of file
+function search_check(obj){if(obj.keyboard.value.length==0){alert('请输入搜索关键字');return false;}return true;}document.write("");
\ No newline at end of file
diff --git a/e/action/ListInfo.php b/e/action/ListInfo.php
index 8fcf765..aacccac 100644
--- a/e/action/ListInfo.php
+++ b/e/action/ListInfo.php
@@ -5,6 +5,7 @@ require('../class/functions.php');
require('../class/t_functions.php');
require('../data/dbcache/class.php');
require LoadLang('pub/fun.php');
+
$link=db_connect();
$empire=new mysqlquery();
eCheckCloseMods('fieldand');//关闭模块
@@ -62,9 +63,28 @@ if($classid)
{
$add.=' and '.ReturnClass($class_r[$trueclassid][sonclass]);
}
- $cr=$empire->fetch1("select classpagekey,intro,classimg,cgroupid from {$dbtbpre}enewsclass where classid='$trueclassid'");
+ $cr=$empire->fetch1("select classpagekey,intro,classimg,cgroupid,companygroupid from {$dbtbpre}enewsclass where classid='$trueclassid'");
+ $isCompany = 0;
+ if($cr['companygroupid'])
+ {
+ $userId= (int)$_COOKIE['lsfmomluserid'];
+ $usergroupid = 0;
+ if($userId){
+ $ccompany=$empire->fetch1("SELECT id FROM www_moban5_cn_ecms_companys WHERE title IN (SELECT company FROM www_moban5_cn_enewsmemberadd WHERE userid='{$userId}')");
+ if($ccompany){
+ $usergroupid = $ccompany['id'];
+ }
+ }
+
+ if(!in_array($usergroupid,explode(",",$cr[companygroupid])))
+ {
+ printerror('NotLevelToClass2','history.go(-1)',1);
+ }else{
+ $isCompany = 1;
+ }
+ }
//权限
- if($cr['cgroupid'])
+ if($cr['cgroupid'] && !$isCompany)
{
$mgroupid=(int)getcvar('mlgroupid');
if(!strstr($cr[cgroupid],','.$mgroupid.','))
@@ -72,6 +92,8 @@ if($classid)
printerror('NotLevelToClass','history.go(-1)',1);
}
}
+
+
$pagetitle=$class_r[$trueclassid]['classname'];
$pagekey=$cr['classpagekey'];
$pagedes=$cr['intro'];
@@ -230,6 +252,7 @@ if(empty($tempid))
printerror('ErrorUrl','',1);
}
$tempr=$empire->fetch1("select tempid,temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from ".GetTemptb("enewslisttemp")." where tempid='$tempid'");
+
if(empty($tempr[tempid]))
{
printerror('ErrorUrl','',1);
diff --git a/e/admin-moban5/AddClass.php b/e/admin-moban5/AddClass.php
index cf97c38..4af406f 100644
--- a/e/admin-moban5/AddClass.php
+++ b/e/admin-moban5/AddClass.php
@@ -93,6 +93,7 @@ if($enews=="EditClass"||$copyclass)
$read="";
$r=$empire->fetch1("select * from {$dbtbpre}enewsclass where classid='$classid'");
$addr=$empire->fetch1("select * from {$dbtbpre}enewsclassadd where classid='$classid'");
+
if(!empty($r[bclassid]))
{$defaultbclassid="";}
$url="管理栏目 > ".$thisdo."栏目:".$r[classname];
@@ -301,6 +302,26 @@ while($l_r=$empire->fetch($sql1))
}
$cgroup.=" ".$l_r[groupname]." ".$qgbr;
}
+//获取公司信息
+$sql_cs=$empire->query("select id,title from www_moban5_cn_ecms_companys order by id desc");
+$companys = [[
+ "value"=>"",
+ "text"=> "---请选择---"
+ ]];
+while($sql_c=$empire->fetch($sql_cs))
+{
+ $select="";
+ if(strstr($r[companygroupid],','.$sql_c[id].','))
+ {
+ $select=" selected ";
+ }
+ $companys[] = [
+ "value"=>$sql_c[id],
+ "text"=> $sql_c[title]
+ ];
+ $companySelect.="".$sql_c[title]." ";
+}
+
//js模板
$jstempsql=$empire->query("select tempid,tempname from ".GetTemptb("enewsjstemp")." order by tempid");
while($jstempr=$empire->fetch($jstempsql))
@@ -505,9 +526,146 @@ myfrm.pripath.value=bclass[SelectedBigId][0];
}
}
+(function() {
+ selectMultip = {
+ register: function(id) {
+ //大致思路是:为下拉选创建一个隐藏的子选项,每次单选之后将单选的值追加到隐藏的子选项中,并将子选项选中显示即可
+ //全局查找所有标记multip的select
+ document.querySelectorAll("[multip]").forEach(function(e) {
+ render(e);
+ })
+ },
+ reload: function(id, data, setData) {
+ var htm = "";
+ for(var i = 0; i < data.length; i++) {
+ htm += '' + data[i].text + ' '
+ }
+ var e = document.getElementById(id);
+ e.innerHTML = htm;
+ render(e);
+ this.setVal(id, setData);
+ },
+ setVal: function(id, str) {
+ var type = Object.prototype.toString.call(str);
+ switch(type) {
+ case "[object String]":
+ document.getElementById(id).val = str;
+ break;
+ case "[object Array]":
+ document.getElementById(id).val = str.toString();
+ break;
+ default:
+ break;
+ }
+ },
+ getVal: function(id) {
+ return document.getElementById(id).val;
+ },
+
+ }
+
+ function render(e) {
+ e.param = {
+ arr: [],
+ valarr: [],
+ opts: []
+ };
+ var choosevalue = "",
+ op;
+
+ for(var i = 0; i < e.length; i++) {
+ op = e.item(i);
+ e.param.opts.push(op);
+ if(op.hasAttribute("choose")) {
+ if(choosevalue == "") {
+ choosevalue = op.value
+ } else {
+ choosevalue += "," + op.value;
+ }
+
+ }
+ }
+
+ //创建一个隐藏的option标签用来存储多选的值,其中的值为一个数组
+ var option = document.createElement("option");
+ option.hidden = true;
+ e.appendChild(option);
+ e.removeEventListener("input", selchange);
+ e.addEventListener("input", selchange);
+
+ //重新定义标签基础属性的get和set方法,实现取值和赋值的功能
+ Object.defineProperty(e, "val", {
+ get: function() {
+ return this.querySelector("[hidden]").value;
+ },
+ set: function(value) {
+ e.param.valarr = [];
+ var valrealarr = value == "" ? [] : value.split(",");
+ e.param.arr = [];
+ e.param.opts.filter(function(o) {
+ o.style = "";
+ });
+ if(valrealarr.toString()) {
+ for(var i = 0; i < valrealarr.length; i++) {
+ e.param.opts.filter(function(o) {
+ if(o.value == valrealarr[i]) {
+ o.style = "color: blue;";
+ e.param.arr.push(o.text);
+ e.param.valarr.push(o.value)
+ }
+ });
+ }
+ this.options[e.length - 1].text = e.param.arr.toString();
+ this.options[e.length - 1].value = e.param.valarr.toString();
+ this.options[e.length - 1].selected = true;
+ } else {
+ this.options[0].selected = true;
+ }
+
+ },
+ configurable: true
+ })
+ //添加属性choose 此属性添加到option中用来指定默认值
+ e.val = choosevalue;
+ //添加属性tip 此属性添加到select标签上
+ if(e.hasAttribute("tip") && !e.tiped) {
+ e.tiped = true;
+ e.insertAdjacentHTML('afterend', '*可多选 ');
+ }
+ }
+
+ function selchange() {
+ var text = this.options[this.selectedIndex].text;
+ var value = this.options[this.selectedIndex].value;
+ this.options[this.selectedIndex].style = "color: blue;";
+ var ind = this.param.arr.indexOf(text);
+ if(ind > -1) {
+ this.param.arr.splice(ind, 1);
+ this.param.valarr.splice(ind, 1);
+ this.param.opts.filter(function(o) {
+ if(o.value == value) {
+ o.style = "";
+ }
+ });
+ } else {
+ this.param.arr.push(text);
+ this.param.valarr.push(value);
+ }
+ this.options[this.length - 1].text = this.param.arr.toString();
+ this.options[this.length - 1].value = this.param.valarr.toString();
+ if(this.param.arr.length > 0) {
+ this.options[this.length - 1].selected = true;
+ } else {
+ this.options[0].selected = true;
+ }
+ }
+})();
+
//检查
function CheckForm(obj)
{
+ var companygroupid = selectMultip.getVal("companygroupid")
+ console.log("1111",companygroupid);
if(obj.classname.value=="")
{
alert("请输入栏目名称");
@@ -604,6 +762,8 @@ function EditSmallBdInfo(obj){
window.open('AddNews.php?=$ecms_hashur['ehref']?>&enews=EditNews&classid='+r[0]+'&id='+r[1]);
}
+
+
@@ -806,11 +966,24 @@ tb1 = new WebFXTabPane( document.getElementById( "TabPane1" ) );
=$cgroup?>
+
+
+ 授权机构
+
+
+ =$companySelect?>
+
+
+
+
>
访问权限应用于信息(选择后信息的查看权限可以不设置)
+
+
+
开启前台投稿
>
@@ -834,6 +1007,7 @@ tb1 = new WebFXTabPane( document.getElementById( "TabPane1" ) );
=$qgroup?>
+
投稿生成列表
@@ -1358,6 +1532,15 @@ tb1 = new WebFXTabPane( document.getElementById( "TabPane1" ) );
+