Repository navigation
Expand file tree
/
Copy pathavatar.php
More file actions
66 lines (65 loc) · 2.3 KB
/
Copy pathavatar.php
File metadata and controls
66 lines (65 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require('../../global.php');
//验证是否登入
if(!checkLogin()){
redirect('../error.php?code='.$errorcode['noLogin']);
}
$avatar = '../../'.getAvatar(session('member_id'), 'l');
$global_title = 'avatar';
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>修改头像</title>
<?php include('sysapp/global_css.php'); ?>
</head>
<body>
<?php include('global_title.php'); ?>
<div style="width:630px;margin:0 auto;text-align:center;margin-top:20px">
<p id="swfContainer">本组件需要安装Flash Player后才可使用,请从<a href="http://www.adobe.com/go/getflashplayer">这里</a>下载安装。</p>
</div>
<?php include('sysapp/global_js.php'); ?>
<script src="../../libs/system/fullAvatarEditor-2.3/scripts/swfobject.js"></script>
<script src="../../libs/system/fullAvatarEditor-2.3/scripts/fullAvatarEditor.js"></script>
<script>
swfobject.addDomLoadEvent(function () {
var swf = new fullAvatarEditor('../../libs/system/fullAvatarEditor-2.3/fullAvatarEditor.swf', '../../libs/system/fullAvatarEditor-2.3/expressInstall.swf', 'swfContainer', {
id: 'swf',
upload_url: 'ajax.php?ac=avatar', //上传接口
method: 'post', //传递到上传接口中的查询参数的提交方式。更改该值时,请注意更改上传接口中的查询参数的接收方式
src_upload: 0, //是否上传原图片的选项,有以下值:0-不上传;1-上传;2-显示复选框由用户选择
avatar_box_border_width: 0,
avatar_sizes: '120*120|48*48|24*24',
avatar_sizes_desc: '120*120像素|48*48像素|24*24像素',
avatar_tools_visible: false,
avatar_box_border_width: 1
}, function (msg) {
switch(msg.code){
case 1:
//alert("页面成功加载了组件!");
break;
case 2:
//alert("已成功加载图片到编辑面板。");
break;
case 3:
if(msg.type == 0){
//alert("摄像头已准备就绪且用户已允许使用。");
}else if(msg.type == 1){
//alert("摄像头已准备就绪但用户未允许使用!");
}else{
//alert("摄像头被占用!");
}
break;
case 5:
if(msg.type == 0){
window.parent.HROS.startMenu.getAvatar();
}
break;
}
}
);
});
</script>
</body>
</html>