<div class="toptel"></div> <?php if ($GLOBALS['MooUid']) { ?> <div class="topmsg">欢迎您 <span class="f-ed0a91"><?php echo MooCutstr($GLOBALS["user_arr"]['nickname'], 8, ''); ?> </span> ,您是今天第 <span class="f-000-a"><?php echo MooLogin(); ?> </span> 位登陆用户</div> <div class="topmsg">您的ID是 <span class="f-ed0a91"><?php echo $GLOBALS["user_arr"]['uid']; ?> </span> <a href="index.php?n=service&h=message" class="f-000-a">最新邮件</a>(<span class="f-ed0a91"><?php echo $message_total = header_show_total($GLOBALS["user_arr"]['uid']); ?> </span>) <a href="index.php?n=material&h=password" class="f-000-a">修改密码</a> <a href="./index.php?n=index&h=logout" class="f-000-a">安全退出</a></div> <?php } else { ?> <div class="topmsg2">您好,欢迎来到真爱一生网![<a href="index.php?n=login" class="f-000-a">请登陆</a>] [<a href="index.php?n=register" class="f-000-a">免费注册</a>]</div> <?php } ?> </div> <div class="topnav"> <ul class="navbar"> <li><a href="index.html">首 页</a><b></b></li> <li><a href="service.html">我的真爱</a><b></b></li> <li><a href="search.html">真爱寻友</a><b></b></li>
function public_showmsg($uid) { header("Expires: Mon, 26 Jul 1970 05:00:00 GMT"); header("Cache-Control:no-cache, must-revalidate"); header("Pragma:no-cache"); $serverid = Moo_is_kefu(); global $_MooClass, $dbTablePre, $timestamp, $memcached, $user_arr; // 会员ID // $uid = MooGetGPC('uid','integer'); // 初始化显示数据 $str = ''; $n = 0; // 未读消息条数 // $msg = $_MooClass['MooMySQL']->getOne("select count(*) from // {$dbTablePre}services where s_uid={$uid} and s_status='0' and flag = '1' // and s_uid_del='0'"); // $msg_count = $msg['count(*)']; $msg_count = header_show_total($uid); // 前台显示 if ($msg_count) { // 3个发件人的ID $user_msg_id = $_MooClass['MooMySQL']->getAll("select distinct s_fromid from {$dbTablePre}services where s_uid={$uid} and s_status='0' and s_uid_del='0' order by s_time desc limit 3"); $inidArr = array(); foreach ($user_msg_id as $v) { if ($v['s_fromid'] == 0) { $from_kefu = 1; } else { $inidArr[] = $v['s_fromid']; } } $inid = implode(',', $inidArr); // 提示信息 $user_msg = array(); if (MOOPHP_ALLOW_FASTDB) { foreach ($inidArr as $arruid) { $user_msg[] = MooFastdbGet('members_search', 'uid', $arruid); } } else { $user_msg = $_MooClass['MooMySQL']->getAll("select uid,nickname,s_cid from {$dbTablePre}members_search where uid in ({$inid})"); } $str .= '<p>您有<a href="index.php?n=service&h=message">' . $msg_count . '条新消息</a></p>'; foreach ($user_msg as $vv) { // 设置不同链接 if ($vv) { // $nickname=$vv['nickname2']?$vv['nickname2']:$vv['nickname']; $nickname = $vv['nickname']; if ($nickname) { $str .= '<p>查看<a href="index.php?n=service&h=message&t=membermessage">' . $nickname . '给您发的新邮件</a></p>'; } else { $str .= '<p>查看<a href="index.php?n=service&h=message&t=membermessage">会员ID ' . $vv['uid'] . '给您发的新邮件</a></p>'; } } } if ($from_kefu) { $str .= '<p>查看<a href="index.php?n=service&h=message&t=hlmessage">真爱一生网发新邮件</a></p>'; } $n++; } // 提示被哪些用户访问主页 if ($user_arr['regdate'] < time() - 7200) { // 注册时间超过2个小时的会员 if ($user_arr['showinformation']) { // 信息公开的会员 $visitor_msg = public_showmsg_two($uid); // 删除对应的浏览会员 if ($uid && $visitor_msg['uid']) { $sql = "DELETE FROM web_service_browser where browserid='{$uid}' and uid={$visitor_msg['uid']}"; $_MooClass['MooMySQL']->query($sql); } } // $nickname=$visitor_msg['nickname2']?$visitor_msg['nickname2']:$visitor_msg['nickname']; if (!empty($visitor_msg)) { $nickname = $visitor_msg['nickname']; $nc = $nickname ? $nickname : 'ID:' . $visitor_msg['uid']; // 伪造查看共多少秒,存memcached $makevisit_sec = $memcached->get('makevisit' . $visitor_msg['uid'] . '_' . $uid); if ($makevisit_sec) { $sec = $makevisit_sec + 1; $memcached->set('makevisit' . $visitor_msg['uid'] . '_' . $uid, $sec); } else { $sec = rand(30, 300); $memcached->set('makevisit' . $visitor_msg['uid'] . '_' . $uid, $sec); } //$img = MooGetphoto ( $visitor_msg ['uid'], 'page' ); // 显示访问者的头像 $img = MooGetphoto($visitor_msg['uid'], 'mid'); // 显示访问者的头像 $mid_img = MooGetphoto($visitor_msg['uid'], 'mid'); if (MOOPHP_ALLOW_FASTDB && $visitor_msg['uid']) { $msg2 = MooFastdbGet('members_search', 'uid', $visitor_msg['uid']); $msg_b = MooFastdbGet('members_base', 'uid', $visitor_msg['uid']); $msg2 = array_merge($msg2, $msg_b); } elseif ($visitor_msg['uid']) { $sql = "SELECT * FROM {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where s.uid='{$visitor_msg['uid']}'"; $msg2 = $_MooClass['MooMySQL']->query($sql); } if ($sec) { if ($sec < 60) { $showsec = $sec . "秒"; } if ($sec == 60) { $showsec = "一分钟"; } if ($sec > 60) { $secOne = intval($sec / 60); $secTwo = $sec - $secOne * 60; $mod = $sec % 60; if (empty($mod)) { $showsec = $secOne . '分钟'; } else { $showsec = $secOne . '分钟' . $secTwo . '秒'; } } } $photo = null; if ($msg2['mainimg'] && $visitor_msg['uid']) { $photo = "<a target='_blank' href='index.php?n=space&h=viewpro&uid=" . $visitor_msg['uid'] . "'><img src=" . $img . " class='u-photo'></a>"; if ($user_arr['s_cid'] < 40) { $str .= '<div class="c-line"></div>' . $photo . '<p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>也许适合您哦,</p><p>为了您的幸福,请把握缘分。</p><p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">关注Ta的资料</a></p><div style="clear:both"></div>'; } else { $str .= '<div class="c-line"></div>' . $photo . '<p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>关注了您,</p><p>查看了' . $showsec . ',</p><p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">关注Ta的资料</a></p><div style="clear:both"></div>'; } } elseif ($visitor_msg['uid']) { if ($user_arr['s_cid'] < 40) { $str .= '<p>' . $photo . '<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>关注了您,查看了' . $showsec . ',<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">查看Ta的资料</a></p>'; } else { $str .= '<p>' . $photo . '<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>也许适合您哦,为了您的幸福,请把握缘分。<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">关注Ta的资料</a></p>'; } } $n++; } } // 提示当前会员有未读在线聊天消息 $chat_msg = public_showmsg_three($uid); //print_r($chat_msg); $new_message = ''; if ($chat_msg) { //$num = count($chat_msg); //$t_arr = array_keys($chat_msg); //普通会员可以接受来自高级会员的聊天信息 $str .= '<p>您有<a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=chat&h=inline_chat&c=1&fid=' . $user_arr['uid'] . '&tid=' . $chat_msg['fromid'] . '&sid=' . $serverid . '\',\'' . $user_arr['uid'] . '_' . $chat_msg['fromid'] . '\',\'scrollbars=no,resizable=no,status=no,width=497, height=440\');setTimeout(function(){public_showmsg(1);},1000);void(0);">新的在线消息</a></p>'; $new_message = '|new_message'; $n++; } // 委托真爱一生联系TA消息提醒,十五天后自动消失 $expires_time = time() - 3600 * 24 * 15; $sql_contact = "SELECT count(*) as yc_count,other_contact_you,you_contact_other FROM {$dbTablePre}service_contact WHERE is_read=0 and you_contact_other = '{$uid}' AND syscheck = '1' AND stat = '1' AND sendtime > " . $expires_time; $ret = $_MooClass['MooMySQL']->getOne($sql_contact, true); if ($uid == $ret['you_contact_other']) { $you_contact_other_msg_count = $ret['yc_count']; if ($you_contact_other_msg_count > 0) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret['other_contact_you'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=2,uid=' . $uid . ')">ID为' . $ret['other_contact_you'] . '</a>委托真爱一生联系您</p>'; $n++; } } // 秋波发送提醒,十五天后自动消失 $sql_leer = "SELECT receiveuid,senduid FROM web_service_leer WHERE is_read=0 and receiveuid = '" . $uid . "' AND receivetime > " . $expires_time; $ret_leer = $_MooClass['MooMySQL']->getOne($sql_leer); if (!empty($ret_leer) && $uid == $ret_leer['receiveuid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_leer['senduid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=0,uid=' . $uid . ')">ID为' . $ret_leer['senduid'] . '</a>向您送出了一个秋波</p>'; $n++; } // 鲜花发送提醒 $sql_rose = "SELECT receiveuid,senduid,num FROM web_service_rose WHERE is_read=0 and receiveuid = '" . $uid . "' AND receivetime > " . $expires_time; $ret_rose = $_MooClass['MooMySQL']->getOne($sql_rose); if (!empty($ret_rose) && $uid == $ret_rose['receiveuid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_rose['senduid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=1,uid=' . $uid . ')">ID为' . $ret_rose['senduid'] . '</a>向您送出了鲜花</p>'; $n++; } // 意中人提醒 $sql_liker = "SELECT * FROM web_service_friend WHERE is_read=0 and friendid = '" . $uid . "' AND sendtime > " . $expires_time; $ret_liker = $_MooClass['MooMySQL']->getAll($sql_liker); $count_liker = count($ret_liker); if ($count_liker >= 1) { if ($count_liker > 1 && $_MooCookie['uid_liker'] == $ret_liker[0]['uid']) { MooSetCookie('uid_liker', $ret_liker[0]['uid'], 86400); shuffle($ret_liker); $rand = rand(1, $count_liker); $ret_liker['friendid'] = $ret_liker[$rand]['friendid']; $ret_liker['uid'] = $ret_liker[$rand]['uid']; } elseif (isset($ret_liker[0])) { MooSetCookie('uid_liker', $ret_liker[0]['uid'], 86400); $ret_liker['friendid'] = $ret_liker[0]['friendid']; $ret_liker['uid'] = $ret_liker[0]['uid']; } if (empty($ret_liker['friendid'])) { $ret_liker['friendid'] = 0; } if ($uid == $ret_liker['friendid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_liker['uid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=3,uid=' . $uid . ')">ID为' . $ret_liker['uid'] . '</a>将您添加为意中人了</p>'; $n++; } } // 输出 if ($str) { $str .= "|最新提醒({$n}){$new_message}"; echo $str; } else { // $n = 0; $n = ''; echo $n; } }
MooMessage('没有这个页面', 'index.php', '01'); } //伪造游客用户数据 if (empty($user_arr)) { $user_arr['uid'] = 0; $user_arr['gender'] = 0; $user_arr['birthyear'] = date("Y") - 26; //默认26岁 $user_arr['province'] = 0; $user_arr['city'] = 0; } //时间相关 if ($uid) { //更新COOKIE 成活时间 MooUpateCookie($uid); $new_email_num = header_show_total($uid); // 判断是不是已经升高级付款 $sql = "select id from {$dbTablePre}payment_new where status = 1 and pay_type = 2 and pay_service = 1 and uid = {$uid}"; $h_pay = $_MooClass['MooMySQL']->getOne($sql, true); } //获取皮肤名称 $style_uid = MooGetGPC('uid', 'integer', 'G'); $skiname = MooGetGPC('skiname', 'string', 'G'); //新邮件数 if (!empty($style_uid) && $style_uid != $uid) { //采用他人的样式 $style_user_arr = array(); if (MooMembersData($style_uid, 'is_lock') == 1) { $style_user_arr = MooMembersData($style_uid); } } else {
function public_showmsg($uid) { header("Expires: Mon, 26 Jul 1970 05:00:00 GMT"); header("Cache-Control:no-cache, must-revalidate"); header("Pragma:no-cache"); global $_MooClass, $dbTablePre, $timestamp, $memcached, $user_arr; //会员ID //$uid = MooGetGPC('uid','integer'); //初始化显示数据 $str = ''; $n = 0; //未读消息条数 //$msg = $_MooClass['MooMySQL']->getOne("select count(*) from {$dbTablePre}services where s_uid={$uid} and s_status='0' and flag = '1' and s_uid_del='0'"); //$msg_count = $msg['count(*)']; $msg_count = header_show_total($uid); //前台显示 if ($msg_count) { //3个发件人的ID $user_msg_id = $_MooClass['MooMySQL']->getAll("select distinct s_fromid from {$dbTablePre}services where s_uid={$uid} and s_status='0' and s_uid_del='0' order by s_time desc limit 3"); $inidArr = array(); foreach ($user_msg_id as $v) { if ($v['s_fromid'] == 0) { $from_kefu = 1; } else { $inidArr[] = $v['s_fromid']; } } $inid = implode(',', $inidArr); //提示信息 $user_msg = array(); if (MOOPHP_ALLOW_FASTDB) { foreach ($inidArr as $arruid) { $user_msg[] = MooFastdbGet('members_search', 'uid', $arruid); } } else { $user_msg = $_MooClass['MooMySQL']->getAll("select uid,nickname,s_cid from {$dbTablePre}members_search where uid in ({$inid})"); } $str .= '<p>您有<a href="index.php?n=service&h=message">' . $msg_count . '条新消息</a></p>'; foreach ($user_msg as $vv) { //设置不同链接 if ($vv) { //$nickname=$vv['nickname2']?$vv['nickname2']:$vv['nickname']; $nickname = $vv['nickname']; if ($nickname) { $str .= '<p>查看<a href="index.php?n=service&h=message&t=membermessage">' . $nickname . '给您发的新邮件</a></p>'; } else { $str .= '<p>查看<a href="index.php?n=service&h=message&t=membermessage">会员ID ' . $vv['uid'] . '给您发的新邮件</a></p>'; } } } if ($from_kefu) { $str .= '<p>查看<a href="index.php?n=service&h=message&t=hlmessage">真爱一生网发新邮件</a></p>'; } $n++; } //提示被哪些用户访问主页 if ($user_arr['regdate'] < time() - 7200) { if ($user_arr['showinformation']) { $visitor_msg = public_showmsg_two($uid); } //$nickname=$visitor_msg['nickname2']?$visitor_msg['nickname2']:$visitor_msg['nickname']; $nickname = $visitor_msg['nickname']; $nc = $nickname ? $nickname : 'ID:' . $visitor_msg['uid']; if ($visitor_msg) { //伪造查看共多少秒,存memcached $makevisit_sec = $memcached->get('makevisit' . $visitor_msg['uid'] . '_' . $uid); if ($makevisit_sec) { $sec = $makevisit_sec; } else { $sec = rand(100, 200); $memcached->set('makevisit' . $visitor_msg['uid'] . '_' . $uid, $sec, 60); } $img = MooGetphoto($visitor_msg['uid'], 'page'); //显示访问者的头像 $mid_img = MooGetphoto($visitor_msg['uid'], 'mid'); if ($mid_img && !$img) { $image = MooAutoLoad('MooImage'); $pic_dir = substr($mid_img, 0, 28); $new_file_name = $visitor_msg['uid'] * 3 . "_page.jpg"; $image->config(array('thumbDir' => $pic_dir, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $new_file_name, 'waterMarkMinWidth' => '82', 'waterMarkMinHeight' => '114', 'waterMarkStatus' => 9)); $image->thumb(49, 62, $mid_img); $img = $page_img; } if ($img) { $photo = "<a target='_blank' href='index.php?n=space&h=viewpro&uid=" . $visitor_msg['uid'] . "'><img src=" . $img . " class='u-photo'></a>"; $str .= '<div class="c-line"></div><p>您的资料正在被:</p>' . $photo . '<p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>查看,</p><p>已查看' . $sec . '秒,</p><p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">查看Ta的资料</a></p><div style="clear:both"></div>'; } else { $str .= '<p>您的资料正在被' . $photo . '<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>查看,已查看' . $sec . '秒,<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">查看Ta的资料</a></p>'; } $n++; } } //提示当前会员有未读在线聊天消息 $chat_msg = public_showmsg_three($uid); $new_message = ''; if ($chat_msg) { $str .= '<p>您有<a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=service&h=chat&chatorid=' . $chat_msg['s_fromid'] . '\', \'_blank\', \'height=500, width=700, toolbar =no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no\')">新的在线消息</a></p>'; $new_message = '|new_message'; $n++; } //委托真爱一生联系TA消息提醒,十五天后自动消失 $expires_time = time() - 3600 * 24 * 15; $sql_contact = "SELECT count(*) as yc_count,other_contact_you,you_contact_other FROM {$dbTablePre}service_contact WHERE is_read=0 and you_contact_other = '{$uid}' AND syscheck = '1' AND stat = '1' AND sendtime > " . $expires_time; $ret = $_MooClass['MooMySQL']->getOne($sql_contact); if ($uid == $ret['you_contact_other']) { $you_contact_other_msg_count = $ret['yc_count']; if ($you_contact_other_msg_count > 0) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret['other_contact_you'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=2,uid=' . $uid . ')">ID为' . $ret['other_contact_you'] . '</a>委托真爱一生联系您</p>'; $n++; } } //秋波发送提醒,十五天后自动消失 $sql_leer = "SELECT receiveuid,senduid FROM web_service_leer WHERE is_read=0 and receiveuid = '" . $uid . "' AND receivetime > " . $expires_time; $ret_leer = $_MooClass['MooMySQL']->getOne($sql_leer); if ($uid == $ret_leer['receiveuid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_leer['senduid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=0,uid=' . $uid . ')">ID为' . $ret_leer['senduid'] . '</a>向您送出了一个秋波</p>'; $n++; } //鲜花发送提醒 $sql_rose = "SELECT receiveuid,senduid,num FROM web_service_rose WHERE is_read=0 and receiveuid = '" . $uid . "' AND receivetime > " . $expires_time; $ret_rose = $_MooClass['MooMySQL']->getOne($sql_rose); if ($uid == $ret_rose['receiveuid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_rose['senduid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=1,uid=' . $uid . ')">ID为' . $ret_rose['senduid'] . '</a>向您送出了鲜花</p>'; $n++; } //意中人提醒 $sql_liker = "SELECT * FROM web_service_friend WHERE is_read=0 and friendid = '" . $uid . "' AND sendtime > " . $expires_time; $ret_liker = $_MooClass['MooMySQL']->getOne($sql_liker); if ($uid == $ret_liker['friendid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_liker['uid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=3,uid=' . $uid . ')">ID为' . $ret_liker['uid'] . '</a>将您添加为意中人了</p>'; $n++; } //输出 if ($str) { $str .= "|最新提醒({$n}){$new_message}"; echo $str; } else { echo $n; } }