ll手游卡怎么区分R SR UR卡的头像

> 疯狂猜成语人头像、笔的答案是什么成语?
疯狂猜成语人头像、笔的答案是什么成语?
作者:zsw 来源:口袋巴士发布时间:日 14:41:10点击:6
  疯狂猜成语人头像、笔的答案是什么成语?
  答案:从头至尾
  疯狂猜成语是一款全中文休闲益智游戏,可以和好友一起体验中国古老文化-成语的魅力,成语是我国汉字语言词汇中一部分定型的词组或短句。成语有固定的结构形式和固定的说法,表示一定的意义,在语句中是作为一个整体来应用的。成语有很大一部分是从古代相承沿用下来的,在用词方面往往不同于现代汉语它代表了一个故事或者典故。 中华成语千千万,你知道但不一定能猜到!猜到不一定答得出来,不服就来猜猜看!
相关文章推荐
 ICP:皖B2- 皖公网安备05
Copyright (C)
Corporation, All Rights Reserved.微信公众号
Codeigniter+flash实现Avatar头像上传的程序
Loading...
头像上传功能我们用到最多的就简单的flash+php来实现上传前剪切图片然后达到我们想要的效果了,下面我来给各位整理几个基于ci整合Avatar头像上传功能,希望例子能帮助到各位。 然后在控制器中调用即可:实现方法
//重新设置session(防止新传头像无法显示)
$this-&session-&set_userdata('user_info',$user_info);
//项目决对路径
$base_path = rtrim(str_replace('\\','/', FCPATH),'/');
require APPPATH.'libraries/avatar.class.php';
$au = new avatar($base_path.'/uploads/user/'.$user_info['mid'].'/',$base_path.'/uploads/user/temp/','/uploads/user/','/faceapi/');
if(!$user_info['face']){
&&& $uid = 'uface_'.$user_info['mid'];
&&& $uid = $user_info['face'];
$this-&data['urlAvatarBig']&& = $user_info['face'] ? $au-&getAvatarUrl($uid,'big') : (($this-&user_info['sex']==0 )? static_url().'/uploads/user/dfgirl.png' : static_url().'/uploads/user/dfboy.png' );
$this-&data['urlCameraFlash'] = $au-&renderHtml($uid);
$this-&data['uid'] = $//头像标示
$this-&load-&view('center/member/edit_face',$this-&data);
视图中的调用方法
&div style=&float:width:455height:253overflow:margin-left:10&&&?php echo $urlCameraFlash ?&&/div&
&script type=&text/javascript&&
function updateavatar(){
&&& $('#userface').attr('src','/uploads/user/&?php echo $user_info['mid'].'/'.$uid?&_big.jpg?aid='+Math.random());
下面再来补充一下avatar.class.php了
class avatar{
&public $saveP
&public $tempP
&public $viewP
&public $urlP
&public function __construct($savePath,$tempPath,$viewPath,$urlPath,$mid){
&&$this-&savePath=$saveP
&&$this-&tempPath=$tempP
&&$this-&viewPath='http://'.$_SERVER['HTTP_HOST'].$viewP
&&$this-&urlPath='http://'.$_SERVER['HTTP_HOST'].$urlP
&&$this-&mid = $
&// 第一步:上传原始图片文件
&private function uploadAvatar($uid){
&&// 检查上传文件的有效性
&&if(empty($_FILES['Filedata'])){
&&&return -3; // No photograph be upload!
&&// 本地临时存储位置
&&$tmpPath = $this-&tempPath.&{$uid}.jpg&;
&&// 如果临时存储的文件夹不存在,先创建它
&&$dir=dirname($tmpPath);
&&if(!file_exists($dir)){
&&&@mkdir($dir,0777, true );
&&// 如果同名的临时文件已经存在,先删除它
&&if(file_exists($tmpPath)){
&&&@unlink($tmpPath);
&&// 把上传的图片文件保存到预定位置
&&if ( @copy($_FILES['Filedata']['tmp_name'], $tmpPath) || @move_uploaded_file($_FILES['Filedata']['tmp_name'], $tmpPath)) {
&&&@unlink($_FILES['Filedata']['tmp_name']);
&&&list($width, $height, $type, $attr) = getimagesize($tmpPath);
&&&if ( $width & 10 || $height & 10 || $width & 3000 || $height & 3000 || $type == 4 ) {
&&&&@unlink($tmpPath);
&&&&return -2; // Invalid photograph!
&&} else {
&&&@unlink($_FILES['Filedata']['tmp_name']);
&&&return -4; // Can not write to the data/tmp folder!
&&// 用于访问临时图片文件的 url
&&$tmpUrl =$this-&viewPath.&temp/{$uid}.jpg&;
&&return $tmpU
&private function flashdata_decode($s) {
&&$r = '';
&&$l = strlen($s);
&&for($i=0; $i&$l; $i=$i+2) {
&&&$k1 = ord($s[$i]) - 48;
&&&$k1 -= $k1 & 9 ? 7 : 0;
&&&$k2 = ord($s[$i+1]) - 48;
&&&$k2 -= $k2 & 9 ? 7 : 0;
&&&$r .= chr($k1 && 4 | $k2);
&&return $r;
&// 第二步:上传分割后的三个图片数据流
&private function rectAvatar( $uid ){
&&// 从 $_POST 中提取出三个图片数据流
&&$bigavatar&&& = $this-&flashdata_decode( $_POST['avatar1'] );
&&$middleavatar = $this-&flashdata_decode( $_POST['avatar2'] );
&&if ( !$bigavatar || !$middleavatar) {
&&&return '&root&&message type=&error& value=&-2& /&&/root&';
&&//不存在目录,则创建
&&if(!file_exists($this-&savePath)){
&&&@mkdir($this-&savePath,0777, true );
&&// 保存为图片文件
&&$bigavatarfile&&& = $this-&savePath.&{$uid}_big.jpg&;
&&$middleavatarfile = $this-&savePath.&{$uid}_middle.jpg&;
&&$success = 1;
&&$fp = @fopen($bigavatarfile, 'wb');
&&@fwrite($fp, $bigavatar);
&&@fclose($fp);
&&$fp = @fopen($middleavatarfile, 'wb');
&&@fwrite($fp, $middleavatar);
&&@fclose($fp);
&&// 验证图片文件的正确性
&&$biginfo&&& = @getimagesize($bigavatarfile);
&&$middleinfo = @getimagesize($middleavatarfile);
&&if ( !$biginfo || !$middleinfo || $biginfo[2] == 4 || $middleinfo[2] == 4 ) {
&&&file_exists($bigavatarfile) && unlink($bigavatarfile);
&&&file_exists($middleavatarfile) && unlink($middleavatarfile);
&&&$success = 0;
&&// 删除临时存储的图片
&&$tmpPath = $this-&tempPath.&{$uid}.jpg&;
&&@unlink($tmpPath);
&&//临时保存头像
&&$con=mysql_connect('localhost','root','root');
&&mysql_select_db('zenyue');
&&mysql_query(&set names utf8&);
&&$sql=&update zen_user set `face`='&.$uid.&' where mid='&.$this-&mid.&'&;
&&mysql_query($sql);
&&return '&?xml version=&1.0& ?&&root&&face success=&' . $success . '&/&&/root&';
&// 从客户端访问头像图片的 url
&public function getAvatarUrl( $uid, $size='middle' ){
&&$ci = &get_instance();
&&$user_info = $ci-&session-&userdata('user_info');
&&return $this-&viewPath.&{$user_info['mid']}/{$uid}_{$size}.jpg&;
&// 处理 HTTP Request
&// 返回值:如果是可识别的 request,处理后返回 true;否则返回 false。
&public function processRequest(){
&&// 从 input 参数里拆解出自定义参数
&&$arr = array();
&&parse_str( $_GET['input'], $arr );
&&$uid = $arr['uid'];
&&if ( $_GET['a'] == 'uploadavatar') {
&&&// 第一步:上传原始图片文件
&&&echo $this-&uploadAvatar( $uid );
&&} else if ( $_GET['a'] == 'rectavatar') {
&&&// 第二步:上传分割后的三个图片数据流
&&&echo $this-&rectAvatar( $uid );
&// 编辑页面中包含 camera.swf 的 HTML 代码
&public function renderHtml( $uid ){
&&// 把需要回传的自定义参数都组装在 input 里
&&$ci = &get_instance();
&&$user_info = $ci-&session-&userdata('user_info');
&&$input = urlencode(&uid={$uid}&FSESSIONID=&.session_id().'&mid='.$user_info['mid']);
&&$baseUrl = '/public/zen/js/avatar/';
&&$uc_api = urlencode( $this-&urlPath.'avatar.php');
&&$urlCameraFlash = &{$baseUrl}camera.swf?m=user&inajax=1&appid=1&ucapi={$uc_api}&input={$input}&uploadSize=2048&;
&&$urlCameraFlash = '&script src=&'.$baseUrl.'common.js?B6k& type=&text/javascript&&&/script&&script type=&text/javascript&&document.write(AC_FL_RunContent(&width&,&455&,&height&,&253&,&scale&,&exactfit&,&src&,&'.$urlCameraFlash.'&,&id&,&mycamera&,&name&,&mycamera&,&quality&,&high&,&bgcolor&,&#ffffff&,&wmode&,&transparent&,&menu&,&false&,&swLiveConnect&,&true&,&allowScriptAccess&,&always&));&/script&';
&&return $urlCameraF
相关推荐:1、2、3、4、5、6、7、8、9、10、
猜你喜欢:1、2、3、4、5、6、7、8、9、10、
推荐电影:1、2、3、4、5、6、7、8、9、10、
热门关键词:
随机关键词:
正在加载...
热评文章评分 3.9, 满分 5 星10 票评分 3.9, 满分 5 星10 票评分 3.8, 满分 5 星10 票评分 3.8, 满分 5 星10 票评分 4.0, 满分 5 星9 票
最新微资讯

我要回帖

更多关于 神武手游 的文章

 

随机推荐