Example #1
0
function getlatestvisitor()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr;
    $pagesize = 4;
    //note 获取删除提交的变量
    $delvisitor = MooGetGPC('delvisitor', 'string');
    $delvisitorid = MooGetGPC('delvisitorid', 'array');
    //note 删除提交的数据
    if ($delvisitor && count($delvisitorid)) {
        for ($i = 0; $i < count($delvisitorid); $i++) {
            $result = $_MooClass['MooMySQL']->getOne("SELECT `who_del` FROM `" . $dbTablePre . "service_visitor` WHERE `vid`=" . $delvisitorid[$i], true);
            if ($result['who_del'] != 0) {
                $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_visitor WHERE vid = '{$delvisitorid[$i]}'");
            } else {
                $_MooClass['MooMySQL']->query("UPDATE `" . $dbTablePre . "service_visitor` SET `who_del`=2 WHERE `vid`=" . $delvisitorid[$i]);
            }
        }
        MooMessage("删除成功", 'index.php?n=service&h=mindme', '05');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delvisitor && !count($delvisitorid)) {
        MooMessage('请选择要删除选项', 'index.php?n=service&h=mindme', '01');
        exit;
    }
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    //note 获得第几页
    $page = empty($_GET['page']) ? '1' : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    //note 多少个人访问统计总数
    $ret_c = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2");
    $total = $ret_c['c'];
    if ($total > 200) {
        $total = 200;
    }
    //更改最近留意我的人最我显示200个
    $tomeArr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND who_del !=1");
    $tome = $tomeArr['count(*)'];
    //note 查询出谁访问过我相关信息
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_visitor WHERE  uid >0 and visitorid = '{$userid}' AND who_del !=2 order by visitortime desc LIMIT {$start},{$pagesize}");
        $visitors = array();
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $vistor = array();
            $send_user1 = leer_send_user1($v['uid']);
            $send_user2 = leer_send_user2($v['uid']);
            $vistor['l'] = $v;
            $vistor['l']['visitortime'] = $vistor['l']['visitortime'] ? $vistor['l']['visitortime'] : time();
            $vistor['s'] = $send_user1;
            $vistor['t'] = $send_user2;
            $visitors[$k] = $vistor;
        }
    }
    require MooTemplate('public/service_visitor_latestvisitor', 'module');
}
Example #2
0
File: leer.php Project: noikiy/zays
function getmyleers()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    //note 处理回复秋波
    $repeatleer = MooGetGPC('repeatleer', 'string');
    $repeatleerid = MooGetGPC('repeatleerid', 'integer');
    if ($repeatleer && $repeatleerid) {
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '{$repeatleer}' WHERE senduid = '{$repeatleerid}' AND receiveuid = '{$userid}' ");
        header("location:index.php?n=service&h=leer");
    }
    //note 处理委婉拒绝秋波
    $refuseleer = MooGetGPC('refuseleer', 'string');
    $refuseleerid = MooGetGPC('refuseleerid', 'integer');
    if ($refuseleer && $refuseleerid) {
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '2' WHERE senduid = '{$refuseleerid}' AND receiveuid = '{$userid}' ");
        header("location:index.php?n=service&h=leer");
    }
    //note 获取删除提交的变量
    $delleer = MooGetGPC('delleer', 'string');
    $delleerid = MooGetGPC('delleerid', 'array');
    //note 删除提交的数据
    if ($delleer && count($delleerid)) {
        $time = time();
        foreach ($delleerid as $v) {
            //$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_leer WHERE lid = '$v'");
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET receive_del=1,receive_deltime='{$time}',receivenum = '0' WHERE lid = '{$v}'");
        }
        MooMessage("秋波删除成功", 'index.php?n=service&h=leer');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delleer && !count($delleerid)) {
        MooMessage('请选择要删除的秋波', 'index.php?n=service&h=leer', '01');
        exit;
    }
    //分页
    $page_per = 4;
    $page_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $page_url = preg_replace("/(&page=\\d+)/", "", $page_url);
    $page_now = MooGetGPC('page', 'integer', 'G');
    $temp = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_leer WHERE receiveuid  = '{$userid}' and receive_del=0");
    $item_num = $temp['num'];
    $page_num = ceil($item_num / $page_per);
    if ($page_now > $page_num) {
        $page_now = $page_num;
    }
    if ($page_now < 1) {
        $page_now = 1;
    }
    //读数据
    $start = ($page_now - 1) * $page_per;
    $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0  ORDER BY receivetime desc LIMIT {$start},{$page_per}");
    $leers = array();
    foreach ($results as $k => $v) {
        $send_user1 = array();
        $send_user2 = array();
        $send_user1 = leer_send_user1($v['senduid']);
        $send_user2 = leer_send_user2($v['senduid']);
        $leers[$k]['l'] = $v;
        $leers[$k]['s'] = $send_user1;
        $leers[$k]['t'] = $send_user2;
    }
    //note 已收到的总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when receivenum>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0");
    $receive_num = empty($temp['num']) ? 0 : $temp['num'];
    //note 已发送的总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when num>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_leer WHERE senduid = '{$userid}' and send_del=0 ");
    //AND send_del = 0 AND is_server=0
    $send_num = empty($temp['num']) ? 0 : $temp['num'];
    require MooTemplate('public/service_leer_getmyleers', 'module');
}
Example #3
0
function whoaddme()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    //note 获取删除提交的变量
    $delfriend = MooGetGPC('delfriend', 'string', 'P');
    $delfriendid = MooGetGPC('delfriendid', 'array', 'P');
    //note 删除提交的数据
    if ($delfriend) {
        $ids = implode(',', $delfriendid);
        //foreach($delfriendid as $v) {
        $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_friend WHERE fid  in  ({$ids})");
        //}
        MooMessage("删除意中人成功", 'index.php?n=service&h=liker', '05');
    }
    $pagesize = 4;
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    //note 获得第几页
    $page = empty($_GET['page']) ? 1 : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    //note 查出谁加我为意中人的总数
    $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_friend WHERE friendid = '{$userid}'");
    $total = $ret_count['c'];
    $total2Arr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_friend WHERE uid = '{$userid}'");
    $total2 = $total2Arr['count(*)'];
    //note
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_friend WHERE friendid = '{$userid}' order by sendtime desc LIMIT {$start},{$pagesize}");
        $friends = array();
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $friend = array();
            $send_user1 = leer_send_user1($v['uid']);
            $send_user2 = leer_send_user2($v['uid']);
            $friend['l'] = $v;
            $friend['s'] = $send_user1;
            $friend['t'] = $send_user2;
            $friends[$k] = $friend;
        }
    }
    require MooTemplate('public/service_friend_whoaddmylist', 'module');
}
Example #4
0
File: rose.php Project: noikiy/zays
function get_receive_rose()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    //note 获取删除提交的变量
    $delrose = MooGetGPC('delrose', 'string', 'POST');
    $delroseid = MooGetGPC('delroseid', 'string', 'POST');
    //note 删除提交的数据
    if ($delrose && count($delroseid)) {
        $ids = "'" . implode("','", $delroseid) . "'";
        $time = time();
        $_MooClass['MooMySQL']->query("UPDATE  {$dbTablePre}service_rose SET receive_del=1,receive_deltime='{$time}', receivenum = 0 WHERE rid  IN ( {$ids} )");
        MooMessage("鲜花删除成功", 'index.php?n=service&h=gift&t=igetrose', '05');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delrose && !count($delroseid)) {
        MooMessage('请选择要删除的鲜花', 'index.php?n=service&h=gift&t=igetrose', '01');
        exit;
    }
    //分页
    $page_per = 4;
    $page_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $page_url = preg_replace("/(&page=\\d+)/", "", $page_url);
    $page_now = MooGetGPC('page', 'integer', 'G');
    $temp = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_rose WHERE receiveuid  = '{$userid}' and send_del=0", true);
    $item_num = $temp['num'];
    $page_num = ceil($item_num / $page_per);
    if ($page_now > $page_num) {
        $page_now = $page_num;
    }
    if ($page_now < 1) {
        $page_now = 1;
    }
    $start = ($page_now - 1) * $page_per;
    $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$userid}' and receive_del=0 ORDER BY receivetime desc LIMIT {$start},{$page_per}");
    $roses = array();
    foreach ($results as $k => $v) {
        $send_user1 = array();
        $send_user2 = array();
        $rose = array();
        $send_user1 = leer_send_user1($v['senduid']);
        $send_user2 = leer_send_user2($v['senduid']);
        $rose['l'] = $v;
        $rose['s'] = $send_user1;
        $rose['t'] = $send_user2;
        $roses[$k] = $rose;
    }
    //note 已收到的玫瑰总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when receivenum>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_rose WHERE receiveuid = '{$userid}' and receive_del=0");
    $receive_num = empty($temp['num']) ? 0 : $temp['num'];
    //note 已发送的玫瑰总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when num>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_rose WHERE senduid = '{$userid}' and send_del=0");
    $send_num = empty($temp['num']) ? 0 : $temp['num'];
    require MooTemplate('public/service_rose_getreceiverose', 'module');
}
			<?php 
