Example #1
1
 /**
  * Handle adding of keywords to database when entry is modified.
  *
  * @param array $params contains 'itemid'
  */
 function event_PreUpdateItem(&$params)
 {
     $itemid = $params['itemid'];
     $newkeywords = explode(',', postvar('plug_keywords_keywords'));
     foreach ($newkeywords as $id => $keyword) {
         $newkeywords[$id] = trim($keyword);
     }
     $oldkeywords = $this->_selectKeywords($itemid);
     $addkeywords = array_diff($newkeywords, $oldkeywords);
     $deletekeywords = array_diff($oldkeywords, $newkeywords);
     foreach ($addkeywords as $keyword) {
         $this->_addKeyword($itemid, $keyword);
     }
     foreach ($deletekeywords as $keyword) {
         $this->_deleteKeyword($itemid, $keyword);
     }
 }
Example #2
0
 public function index()
 {
     if (!checkpost()) {
         exit('error');
     }
     if (!$GLOBALS['islogin']) {
         exit('{"stat":9, "errno":"未登录", "error":"未登录}');
     }
     $receiver_uid = postvar('uid', 1);
     $msgModel = D('Msg');
     if (!$msgModel->check_link($receiver_uid)) {
         $msgModel->exitError();
     }
     $u = $msgModel->check_contact('uid', 'sex, uid');
     $msgModel->send_1($u['uid'], 0);
     echo '{"stat":9,"error":"打招呼成功","msg":"打招呼成功"}';
 }
Example #3
0
 public function answer()
 {
     if (!$GLOBALS['islogin']) {
         exit;
     }
     if (!checkpost()) {
         exit;
     }
     $qid = postvar('qid', 1);
     $uid = $GLOBALS['i']['uid'];
     $wenwen_question = M('wenwen_question');
     $wq = $wenwen_question->where("qid={$qid}")->find();
     if (!$wq) {
         exit('not found');
     }
     $answer = M("wenwen_answer");
     $data['qid'] = $qid;
     $data['content'] = postvar('content');
     $data['rsync_tsina'] = postvar('rsync_tsina', 1);
     $data['uid'] = $GLOBALS['i']['uid'];
     $data['username'] = $GLOBALS['i']['username'];
     $date['add_time'] = time();
     $condition['qid'] = $qid;
     $condition['uid'] = $GLOBALS['i']['uid'];
     $a = $answer->where($condition)->find();
     if ($a) {
         $id = $a['id'];
         $answer->where($condition)->save($data);
     } else {
         $id = $answer->where($condition)->add($data);
         $member_field = M('member_field');
         $data1['wenwen_num'] = array('exp', 'wenwen_num+1');
         $member_field->where("uid={$uid}")->save($data1);
         //echo $member_field->getLastSql();
     }
     $body = array('id' => $id, 'qid' => $qid, 'wenwen_question' => $wq['wenwen_question'], 'wenwen_answer' => $data['content']);
     $body_arr[$id] = $body;
     //feed_publish(6, $body_arr);
     $feedModel = D('Feed');
     $feedModel->feed_publish(6, $body_arr);
     //echo $answer->getLastSql();
     echo 0;
 }
 public function other()
 {
     if (checkpost()) {
         $act = getvar('act', array('b', 'c', 'd'));
         $uid = postvar('uid', 1);
         $content = postvar('content');
         if ($act == 'b') {
             $member = M('member');
             $member->where("uid={$uid}")->setField('group_type', 2);
         } elseif ($act == 'c') {
             $photo = M('photo');
             $photo->where("uid={$uid} AND gid=0")->setField('is_pass', 0);
         } elseif ($act == 'd') {
             $msgModel = D('Msg');
             $msgModel->sys_notifi($uid, $content);
         }
         exit(1);
     }
     $this->display();
 }
Example #5
0
 private function _load_feed($type = 'more')
 {
     if (!checkpost()) {
         exit;
     }
     $face_size = postvar('face_size', 1);
     $page = postvar('page', 1);
     $is_last = postvar('is_last', 1);
     $last_id = postvar('last_id', 1);
     $this->_assign_feed($face_size, $type, $page, $is_last, $last_id);
     $feed = $this->fetch('feed');
     //if(!$feed) exit();
     $arr = array('errno' => 200, 'more' => $feed, 'page' => $page, 'is_new_dt' => 0);
     if ($type == 'more') {
         $arr['is_last'] = 0;
         $arr['last_id'] = 555484;
         $arr['show_member_tips'] = 0;
         $arr['show_member_tips_ssesion'] = NULL;
     }
     echo json_encode($arr);
 }
