?> cm</span><?php if (!empty($m['constellation'])) { ?> <span>星座:<?php echo $m['constellation']; ?> </span><?php } ?> </p> <?php if (!empty($m['want_content'])) { ?> <p class="fs_12"><?php echo do_things($m['want_content'], $m['sex']); ?> <a class="f_r underline" onclick="try_meet(<?php echo $m['uid']; ?> ,2,'<?php echo $m['username']; ?> ','<?php echo $m['want_content']; ?> ')" >约<?php echo ui_sex($m['sex']); ?> </a></p><?php }
public function user_ping() { if (!checkpost()) { exit('error'); } if (!$GLOBALS['islogin']) { exit('{"stat":9, "errno":"未登录", "error":"未登录}'); } $msgModel = D('Msg'); $u = $msgModel->check_contact('uid', 'uid, username, sex, default_pic, score_impress, score_impress_num, hometown_prov, hometown_city'); $ping_score = round(floatval($_POST['score']), 1); $ping_score = min(max(1, $ping_score), 10); $score = ($ping_score - $u['score_impress']) / ($u['score_impress_num'] + 1) + $u['score_impress']; $score = round($score, 1); //visit表中记录打分 $visit = M('visit'); $data['uid'] = $GLOBALS['i']['uid']; $data['visit_uid'] = $u['uid']; $data['score_impress'] = $ping_score; $data['add_time'] = time(); $hot = $visit->where("uid={$GLOBALS['i']['uid']} AND visit_uid={$u['uid']}")->find(); if ($hot) { $visit->where("id={$hot['id']}")->save($data); } else { $visit->add($data); } //member表和member_field记录变化 $member = M('member'); $edit['score_impress'] = $score; $edit['score_impress_num'] = array('exp', "score_impress_num+1"); $member->where("uid={$u['uid']}")->save($edit); //echo $member->getLastSql(); $member_field = M('member_field'); $data1['new_receive_score'] = array('exp', 'new_receive_score+1'); $data1['receive_score_num'] = array('exp', 'receive_score_num+1'); $member_field->where("uid={$u['uid']}")->save($data1); //调整打分的指针 $offset = $GLOBALS['i']['user_ping_offset'] + 1; $sex = 3 - $GLOBALS['i']['sex']; $count = $member->where("sex={$sex} AND default_photonum>0 AND group_type>0")->count(); $offset = $offset > $count - 1 ? 0 : $offset; $member->where("uid={$GLOBALS['i']['uid']}")->setField('user_ping_offset', $offset); $rs = $member->field('uid, sex, username, default_pic, photonum, hometown_prov, hometown_city, want_content')->where("sex={$sex} AND default_photonum>0 AND group_type>0")->limit("{$offset}, 2")->select(); $u1 = $rs[0]; $offset = $offset + 11 > $count - 1 ? $offset - $count : $offset; $u2 = $member->field('uid, default_pic, username')->where("sex={$sex} AND default_photonum>0 AND group_type>0")->limit($offset + 11 . ",1")->select(); $u2 = $u2[0]; $u3 = $rs[1]; $accurate = $is_play = ''; if ($ping_score > $score) { $accurate = '谢谢你啊!'; } elseif ($ping_score == $score) { $accurate = '太准了!'; $is_play = 1; } elseif ($ping_score > $score - 0.5) { $accurate = '不错哦!'; } else { $accurate = '欠你钱啊!'; } $do_things = do_things($u1['want_content'], $u1['sex']); $next_ping_user = array("key" => "2Nsk3l", "uid" => $u1['uid'], "sex" => $u1['sex'] + 1, "photo_count" => $u1['photonum'], "face_url" => $GLOBALS['s']['urlupload'] . $u1['default_pic'] . '_240x240.jpg', "nickname" => $u1['username'], "age_show" => getAge($u1['birth_y']) . '岁,', "location_country" => '中国', "location_prov" => $u1['hometown_prov'], "location_city" => $u1['hometown_city'], "do_things" => $do_things); $end_ping_user = array("uid" => $u2['uid'], "face_url" => $GLOBALS['s']['urlupload'] . $u2['default_pic'] . '_72x72.jpg', "nickname" => $u2['username']); $last_ping_user = array("photo_count" => $u['photonum'], "ta" => ui_sex($u['sex']), "ping_score" => $ping_score, "score" => $score, "home_url" => $GLOBALS['s']['urldomain'] . "/{$u['uid']}", "face_url" => $GLOBALS['s']['urlupload'] . $u['default_pic'] . '_72x72.jpg', "nickname" => $u['username'], "age_show" => getAge($u['birth_y']) . '岁,', "location_country" => '中国', "location_prov" => $u['hometown_prov'], "location_city" => $u['hometown_city'], "ico_button" => "", "is_play" => $is_play, "accurate" => $accurate); $arr = array("next_ping_user" => $next_ping_user, "end_ping_user" => $end_ping_user, "last_ping_user" => $last_ping_user, "preload_img_url" => $GLOBALS['s']['urlupload'] . $u3['default_pic'] . '_240x240.jpg'); echo json_encode($arr); }
?> 照片)</span>,<?php echo getage(${$userlist}[0]['sex']); ?> 岁,<?php echo ${$userlist}[0]['college']; ?> <a href="<?php echo $urldomain; ?> /<?php echo $userlist[0]['uid']; ?> " target="_blank">详细资料</a> </p> <p class="clear"><?php echo do_things($userlist[0]['want_content'], $userlist[0]['sex']); ?> </p> </div> </div> <div class="box_t_r"> <div class="" id="play_flash"> <object width="0px" height="0px" align="middle" id="perfectie" name="perfectie" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"> <param value="always" name="allowScriptAccess"> <param value="transparent" name="wmode"> <param value="<?php echo $urlstatic2; ?> /flash/perfect.swf" name="movie"> <param value="high" name="quality"> <embed src="<?php