Exemple #1
0
    }
}
//￁ᆰᅬ슈ᅧ￁ᅬ
$space['profile_contact'] = 0;
foreach (array('mobile', 'qq', 'msn') as $value) {
    if ($space[$value]) {
        $space['profile_contact'] = 1;
    }
}
//ᄏ�위
$space['star'] = getstar($space['experience']);
//￈ᆬᄉ￴ᄍ ̄ᄌ₩
$_SGLOBAL['ad'] = array();
$_GET['view'] = 'me';
$_TPL['css'] = 'space';
$dept = isDepartment($space['uid']);
$ntags = getntags($space[uid], 'index', 0);
include_once template("space_index");
//ᄒᄎ틔ᅤᅤᅢ
function show_credit()
{
    global $_SGLOBAL, $space;
    $showcredit = getcount('show', array('uid' => $space['uid']), 'credit');
    if ($showcredit > 0) {
        if ($showcredit == 1) {
            //ᅬᅡᄚ￱ᅪ뛹
            notification_add($space['uid'], 'show', cplang('note_show_out'));
        }
        $_SGLOBAL['db']->query("UPDATE " . tname('show') . " SET credit=credit-1 WHERE uid='{$space['uid']}' AND credit>0");
    }
}
Exemple #2
0
function IHomeServiceCreateComplain($params = NULL)
{
    global $_SGLOBAL;
    if ($params['uid']) {
        if ($params['uid'] <= 0) {
            $errorMsg = array("errorNo" => "4002", "content" => "the format of parameter is not correct. the id must be a positive interger.");
            return json_encode($errorMsg);
        } else {
            $sql = "select name,username from " . tname('space') . " where uid = " . $params['uid'];
            $query = $_SGLOBAL['db']->query($sql);
            if ($row = $_SGLOBAL['db']->fetch_array($query)) {
                if ($row['name']) {
                    $params['uname'] = $row['name'];
                } else {
                    $params['uname'] = $row['username'];
                }
            } else {
                $errorMsg = array("errorNo" => "500", "content" => "the uid is not exist");
                return json_encode($errorMsg);
            }
        }
    } else {
        $errorMsg = array("errorNo" => "4001", "content" => "lack the neccessary parameter uid.the uid is not exist or the uid is not a positive interger.");
        return json_encode($errorMsg);
    }
    // 忽略department_id_list
    if (!$params['content']) {
        $errorMsg = array("errorNo" => "4001", "content" => "lack the neccessary parameter message.the message is not exist or the message is empty.");
        return json_encode($errorMsg);
    }
    if ($params['device'] && !in_array($params['device'], array('web', 'wechat', 'mobile'))) {
        $errorMsg = array("errorNo" => "4002", "content" => "the format of parameter is not correct. the parameter device is out of range.");
        return json_encode($errorMsg);
    }
    $UserIds = array();
    $mood = 0;
    $params['status'] = 'init';
    $params['reply_count'] = 0;
    $params['timestamp'] = time();
    $params['department_list'] = array();
    $params['operation_list'] = array();
    $params['reply_list'] = array();
    preg_match("/\\[em\\:(\\d+)\\:\\]/s", $params['content'], $ms);
    $mood = empty($ms[1]) ? 0 : intval($ms[1]);
    $message = rawurldecode(getstr($params['content'], 1000, 1, 1, 1, 2));
    preg_match_all("/[@](.*)[(]([\\d]+)[)]\\s*/U", $message, $matches, PREG_SET_ORDER);
    # 加上链接
    foreach ($matches as $value) {
        $TmpString = $value[0];
        $TmpName = $value[1];
        $UserId = $value[2];
        $result = $_SGLOBAL['db']->query("select uid,username,name from " . tname('space') . " where uid={$UserId}");
        if ($rs = $_SGLOBAL['db']->fetch_array($result)) {
            $realname = $rs['name'];
            if (empty($realname)) {
                $realname = $rs['username'];
            }
            $params['department_list'][intval($UserId)] = $realname;
            $ValidValue = getAtName($TmpString, $TmpName, $realname);
            $ValidValue = trim($ValidValue);
            $at_friend = "space.php?uid=" . $UserId;
            if ($ValidValue != false) {
                $message = str_replace($ValidValue, "<a href={$at_friend}>@" . $realname . "</a> ", $message);
                if (!in_array($UserId, $UserIds)) {
                    $UserIds[] = $UserId;
                }
            }
        }
    }
    $message = preg_replace("/\\[em:(\\d+):]/is", "<img src=\"image/face/\\1.gif\" class=\"face\">", $message);
    $message = preg_replace("/\\<br.*?\\>/is", ' ', $message);
    $params['content'] = $message;
    $setarr = array('uid' => $params['uid'], 'username' => $params['uname'], 'dateline' => $_SGLOBAL['timestamp'], 'from' => $params['uid'], 'message' => $message, 'mood' => $mood, 'ip' => getonlineip(), 'fromdevice' => 'web');
    if ($params['device']) {
        $setarr['fromdevice'] = $params['device'];
    }
    if ($params['ip']) {
        $setarr['ip'] = $params['ip'];
    }
    $newdoid = inserttable('doing', $setarr, 1);
    @(include_once S_ROOT . './data/data_creditrule.php');
    $isComplain = TRUE;
    /*if($isComplain && ($_SGLOBAL['member']['credit'] < $_SGLOBAL['creditrule']['complain']['credit'])){ # 如果积分不够
          $isComplain = FALSE;
          $note = cplang('note_complain_credit_failed', array("space.php?do=doing&doid=$newdoid"));
          notification_complain_add($_SGLOBAL['supe_uid'], 'complain', $note);
          $complain_msg = 'note_complain_credit_failed';
      }*/
    # 这部分可能会出错
    foreach ($UserIds as $UserId) {
        if ($isComplain) {
            $UserDept = isDepartment($UserId, 1);
            if ($UserDept) {
                $nowtime = time();
                $complain = array('doid' => $newdoid, 'uid' => $params['uid'], 'uname' => $params['uname'], 'atdepartment' => $UserDept['department'], 'atdeptuid' => $UserId, 'from' => $params['uid'], 'atuid' => $UserId, 'atuname' => $UserDept['department'], 'isreply' => 0, 'addtime' => $nowtime, 'dateline' => $nowtime, 'expire' => 0, 'times' => 1, 'issendmsg' => 0, 'message' => $message, 'datatime' => date("Ymd", $nowtime));
                inserttable('complain', $complain, 0);
                $note = cplang('note_complain_buchu', array("space.php?do=complain_item&doid={$newdoid}", date('Y-m-d H:i', $nowtime + 3600 * 24)));
                notification_complain_add($UserId, 'complain', $note);
                $complainOK = TRUE;
            } else {
                $note = cplang('note_doing_at', array("space.php?do=doing&doid={$newdoid}"));
                notification_add($UserId, 'atyou', $note);
            }
        }
    }
    if ($complainOK) {
        $note = cplang('note_complain_user_success', array("space.php?do=complain_item&doid={$newdoid}"));
        notification_complain_add($params['uid'], 'complain', $note);
        $complain_msg = 'note_complain_user_success';
        getreward('complain', 1, $params['uid']);
    }
    if (!$complainOK && $isComplain) {
        if ($UserId == '0000') {
            //系统管理员 虽然并没有什么用
            $note = cplang("您好,您的诉求已发送成功。谢谢您对ihome社区的大力支持!", array("space.php?do=doing&doid={$newdoid}"));
            notification_complain_add($_SGLOBAL['supe_uid'], 'complain', $note);
        } else {
            $note = cplang('note_complain_user_failed', array("space.php?do=doing&doid={$newdoid}"));
            notification_complain_add($_SGLOBAL['supe_uid'], 'complain', $note);
            $complain_msg = 'note_complain_user_failed';
        }
    }
    $feedarr = array('appid' => UC_APPID, 'icon' => 'doing', 'uid' => $params['uid'], 'username' => $params['uname'], 'dateline' => $_SGLOBAL['timestamp'], 'title_template' => cplang('feed_doing_title'), 'title_data' => saddslashes(serialize(sstripslashes(array('message' => $message)))), 'body_template' => '', 'body_data' => '', 'id' => $newdoid, 'idtype' => 'doid', 'fromdevice' => 'web', 'ip' => getonlineip());
    if ($params['device']) {
        $feedarr['fromdevice'] = $params['device'];
    }
    if ($params['ip']) {
        $feedarr['ip'] = $params['ip'];
    }
    $feedarr['hash_template'] = md5($feedarr['title_template'] . "\t" . $feedarr['body_template']);
    //ϲºÃhash
    $feedarr['hash_data'] = md5($feedarr['title_template'] . "\t" . $feedarr['title_data'] . "\t" . $feedarr['body_template'] . "\t" . $feedarr['body_data']);
    //ºÏ²¢hash
    $feedid = inserttable('feed', $feedarr, 1);
    updatestat('doing');
    $setarr = array('note' => $message);
    $reward = getreward('doing', 0);
    updatetable('spacefield', $setarr, array('uid' => $params['uid']));
    return json_encode($params);
}
     $note = cplang('note_complain_fuxiaozhang', array($complain_url, date('Y-m-d H:i', $nexttime), $result['atdepartment']));
     notification_complain_add($UpUserArray2['dept_uid'], 'complain', $note);
     $log->debug("complain doid {$result['doid']} send message fuxiaozhang");
 } elseif ($result['times'] == 7 && $nowtime - $result['dateline'] > 7 * 24 * 3600) {
     $up_arr = explode(",", $UserArray['up_uid']);
     $UpUserArray = isDepartment($up_arr[0], 0);
     if (empty($UpUserArray)) {
         continue;
     }
     $up_arr = explode(",", $UpUserArray['up_uid']);
     $UpUserArray2 = isDepartment($up_arr[0], 0);
     if (empty($UpUserArray2)) {
         continue;
     }
     $up_arr = explode(",", $UpUserArray2['up_uid']);
     $UpUserArray3 = isDepartment($up_arr[0], 0);
     if (empty($UpUserArray3)) {
         continue;
     }
     addNeedSend($result, $UpUserArray3['dept_uid'], $nexttime, "条诉求未处理,请您安排处理.", $UpUserArray3, array($result['atuid'] => $UserArray['mobile'] . ',1', $UpUserArray['dept_uid'] => $UpUserArray['mobile'] . ',3', $UpUserArray2['dept_uid'] => $UpUserArray2['mobile'] . ',7'), 10);
     updatetable("complain", array("issendmsg" => 1, "times" => 10), array("id" => $result['id']));
     $note = cplang("note_complain_user", array($complain_url, $result['atdepartment'], '校长'));
     notification_complain_add($result['uid'], 'complain', $note);
     $note = cplang("note_complain_buchu3", array($complain_url, date('Y-m-d H:i', $nexttime)));
     notification_complain_add($UserArray['dept_uid'], 'complain', $note);
     $note = cplang('note_complain_chuzhang2', array($complain_url, date('Y-m-d H:i', $nexttime)));
     notification_complain_add($UpUserArray['dept_uid'], 'complain', $note);
     $note = cplang('note_complain_fuxiaozhang1', array($complain_url, date('Y-m-d H:i', $nexttime), $result['atdepartment']));
     notification_complain_add($UpUserArray2['dept_uid'], 'complain', $note);
     $note = cplang('note_complain_xiaozhang', array($complain_url, date('Y-m-d H:i', $nexttime), $result['atdepartment']));
     notification_complain_add($UpUserArray3['dept_uid'], 'complain', $note);
Exemple #4
0
 $nowtime = time();
 if ($isComplain) {
     $complainOK = FALSE;
 }
 //»ý·ÖµÍÓÚ»ý·Ö¹æÔòÖÐÉèÖõÄÊýֵʱ,½ûÖ¹·¢ÆðËßÇó,½«ËßÇóתΪÆÕͨ¼Ç¼
 @(include_once S_ROOT . './data/data_creditrule.php');
 if ($isComplain && $_SGLOBAL['member']['credit'] < $_SGLOBAL['creditrule']['complain']['credit']) {
     $isComplain = FALSE;
     $note = cplang('note_complain_credit_failed', array("space.php?do=doing&doid={$newdoid}"));
     notification_complain_add($_SGLOBAL['supe_uid'], 'complain', $note);
     $complain_msg = 'note_complain_credit_failed';
 }
 foreach ($UserIds as $UserId) {
     if ($isComplain) {
         //¸ù¾Ý@µ½µÄÓû§ID,²éѯ¸ÃÓû§ÊÇ·ñΪ²¿ÃÅ
         $UserDept = isDepartment($UserId, 1);
         if ($UserDept) {
             $nowtime = time();
             $complain = array('doid' => $newdoid, 'uid' => $_SGLOBAL['supe_uid'], 'uname' => $_SGLOBAL['supe_username'], 'atdepartment' => $UserDept['department'], 'atdeptuid' => $UserId, 'from' => $_SGLOBAL['supe_uid'], 'atuid' => $UserId, 'atuname' => $UserDept['department'], 'isreply' => 0, 'addtime' => $nowtime, 'dateline' => $nowtime, 'expire' => 0, 'times' => 1, 'issendmsg' => 0, 'message' => $message, 'datatime' => date("Ymd", $nowtime));
             inserttable('complain', $complain, 0);
             //֪ͨ±»@µÄ²¿ÃÅ,ÓÐÓû§Í¶Ëß
             $note = cplang('note_complain_buchu', array("space.php?do=complain_item&doid={$newdoid}", date('Y-m-d H:i', $nowtime + 3600 * 24)));
             notification_complain_add($UserId, 'complain', $note);
             $complainOK = TRUE;
         } else {
             //֪ͨ±»@µÄÓû§
             $note = cplang('note_doing_at', array("space.php?do=doing&doid={$newdoid}"));
             notification_add($UserId, 'atyou', $note);
         }
     } else {
         //֪ͨ±»@µÄÓû§
Exemple #5
0
}
$tags = array();
$tag_index = 0;
while ($value = $_SGLOBAL['db']->fetch_array($tags_query)) {
    $tags[$tag_index] = $value;
    $tag_index++;
}
if ($_GET['view'] == 'complain') {
    if ($_GET['type'] == 'all') {
        $ComplainQuery = $_SGLOBAL['db']->query("SELECT doid FROM " . tname('complain') . " USE INDEX(doid) GROUP BY doid");
        $doids = '';
        while ($ComplainDoids = $_SGLOBAL['db']->fetch_array($ComplainQuery)) {
            $doids .= $ComplainDoids['doid'] . ',';
        }
    } else {
        $UserUidArray = isDepartment($space['uid'], 1);
        if ($UserUidArray) {
            $ComplainQuery = $_SGLOBAL['db']->query("SELECT doid FROM " . tname('complain') . " USE INDEX(doid) WHERE atuid='{$UserUidArray['dept_uid']}'");
            $doids = '';
            while ($ComplainDoids = $_SGLOBAL['db']->fetch_array($ComplainQuery)) {
                $doids .= $ComplainDoids['doid'] . ',';
            }
        } else {
            $ComplainQuery = $_SGLOBAL['db']->query("SELECT doid FROM " . tname('complain') . " USE INDEX(doid) WHERE uid='{$_SGLOBAL['supe_uid']}' GROUP BY doid");
            $doids = '';
            while ($ComplainDoids = $_SGLOBAL['db']->fetch_array($ComplainQuery)) {
                $doids .= $ComplainDoids['doid'] . ',';
            }
        }
        if (!$doids) {
            /*
Exemple #6
0
        }
        $atfriends[$count++] = array('uid' => $value['uid'], 'namequery' => $value['name'] . ' ' . Pinyin($value['name'], 1) . ' ' . $value['uid'], 'name' => $value['name'], 'avatar' => '');
    }
    $friends = json_encode($atfriends);
    $friends = preg_replace("#\\\\u([0-9a-f]+)#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $friends);
    $f = fopen($friendurl_w, "w");
    fwrite($f, $friends);
    fclose($f);
}
$querygroupid = $_SGLOBAL['db']->query("SELECT groupid,pptype,caninvite FROM " . tname('space') . " WHERE uid=" . $_SGLOBAL['supe_uid']);
$groupid = $_SGLOBAL['db']->fetch_array($querygroupid);
//include_once("space_status_feed.html");
if ($_SGLOBAL['supe_uid']) {
    $querygroupid = $_SGLOBAL['db']->query("SELECT pptype,caninvite FROM " . tname('space') . " WHERE uid=" . $_SGLOBAL['supe_uid']);
    $valuegroupid = $_SGLOBAL['db']->fetch_array($querygroupid);
    if (isDepartment($_SGLOBAL['supe_uid'], 0) || $valuegroupid['pptype'] == 1 || $valuegroupid['pptype'] == 2 || $valuegroupid['caninvite'] == 1) {
        //显示邀请功能
        $_SCONFIG['closeinvite'] = 1;
    } else {
        //不显示邀请功能
        $_SCONFIG['closeinvite'] = 0;
    }
}
//exit;
//是否公开
if (empty($isinvite) && empty($_SCONFIG['networkpublic'])) {
    checklogin();
    //需要登录
}
//showmessage($uid);
//获取空间
function getOfficial($uid, $officials = '')
{
    //STATIC $officials = '';
    $UserInfo = isDepartment($uid, 0);
    $officials .= $UserInfo['dept_uid'] . ',';
    if ($UserInfo['dept_uid'] == $UserInfo['up_uid']) {
        return $officials;
    }
    $officials = getOfficial($UserInfo['up_uid'], $officials);
    return $officials;
}
Exemple #8
0
         $setarr['emailcheck'] = 0;
     } elseif ($newemail != $space['email']) {
         //之前已经验证
         if ($space['emailcheck']) {
             //发送邮件验证,不修改邮箱
             $setarr['newemail'] = $newemail;
         } else {
             //修改邮箱
             $setarr['email'] = $newemail;
         }
         emailcheck_send($space['uid'], $newemail);
     }
 }
 updatetable('spacefield', $setarr, array('uid' => $_SGLOBAL['supe_uid']));
 //如果是部处,则对应更新powerlevel表中的手机号
 if (isDepartment($_SGLOBAL['supe_uid'], 1)) {
     $mobile = $setarr['mobile'];
     $aeskeyMobile = getAESKey('Mobile');
     $mobile = M_encode($mobile, $aeskeyMobile);
     $powerlevel['mobile'] = $mobile;
     updatetable('powerlevel', $powerlevel, array('dept_uid' => $_SGLOBAL['supe_uid']));
     //更新缓存中的powerlevel.php文件
     updatePowerlevelFile();
 }
 //隐私
 $inserts = array();
 foreach ($_POST['friend'] as $key => $value) {
     $value = intval($value);
     $inserts[] = "('contact','{$key}','{$space['uid']}','{$value}')";
 }
 if ($inserts) {
Exemple #9
0
<?php

/*
	cp_namecard.php is get the ajax post, and then return the userbaseinfo.
	writen by xuxing@ihome. 2013-4-27
*/
if (!defined('iBUAA')) {
    exit('Access Denied');
}
//$op = empty($_GET['op'])?0:intval($_GET['op']);
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
$result = getuserbaseinfo($uid);
if ($uid != $space['uid']) {
    $result['common'] = getcommonfriendlist($space['uid'], $uid, 1);
}
$dept = isDepartment($uid);
if ($dept) {
    $result['duty'] = $dept['depduty'];
}
$result = json_encode($result);
$result = preg_replace("#\\\\u([0-9a-f]+)#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;