| @@ -669,6 +669,7 @@ function AddFilter($channelid, $type=1, $fieldsnamef=array(), $defaulttid=0, $to | |||
| */ | |||
| function HideEmail($email) | |||
| { | |||
| if (empty($email)) return "空"; | |||
| $em = explode("@",$email); | |||
| $name = implode('@', array_slice($em, 0, count($em)-1)); | |||
| $len = floor(strlen($name)/2); | |||
| @@ -125,7 +125,8 @@ else if ($dopost == 'save') { | |||
| $description = HtmlReplace($description, -1); | |||
| $mtypesid = intval($mtypesid); //对输入参数mtypesid未进行int整型转义,导致SQL注入的发生 | |||
| //保存到主表 | |||
| $inQuery = "INSERT INTO `#@__archives` (id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,description,keywords,mtype) VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','','$pubdate','$senddate','$mid','$description','$keywords','$mtypesid'); "; | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| $inQuery = "INSERT INTO `#@__archives` (id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,description,keywords,mtype) VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$mid','$description','$keywords','$mtypesid'); "; | |||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | |||
| $gerr = $dsql->GetError(); | |||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID' "); | |||
| @@ -114,8 +114,8 @@ else if ($dopost == 'save') { | |||
| } | |||
| $description = HtmlReplace($description, -1); | |||
| //更新数据库的SQL语句 | |||
| //更新数据库的SQL语句 | |||
| $upQuery = "UPDATE `#@__archives` SET ismake='$ismake',arcrank='$arcrank',typeid='$typeid',title='$title',description='$description',keywords='$keywords',mtype='$mtypesid',flag='$flag' WHERE id='$aid' AND mid='$mid'; "; | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| $upQuery = "UPDATE `#@__archives` SET ismake='$ismake',arcrank='$arcrank',typeid='$typeid',title='$title',description='$description',keywords='$keywords',mtype='$mtypesid',flag='$flag',litpic='$litpic' WHERE id='$aid' AND mid='$mid'; "; | |||
| if (!$dsql->ExecuteNoneQuery($upQuery)) { | |||
| ShowMsg("数据保存到数据库主表`#@__archives`时出错,请联系管理员".$dsql->GetError(), "-1"); | |||
| exit(); | |||
| @@ -58,7 +58,7 @@ if ($action === 'is_need_check_code') { | |||
| "email" => $row['email'], | |||
| ), | |||
| )); | |||
| } else if($action === 'upload_face'){ | |||
| } else if($action === 'upload'){ | |||
| if (!$cfg_ml->IsLogin()) { | |||
| if ($format === 'json') { | |||
| echo json_encode(array( | |||
| @@ -72,6 +72,7 @@ if ($action === 'is_need_check_code') { | |||
| exit; | |||
| } | |||
| $target_dir = "uploads/"; //上传目录 | |||
| $type = isset($type)? $type : ''; | |||
| $allowedTypes = array('image/png', 'image/jpg', 'image/jpeg'); | |||
| $uploadedFile = $_FILES['file']['tmp_name']; | |||
| @@ -85,18 +86,46 @@ if ($action === 'is_need_check_code') { | |||
| )); | |||
| exit; | |||
| } | |||
| if (!is_dir($cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}")) { | |||
| MkdirAll($cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}", $cfg_dir_purview); | |||
| CloseFtp(); | |||
| } | |||
| $target_file = $cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}/newface.png"; //上传文件名 | |||
| $target_url = $cfg_mediasurl.'/userup'."/{$cfg_ml->M_ID}/newface.png"; | |||
| if ($type === "face") { | |||
| $target_file = $cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}/newface.png"; //上传文件名 | |||
| $target_url = $cfg_mediasurl.'/userup'."/{$cfg_ml->M_ID}/newface.png"; | |||
| } else { | |||
| $nowtme = time(); | |||
| $rnd = $nowtme.'-'.mt_rand(1000,9999); | |||
| $target_file = $cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}/".$rnd.'.png'; | |||
| $fsize = filesize($_FILES["file"]["tmp_name"]); | |||
| $target_url = $cfg_mediasurl.'/userup'."/{$cfg_ml->M_ID}/".$rnd.".png"; | |||
| $row = $dsql->GetOne("SELECT aid,title,url FROM `#@__uploads` WHERE url LIKE '$target_url' AND mid='".$cfg_ml->M_ID."'; "); | |||
| $uptime = time(); | |||
| if(is_array($row)) | |||
| { | |||
| $query = "UPDATE `#@__uploads` SET mediatype=1, | |||
| width='{$imgSize[0]}',height='{$imgSize[1]}',filesize='{$fsize}',uptime='$uptime' | |||
| WHERE aid='{$row['aid']}'; "; | |||
| $dsql->ExecuteNoneQuery($query); | |||
| } | |||
| else | |||
| { | |||
| $inquery = "INSERT INTO `#@__uploads`(url,mediatype,width,height,playtime,filesize,uptime,mid) | |||
| VALUES ('$target_url','1','".$imgSize[0]."','".$imgSize[1]."','0','".$fsize."','$uptime','".$cfg_ml->M_ID."'); "; | |||
| $dsql->ExecuteNoneQuery($inquery); | |||
| } | |||
| } | |||
| if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) { | |||
| require_once DEDEINC."/libraries/imageresize.class.php"; | |||
| try{ | |||
| $image = new ImageResize($target_file); | |||
| $image->crop(150, 150); | |||
| if ($type === "face") { | |||
| $image->crop(150, 150); | |||
| } else { | |||
| $image->resize($cfg_ddimg_width, $cfg_ddimg_height); | |||
| } | |||
| $image->save($target_file); | |||
| echo json_encode(array( | |||
| "code" => 0, | |||
| @@ -14,6 +14,7 @@ require_once(DEDEINC."/userlogin.class.php"); | |||
| require_once(DEDEINC."/customfields.func.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_catalog_options.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_archives_functions.php"); | |||
| CheckRank(0, 0); | |||
| $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 1; | |||
| $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; | |||
| $mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
| @@ -95,6 +96,7 @@ else if ($dopost == 'save') { | |||
| exit(); | |||
| } | |||
| //保存到主表 | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| $inQuery = "INSERT INTO `#@__archives` (id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,description,keywords,mtype) VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$mid','$description','$keywords','$mtypesid'); "; | |||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | |||
| $gerr = $dsql->GetError(); | |||
| @@ -37,6 +37,7 @@ function addArchives() | |||
| 添加投稿 | |||
| ------------------*/ | |||
| else if ($dopost == "addArc") { | |||
| CheckRank(0, 0); | |||
| if ($channelid == 1) { | |||
| $addcon = 'article_add.php?channelid='.$channelid; | |||
| } else if ($channelid == 2) { | |||
| @@ -14,6 +14,7 @@ require_once(DEDEINC."/dedetag.class.php"); | |||
| require_once(DEDEINC."/customfields.func.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_catalog_options.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_archives_functions.php"); | |||
| CheckRank(0, 0); | |||
| $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 1; | |||
| $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||
| $mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
| @@ -82,6 +83,7 @@ else if ($dopost == 'save') { | |||
| //处理图片文档的自定义属性 | |||
| if ($litpic != '') $flag = 'p'; | |||
| //更新数据库的SQL语句 | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| $upQuery = "UPDATE `#@__archives` SET ismake='$ismake',arcrank='$arcrank',typeid='$typeid',title='$title',litpic='$litpic',description='$description',keywords='$keywords',mtype='$mtypesid',flag='$flag' WHERE id='$aid' And mid='$mid'; "; | |||
| if (!$dsql->ExecuteNoneQuery($upQuery)) { | |||
| ShowMsg("数据保存到数据库主表`#@__archives`时出错,请联系管理员".$dsql->GetError(), "-1"); | |||
| @@ -14,6 +14,7 @@ require_once(DEDEINC."/userlogin.class.php"); | |||
| require_once(DEDEINC."/customfields.func.php"); | |||
| require_once(dirname(__FILE__)."/inc/inc_catalog_options.php"); | |||
| require_once(dirname(__FILE__)."/inc/inc_archives_functions.php"); | |||
| CheckRank(0, 0); | |||
| $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 1; | |||
| $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; | |||
| $mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
| @@ -146,7 +147,8 @@ else if ($dopost == 'save') { | |||
| ShowMsg("没找到当前模型<span class='text-primary'>{$channelid}</span>主表信息,无法完成操作", "javascript:;"); | |||
| exit(); | |||
| } else { | |||
| $inquery = "INSERT INTO `{$addtable}` (aid,typeid,arcrank,mid,channel,title,senddate,litpic,userip{$inadd_f}) VALUES ('$arcID','$typeid','$arcrank','$mid','$channelid','$title','$senddate','','$userip'{$inadd_v})"; | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| $inquery = "INSERT INTO `{$addtable}` (aid,typeid,arcrank,mid,channel,title,senddate,litpic,userip{$inadd_f}) VALUES ('$arcID','$typeid','$arcrank','$mid','$channelid','$title','$senddate','$litpic','$userip'{$inadd_v})"; | |||
| if (!$dsql->ExecuteNoneQuery($inquery)) { | |||
| $gerr = $dsql->GetError(); | |||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | |||
| @@ -14,6 +14,7 @@ require_once(DEDEINC."/dedetag.class.php"); | |||
| require_once(DEDEINC."/customfields.func.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_catalog_options.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_archives_functions.php"); | |||
| CheckRank(0, 0); | |||
| $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 1; | |||
| $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||
| $mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
| @@ -106,7 +107,8 @@ else if ($dopost == 'save') { | |||
| } | |||
| } | |||
| if ($addtable != '') { | |||
| $upQuery = "UPDATE `$addtable` SET `title`='$title',`typeid`='$typeid',`arcrank`='$arcrank',userip='$userip'{$inadd_f} WHERE aid='$aid' "; | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| $upQuery = "UPDATE `$addtable` SET `title`='$title',`typeid`='$typeid',`arcrank`='$arcrank',litpic='$litpic',userip='$userip'{$inadd_f} WHERE aid='$aid' "; | |||
| if (!$dsql->ExecuteNoneQuery($upQuery)) { | |||
| ShowMsg("数据保存到数据库附加表时出错,请联系管理员", "javascript:;"); | |||
| exit(); | |||
| @@ -14,6 +14,7 @@ require_once(DEDEINC."/userlogin.class.php"); | |||
| require_once(DEDEINC."/customfields.func.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_catalog_options.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_archives_functions.php"); | |||
| CheckRank(0, 0); | |||
| $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 1; | |||
| $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; | |||
| $mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
| @@ -76,6 +77,8 @@ else if ($dopost == 'save') { | |||
| } | |||
| $body = AnalyseHtmlBody($body, $description); | |||
| $body = HtmlReplace($body, -1); | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| //生成文档id | |||
| $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $mid); | |||
| if (empty($arcID)) { | |||
| @@ -84,7 +87,7 @@ else if ($dopost == 'save') { | |||
| } | |||
| //保存到主表 | |||
| $inQuery = "INSERT INTO `#@__archives` (id,typeid,sortrank,flag,ismake,channel,arcrank,click,`money`,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,description,keywords,mtype) | |||
| VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','','$pubdate','$senddate','$mid','$description','$keywords','$mtypesid'); "; | |||
| VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$mid','$description','$keywords','$mtypesid'); "; | |||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | |||
| $gerr = $dsql->GetError(); | |||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID' "); | |||
| @@ -14,6 +14,7 @@ require_once(DEDEINC."/dedetag.class.php"); | |||
| require_once(DEDEINC."/customfields.func.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_catalog_options.php"); | |||
| require_once(DEDEMEMBER."/inc/inc_archives_functions.php"); | |||
| CheckRank(0, 0); | |||
| $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 1; | |||
| $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||
| $mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
| @@ -77,8 +78,9 @@ else if ($dopost == 'save') { | |||
| } | |||
| $body = AnalyseHtmlBody($body, $description); | |||
| $body = HtmlReplace($body, -1); | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| //更新数据库的SQL语句 | |||
| $upQuery = "UPDATE `#@__archives` SET ismake='$ismake',arcrank='$arcrank',typeid='$typeid',title='$title',description='$description',mtype='$mtypesid',keywords='$keywords',flag='$flag' WHERE id='$aid' AND mid='$mid'; "; | |||
| $upQuery = "UPDATE `#@__archives` SET ismake='$ismake',arcrank='$arcrank',typeid='$typeid',title='$title',description='$description',mtype='$mtypesid',keywords='$keywords',flag='$flag',litpic='$litpic' WHERE id='$aid' AND mid='$mid'; "; | |||
| if (!$dsql->ExecuteNoneQuery($upQuery)) { | |||
| ShowMsg("数据保存到数据库主表`#@__archives`时出错,请联系管理员".$dsql->GetError(), "-1"); | |||
| exit(); | |||
| @@ -7,6 +7,7 @@ | |||
| * @link https://www.dedebiz.com | |||
| */ | |||
| require_once(dirname(__FILE__)."/config.php"); | |||
| CheckRank(0, 0); | |||
| $svali = GetCkVdValue(); | |||
| if (strtolower($vdcode) != $svali || $svali == "") { | |||
| ShowMsg("验证码不正确", "-1"); | |||
| @@ -253,4 +253,9 @@ function GetSafequestion($selid=0,$formname='safequestion') | |||
| return $safequestions_form; | |||
| } | |||
| $enabledChannels = MemberLogin::GetEnabledChannels(); | |||
| function UserInclude($file) | |||
| { | |||
| return DEDEMEMBER.'/'.$file; | |||
| } | |||
| ?> | |||
| @@ -60,8 +60,9 @@ if ($dopost == 'save') { | |||
| //修改头像 | |||
| $target_file = $cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}/newface.png"; | |||
| if (!empty($newface) && file_exists($target_file)) { | |||
| rename($target_file, $cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}/face.png"); | |||
| $target_url = $cfg_mediasurl.'/userup'."/{$cfg_ml->M_ID}/face.png"; | |||
| $rnd = mt_rand(10000, 99999); | |||
| rename($target_file, $cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}/face{$rnd}.png"); | |||
| $target_url = $cfg_mediasurl.'/userup'."/{$cfg_ml->M_ID}/face{$rnd}.png"; | |||
| $addupquery = ",face='{$target_url}'"; | |||
| @unlink($target_file); | |||
| } | |||
| @@ -105,6 +105,8 @@ else if ($dopost == 'save') { | |||
| $flag = 'p'; | |||
| } | |||
| $body = HtmlReplace($body, -1); | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| //保存到主表 | |||
| $inQuery = "INSERT INTO `#@__archives`(id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,description,keywords) VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$mid','$description','$keywords'); "; | |||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | |||
| @@ -129,6 +129,7 @@ else if ($dopost == 'save') { | |||
| } | |||
| } | |||
| //修改主文档表 | |||
| $litpic = isset($litpic)? HtmlReplace($litpic, 1) : ''; | |||
| $upQuery = "UPDATE `#@__archives` SET ismake='$ismake',arcrank='$arcrank',typeid='$typeid',title='$title',litpic='$litpic',description='$description',keywords='$keywords',flag='$flag' WHERE id='$aid' AND mid='$mid'; "; | |||
| if (!$dsql->ExecuteNoneQuery($upQuery)) { | |||
| ShowMsg("数据保存到数据库主表`#@__archives`时出错,请联系管理员", "-1"); | |||
| @@ -26,7 +26,8 @@ | |||
| <form name="addcontent" action="album_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | |||
| <input type="hidden" name="dopost" value="save"> | |||
| <input type="hidden" name="channelid" value="<?php echo $channelid;?>"> | |||
| <input type="hidden" name="imagebody" id="imagebody" value=""> | |||
| <input type="hidden" name="imagebody" id="imagebody" value=""> | |||
| <input type="hidden" id="litpic" name="litpic" value=""> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" placeholder="请输入文档标题"></div> | |||
| @@ -38,8 +39,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">上传缩略图</span> | |||
| <img id="imgLitpic" src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">上传缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -125,5 +127,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -31,6 +31,7 @@ | |||
| <input type="hidden" name="oldlitpic" value="<?php echo $row['litpic'];?>"> | |||
| <input type="hidden" name="sortrank" value="<?php echo $row['sortrank'];?>"> | |||
| <input type="hidden" name="imagebody" id="imagebody" value=""> | |||
| <input type="hidden" id="litpic" name="litpic" value="<?php echo $row['litpic'];?>"> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" value="<?php echo $row['title']?>"></div> | |||
| @@ -42,8 +43,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">修改缩略图</span> | |||
| <img id="imgLitpic" src="<?php echo empty($row['litpic'])? $cfg_staticurl.'/web/img/thumbnail.jpg' : $row['litpic'];?>" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">修改缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -122,5 +124,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -26,6 +26,7 @@ | |||
| <form name="addcontent" action="archives_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | |||
| <input type="hidden" name="dopost" value="save"> | |||
| <input type="hidden" name="channelid" value="<?php echo $channelid;?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value=""> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" placeholder="请输入文档标题"></div> | |||
| @@ -37,8 +38,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">上传缩略图</span> | |||
| <img id="imgLitpic" src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">上传缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -72,5 +74,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -26,6 +26,7 @@ | |||
| <form name="addcontent" action="archives_edit.php?aid=<?php echo $aid;?>" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | |||
| <input type="hidden" name="dopost" value="save"> | |||
| <input type="hidden" name="channelid" value="<?php echo $channelid;?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value="<?php echo $row['litpic'];?>"> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" value="<?php echo $row['title']?>"></div> | |||
| @@ -37,8 +38,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">修改缩略图</span> | |||
| <img id="imgLitpic" src="<?php echo empty($row['litpic'])? $cfg_staticurl.'/web/img/thumbnail.jpg' : $row['litpic'];?>" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">修改缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -71,5 +73,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -26,6 +26,7 @@ | |||
| <form name="addcontent" action="archives_sg_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | |||
| <input type="hidden" name="dopost" value="save"> | |||
| <input type="hidden" name="channelid" value="<?php echo $channelid;?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value=""> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" placeholder="请输入文档标题"></div> | |||
| @@ -37,8 +38,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">上传缩略图</span> | |||
| <img id="imgLitpic" src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">上传缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -72,5 +74,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -26,6 +26,7 @@ | |||
| <form name="addcontent" action="archives_sg_edit.php?aid=<?php echo $aid;?>" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | |||
| <input type="hidden" name="dopost" value="save"> | |||
| <input type="hidden" name="channelid" value="<?php echo $channelid;?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value="<?php echo $addRow['litpic'];?>"> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" value="<?php echo $addRow['title']?>"></div> | |||
| @@ -37,8 +38,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">修改缩略图</span> | |||
| <img id="imgLitpic" src="<?php echo empty($addRow['litpic'])? $cfg_staticurl.'/web/img/thumbnail.jpg' : $addRow['litpic'];?>" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">修改缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -71,5 +73,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -26,6 +26,7 @@ | |||
| <form name="addcontent" action="article_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | |||
| <input type="hidden" name="dopost" value="save"> | |||
| <input type="hidden" name="channelid" value="<?php echo $channelid;?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value=""> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" placeholder="请输入文档标题"></div> | |||
| @@ -37,8 +38,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">上传缩略图</span> | |||
| <img id="imgLitpic" src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">上传缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -76,5 +78,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -30,6 +30,7 @@ | |||
| <input type="hidden" name="channelid" value="<?php echo $row['channel'];?>"> | |||
| <input type="hidden" name="oldlitpic" value="<?php echo $row['litpic'];?>"> | |||
| <input type="hidden" name="sortrank" value="<?php echo $row['sortrank'];?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value="<?php echo $row['litpic'];?>"> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" value="<?php echo $row['title']?>"></div> | |||
| @@ -41,8 +42,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">修改缩略图</span> | |||
| <img id="imgLitpic" src="<?php echo empty($row['litpic'])? $cfg_staticurl.'/web/img/thumbnail.jpg' : $row['litpic'];?>" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">修改缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -79,5 +81,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -147,7 +147,7 @@ | |||
| var fileData = $('#iptNewface')[0].files[0]; | |||
| formData.append('file', fileData); | |||
| $.ajax({ | |||
| url: '<?php echo $cfg_cmsurl;?>/user/api.php?action=upload_face', | |||
| url: '<?php echo $cfg_cmsurl;?>/user/api.php?action=upload&type=face', | |||
| type: 'POST', | |||
| data: formData, | |||
| processData: false, | |||
| @@ -43,6 +43,7 @@ | |||
| <form name="addcontent" action="soft_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | |||
| <input type="hidden" name="dopost" value="save"> | |||
| <input type="hidden" name="channelid" value="<?php echo $channelid;?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value=""> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" placeholder="请输入文档标题"></div> | |||
| @@ -54,8 +55,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">上传缩略图</span> | |||
| <img id="imgLitpic" src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">上传缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -190,5 +192,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -45,7 +45,8 @@ | |||
| <input type="hidden" name="aid" value="<?php echo $row['id'];?>"> | |||
| <input type="hidden" name="channelid" value="<?php echo $row['channel'];?>"> | |||
| <input type="hidden" name="oldlitpic" value="<?php echo $row['litpic'];?>"> | |||
| <input type="hidden" name="sortrank" value="<?php echo $row['sortrank'];?>"> | |||
| <input type="hidden" name="sortrank" value="<?php echo $row['sortrank'];?>"> | |||
| <input type="hidden" id="litpic" name="litpic" value="<?php echo $row['litpic'];?>"> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">标题</label> | |||
| <div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" value="<?php echo $row['title']?>"></div> | |||
| @@ -57,8 +58,9 @@ | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">缩略图</label> | |||
| <div class="col-sm-10"> | |||
| <img src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm">修改缩略图</span> | |||
| <img id="imgLitpic" src="<?php echo empty($row['litpic'])? $cfg_staticurl.'/web/img/thumbnail.jpg' : $row['litpic'];?>" class="thumbnail-md mr-3"> | |||
| <span class="btn btn-success btn-sm" id="btnUploadLitpic">修改缩略图</span> | |||
| <input id="iptLitpic" type="file" name="iptLitpic" class="d-none"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| @@ -196,5 +198,6 @@ | |||
| </div> | |||
| </div> | |||
| <?php pasterTempletDiy('foot.htm');?> | |||
| <?php include UserInclude("templets/widget_litpic.htm");?> | |||
| </body> | |||
| </html> | |||
| @@ -0,0 +1,28 @@ | |||
| <script> | |||
| $(document).ready(function () { | |||
| $("#btnUploadLitpic").click(function(){ | |||
| $("#iptLitpic").click(); | |||
| }) | |||
| $("#iptLitpic").change(function (val) { | |||
| var formData = new FormData(); | |||
| var fileData = $('#iptLitpic')[0].files[0]; | |||
| formData.append('file', fileData); | |||
| $.ajax({ | |||
| url: '<?php echo $cfg_cmsurl;?>/user/api.php?action=upload&type=litpic', | |||
| type: 'POST', | |||
| data: formData, | |||
| processData: false, | |||
| contentType: false, | |||
| success: function (result) { | |||
| if (result.code === 0) { | |||
| $("#imgLitpic").attr('src', result.data); | |||
| $("#litpic").val(result.data); | |||
| } | |||
| }, | |||
| error: function (xhr, status, error) { | |||
| ShowMsg("文件上传失败"); //处理上传失败后的回调 | |||
| } | |||
| }); | |||
| }); | |||
| }); | |||
| </script> | |||