Example #6
0
 public function forbid()
 {
     if (!$GLOBALS['islogin']) {
         exit;
     }
     if (!checkpost()) {
         exit;
     }
     $forbid_uid = postvar('forbid_uid', 1);
     $data['uid'] = $GLOBALS['i']['uid'];
     $data['forbid_uid'] = $forbid_uid;
     $link = M('link');
     $rs = $link->where($data)->find();
     if ($rs) {
         echo '-2';
     } else {
         $status = postvar('status', array(1, 2));
         $data['status'] = $status;
         $data['add_time'] = time();
         $link->add($data);
         echo $status == 2 ? 1 : 2;
     }
 }
}
//=== A C T I O N S =================================================
$action = strtolower(getvar('action'));
switch ($action) {
    case 'dump':
        @(include_once 'lib_dump.php');
        $connection = @mysql_connect(XOX_DB_HOST, XOX_DB_USER, XOX_DB_PASS);
        $dumper = new MySQLDump(XOX_DB_NAME, 'dump' . date(YmdHis) . '.sql', false, false);
        $dumper->doDump();
        exit;
    case 'info':
        phpinfo();
        exit;
}
//=== M A I N =======================================================
$sql_query = stripslashes(postvar('SQL', getvar('sql', getvar('SQL', "SHOW TABLES FROM " . XOX_DB_NAME))));
$sql_form = '
        <form method="post" name="frmSQL" action="">
            <textarea name="SQL" rows="7" cols="60" wrap="physical" style="float:left;margin-right:20px;">' . htmlspecialchars($sql_query, ENT_NOQUOTES, 'UTF-8') . '</textarea>
            <input type="submit" value="Ausf&uuml;hren" style="background-color: #F5DEB3">
            <input type="reset" value="Leeren" style="background-color: #Ffeecc" onclick="document.forms[\'frmSQL\'].elements[\'SQL\'].innerHTML=\'\';">
        </form>';
echo "<div id=\"sqlcommander\"><fieldset><legend>SQL-Commandline</legend>{$sql_form}</fieldset>";
/** /
phpinfo();
/**/
$connection_id = 0;
$result = 0;
$error = 0;
$table_list = '';
//sessionvar('table_list');
Example #8
0
 public function send()
 {
     if (!checkpost()) {
         exit('error');
     }
     if (!$GLOBALS['islogin']) {
         exit('{"stat":9, "errno":"未登录", "error":"未登录}');
     }
     $receiver_uid = postvar('receiver_uid', 1);
     $msgModel = D('Msg');
     if (!$msgModel->check_link($receiver_uid)) {
         $msgModel->exitError();
     }
     $u = $msgModel->check_contact('receiver_uid', 'sex, uid');
     $type = postvar('type', 1);
     $action = 'send_' . $type;
     $id = postvar('related', 1);
     $msgModel->{$action}($u['uid'], $id);
     echo '{"stat":0,"error":"\\u53d1\\u9001\\u6210\\u529f","pay_card":0}';
 }
