Commit d935dd52 authored by 杨培's avatar 杨培

Merge remote-tracking branch 'origin/test' into test

parents 7797d073 33ecb5cb
...@@ -16,6 +16,15 @@ ...@@ -16,6 +16,15 @@
<!-- Css --> <!-- Css -->
<link rel="stylesheet" href="css/basic.css"> <link rel="stylesheet" href="css/basic.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?59926961b935e067a1cb86d52ce44500";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<body> <body>
<div class="warp"> <div class="warp">
<div class="pic-hand"> <div class="pic-hand">
...@@ -45,20 +54,12 @@ ...@@ -45,20 +54,12 @@
<div class="phone-box"> <div class="phone-box">
<a href="javascript:;"> <a href="javascript:location.reload();">
<img src="img/download_phone_img.jpg"> <img src="img/download_phone_img.jpg">
</a> </a>
</div> </div>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?59926961b935e067a1cb86d52ce44500";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="application/javascript" src="js/mobile-detect.min.js"></script> <script type="application/javascript" src="js/mobile-detect.min.js"></script>
<script type="application/javascript" src="js/index.js"></script> <script type="application/javascript" src="js/index.js"></script>
</body> </body>
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<include name="skin/**" /> <include name="skin/**" />
<include name="environments/**" /> <include name="environments/**" />
<include name="vendor/**" /> <include name="vendor/**" />
<include name="appdownload/**" />
</patternset> </patternset>
</fileset> </fileset>
<filelist dir="." files="init,build.xml,build.properties,build_win.properties"/> <filelist dir="." files="init,build.xml,build.properties,build_win.properties"/>
......
...@@ -9,6 +9,11 @@ require("../class/copypath.php"); ...@@ -9,6 +9,11 @@ require("../class/copypath.php");
require("../class/t_functions.php"); require("../class/t_functions.php");
require("../data/dbcache/class.php"); require("../data/dbcache/class.php");
require("../data/dbcache/MemberLevel.php"); require("../data/dbcache/MemberLevel.php");
require '../config/config_ibanshou.php';
require '../extend/internalApi/autoload.php';
\internalApi\base\Client::config($config['wxh.internal']['client']);
$link=db_connect(); $link=db_connect();
$empire=new mysqlquery(); $empire=new mysqlquery();
$enews=$_POST['enews']; $enews=$_POST['enews'];
......
...@@ -37,7 +37,7 @@ class mysqlquery ...@@ -37,7 +37,7 @@ class mysqlquery
return $this->sql; return $this->sql;
} }
//执行mysqli_fetch_array() //执行mysqli_fetch_array()
function fetch($sql)//此方法的参数是$sql就是sql语句执行结果 function fetch($sql)//此方法的参数是$sql就是sql语句执行结果
{ {
$this->r=mysqli_fetch_array($sql); $this->r=mysqli_fetch_array($sql);
return $this->r; return $this->r;
......
...@@ -239,7 +239,7 @@ function AddNews($add,$userid,$username){ ...@@ -239,7 +239,7 @@ function AddNews($add,$userid,$username){
//主表 //主表
$infosql=$empire->query("insert into ".$infotbr['tbname']."(id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,ispic,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard".$ret_r['fields'].") values('$id','$add[classid]','$add[ttid]','$add[onclick]',0,'$add[totaldown]','$newspath','$filename','$userid','".addslashes($username)."','$add[firsttitle]','$add[isgood]','$add[ispic]','$add[istop]','$isqf',0,'$add[isurl]','$truetime','$lastdotime','$havehtml','$add[groupid]','$add[userfen]','".addslashes($add[my_titlefont])."','".addslashes($add[titleurl])."','$ret_r[tb]','$public_r[filedeftb]','$public_r[pldeftb]','".addslashes($add[keyboard])."'".$ret_r['values'].");"); $infosql=$empire->query("insert into ".$infotbr['tbname']."(id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,ispic,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard".$ret_r['fields'].") values('$id','$add[classid]','$add[ttid]','$add[onclick]',0,'$add[totaldown]','$newspath','$filename','$userid','".addslashes($username)."','$add[firsttitle]','$add[isgood]','$add[ispic]','$add[istop]','$isqf',0,'$add[isurl]','$truetime','$lastdotime','$havehtml','$add[groupid]','$add[userfen]','".addslashes($add[my_titlefont])."','".addslashes($add[titleurl])."','$ret_r[tb]','$public_r[filedeftb]','$public_r[pldeftb]','".addslashes($add[keyboard])."'".$ret_r['values'].");");
//副表 //副表
$finfosql=$empire->query("insert into ".$infotbr['datatbname']."(id,classid,keyid,dokey,newstempid,closepl,haveaddfen,infotags".$ret_r['datafields'].") values('$id','$add[classid]','$keyid','$add[dokey]','$add[newstempid]','$add[closepl]',0,'".addslashes($add[infotags])."'".$ret_r['datavalues'].");"); $finfosql=$empire->query("insert into ".$infotbr['datatbname']."(id,classid,keyid,dokey,newstempid,closepl,haveaddfen,infotags".$ret_r['datafields'].") values('$id','$add[classid]','$keyid','$add[dokey]','$add[newstempid]','$add[closepl]',0,'".addslashes($add[infotags])."'".$ret_r['datavalues'].");");
//更新栏目信息数 //更新栏目信息数
AddClassInfos($add['classid'],'+1','+1',$add['checked']); AddClassInfos($add['classid'],'+1','+1',$add['checked']);
//更新新信息数 //更新新信息数
...@@ -336,7 +336,40 @@ function AddNews($add,$userid,$username){ ...@@ -336,7 +336,40 @@ function AddNews($add,$userid,$username){
} }
$GLOBALS['ecmsadderrorurl']=$ecmsfrom.$addecmscheck; $GLOBALS['ecmsadderrorurl']=$ecmsfrom.$addecmscheck;
insert_dolog("classid=$add[classid]<br>id=".$id."<br>title=".$add[title],$pubid);//操作日志 insert_dolog("classid=$add[classid]<br>id=".$id."<br>title=".$add[title],$pubid);//操作日志
printerror("AddNewsSuccess","AddNews.php?enews=AddNews&ecmsnfrom=$add[ecmsnfrom]&bclassid=$add[bclassid]&classid=$add[classid]".$addecmscheck.hReturnEcmsHashStrHref2(0));
//添加es数据
if(empty(!empty($add['checked']))){
global $dbtbpre,$ecms_config;
$tablenews = "{$dbtbpre}ecms_news";
$tableDatas = "{$dbtbpre}ecms_news_data_1";
$sql = "select $tableDatas.newstext,$tablenews.* from $tablenews left JOIN $tableDatas on $tablenews.id = $tableDatas.id where $tablenews.id = $id ";
$data = $empire->fetch1($sql);
$content = cutstr_html($data['newstext']);
$id = $data['id'];
$title = $data['title'];
$from = 's';
$createAt = $data['newstime'];
$url = $ecms_config['site_url'].$data['titleurl'];
//获取图片
$img = $data['titlepic'];
if (!$img) {
$newstext = stripslashes($data['newstext']);
preg_match('/src="([^"]+?)"/i', $newstext, $match);
$img = isset($match[1]) ? $match[1] : '';
}
if ($img && !preg_match('/^https?:/', $img)) {
$img = $ecms_config['site_url'] . $img;
}
$extra = [
'classid'=>$data['classid'],
];
\internalApi\ucenter\ElasContent::replace($id,$title,$content,$img,$url,$from,$createAt,$extra);
}
printerror("AddNewsSuccess","AddNews.php?enews=AddNews&ecmsnfrom=$add[ecmsnfrom]&bclassid=$add[bclassid]&classid=$add[classid]".$addecmscheck.hReturnEcmsHashStrHref2(0));
} }
else else
{ {
...@@ -344,6 +377,20 @@ function AddNews($add,$userid,$username){ ...@@ -344,6 +377,20 @@ function AddNews($add,$userid,$username){
} }
} }
function cutstr_html($string)
{
$string = strip_tags($string);
$string = trim($string);
$string = mb_ereg_replace("\t", "", $string);
$string = mb_ereg_replace("\r\n", "", $string);
$string = mb_ereg_replace("\r", "", $string);
$string = mb_ereg_replace("\n", "", $string);
$string = mb_ereg_replace(" ", "", $string);
return trim($string);
}
//修改信息 //修改信息
function EditNews($add,$userid,$username){ function EditNews($add,$userid,$username){
global $empire,$class_r,$class_zr,$bclassid,$public_r,$dbtbpre,$emod_r; global $empire,$class_r,$class_zr,$bclassid,$public_r,$dbtbpre,$emod_r;
...@@ -589,7 +636,47 @@ function EditNews($add,$userid,$username){ ...@@ -589,7 +636,47 @@ function EditNews($add,$userid,$username){
{ {
$ecmsfrom="ListNews.php?bclassid=$add[bclassid]&classid=$add[classid]".hReturnEcmsHashStrHref2(0); $ecmsfrom="ListNews.php?bclassid=$add[bclassid]&classid=$add[classid]".hReturnEcmsHashStrHref2(0);
} }
insert_dolog("classid=$add[classid]<br>id=".$add[id]."<br>title=".$add[title],$pubid);//操作日志
//添加elas
$from = 's';
$id = $index_checkr['id'];
if(empty($newchecked)){
//删除
\internalApi\ucenter\ElasContent::delete($id,$from);
}else{
//修改
global $dbtbpre,$ecms_config;
$tablenews = "{$dbtbpre}ecms_news";
$tableDatas = "{$dbtbpre}ecms_news_data_1";
$sql = "select $tableDatas.newstext,$tablenews.* from $tablenews left JOIN $tableDatas on $tablenews.id = $tableDatas.id where $tablenews.id = $id ";
$data = $empire->fetch1($sql);
$content = cutstr_html($data['newstext']);
$id = $data['id'];
$title = $data['title'];
$createAt = $data['newstime'];
$url = $ecms_config['site_url'].$data['titleurl'];
//获取图片
$img = $data['titlepic'];
if (!$img) {
$newstext = stripslashes($data['newstext']);
preg_match('/src="([^"]+?)"/i', $newstext, $match);
$img = isset($match[1]) ? $match[1] : '';
}
if ($img && !preg_match('/^https?:/', $img)) {
$img = $ecms_config['site_url'] . $img;
}
$extra = [
'classid'=>$data['classid'],
];
\internalApi\ucenter\ElasContent::replace($id,$title,$content,$img,$url,$from,$createAt,$extra);
}
insert_dolog("classid=$add[classid]<br>id=".$add[id]."<br>title=".$add[title],$pubid);//操作日志
printerror("EditNewsSuccess",$ecmsfrom.$addecmscheck); printerror("EditNewsSuccess",$ecmsfrom.$addecmscheck);
} }
else else
...@@ -756,6 +843,45 @@ function EditInfoSimple($add,$userid,$username){ ...@@ -756,6 +843,45 @@ function EditInfoSimple($add,$userid,$username){
$ecmsfrom="ListNews.php?bclassid=$add[bclassid]&classid=$add[classid]".hReturnEcmsHashStrHref2(0); $ecmsfrom="ListNews.php?bclassid=$add[bclassid]&classid=$add[classid]".hReturnEcmsHashStrHref2(0);
} }
$ecmsfrom=$ecmsfrom.$addecmscheck; $ecmsfrom=$ecmsfrom.$addecmscheck;
//添加elas
$from = 's';
$id = $index_checkr['id'];
if(empty($newchecked)){
//删除
\internalApi\ucenter\ElasContent::delete($id,$from);
}else{
//修改
global $dbtbpre,$ecms_config;
$tablenews = "{$dbtbpre}ecms_news";
$tableDatas = "{$dbtbpre}ecms_news_data_1";
$sql = "select $tableDatas.newstext,$tablenews.* from $tablenews left JOIN $tableDatas on $tablenews.id = $tableDatas.id where $tablenews.id = $id ";
$data = $empire->fetch1($sql);
$content = cutstr_html($data['newstext']);
$id = $data['id'];
$title = $data['title'];
$createAt = $data['newstime'];
$url = $ecms_config['site_url'].$data['titleurl'];
//获取图片
$img = $data['titlepic'];
if (!$img) {
$newstext = stripslashes($data['newstext']);
preg_match('/src="([^"]+?)"/i', $newstext, $match);
$img = isset($match[1]) ? $match[1] : '';
}
if ($img && !preg_match('/^https?:/', $img)) {
$img = $ecms_config['site_url'] . $img;
}
$extra = [
'classid'=>$data['classid'],
];
\internalApi\ucenter\ElasContent::replace($id,$title,$content,$img,$url,$from,$createAt,$extra);
}
insert_dolog("classid=$add[classid]<br>id=".$add[id]."<br>title=".$add[title],$pubid);//操作日志 insert_dolog("classid=$add[classid]<br>id=".$add[id]."<br>title=".$add[title],$pubid);//操作日志
printerror("EditNewsSuccess",$closeurl,8); printerror("EditNewsSuccess",$closeurl,8);
} }
...@@ -878,7 +1004,12 @@ function DelNews($id,$classid,$userid,$username){ ...@@ -878,7 +1004,12 @@ function DelNews($id,$classid,$userid,$username){
$returl="ListNews.php?bclassid=$adddatar[bclassid]&classid=$adddatar[classid]".$addecmscheck.hReturnEcmsHashStrHref2(0); $returl="ListNews.php?bclassid=$adddatar[bclassid]&classid=$adddatar[classid]".$addecmscheck.hReturnEcmsHashStrHref2(0);
} }
} }
insert_dolog("classid=$classid<br>id=".$id."<br>title=".$r[title],$pubid);//操作日志
//添加es
$from = 's';
\internalApi\ucenter\ElasContent::delete($id,$from);
insert_dolog("classid=$classid<br>id=".$id."<br>title=".$r[title],$pubid);//操作日志
printerror("DelNewsSuccess",$returl); printerror("DelNewsSuccess",$returl);
} }
else else
......
...@@ -132,7 +132,7 @@ $ecms_config['sets']['realplayertype']=',.rm,.ra,.rmvb,.mp4,.mov,.avi,.wav,.ram, ...@@ -132,7 +132,7 @@ $ecms_config['sets']['realplayertype']=',.rm,.ra,.rmvb,.mp4,.mov,.avi,.wav,.ram,
//------------e_public //------------e_public
$public_r=array('sitename'=>'扳手 - 征集slogan', $public_r=array('sitename'=>'扳手 - 征集slogan',
'newsurl'=>'/', 'newsurl'=>'/',
'filetype'=>'|.gif|.jpg|.swf|.rar|.zip|.mp3|.wmv|.txt|.doc|', 'filetype'=>'|.gif|.jpg|.swf|.rar|.zip|.mp3|.mp4|.wmv|.txt|.doc|',
'filesize'=>2048, 'filesize'=>2048,
'relistnum'=>8, 'relistnum'=>8,
'renewsnum'=>100, 'renewsnum'=>100,
...@@ -242,7 +242,7 @@ $public_r=array('sitename'=>'扳手 - 征集slogan', ...@@ -242,7 +242,7 @@ $public_r=array('sitename'=>'扳手 - 征集slogan',
'gbkey_ok'=>0, 'gbkey_ok'=>0,
'fbkey_ok'=>0, 'fbkey_ok'=>0,
'newaddinfotime'=>0, 'newaddinfotime'=>0,
'classnavs'=>'<a href=\"/news/\">新闻</a>&nbsp;|&nbsp;<a href=\"/pinlei/\">品类</a>&nbsp;|&nbsp;<a href=\"/pinpai/\">品牌</a>&nbsp;|&nbsp;<a href=\"/huandeng/\">首页幻灯</a>', 'classnavs'=>'<a href=\"/news/\">新闻</a>&nbsp;|&nbsp;<a href=\"/pinlei/\">品类</a>&nbsp;|&nbsp;<a href=\"/pinpai/\">品牌</a>&nbsp;|&nbsp;<a href=\"/huandeng/\">首页幻灯</a>&nbsp;|&nbsp;<a href=\"/ceshi/\">测试</a>',
'adminstyle'=>',1,2,', 'adminstyle'=>',1,2,',
'docnewsnum'=>300, 'docnewsnum'=>300,
'openschall'=>1, 'openschall'=>1,
...@@ -408,7 +408,7 @@ $emod_r[1]=Array('mid'=>1, ...@@ -408,7 +408,7 @@ $emod_r[1]=Array('mid'=>1,
'qeditdofunf'=>'||', 'qeditdofunf'=>'||',
'definfovoteid'=>0, 'definfovoteid'=>0,
'orderf'=>'', 'orderf'=>'',
'sonclass'=>'|2|3|10|28|11|12|13|14|15|16|29|', 'sonclass'=>'|2|3|10|28|11|12|13|14|15|16|29|32|',
'tid'=>1, 'tid'=>1,
'tbname'=>'news'); 'tbname'=>'news');
$emod_r[2]=Array('mid'=>2, $emod_r[2]=Array('mid'=>2,
......
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 11/10/2017
* Time: 5:03 PM
*/
namespace internalApi\ucenter;
use internalApi\base\Client;
class ElasContent extends Client
{
/**
* @param $id //数据id
* @param $title //标题
* @param $contentData //纯文本内容
* @param $pic //图片 没有预览图去文本第一章
* @param $url
* @param $from bbs xue s
* @param $createdAt //创建时间
* @param $extra //额外属性 array
* @return mixed
*/
public static function replace($id, $title, $contentData, $pic,$url,$from, $createdAt, $extra){
return self::call('elasContent.replace',compact('id','title','contentData','pic','url','from','createdAt','extra'));
}
/**
* delete
* @param $id
* @param $from bbs xue s
* @return mixed
*/
public static function delete($id,$from){
return self::call('elasContent.delete',compact('id','from'));
}
}
\ No newline at end of file
...@@ -58,12 +58,12 @@ if($mhavelogin==1) ...@@ -58,12 +58,12 @@ if($mhavelogin==1)
{ {
?> ?>
document.write("&raquo;&nbsp;<font color=red><b><?=$myusername?></b></font>&nbsp;&nbsp;<a href=\"/e/member/my/\" target=\"_parent\"><?=$groupname?></a>&nbsp;<?=$havemsg?>&nbsp;<a href=\"/e/space/?userid=<?=$myuserid?>\" target=_blank>我的空间</a>&nbsp;&nbsp;<a href=\"/e/member/msg/\" target=_blank>短信息</a>&nbsp;&nbsp;<a href=\"/e/member/fava/\" target=_blank>收藏夹</a>&nbsp;&nbsp;<a href=\"/e/member/cp/\" target=\"_parent\">控制面板</a>&nbsp;&nbsp;<a href=\"/e/member/doaction.php?enews=exit&ecmsfrom=9\" onclick=\"return confirm(\'确认要退出?\');\">退出</a>"); document.write("&raquo;&nbsp;<font color=red><b><?=$myusername?></b></font>&nbsp;&nbsp;<a href=\"/e/member/my/\" target=\"_parent\"><?=$groupname?></a>&nbsp;<?=$havemsg?>&nbsp;<a href=\"/e/space/?userid=<?=$myuserid?>\" target=_blank>我的空间</a>&nbsp;&nbsp;<a href=\"/e/member/msg/\" target=_blank>短信息</a>&nbsp;&nbsp;<a href=\"/e/member/fava/\" target=_blank>收藏夹</a>&nbsp;&nbsp;<a href=\"/e/member/cp/\" target=\"_parent\">控制面板</a>&nbsp;&nbsp;<a href=\"/e/member/doaction.php?enews=exit&ecmsfrom=9\" onclick=\"return confirm(\'确认要退出?\');\">退出</a>");
<?php <?
} }
else else
{ {
?> ?>
document.write("<form name=login method=post action=\"/e/member/doaction.php\"> <input type=hidden name=enews value=login> <input type=hidden name=ecmsfrom value=9> 用户名:<input name=\"username\" type=\"text\" class=\"inputText\" size=\"16\" />&nbsp; 密码:<input name=\"password\" type=\"password\" class=\"inputText\" size=\"16\" />&nbsp; <input type=\"submit\" name=\"Submit\" value=\"登陆\" class=\"inputSub\" />&nbsp; <input type=\"button\" name=\"Submit2\" value=\"注册\" class=\"inputSub\" onclick=\"window.open(\'/e/member/register/\');\" /></form>"); document.write("<form name=login method=post action=\"/e/member/doaction.php\"> <input type=hidden name=enews value=login> <input type=hidden name=ecmsfrom value=9> 用户名:<input name=\"username\" type=\"text\" class=\"inputText\" size=\"16\" />&nbsp; 密码:<input name=\"password\" type=\"password\" class=\"inputText\" size=\"16\" />&nbsp; <input type=\"submit\" name=\"Submit\" value=\"登陆\" class=\"inputSub\" />&nbsp; <input type=\"button\" name=\"Submit2\" value=\"注册\" class=\"inputSub\" onclick=\"window.open(\'/e/member/register/\');\" /></form>");
<?php <?
} }
?> ?>
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 14/10/2017
* Time: 4:52 PM
*/
require '../class/connect.php';
require '../class/db_sql.php';
require '../class/q_functions.php';
require '../extend/internalApi/autoload.php';
require '../config/config_ibanshou.php';
\internalApi\base\Client::config($config['wxh.internal']['client']);
$link = db_connect();
$empire = new mysqlquery();
$tablenews = "{$dbtbpre}ecms_news";
$tableDatas = "{$dbtbpre}ecms_news_data_1";
$offset = 0;
$limit = 100;
$start = 0;
$count = 0;
while($start == 0 or $count >= $limit ){
$sql = "select $tableDatas.newstext,$tablenews.* from $tablenews left JOIN $tableDatas on $tablenews.id = $tableDatas.id where $tablenews.id > $start limit $limit offset $offset ";
$query = $empire->query($sql);
$count = $empire->num1($query);
while($data = $empire->fetch($query)){
$content = cutstr_html($data['newstext']);
$id = $data['id'];
$title = $data['title'];
$from = 's';
$createAt = $data['newstime'];
$url = $ecms_config['site_url'].$data['titleurl'];
//获取图片
$img = $data['titlepic'];
if (!$img) {
$newstext = stripslashes($data['newstext']);
preg_match('/src="([^"]+?)"/i', $newstext, $match);
$img = isset($match[1]) ? $match[1] : '';
}
if ($img && !preg_match('/^https?:/', $img)) {
$img = $ecms_config['site_url'] . $img;
}
$extra = [
'classid'=>$data['classid'],
];
\internalApi\ucenter\ElasContent::replace($id,$title,$content,$img,$url,$from,$createAt,$extra);
echo "{$data['id']} {$data['title']}\n";
$start = $data['id'];
}
}
function cutstr_html($string)
{
$string = strip_tags($string);
$string = trim($string);
$string = mb_ereg_replace("\t", "", $string);
$string = mb_ereg_replace("\r\n", "", $string);
$string = mb_ereg_replace("\r", "", $string);
$string = mb_ereg_replace("\n", "", $string);
$string = mb_ereg_replace(" ", "", $string);
return trim($string);
}
...@@ -160,7 +160,7 @@ if($r[retext]) ...@@ -160,7 +160,7 @@ if($r[retext])
</table> </table>
<br /> <br />
<?php <?
} }
?> ?>
......
...@@ -307,6 +307,12 @@ ...@@ -307,6 +307,12 @@
.portal-news-info span.time { .portal-news-info span.time {
padding-left: 0; padding-left: 0;
} }
.portal-news-info span.time b {
font-weight: normal;
border: 1px solid #ccc;
padding: 2px 4px;
border-radius: 3px;
}
.pb-none { .pb-none {
padding-bottom: 0!important; padding-bottom: 0!important;
} }
...@@ -319,6 +325,26 @@ ...@@ -319,6 +325,26 @@
border-radius: 6px; border-radius: 6px;
} }
.portal-course .img-item {
position: relative;
}
.portal-course .img-item i {
position: absolute;
left: 50%;
top: 50%;
margin-left: -25px;
margin-top: -25px;
display: inline-block;
width: 50px;
height: 50px;
background-color: rgba(0,0,0,.5);
border-radius: 100%;
color: #fff;
line-height: 50px;
text-align: center;
font-size: 20px;
}
.hot-nav ul li a i { .hot-nav ul li a i {
display: inline-block; display: inline-block;
width: 40px; width: 40px;
...@@ -346,4 +372,65 @@ ...@@ -346,4 +372,65 @@
background-color: #ffa42f; background-color: #ffa42f;
} }
/*hot news*/
.related-news {
border-top: 1px solid #f3f3f3;
}
.px-line {
height: 10px;
border: 1px solid #f0f0f0;
background-color: #f3f3f3;
}
.related-news .rl-tit {
padding: 20px 15px 10px;
font-size: 16px;
font-weight: 500;
background-color: #fff;
}
.related-news .rl-tit span {
text-transform: uppercase;
padding-left: 5px;
color: #07c706;
font-size: 12px;
font-weight: normal;
}
.related-news .news-item {
border-bottom: none;
}
.related-news .news-item a.content .tit {
font-size: 16px;
}
.related-news .rl-info {
position: absolute;
line-height: 20px;
font-size: 12px;
color: #999;
left: 15px;
bottom: 10px;
}
.related-news .rl-info span {
padding-right: 10px;
}
.related-news .one-picture a.content {
padding: 10px 110px 10px 15px;
}
.related-news .one-picture a.content .img-item-box .img-item {
top: 10px;
}
.related-news .one-picture a.content .img-item-box .img-item img {
border-radius: 3px;
}
.comment-box .rl-tit {
padding: 20px 0 10px;
font-size: 16px;
font-weight: 500;
background-color: #fff;
}
.comment-box .rl-tit span {
text-transform: uppercase;
padding-left: 5px;
color: #07c706;
font-size: 12px;
font-weight: normal;
}
...@@ -410,8 +410,9 @@ ...@@ -410,8 +410,9 @@
/*CONTENT*/ /*CONTENT*/
.main-content { .main-content {
padding: 15px 15px 0; padding: 15px;
background-color: #fff; background-color: #fff;
border-bottom: 1px solid #e7e7e7;
} }
.main-content .tit h1 { .main-content .tit h1 {
font-family: PingFang SC,Lantinghei SC,Helvetica Neue,Helvetica,Arial,Microsoft YaHei,\\5FAE\8F6F\96C5\9ED1,STHeitiSC-Light,simsun,\\5B8B\4F53,WenQuanYi Zen Hei,WenQuanYi Micro Hei,"sans-serif"; font-family: PingFang SC,Lantinghei SC,Helvetica Neue,Helvetica,Arial,Microsoft YaHei,\\5FAE\8F6F\96C5\9ED1,STHeitiSC-Light,simsun,\\5B8B\4F53,WenQuanYi Zen Hei,WenQuanYi Micro Hei,"sans-serif";
...@@ -438,7 +439,6 @@ ...@@ -438,7 +439,6 @@
color: #3d464d; color: #3d464d;
font-size: 16px; font-size: 16px;
line-height: 30px; line-height: 30px;
text-align: justify;
padding-bottom: 26px; padding-bottom: 26px;
} }
...@@ -833,6 +833,10 @@ ...@@ -833,6 +833,10 @@
left: 0; left: 0;
top: 0; top: 0;
} }
.detail-top-nav a.close {
left: 50px;
top: 0;
}
.detail-top-nav a.menu { .detail-top-nav a.menu {
right: 0; right: 0;
top: 0; top: 0;
...@@ -844,6 +848,40 @@ ...@@ -844,6 +848,40 @@
padding: 10px 0 30px; padding: 10px 0 30px;
} }
/*video-detail*/
.portal-video-box {
position: fixed;
width: 100%;
top: 0;
z-index: 2;
}
.portal-video-box .nav {
position: relative;
}
.portal-video-box .nav a {
display: inline-block;
position: absolute;
top: 0;
height: 50px;
width: 50px;
text-align: center;
line-height: 50px;
color: #fff;
}
.portal-video-box .nav a.back {
left: 0;
}
.portal-video-box .nav a.menu {
right: 0;
}
.portal-video-box .main img {
width: 100%;
vertical-align: top;
}
.video-empty-block {
background-color: #fff;
}
/*适配电脑端*/ /*适配电脑端*/
@media screen and (min-width: 900px){ @media screen and (min-width: 900px){
html { html {
...@@ -868,4 +906,10 @@ ...@@ -868,4 +906,10 @@
left: 50%; left: 50%;
margin-left: -450px; margin-left: -450px;
} }
.portal-video-box {
width: 900px;
}
.portal-video-box .main img {
width: 900px;
}
} }
var newsid = $("input[name='newsid']").val();
//评论
$(".send-pl").click(function () {
var data = {
'newsid': newsid,
'content': $.trim($("textarea[name='content']").val())
};
var self = this;
if (!data['newsid']) {
pop('参数错误');
return false;
}
if (!data['content']) {
pop('评论内容不能为空');
return false;
}
$(self).attr("disabled", true);
$.post("/e/action/news/comment.php?mod=create", data, function (e) {
$(self).attr("disabled", false);
if (e.status) {
$("textarea[name='content']").val('');
var html = tpl(e.data);
$(".comment-list").prepend(html);
$(".comment-send-box").hide();
$('.mask').hide();
} else {
pop(e.msg, e.data);
}
}, 'json');
});
function comments() {
var lastplid = $(".comment-list li:last-child").attr('data-id');
lastplid = lastplid ? lastplid : 0;
$.post("/e/action/news/comment.php", {newsid: newsid, lastplid: lastplid}, function (e) {
if (!$.isEmptyObject(e.data)) {
var comments = e.data;
var html = '';
for (i in comments) {
html += tpl(comments[i]);
}
$(".comment-list").html(html);
}
}, 'json');
}
function tpl(comment) {
var html = '<li data-id="'+ comment.id +'">\
<img src="' + comment.avatar + '">\
<div class="name">' + comment.nickname + '</div>\
<div class="comment-main">' + comment.content + '</div>\
<div class="comment-footbar clearfix">\
<span>' + comment.created_at + '</span>\
<a href="javascript:popReplyComment(' + comment.id + ');" class="pl-reply"><i class="iconfont icon-comment_light"></i>回复</a> \
<a href="javascript:likeComment(' + comment.id + ', ' + comment.islike + ');" class="pl-zan"><i class="iconfont '+(comment.islike?"icon-zan-fill":"icon-zan")+'"></i>赞</a> \
</div>';
if (!$.isEmptyObject(comment.reply)) {
var replys = comment.reply;
html += '<div class="comment-replay">';
for (i in replys) {
html += '<div class="comment-replay-list"><span>'+replys[i].nickname+':</span>'+replys[i].content+' <span>'+replys[i].created_at+'</span></div>';
}
html += '</div>';
}
return html + '</li>';
}
//回复弹窗
function popReplyComment(id) {
var parent = $('.comment-list').find('> li[data-id='+id+']');
var name = parent.find('> .name').text() + ':';
var content = parent.find('> .comment-main').text();
$('#reply-name').text(name);
$('#reply-content').text(content);
$("#maskCommon").show();
$(".comment-reply").show();
$("input[name='plid']").val(id);
}
//回复评论
$(".reply-pl").click(function () {
var data = {
'newsid': newsid,
'plid': $("input[name='plid']").val(),
'content': $.trim($("textarea[name='replycontent']").val())
};
var self = this;
if (!data['newsid'] || !data['plid']) {
pop('参数错误');
return false;
}
if (!data['content']) {
pop('评论内容不能为空');
return false;
}
$(self).attr("disabled", true);
$.post("/e/action/news/comment.php?mod=reply", data, function (e) {
$(self).attr("disabled", false);
if (e.status) {
handelReplyComment(data.plid, e.data);
$("textarea[name='replycontent']").val('');
$(".comment-reply").hide();
$('.mask').hide();
} else {
pop(e.msg, e.data);
}
}, 'json');
});
function handelReplyComment(plid, comment) {
$.each( $('.comment-list li'), function(){
if ($(this).attr('data-id') == plid) {
var html = '';
if($(this).children(".comment-replay").html()) {
html = '<div class="comment-replay-list"><span>'+comment.nickname+':</span>'+comment.content+' <span>'+comment.created_at+'</span></div>';
$(this).children(".comment-replay").append(html);
} else {
html = '<div class="comment-replay">\
<div class="comment-replay-list"><span>'+comment.nickname+':</span>'+comment.content+' <span>'+comment.created_at+'</span></div>\
</div>';
$(this).append(html);
}
}
});
}
//评论点赞
function likeComment(plid, islike) {
if (islike) {
return false;
}
$.post("/e/action/news/comment.php?mod=like", {plid: plid}, function (e) {
if (e.status) {
$.each( $('.comment-list li'), function(){
if ($(this).attr('data-id') == plid) {
$(this).find(".icon-zan").addClass("icon-zan-fill").removeClass("icon-zan");
}
});
} else {
pop(e.msg, e.data);
}
}, 'json');
}
function pop(msg, islogin) {
if (islogin === 'nologin') {
location.href = "/e/member/login";
return false;
}
layer.msg(msg);
}
var isLoading = false;
var scrollLoad = $("#scrollLoad");
var spinner = "/skin/default/images/spinner-rosetta-blue-26x26.gif";
var preload = new Image();
preload.src = spinner;
function scrollLoading() {
var currentBottom = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
if ($(document).height() <= currentBottom) {
if (!isLoading) {
isLoading = true;
var lastplid = $(".comment-list li:last-child").attr('data-id');
lastplid = lastplid ? lastplid : 0;
scrollLoad.html("<img src='" + spinner + "'>");
$.post("/e/action/news/comment.php", {newsid:newsid, lastplid:lastplid}, function (e) {
if (!$.isEmptyObject(e.data)) {
var comments = e.data;
var html = '';
for (i in comments) {
html += tpl(comments[i]);
}
$(".comment-list").append(html);
} else {
scrollLoad.html("全部加载完毕");
$(window).off("scroll", scrollLoading);
setTimeout(function() {
scrollLoad.slideUp();
}, 1000);
}
isLoading = false;
}, 'json');
}
}
}
if (scrollLoad.length > 0) {
comments();
$(window).on("scroll", scrollLoading);
scrollLoading();
}
//init
$.post("/e/action/news/index.php?mod=init", {newsid: newsid}, function (e) {
//点赞
if (e.data.isdiggtop) {
$("#zan").find('i').removeClass('icon-zan').addClass('icon-zan-fill');
} else {
diggtop();
}
//收藏
if (e.data.isfava) {
$('#favor').find('i').removeClass('icon-favor').addClass('icon-favor-fill');
}
}, 'json');
//点赞
function diggtop() {
$('#zan').one('click',function () {
$.post("/e/action/news/index.php?mod=diggtop", {newsid: newsid}, function (e) {
if (e.status) {
$("#zan").find('i').removeClass('icon-zan').addClass('icon-zan-fill');
$('.zan-tip').animate({opacity: "1", top: "-=30"},500).animate({opacity: "0", top: "-30"}, "slow");
} else {
pop(e.msg, e.data);
}
}, 'json');
});
}
//收藏
$('#favor').click(function () {
var self = this;
var fill = $(self).find("i").hasClass("icon-favor");
$.post("/e/action/news/index.php?mod=favorite", {newsid: newsid}, function (e) {
if (e.status) {
if (fill) {
$(self).find('i').removeClass('icon-favor').addClass('icon-favor-fill');
} else {
$(self).find('i').removeClass('icon-favor-fill').addClass('icon-favor');
}
} else {
pop(e.msg, e.data);
}
}, 'json');
});
(function($) {
//加载乐视视频
$("div.lecloud-video").each(function() {
var width = 640, height = 360, rate = width / height;
var video = createVideoElement(width, height);
$("#videoPlayer").append(video);
//按设定的比例调整大小
var pNode = video.parentNode,
toWidth = pNode.clientWidth >= 1024 ? 1024 : pNode.clientWidth,
toHeight = toWidth / rate;
//视频浮动站位
$('.video-empty-block').height(toHeight);
setVideo(video, $(this).attr('vu'), toWidth, toHeight);
$(this).remove();
});
function createVideoElement(w, h) {
var node = document.createElement('iframe');
node.setAttribute("allowfullscreen", true);
node.setAttribute("allowtransparency", true);
node.setAttribute("frameborder", "0");
node.setAttribute("scrolling", "no");
//node.setAttribute("width", w);
//node.setAttribute("height", h);
node.style.maxWidth = "100%";
return node;
}
function setVideo(node, vu, w, h) {
node.setAttribute("width", w);
node.setAttribute("height", h);
node.src = 'http://yuntv.letv.com/bcloud.html?uu=pjseptwfce&vu=' + vu + '&pu=510360dfc7&auto_play=1&width=' + w + '&height=' + h + '&lang=zh_CN';
}
})(jQuery);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment