<?
require "../e/class/connect.php";
require "../e/class/db_sql.php";
require "../e/member/class/user.php";
$link=db_connect();
$empire=new mysqlquery;
require "class/fun.php";
$ur=user_returnlogin();
$userid=$ur[userid];
$usercheck=checklogin($userid);
$username=$ur[username];
$nickname=getnickname($ur[userid]);
$headerimgfile='header/avatar/'.$userid.'_avatar_small.jpg';
if(file_exists($headerimgfile)){ $headerimg='header/avatar/'.$userid.'_avatar_small.jpg'; } 
else{ $headerimg='temp/images/avatar.jpg'; }


?>
<?php
$domain=$public_r[newsurl];
$swf_src=$domain.'user/header/camera.swf';
$dmain=str_replace('http://','',$domain);
$api_src=$dmain.'user/header/';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>头像设置 - 会员中心 -奇热网</title>
<? include_once "temp/header.php"; ?>
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
<? include_once "temp/left.php"; ?>
    <div class="i-box-cnt" id="i-cnt">
      <div id="i-avatar">
        <div class="ui-title i-tab-nav-box">
          <ul class="i-tab-nav fn-clear">
            <li ><a href="info.php" hidefocus>基本资料</a></li>
            <li class="line"></li>
            <li class="current"><a href="avatar.php" hidefocus>头像设置</a></li>
            <li class="line"></li>
            <li ><a href="pass.php" hidefocus>密码设置</a></li>
            <!--<li ><a href="/user-Center-emailset" hidefocus>订阅提醒</a></li>-->
          </ul>
        </div>
        <div class="qire-notice"> 上传成功后，刷新页面便可以看到头像 </div>
        <div class="ui-form fn-clear">
          <div class="user-upload">
              <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="450" height="253" id="mycamera" align="middle">
                <param name="allowScriptAccess" value="always" />
                <param name="scale" value="exactfit" />
                <param name="wmode" value="transparent" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="#ffffff" />
                <param name="movie" value="<?=$swf_src?>?inajax=1&appid=1&input=1c1b2jTXsCBd3X1qu%2FiOwg6q2UyuZTYzqnrL9unhxnkKfxxWlZS4BDWOv5bYYI0cyK6EtAmtqyWk2R273Qh1nneFb8LZXmkcIIWPeuLGXQpXkDHDTV1f%2FXM&agent=94cd9520d77c95ddf7527aa4b52c5a3e&ucapi=<?=$api_src?>&avatartype=virtual&uploadSize=2048" />
                <param name="menu" value="false" />
                <embed src="<?=$swf_src?>?inajax=1&appid=1&input=1c1b2jTXsCBd3X1qu%2FiOwg6q2UyuZTYzqnrL9unhxnkKfxxWlZS4BDWOv5bYYI0cyK6EtAmtqyWk2R273Qh1nneFb8LZXmkcIIWPeuLGXQpXkDHDTV1f%2FXM&agent=94cd9520d77c95ddf7527aa4b52c5a3e&ucapi=<?=$api_src?>&avatartype=virtual&uploadSize=2048" quality="high" bgcolor="#ffffff" width="450" height="253" name="mycamera" align="middle" allowscriptaccess="always" allowfullscreen="false" scale="exactfit"  wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
              </object>
          </div>
          <div class="user-info-box">
            <h5>头像预览</h5>
            <div class="user-info"> <img src="<?=$headerimg?>" alt="暂无图片" id="userlogo"/></div>
          </div>
        </div>
        <!-- // ui-form end -->
      </div>
      <!-- // ui-box End -->
    </div>
    <!-- // i-cnt End -->
  </div>
  <!-- // maxBox End -->
</div>
<script>var curcookie=parseInt(0);function flushavater(){var x=getCookie('avater');if(x>curcookie){curcookie=x;$("#userlogo").attr('src',$("#userlogo").attr('src')+"&r="+Math.random())}}function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return parseInt(unescape(document.cookie.substring(c_start,c_end)))}}return 0}var a=setInterval('flushavater()',1000);
</script>
<!-- // wrap End -->
<? include_once "temp/footer.php"; ?>
</body>
</html>