Exemplo n.º 1
0
function explodetopic($content)
{
    global $db;
    $topic = preg_replace("/(.*?)#([^#].*?)#(.*?)/i", "\$2|", $content);
    $tem = explode("|", $topic);
    $length = count($tem);
    if ($length > 1) {
        for ($i = 0; $i < $length - 1; $i++) {
            if ($tem[$i]) {
                if (StrLenW($topic) > 20) {
                    $tem[$i] = getsubstrutf8($tem[$i], 0, 20, false);
                }
                if (getcount('et_topic', array('topicname' => $tem[$i])) == 0) {
                    $db->query("INSERT INTO et_topic (topicname,topictimes) VALUES ('{$tem[$i]}','1')");
                } else {
                    $db->query("UPDATE et_topic SET topictimes=topictimes+1 WHERE topicname='{$tem[$i]}'");
                }
            }
        }
    }
}
<?php

$API = 1;
include '../common.inc.php';
if ($action == 'sendreply') {
    if ($_POST['sid'] && $_POST['suid'] && $_POST['scont'] && $my['user_id']) {
        $query = $db->query("SELECT privacy FROM et_content WHERE content_id='{$_POST['sid']}'");
        $data = $db->fetch_array($query);
        if ($data[privacy] == 1) {
            echo '此消息是私密消息不能回复';
            exit;
        }
        $content = getsubstrutf8($content, 0, 140, false);
        $content = replace(trim($_POST['scont']));
        //词语过滤
        $back = atsend($content);
        //@
        $content = $back['content'];
        $uids = $back['uids'];
        array_push($uids, $_POST['suid']);
        $uids = array_unique($uids);
        $content = daddslashes($content);
        $isshownew = $_POST['rck'] == "true" ? 1 : 0;
        //作为新的信息
        $contdata = getReply($_POST[sid]);
        if (!$content) {
            echo '你还没有填写发表的内容!';
            exit;
        }
        $db->query("INSERT INTO et_content (user_id,user_name,user_nickname,user_head,content_body,posttime,status_id,status_uname,status_unickname,replyshow) VALUES ('{$my['user_id']}','{$my['user_name']}','{$my['nickname']}','{$my['user_head']}','{$content}','{$addtime}','{$_POST['sid']}','{$contdata['user_name']}','{$contdata['user_nickname']}','{$isshownew}')");
        $insertid = mysql_insert_id();
<?php

if (!defined('IN_ET')) {
    exit('Access Denied');
}
tologin();
$page = $_GET['page'] ? intval($_GET['page']) : 1;
$pm = isset($_GET['pm']) && $_GET['pm'] != "undefined" ? $_GET['pm'] : "my";
//我的信息
$my['old'] = date(Y) - getsubstrutf8($my['birthday'], 0, 4);
if ($my['home_city'] == "选择省份 选择城市" || $my['home_city'] == "" || $my['home_city'] == " ") {
    $my['home_city'] = "";
} else {
    $my['home_city'] = "<a href='{$webaddr}/op.php?op=finder&sname=&act=search&homesf=" . $tem1[0] . "&homecity=" . $tem1[1] . "'>" . $tem1[0] . " " . $tem1[1] . "</a>";
}
if ($my['live_city'] == "选择省份 选择城市" || $my['live_city'] == "" || $my['live_city'] == " ") {
    $my['live_city'] = "";
} else {
    $my['live_city'] = "<a href='{$webaddr}/op.php?op=finder&sname=&act=search&livesf=" . $tem2[0] . "&livecity=" . $tem2[1] . "'>" . $tem2[0] . " " . $tem2[1] . "</a>";
}
if ($act == "delmsg") {
    tologin();
    $db->query("DELETE FROM et_messages WHERE (senduid ='{$my['user_id']}' || sendtouid ='{$my['user_id']}') && message_id='{$_GET['mid']}'");
    echo "success";
    exit;
}
$i = 0;
$start = ($page - 1) * $home_num;
if ($pm == "my") {
    $sql = "SELECT * FROM et_messages WHERE sendtouid='{$my['user_id']}' order by message_id desc limit {$start},{$home_num}";
} elseif ($pm == "send") {
Exemplo n.º 4
0
            $db->query("INSERT INTO et_messages (senduid,sendname,sendnickname,sendhead,sendtouid,sendtoname,sendtonickname,messagebody,sendtime) VALUES ('{$my['user_id']}','{$my['user_name']}','{$my['nickname']}','{$my['user_head']}','{$data['user_id']}','{$data['user_name']}','{$data['user_nickname']}','{$msg}','{$addtime}')");
            $db->query("UPDATE et_users SET priread = priread+1 WHERE user_id='{$data['user_id']}'");
        }
        $db->query("UPDATE et_users SET msg_num=msg_num+1,lastcontent='{$content}',lastconttime='{$addtime}' WHERE user_id='{$my['user_id']}'");
        $db->query("UPDATE et_content SET zftimes = zftimes+1 WHERE content_id='{$cid}'");
        echo 'success';
        exit;
    } else {
        echo 'error';
        exit;
    }
}
//以下是 发送 代码
if ($action == 'msgsend') {
    tologin();
    $content = getsubstrutf8($_POST["content"], 0, 140, false);
    $morecontent = trim($_POST["morecontent"]);
    //不计入140字符之内
    $privacy = $_POST["privacy"];
    if (!empty($content) && $content != '#请在这里输入自定义话题#') {
        $content = replace($content);
        //词语过滤
        explodetopic($content);
        //专题
        $back = atsend($content);
        //@
        $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}')");
Exemplo n.º 5
0
<?php

$API = 1;
include '../common.inc.php';
$username = $_GET['user_name'];
$user = user_info("user_name='{$username}'");
if (!$user) {
    echo "不存在该用户";
    exit;
}
header("Content-type: application/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "  <rss version=\"2.0\">\n" . "  <channel>\n" . "  <title>{$user[nickname]} - 贫嘴</title>\n" . "  <link>{$webaddr}/{$user[user_name]}</link>\n" . "  <description>贫嘴 - 看看 {$user[nickname]} 在做什么…</description>\n" . "  <webMaster></webMaster>\n" . "  <language>zh-cn</language>\n" . "  <image>\n" . "  <link>{$webaddr}</link>\n" . "  <url>{$webaddr}/images/default/logo.png</url>\n" . "  <title>贫嘴</title>\n" . "  </image>\n";
$query = $db->query("SELECT * FROM et_content WHERE user_name='{$username}' && privacy=0 && replyshow=1 ORDER BY content_id DESC LIMIT 20");
while ($data = $db->fetch_array($query)) {
    $contents = clean_html($data['content_body']);
    $contents = ubbreplace($contents);
    $title = getsubstrutf8($contents, 0, 30, true);
    echo "    <item>\n" . "     <title>{$data[user_nickname]}: {$title}</title>\n" . "     <description><![CDATA[{$data['user_nickname']}: {$contents}]]></description>\n" . "     <pubDate>" . date("r", $data['posttime']) . "</pubDate>\n" . "     <link>{$webaddr}/op/view/{$data['content_id']}</link>\n" . "   </item>\n";
}
echo "  </channel>\n" . "  </rss>";
Exemplo n.º 6
0
    if ($nickname && $nickname != $my[nickname]) {
        $query = $db->query("select user_id from et_users where nickname='{$nickname}'");
        if (StrLenW($nickname) <= 20 && StrLenW($nickname) >= 4 && !$db->fetch_array($query)) {
            $para = "nickname = '{$nickname}'," . $para;
        } else {
            dsetcookie('setok', 'setting2');
            header("location:{$webaddr}/op/setting");
            exit;
        }
    }
    if ($para) {
        $para = trim($para);
        if (getsubstrutf8($para, 0, 1, false) == ',') {
            $para = getsubstrutf8($para, 1, null, false);
        }
        if (getsubstrutf8($para, -1, 1, false) == ',') {
            $para = getsubstrutf8($para, 0, -1, false);
        }
        $db->query("UPDATE et_users SET {$para} WHERE user_id='{$my['user_id']}'");
        dsetcookie('setok', 'setting3');
        header("location:{$webaddr}/op/setting");
        exit;
    }
}
//模板和Foot
$menu = "setting";
$web_name3 = "基本信息设置";
$sqlnum = $db->querynum;
$mtime = explode(' ', microtime());
$loadtime = $mtime[1] + $mtime[0] - $starttime;
include $template->getfile('op_setting.htm');
if (!defined('IN_ET')) {
    exit('Access Denied');
}
if (!$user['user_id']) {
    showmessage("<div class='showmag'><p>您还没有登录,不能执行此操作!</p><p><a href='index.php?op=login'>现在登陆</a></p></div>");
    exit;
}
if ($action == "upload") {
    $phototitle = daddslashes(trim($_POST['phototitle']));
    if (StrLenW($phototitle) > 20) {
        showmessage("<div class='showmag'><p>相片名称要不能大于20字符!</p><p><a href='index.php?op=sendphoto'>重新上传</a></p></div>");
        exit;
    }
    if ($_FILES['photo']['name']) {
        include "include/uploadpic.func.php";
        $ptname = date(YmdHms);
        $upname = UploadImage("photo", 1, 200, 0, "../attachments/photo/user_" . $user[user_id] . "/", "../attachments/photo/user_" . $user[user_id] . "/", $ptname, $ptname . "_thumb");
        $phototitle = $phototitle ? $phototitle : "{$ptname}";
        $suffix = getsubstrutf8($upname, -3, 3, false);
        $content = "{$phototitle}<br/>[img link=" . $webaddr . "/attachments/photo/user_" . $user[user_id] . "/" . $ptname . "." . $suffix . "]" . $webaddr . "/attachments/photo/user_" . $user[user_id] . "/" . $upname . "[/img]";
        $db->query("INSERT INTO et_content (user_id,user_name,user_nickname,user_head,content_body,posttime,type,conttype) VALUES ('{$user['user_id']}','{$user['user_name']}','{$user['nickname']}','{$user['user_head']}','{$content}','{$addtime}','手机','photo')");
        showmessage("<div class='showmag'><p>照片上传成功了!</p><p><a href='{$refer}'>返回上一页</a></p></div>");
        exit;
    } else {
        showmessage("<div class='showmag'><p>照片上传失败!</p><p><a href='index.php?op=sendphoto'>重新上传</a></p></div>");
        exit;
    }
}
wapheader();
echo "<h2>发照片</h2>" . "<form enctype='multipart/form-data' action='index.php?op=sendphoto' method='post'>" . "建议照片大小不超过500K。照片文件名不要包含中文。如果照片太大,建议压缩后再上传。" . "<p>相片名称:<input type='text' name='phototitle' value='我分享了照片'/></p>" . "<p>选择照片:<input type='file' name='photo'/></p>" . "<p><input type='hidden' name='action' value='upload' /><input type='submit' value='上传' /></p>" . "</form>";