if ($total2 == 0) {
    ?>
              <div class="norequest">
              您现在还没有发送任何查看身份证请求
              <p>立即 <a href="?n=search">搜索TA</a>,发送自己的查看请求吧</p>
              </div>
           <?php 
} else {
    ?>
		   <?php 
    foreach ((array) $request_list as $request) {
        ?>
      	   <?php 
        $send_user1 = leer_send_user1($request['uid']);
        $send_user2 = leer_send_user2($request['uid']);
        ?>
				<ul class="service-liker-list">
					<li><input type="checkbox" name="delsms[]" value="<?php 
        echo $request['id'];
        ?>
"/></li>
					<li>
						<div class="r-service-img">
						<?php 
        if (!empty($send_user1['city_star'])) {
            ?>
<a class="citystar2"><img src="module/service/templates/default/images/citystar.gif" /></a>
			  		<?php 
        }
        ?>
Example #6
0
function getcontactme()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    $pagesize = 4;
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    $currenturl2 = preg_replace("/(&page2=\\d+)/", "", $currenturl2);
    $currenturl2 = preg_replace("/(&page3=\\d+)/", "", $currenturl2);
    //note ---------------------等待回应的请求
    //note 获得第几页
    $page = empty($_GET['page']) ? 1 : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    $ret = $_MooClass['MooMySQL']->getAll("SELECT stat,count(*) as c FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}'  and receive_del=0 and send_del=0 group by stat");
    $total = 0;
    $total2 = 0;
    $total3 = 0;
    foreach ($ret as $v) {
        switch ($v['stat']) {
            case 1:
                $total = $v['c'];
                break;
            case 2:
                $total2 = $v['c'];
                break;
            case 3:
                $total3 = $v['c'];
                break;
        }
    }
    //note 查询等待回应的请求
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = 1 and receive_del=0 and send_del=0  order by sendtime desc LIMIT {$start},{$pagesize}");
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $contact = array();
            $send_user1 = leer_send_user1($v['other_contact_you']);
            $send_user2 = leer_send_user2($v['other_contact_you']);
            $contact['l'] = $v;
            $contact['s'] = $send_user1;
            $contact['t'] = $send_user2;
            $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容';
            $contacts[$k] = $contact;
        }
    }
    $page2 = empty($_GET['page2']) ? 1 : $_GET['page2'];
    $start2 = ($page2 - 1) * $pagesize;
    if ($total2) {
        $results2 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}'  AND stat = 2 and receive_del=0 and send_del=0 order by sendtime desc  LIMIT {$start2},{$pagesize}");
        foreach ($results2 as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $contact = array();
            $send_user1 = leer_send_user1($v['other_contact_you']);
            $send_user2 = leer_send_user2($v['other_contact_you']);
            $contact['l'] = $v;
            $contact['s'] = $send_user1;
            $contact['t'] = $send_user2;
            $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容';
            $contacts2[$k] = $contact;
        }
    }
    $page3 = empty($_GET['page3']) ? 1 : $_GET['page3'];
    $start3 = ($page3 - 1) * $pagesize;
    if ($total3) {
        $results3 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = 3 and receive_del=0 and send_del=0 order by sendtime desc LIMIT {$start3},{$pagesize}");
        foreach ($results3 as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $contact = array();
            $send_user1 = leer_send_user1($v['other_contact_you']);
            $send_user2 = leer_send_user2($v['other_contact_you']);
            $contact['l'] = $v;
            $contact['s'] = $send_user1;
            $contact['t'] = $send_user2;
            $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容';
            $contacts3[$k] = $contact;
        }
    }
    require MooTemplate('public/service_contact_getcontactme', 'module');
}