Revert "暂存"

This reverts commit a685c14e23.
master
chenzhi 5 years ago
parent 42a17754e4
commit 6c4319cfe2

@ -63,71 +63,62 @@ class ToolController extends ThinkController {
}
}
/**
* 打款配置
*/
public function transfer_set()
{
$this->BaseConfig("transfer_set");
$this->meta_title = '支付宝打款设置';
$this->display();
}
/**
* 给图片添加水印
* @author 鹿文学
* @date 2018-05-03
*/
public function addWatermarkOnPic() {
// watermark
$tool = M('tool',"tab_")->field('config,status')->where(['name'=>'watermark'])->find();
if(empty($tool)){$this->error('没有此设置');}
if($tool['status']==0) {$this->error('添加水印已关闭');exit;}
$piclist = M('picture')->field('path,url,water')->where(['status'=>1,'water'=>array('neq','')])->select();
if (!is_array($piclist)) {$this->error('没有图片需要添加');exit;}
$water = json_decode($tool['config'],true);
$temp = explode(',',$water['position']);
$position = 3*$temp[0]+$temp[1]+1;
$image = new \Think\Image();
if ($water['types']==1) { // 文字
$offset = array(
$water['hoffset']?$water['hoffset']:0,
$water['voffset']?$water['voffset']:0
);
foreach ($piclist as $k => $v) {
$image->open(ROOTTT.$v['path'])->text($water['font_text'],FONTS.$water['font'],$water['font_size'],$water['font_color'],$position,$offset)->save(ROOTTT.$v['water'],$image->type(),$water['quality']);
}
} else { // 图片
foreach ($piclist as $k => $v) {
$img_url=M('picture')->find($water['icon']);
$img_url=$img_url['path'];
$image->open(ROOTTT.$v['path'])->water(ROOTTT.$img_url,$position,$water['transparency'])->save(ROOTTT.$v['water'],$image->type(),$water['quality']);
}
}
$this->success('水印添加成功');
}
/**
* 给图片添加水印
* @author 鹿文学
* @date 2018-05-03
*/
public function addWatermarkOnPic() {
// watermark
$tool = M('tool',"tab_")->field('config,status')->where(['name'=>'watermark'])->find();
if(empty($tool)){$this->error('没有此设置');}
if($tool['status']==0) {$this->error('添加水印已关闭');exit;}
$piclist = M('picture')->field('path,url,water')->where(['status'=>1,'water'=>array('neq','')])->select();
if (!is_array($piclist)) {$this->error('没有图片需要添加');exit;}
$water = json_decode($tool['config'],true);
$temp = explode(',',$water['position']);
$position = 3*$temp[0]+$temp[1]+1;
$image = new \Think\Image();
if ($water['types']==1) { // 文字
$offset = array(
$water['hoffset']?$water['hoffset']:0,
$water['voffset']?$water['voffset']:0
);
foreach ($piclist as $k => $v) {
$image->open(ROOTTT.$v['path'])->text($water['font_text'],FONTS.$water['font'],$water['font_size'],$water['font_color'],$position,$offset)->save(ROOTTT.$v['water'],$image->type(),$water['quality']);
}
} else { // 图片
foreach ($piclist as $k => $v) {
$img_url=M('picture')->find($water['icon']);
$img_url=$img_url['path'];
$image->open(ROOTTT.$v['path'])->water(ROOTTT.$img_url,$position,$water['transparency'])->save(ROOTTT.$v['water'],$image->type(),$water['quality']);
}
}
$this->success('水印添加成功');
}
public function save($config){
$name = $_POST['name'];

@ -1,79 +0,0 @@
<extend name="Public/base"/>
<block name="body">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text"></p>
</div>
<div class="tab-wrap">
<div class="infomation information1711">
<p>说明①:畅言为----软件接入第三方留言功能</p>
<p>说明②:使用该功能,需到畅言官网创建账户,并配置到本后台此处</p>
</div>
<div class="tab-content tabcon1711 tabcon17112">
<div id="tab1" class="tab-pane in tab1">
<form action="{:U('saveTool')}" method="post" class="form-horizontal OSS form_info_ml">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">商户号</td>
<td class="r table_radio">
<input name="config[partner]" type="text" value="{$changyan['partner']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">密钥</td>
<td class="r table_radio">
<input name="config[key]" type="text" value="{$changyan['key']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">启用状态</td>
<td class="r table_radio">
<span class="form_radio">
<label><input type="radio" name="status" value="0" <eq name="changyan_data['status']" value="0">checked="checked"</eq>> 禁用</label>
<label><input type="radio" name="status" value="1" <eq name="changyan_data['status']" value="1">checked="checked"</eq>> 启用
</label></span>
<span class="notice-text">是否启用畅言设置</span>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="name" value="changyan">
</form>
<div class="form-item cf">
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="OSS">
保存
</button>
</div>
</div>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="{$m_url}">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Tool/changyan')}');
$(function(){
//支持tab
showTab();
})
</script>
</block>
Loading…
Cancel
Save