Exemplo n.º 1
0
        $content = $back['content'];
        $uids = $back['uids'];
        $content = daddslashes($content);
        $content = $content . $morecontent;
        $db->query("INSERT INTO et_content (user_id,user_name,user_nickname,user_head,content_body,posttime,privacy) VALUES ('{$my['user_id']}','{$my['user_name']}','{$my['nickname']}','{$my['user_head']}','{$content}','{$addtime}','{$privacy}')");
        $insertid = mysql_insert_id();
        if ($insertid) {
            for ($i = 0; $i < count($uids); $i++) {
                $db->query("UPDATE et_users SET replyread = replyread+1 WHERE user_id='{$uids[$i]}'");
                $db->query("INSERT INTO et_replyto (user_id,content_id) VALUES ('{$uids[$i]}','{$insertid}')");
            }
            if ($privacy == 0) {
                $db->query("UPDATE et_users SET msg_num=msg_num+1,lastcontent='{$content}',lastconttime='{$addtime}' WHERE user_id='{$my['user_id']}'");
            }
        }
        echo loadoneli($insertid, $my[user_name], $my[user_id], $my[nickname], $my[user_head], ubb($content), '刚才', '网页', 0, 0, $privacy, 0, 0, 0, $privacy);
        exit;
    } else {
        echo 'error';
        exit;
    }
}
//上传照片
if ($action == 'uploadphoto') {
    tologin();
    if ($_FILES['photo']['name']) {
        include ET_ROOT . "/include/uploadpic.func.php";
        $ptname = date(YmdHms);
        $upname = UploadImage("photo", 1, 200, 0, ET_ROOT . "/attachments/photo/user_" . $my[user_id] . "/", ET_ROOT . "/attachments/photo/user_" . $my[user_id] . "/", $ptname, $ptname . "_thumb");
        $phototitle = $phototitle ? $phototitle : "{$ptname}";
        $suffix = getfiletype($upname);
Exemplo n.º 2
0
function loadindex($content)
{
    if (count($content) != 0) {
        foreach ($content as $key => $val) {
            echo loadoneli($val[content_id], $val[user_name], $val[user_id], $val[user_nickname], $val[user_head], $val[content_body], $val[posttime], $val[type], $val[zftimes], $val[replytimes], 0, $val[status_id], $val[status_uname], $val[status_unickname]);
        }
    }
}
if (!defined('IN_ET')) {
    exit('Access Denied');
}
//好友数据
$frilist = array();
$getfri = $db->query("SELECT fid_jieshou FROM et_friend WHERE fid_fasong='{$my['user_id']}'");
while ($data = $db->fetch_array($getfri)) {
    $frilist[] = $data['fid_jieshou'];
}
array_push($frilist, $my[user_id]);
$frilist = implode(",", $frilist);
if ($act == 'getupdate') {
    $lastid = $_GET['lastid'];
    if ($lastid > 0) {
        $query = $db->query("SELECT * FROM et_content WHERE user_id in ({$frilist}) && privacy=0 && replyshow=1 && content_id>'{$lastid}'");
        while ($data = $db->fetch_array($query)) {
            $fricontentnew .= loadoneli($data[content_id], $data[user_name], $data[user_id], $data[user_nickname], $data[user_head], ubb($data[content_body]), timeop($data[posttime]), $data[type], $data[zftimes], $data[replytimes], 0, $data[status_id], $data[status_uname], $data[status_unickname]);
        }
    }
    echo $fricontentnew;
    exit;
}
//读取信息
$fcontnum = 0;
$start = ($page - 1) * $home_num;
$query = $db->query("SELECT * FROM et_content WHERE user_id in ({$frilist}) && privacy=0 && replyshow=1 ORDER BY content_id DESC LIMIT {$start},{$home_num}");
while ($data = $db->fetch_array($query)) {
    $fcontnum++;
    $fricontent[] = array('content_id' => $data['content_id'], 'user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_nickname' => $data['user_nickname'], 'user_head' => $data['user_head'], 'content_body' => ubb($data['content_body']), 'posttime' => timeop($data['posttime']), 'type' => $data['type'], 'status_id' => $data['status_id'], 'status_uname' => $data['status_uname'], 'status_unickname' => $data['status_unickname'], 'replytimes' => $data['replytimes'], 'zftimes' => $data['zftimes'], 'fav_id' => $data['fav_id']);
}
include $template->getfile('hm_friend.htm');