Example #9
0
 public function delete()
 {
     if (!$GLOBALS['islogin']) {
         exit;
     }
     if (!checkpost()) {
         exit;
     }
     $aid = postvar('aid_list', 1);
     $answer = M('answer');
     $answer->where("id={$aid} AND uid={$GLOBALS['i']['uid']}")->delete();
     $member_field = M('member_field');
     $data1['answer_num'] = array('exp', 'answer_num-1');
     $member_field->where("uid={$GLOBALS['i']['uid']}")->save($data1);
     $feedModel = D('Feed');
     $feedModel->feed_delete(4, $aid, $GLOBALS['i']['uid']);
     //echo $answer->getLastSql();
     echo 1;
 }
    $db->query($query);
    $db->next_record();
    doLog(join(', ', getSynset($db->f('super_id'), 3)), uservar('meaning_id'), DEL_SUPER);
    $query = sprintf("UPDATE meanings\n\t\tSET super_id = NULL\n\t\tWHERE id = %d", uservar('meaning_id'));
    $db->query($query);
} else {
    if (uservar('super_id')) {
        # user coming from select_synset.php
        $id = uservar('super_id');
        if (uservar('super_id') == "nothingselected") {
            print T_("Error: You did not select a superordinate conecpt. Please go back and select one of the given options.");
            return;
        } else {
            if (uservar('super_id') == "create") {
                // create a new synset
                $id = addSynset($db, $auth, postvar('new_word'), "", "");
            }
        }
        doLog(join(', ', getSynset($id, 3)), uservar('meaning_id'), ADD_SUPER);
        $query = sprintf("UPDATE meanings\n\t\tSET super_id = %d\n\t\tWHERE id = %d", $id, uservar('meaning_id'));
        $db->query($query);
    } else {
        if (trim(uservar('super_new'))) {
            # remember all form values:
            $url = "select_synset.php?";
            while (list($key, $val) = each($_POST)) {
                $url .= urlencode($key) . "=" . urlencode($val) . "&";
            }
            header("Location: {$url}");
            return;
        }
Example #11
0
 public function api_del_photo_bygroup()
 {
     if (!checkpost()) {
         exit;
     }
     $gid = postvar('gid', 1);
     $photo_group = M("photo_group");
     $photo_group->where("gid={$gid} AND uid={$GLOBALS['i']['uid']}")->delete();
     echo '{"status":1,"msg":""}';
 }
Example #12
0
 public function index()
 {
     if (!$GLOBALS['islogin']) {
         redirect($GLOBALS['s']['urlsite'] . '/member/login');
     }
     $m = $GLOBALS['i'];
     $uid = $m['uid'];
     $college = M("college");
     $list = $college->select();
     //echo $xueyuan->getLastSql();
     $this->assign("list", $list);
     $member = M('member');
     if (checkpost()) {
         $data['college'] = postvar('college');
         $data['hometown_prov'] = postvar('hometown_prov');
         $data['hometown_city'] = postvar('hometown_city');
         $data['birth_y'] = postvar('birth_y', 1);
         $data['birth_m'] = postvar('birth_m', 1);
         $data['birth_d'] = postvar('birth_d', 1);
         $data['height'] = postvar('height', 1);
         $data['constellation'] = postvar('constellation');
         $data['blood'] = postvar('blood');
         $data['stature'] = postvar('stature');
         $data['grade'] = postvar('grade');
         $data['makefriend'] = postvar('makefriend');
         $count = 0;
         if (!empty($data['college'])) {
             $count++;
         }
         if (!empty($data['hometown_prov'])) {
             $count++;
         }
         if (!empty($data['hometown_city'])) {
             $count++;
         }
         if (!empty($data['birth_y'])) {
             $count++;
         }
         if (!empty($data['birth_m'])) {
             $count++;
         }
         if (!empty($data['birth_d'])) {
             $count++;
         }
         if (!empty($data['height'])) {
             $count++;
         }
         if (!empty($data['constellation'])) {
             $count++;
         }
         if (!empty($data['blood'])) {
             $count++;
         }
         if (!empty($data['stature'])) {
             $count++;
         }
         if (!empty($data['grade'])) {
             $count++;
         }
         if (!empty($data['makefriend'])) {
             $count++;
         }
         $data['profile_completed'] = round(floatval($count / 12), 1);
         $member->where("uid={$uid}")->data($data)->save();
         //echo $member->getLastSql();
         echo '{"errno":200,"msg":"修改成功!"}';
         exit;
     }
     $this->assign('m', $m);
     $this->display();
 }
Example #13
0
 public function share_to_qq()
 {
     if (!$GLOBALS['islogin']) {
         exit;
     }
     if (!checkpost()) {
         exit;
     }
     if (empty($GLOBALS['i']['qq_oauth']) || empty($GLOBALS['i']['qquid'])) {
         exit(5);
     }
     $site = 'qq';
     include_once APP_PATH . "/Lib/Extend/apilogin/{$site}.class.php";
     $platform = new $site();
     $content = postvar('content');
     if (!$content) {
         $content = '推荐一个现在很火的网站——大学生恋爱网';
     }
     $pic = $GLOBALS['s']['urlupload'] . '/000face/logo.png';
     if ($GLOBALS['i']['qqshare_timestamp'] == 0) {
         $url = 'http://jianjiandandan.ivu1314.com/?fr=qzone';
     } else {
         $url = 'http://jianjiandandan.ivu1314.com/?fr=qzone' . time();
     }
     $opt = array('access_token' => $GLOBALS['i']['qq_oauth'], 'openid' => $GLOBALS['i']['qquid']);
     $rs = $platform->upload($content, $pic, $opt, $url);
     //dump($rs);
     if ($rs['ret'] == 0 && $GLOBALS['i']['qqshare_timestamp'] + 86400 < time()) {
         $member_field = M('member_field');
         $member_field->where("uid={$GLOBALS['i']['uid']}")->setField('qqshare_timestamp', time());
         $payModel = D('Pay');
         $payModel->edit_pay($GLOBALS['i']['uid'], 'buy', 0.5, '您分享网站到QQ空间获得0.5颗红豆');
     }
 }
Example #14
0
 public function add_remark()
 {
     $remark = postvar('remark');
     $uid = postvar('uid', 1);
     $fav = M('fav');
     $fav->where("uid={$GLOBALS['i']['uid']} AND fav_uid={$uid}")->setField('fav_remark', $remark);
     $array = array("ret" => 1, "uid" => "{$uid}", "remark" => "{$remark}", "show_remark" => "{$remark}", "bt_img" => "/CDN/app/img/ico_write.png");
     echo json_encode($array);
 }
    exit('This script accepts only POST requests');
}
/**
 * Shorthand function for accessing $_POST variables
 */
function postvar($var, $default = null)
{
    return isset($_POST[$var]) ? $_POST[$var] : $default;
}
if (postvar('xpwd') == $XPWD) {
    if (!empty($allowed_track_types) && !in_array(postvar('songtype', -1), $allowed_track_types)) {
        exit('Track type ' . postvar('songtype') . ' not allowed');
    }
    $album_art = postvar('cover');
    // Check if album art exists on update and generate full URL, so we don't have to check it every time the display.php is requested by visitor
    if (!empty($album_art) && file_exists($album_art_PATH . $album_art)) {
        $album_art = $album_art_URL . $album_art;
    } else {
        $album_art = file_exists($album_art_PATH . $album_art_fallback_image) ? $album_art_URL . $album_art_fallback_image : false;
        if (DEBUG) {
            file_put_contents('debug.log', date('Y-m-d H:i:s') . " album art file '{$album_art_PATH}{$album_art}' does not exist. Using fallback image.\n", FILE_APPEND);
        }
    }
    $data_to_save = array('artist' => postvar('artist'), 'title' => postvar('title'), 'album' => postvar('album'), 'songid' => postvar('songid'), 'cover' => $album_art, 'year' => postvar('year'), 'listeners' => postvar('listeners'), 'duration' => postvar('duration'), 'songtype' => postvar('songtype'), 'categoryid' => postvar('catid'), 'station' => postvar('station'), 'slogan' => postvar('slogan'), 'requester' => postvar('requester'), 'reqmessage' => postvar('reqmessage'));
    if (DEBUG) {
        file_put_contents('debug.log', date('Y-m-d H:i:s') . ' data received: ' . print_r($data_to_save, true) . "\n", FILE_APPEND);
    }
    $datatest = serialize($data_to_save);
    file_put_contents($data_file, $datatest);
    echo 'Data successfully saved';
}
Example #16
0
function rr_post_vars()
{
    global $soa, $rr_active_types;
    $rr = array();
    $rr['id'] = (int) postvar('id');
    $rr['active'] = $rr_active_types[gettrinary(postvar('active'))];
    $rr['serial'] = postvar('serial');
    $rr['stamp'] = postvar('stamp');
    $rr['name'] = trim(postvar('name'));
    $rr['ttl'] = gettime(postvar('ttl'));
    $rr['type'] = strtoupper(trim(postvar('type')));
    $rr['aux'] = (int) postvar('aux');
    $rr['data'] = trim(postvar('data'));
    if (!strlen($rr['name'])) {
        $rr['name'] = $soa['origin'];
    }
    return $rr;
}
Example #17
0
{
    list($usec, $sec) = explode(" ", microtime());
    return (double) $usec + (double) $sec;
}
function mydie($msg)
{
    echo "<strong>{$msg}</strong><br />";
    return false;
}
$sql_query = stripslashes(postvar('SQL', getvar('sql', getvar('SQL', "SHOW TABLES FROM " . XOX_DB_NAME))));
// <b><tt>#</tt></b> Kommentiert eine Zeile
// <hr>
// <b><tt>!dateiname</tt></b> Laedt eine lokale SQL-Datei
$sql_form = '
        <form method="post" name="frmSQL" action="">
            <input type="hidden" name="p" value="' . postvar(NAVIGATION_VAR, getvar(NAVIGATION_VAR)) . '" />
            <textarea name="SQL" rows="7" cols="60" wrap="physical" style="float:left;margin-right:20px;">' . htmlspecialchars($sql_query, ENT_NOQUOTES) . '</textarea>
            <input type="submit" value="Ausf&uuml;hren" style="background-color: #F5DEB3">
            <input type="reset" value="Leeren" style="background-color: #Ffeecc" onclick="document.forms[\'frmSQL\'].elements[\'SQL\'].innerHTML=\'\';">
        </form>';
echo "<div id=\"sqlcommander\"><fieldset><legend>SQL-Commandline</legend>{$sql_form}</fieldset>";
/** /
phpinfo();
/**/
$connection_id = 0;
$result = 0;
$error = 0;
$table_list = '';
//sessionvar('table_list');
// connect to server
if ($connect_id = mysql_pconnect(XOX_DB_HOST, XOX_DB_USER, XOX_DB_PASS)) {
Example #18
0
 public function perfect()
 {
     if (!$GLOBALS['islogin']) {
         exit;
     }
     $type = postvar('type', array(1, 2, 3, 4, 5, 6, 7));
     $uid = postvar('uid', 1);
     if ($uid == $GLOBALS['i']['uid']) {
         exit;
     }
     $member = M('member');
     $m = $member->field('uid')->getByUid($uid);
     if (!$m) {
         exit('error');
     }
     $visit = M('visit');
     $v = $visit->field('perfect_' . $type)->where("uid={$GLOBALS['i']['uid']} AND visit_uid={$m['uid']}")->find();
     if (!$v) {
         exit('db error');
     }
     if ($v['perfect_' . $type] + 86400 > time()) {
         exit('{"errno":503,"msg":"\\u8bf7\\u4e0d\\u8981\\u91cd\\u590d\\u9080\\u8bf7\\uff01"}');
     }
     $i = $GLOBALS['i'];
     $str = "<div class=\"invitebox clear\"><div onclick=\"window.open('{$GLOBALS['s']['urlsite']}/{$i['uid']}')\" class=\"fl cur\"><img src=\"{$GLOBALS['s']['urlupload']}{$i['default_pic']}_48x48.jpg\"></div><div class=\"fl invitebox_l\"><p><span class=\"underline f_blue cur\" onclick=\"window.open('{$GLOBALS['s']['urlsite']}/{$i['uid']}')\">{$i['username']}</span>";
     if ($type == 1) {
         $str .= "邀请你上传更多照片。</p><p onclick=\"window.open('{$GLOBALS['s']['urlsite']}/photo/');event.cancelBubble=true\" class=\"font_list\">进入上传照片</p></div></div>";
     } elseif ($type == 2) {
         $str .= "希望看到你更多的小编专访。</p><p onclick=\"window.open('{$GLOBALS['s']['urlsite']}/wenwen/');event.cancelBubble=true\" class=\"font_list\">进入小编专访</p></div></div>";
     } elseif ($type == 3) {
         $str .= "邀请你发布任务。</p><p onclick=\"window.open('{$GLOBALS['s']['urlsite']}/task/');event.cancelBubble=true\" class=\"font_list\">进入师兄帮帮忙</p></div></div>";
     } elseif ($type == 4) {
         $str .= "邀请你完成视频认证。</p><p onclick=\"window.open('{$GLOBALS['s']['urlsite']}/videoauth/');event.cancelBubble=true\" class=\"font_list\">进入视频认证</p></div></div>";
     } elseif ($type == 5) {
         $str .= "邀请你完善更多基本资料。</p><p onclick=\"window.open('{$GLOBALS['s']['urlsite']}/profile/');event.cancelBubble=true\" class=\"font_list\">进入基本资料</p></div></div>";
     } elseif ($type == 6) {
         $str .= "邀请你写两句。</p><p onclick=\"window.open('{$GLOBALS['s']['urlsite']}/diary/');event.cancelBubble=true\" class=\"font_list\">进入写两句</p></div></div>";
     } elseif ($type == 7) {
         $str .= "邀请你参与问问。</p><p onclick=\"window.open('{$GLOBALS['s']['urlsite']}/question/plaza/');event.cancelBubble=true\" class=\"font_list\">进入问问</p></div></div>";
     }
     $msgModel = D('Msg');
     $msgModel->sys_notifi($m['uid'], $str);
     $visit->where("uid={$GLOBALS['i']['uid']} AND visit_uid={$m['uid']}")->setField('perfect_' . $type, time());
     echo '{"errno":200,"msg":"\\u9080\\u8bf7\\u6210\\u529f"}';
 }
Example #19
0
 public function praise()
 {
     if (!$GLOBALS['islogin']) {
         exit;
     }
     if (!checkpost()) {
         exit;
     }
     $did = postvar('diary_id', 1);
     $type = postvar('type', array(0, 1));
     $diary = M('diary');
     $d = $diary->where("did={$did}")->find();
     if (!$d) {
         exit;
     }
     if (strstr($d['praise_uids'], ",{$GLOBALS['i']['uid']},")) {
         exit('{"errno":500, "msg":"\\u60a8\\u5df2\\u7ecf\\u9001\\u8fc7\\u4e86"}');
     }
     $data['praise_' . $type] = array('exp', "praise_{$type}+1");
     $data['praise_uids'] = rtrim($d['praise_uids'], ',') . ",{$GLOBALS['i']['uid']},";
     $diary->where("did={$did}")->save($data);
     //echo $diary->getLastSql();
     $msgModel = D('Msg');
     //$msgModel->comment($d['uid'], 26, $type, $did);
     $str = "<div class=\"textbg f_6\"><p class=\"word_break\">“写两句”:{$d['content']}</p></div>";
     $classifier = $img = '';
     if ($type == 0) {
         $classifier = $GLOBALS['i']['sex'] == 1 ? '朵' : '片';
         $img = $GLOBALS['i']['sex'] == 1 ? 'ico_diay.gif' : 'ico_diay1.gif';
     } else {
         $classifier = '块';
         $img = 'ico_brick.gif';
     }
     $str .= "<p><a target=\"_blank\" href=\"{$GLOBALS['s']['urlsite']}/{$GLOBALS['i']['uid']}\">{$GLOBALS['i']['username']}</a>给了你一{$classifier}<img src=\"{$GLOBALS['s']['urlstatic']}/img/{$img}\" class=\"ico\"></p>";
     $msgModel->sys_notifi($d['uid'], $str);
     echo '{"errno":200, "msg":""}';
 }
Example #20
0
<?php

require __DIR__ . '/../includes/start.php';
$user = R::dispense('user');
$user->username = postvar("username");
$user->password = password_hash(postvar("password"), PASSWORD_BCRYPT);
R::store($user);
$_SESSION['user_id'] = $user->id;
if (postvar("pay")) {
    $_SESSION['pay'] = 1;
}
Example #21
0
 public function reg_active_post()
 {
     if (!checkpost()) {
         exit;
     }
     $msg = '';
     if ($GLOBALS['islogin']) {
         $msg = "top.location.href='/';";
     }
     $member = M('member');
     $username = postvar('username');
     $rs = $member->field('uid')->where("username='******'")->find();
     if ($rs) {
         $msg = "top.upload_fail('用户名已经存在了', 1);";
     }
     if (!$msg) {
         $sex = postvar('sex', array(1, 2));
         //$photoAction = A('Photo');
         //$rs = $photoAction->_api_upload();
         //
         $noPhoto = postvar('noPhoto', 1);
         if (!$noPhoto) {
             $photoAction = A('Photo');
             $rs = $photoAction->_api_upload();
         } else {
             $data['default_pic'] = '/000face/s' . $sex . '.jpg';
         }
         //
         if (!$noPhoto && !is_array($rs)) {
             $msg = $rs;
         } else {
             $member = M('member');
             $member_field = M('member_field');
             $open_uid = cookie('open_uid');
             if ($open_uid) {
                 $data['username'] = $username;
                 $data2['qquid'] = cookie('open_uid');
                 $data2['qq_oauth'] = cookie('open_oauth');
             } else {
                 $data['username'] = $username;
                 $data['password'] = cookie('password');
             }
             $data['email'] = postvar('email');
             $data['sex'] = $sex;
             $data['college'] = postvar('college');
             $data['register_time'] = time();
             $data['login_time'] = time();
             $data['login_times'] = 1;
             $data['login_ip'] = get_client_ip();
             //打分随机起始点start
             $tsex = 3 - $sex;
             $count = $member->where("sex={$tsex} AND default_photonum>0 AND group_type>0")->count();
             $data['user_ping_offset'] = rand(0, $count - 12);
             //打分随机起始点end
             $uid = $member->add($data);
             //同步插入member_field表
             $data2['uid'] = $uid;
             $member_field->add($data2);
             cookie('uid', $uid, 86400);
             //
             if (!$noPhoto) {
                 $GLOBALS['i'] = array('uid' => $uid, 'username' => $data['username'], 'default_pic' => '', 'sex' => $data['sex']);
                 $pg = array('gid' => 0, 'default_pic' => '');
                 $photoAction->_api_add_num($rs, $pg);
             }
             //
             if ($open_uid) {
                 cookie('open_uid', NULL);
             }
             $msg = "top.location.href='/';";
             $invite_uid = intval(cookie('invite_uid'));
             if ($invite_uid) {
                 $member = M('member');
                 $login_ip = $member->where("uid={$invite_uid}")->getField('login_ip');
                 if ($login_ip != get_client_ip()) {
                     $payModel = D('Pay');
                     $payModel->edit_pay($invite_uid, 'buy', 1, '您邀请1位好友注册获得1颗红豆');
                     $invite = M("invite");
                     $data1['uid'] = $invite_uid;
                     $data1['invite_uid'] = $GLOBALS['i']['uid'];
                     $data1['add_time'] = time();
                     $invite->add($data1);
                 }
             }
         }
     }
     //exit($msg);
     $this->assign('msg', $msg);
     $this->display('Photo:api_upload');
 }
Example #22
0
 public function answer_task()
 {
     if (!$GLOBALS['islogin']) {
         exit('error');
     }
     if (!checkpost()) {
         exit;
     }
     $uid = postvar('receiver_uid', 1);
     $tid = postvar('related', 1);
     $task = M('task');
     $t = $task->where("tid={$tid}")->find();
     if (!$t) {
         exit('error');
     }
     $task_answer = M('task_answer');
     $rs = $task_answer->where("tid={$tid} AND uid={$GLOBALS['i']['uid']}")->find();
     if ($rs) {
         exit('{"stat":5,"error":"\\u60a8\\u5df2\\u7ecf\\u5e2e\\u8fc7\\u4e86"}');
     }
     $data['tid'] = $t['tid'];
     $data['uid'] = $GLOBALS['i']['uid'];
     $data['username'] = $GLOBALS['i']['username'];
     $data['default_pic'] = $GLOBALS['i']['default_pic'];
     $data['content'] = exp_content(postvar('content'));
     $data['is_anonymity'] = postvar('is_anonymity', 1);
     $data['add_time'] = time();
     $rs = $task_answer->add($data);
     if ($rs) {
         $edit['answer_count'] = array('exp', 'answer_count+1');
         $task->where("tid={$t['tid']}")->save($edit);
         $msgModel = D('Msg');
         $ta = $GLOBALS['i']['sex'] == 1 ? '她' : '他';
         $ta2 = $GLOBALS['i']['sex'] == 1 ? '他' : '她';
         $content = exp_content(postvar('content'));
         $str = "<div class=\"textbg f_6\"><b>你参与了{$ta}发布的任务:{$t['title']}</b></div>";
         $str2 = "<div class=\"textbg f_6\"><b>{$ta2}参与了你发布的任务:{$t['title']}</b></div>";
         $str3 = "<div class=\"textbg f_6\"><b>任务:{$t['title']}</b></div>";
         $main = "<p class=\"word_break\"><span class=\"word_break\">回应:{$data['content']}</span></p>";
         $str = $str . $main;
         $str2 = $str2 . $main;
         $str3 = $str3 . $main;
         $msgModel->chat($GLOBALS['i']['uid'], $uid, $str, 0, $str2, $str3);
     }
     //echo $task->getLastSql();
     exit('{"stat":0}');
 }
Example #23
0
 public function send_16($uid, $id)
 {
     $diary = M('diary');
     $rs = $diary->where("did={$id} AND uid={$uid}")->find();
     if (!$rs) {
         exit;
     }
     $ta = $GLOBALS['i']['sex'] == 1 ? '她' : '他';
     $ta2 = $GLOBALS['i']['sex'] == 1 ? '他' : '她';
     $content = exp_content(postvar('content'));
     $str = "<div class=\"textbg f_6\"><b>你对{$ta}“写两句”的评论:{$content}</b></div>";
     $str2 = "<div class=\"textbg f_6\"><b>{$ta2}对你“写两句”的评论:{$content}</b></div>";
     $str3 = "<div class=\"textbg f_6\"><b>{$GLOBALS['i']['username']}的评论:{$content}</b></div>";
     $bak = "<p><span class=\"word_break f_green\">评论:{$content}</span></p>";
     $main = "<p class=\"word_break\"><span class=\"word_break\">“写两句”:{$rs['content']}</span></p>";
     $str = $main . $str;
     $str2 = $main . $str2;
     $str3 = $main . $str3;
     $this->chat($GLOBALS['i']['uid'], $uid, $str, 0, $str2, $str3);
     $this->comment($uid, 16, $content);
 }
<?php

include "include/phplib/prepend.php3";
page_open(array("sess" => "Thesaurus_Session", "auth" => "Thesaurus_Auth"));
$auth->login_if($auth->auth["uid"] == "nobody");
include "include/tool.php";
$db = new DB_Thesaurus();
$new_meaning_id = addSynset($db, $auth, postvar('word'), postvar('subject_id'), postvar('distinction'), postvar('morphologic_id'));
if ($new_meaning_id != -1) {
    header("Location: synset.php?id={$new_meaning_id}&changed=2");
}
page_close();
Example #25
-1
 public function photo_ping()
 {
     if (!checkpost()) {
         exit('error');
     }
     if (!$GLOBALS['islogin']) {
         exit('{"stat":9, "errno":"未登录", "error":"未登录}');
     }
     $msgModel = D('Msg');
     $u = $msgModel->check_contact('uid', 'uid');
     $photo = M('photo');
     $pid = postvar('photo_id', 1);
     $p = $photo->where("uid={$u['uid']} AND pid={$pid}")->find();
     //echo $photo->getLastSql();
     if (!$p) {
         exit('error');
     }
     $data['pid'] = $pid;
     $data['photo_uid'] = $u['uid'];
     $data['uid'] = $GLOBALS['i']['uid'];
     $data['add_time'] = time();
     $photo_hot = M('photo_hot');
     $hot = $photo_hot->where($data)->find();
     if ($hot) {
         exit('hot yet');
     }
     $score = floatval(postvar('score'));
     $data['score'] = $score;
     $photo_hot->add($data);
     $edit['score'] = ($data['score'] - $p['score']) / ($p['score_num'] + 1) + $p['score'];
     $edit['score_num'] = array('exp', 'score_num+1');
     $photo->where("uid={$u['uid']} AND pid={$pid}}")->save($edit);
     echo '{"stat":1,"ping_score":"' . $p['score'] . '","errno":""}';
 }
Example #26
-1
 public function delete()
 {
     if (!$GLOBALS['islogin']) {
         exit;
     }
     if (!checkpost()) {
         exit;
     }
     $qid = postvar('qid_list', 1);
     $feedModel = D('Feed');
     $question = M('question');
     $question->where("id={$qid} AND uid={$GLOBALS['i']['uid']}")->delete();
     $feedModel->feed_delete(3, $qid, $GLOBALS['i']['uid']);
     $answer = M('answer');
     $rs = $answer->field('id')->where("q_id={$qid} AND uid={$GLOBALS['i']['uid']}")->limit(8)->select();
     foreach ($rs as $a) {
         $feedModel->feed_delete(4, $a['id'], $GLOBALS['i']['uid']);
     }
     $sum = $answer->where("q_id={$qid} AND uid={$GLOBALS['i']['uid']}")->count();
     $answer->where("q_id={$qid} AND uid={$GLOBALS['i']['uid']}")->delete();
     $member_field = M('member_field');
     $data1['question_num'] = array('exp', 'question_num-1');
     $data1['answer_num'] = array('exp', "answer_num-{$sum}");
     $member_field->where("uid={$GLOBALS['i']['uid']}")->save($data1);
     //echo $answer->getLastSql();
     echo 1;
 }