$data = array(); $data['type'] = $type; $data['link'] = $url; $data['time'] = date("Y-m-d H:i:s"); $data['desp'] = $desp; switch ($type) { case VIDEO: $info = parse_url($url); $data['video_domain'] = $info['host']; $cnname = '视频'; break; case MUSIC: $data['music_url'] = $url; $cnname = '音乐'; break; case WEBPAGE: $cnname = '网页'; break; } $data['uid'] = format_uid(); global $CI; $CI->load->database(); $CI->db->insert('app_fav', $data); $aid = $CI->db->insert_id(); if ($aid) { $aname = 'ishare'; $appname = get_app_name_with_aid($aname); $title = '<a href="/user/space/' . format_uid() . '" target="_blank">' . _sess('u2_nickname') . '</a>' . $appname . '了一个<a href="/app/native/' . $aname . '/show/' . $aid . '/" target="_blank">' . $cnname . '</a>'; send_to_feed(format_uid(), 'ishare', $title, mb_substr($data['desp'], 0, 20, 'utf-8')); } header('Location: /app/native/' . $GLOBALS['app'] . '/index');
function wall() { $uid = intval(v('uid')); $content = n(v('content')); // check if is empty if ($uid > 0 && $content != '') { $this->user->wall_save($uid, format_uid(), $content); send_to_notice($uid, 'system_guestbook', '<a href="/user/space/' . format_uid() . '">' . _sess('u2_nickname') . '</a>给你留言了 ', '<img src="/static/images/quote_left.gif" /> <a href="/user/space#">' . word_substr($content, 15) . '</a> <img src="/static/images/quote_right.gif" />'); $uname = $this->user->get_nickname_by_uid($uid); $title = '<a href="/user/space/' . format_uid() . '">' . _sess('u2_nickname') . '</a>给<a href="/user/space/' . $uid . '#wall">' . $uname . '</a>留言了'; $desp = word_substr($content, 15); send_to_feed(format_uid(), 'system_miniblog', $title, $desp); } header('Location: /user/space/' . $uid); }
if (!$forum) { info_page('错误的论坛id'); } $now = date("Y-m-d H:i:s"); lazy_run_sql("update `app_iforum_posts` set `reply` = `reply` + 1 , `last_post_time` = '{$now}' ,`last_uid` = '" . format_uid() . "' WHERE id = '{$id}' AND `is_active` = 1 AND `parent_id` = '0' LIMIT 1"); global $CI; $CI->load->database(); $data['fid'] = $check['fid']; $data['parent_id'] = $id; $data['title'] = ''; $data['desp'] = r($desp); $data['floor'] = intval(v('floor')); $data['last_uid'] = $data['uid'] = format_uid(); $data['last_post_time'] = $data['time'] = $now; $CI->db->insert('app_iforum_posts', $data); $count = lazy_get_var("select count(*) from `app_iforum_posts` WHERE fid = '{$data['fid']}' AND `parent_id` = '{$id}' AND `is_active` = 1 AND `parent_id` != '0' "); $page_all = ceil($count / $limit); $rid = intval(v('rid')); if (!$rid) { $nuid = $check['uid']; } else { $temp = lazy_get_var("SELECT `uid` FROM `app_iforum_posts` WHERE id = '{$rid}' AND `is_active` = 1 AND `parent_id` = '{$id}' LIMIT 1"); $nuid = $temp ? $temp : $check['uid']; } if ($nuid != format_uid()) { $title = '<a href="/user/space/' . format_uid() . '" target="_blank">' . _sess('u2_nickname') . '</a>回复了主题<a href="/app/native/iforum/display/' . $id . '/' . $page_all . '/" target="_blank">' . strip_tags($check['title']) . '</a>'; send_to_notice($nuid, 'iforum', $title); } $title = '<a href="/user/space/' . format_uid() . '" target="_blank">' . _sess('u2_nickname') . '</a>回复了主题<a href="/app/native/iforum/display/' . $id . '/" target="_blank">' . strip_tags($check['title']) . '</a>'; send_to_feed(format_uid(), 'iforum', $title); header("Location: /app/native/iforum/display/" . $id . "/" . $page_all . "/" . $return_page . '/' . $return_key);
function register() { $nickname = z(v('nickname')); $email = z(v('email')); $psw1 = z(v('psw1')); $psw2 = z(v('psw2')); $icode = z(v('icode')); if (!$nickname || !$email || !$psw1) { die('<center style="font-size:12px;">用户名,E-mail,密码不能为空</center>'); } if ($psw1 != $psw2) { die('<center style="font-size:12px;">2次密码输入不一致</center>'); } $psw = $psw1; $this->load->model('User_model', 'user', TRUE); $invite = $this->user->check_invite_code($icode); if (!$invite) { die('<center style="font-size:12px;">邀请函防伪码已经使用过了</center>'); } if (!$this->user->register_save($email, $nickname, $psw)) { die('<center style="font-size:12px;">用户名或者email已被占用</center>'); } $this->user->marked_invite_code($invite['id']); $user_info = $this->user->get_user_by_email($email); $title = '<a href="/user/space/' . $user_info['id'] . '">' . $user_info['u2_nickname'] . '</a>加入了' . c('site_name'); send_to_feed($user_info['id'], 'system_user', $title); $invuid = $invite['u2_uid']; if ($invuid && ($olduser = $this->user->load_user_information_by_uid($invuid))) { $this->user->add_friend($invuid, $user_info['id']); $title = '<a href="/user/space/' . $user_info['id'] . '">' . $user_info['u2_nickname'] . '</a>和<a href="/user/space/' . $olduser['id'] . '">' . $olduser['u2_nickname'] . '</a>成为好友了'; send_to_feed($user_info['id'], 'system_user', $title); } $new_one = array(); $new_one['u2_first_time'] = 1; $new_one['u2_inviter_uid'] = $olduser['id']; $new_one['u2_inviter_nickname'] = $olduser['u2_nickname']; $this->user->login_confirm($email, $psw, $new_one); if (isset($_FILES['picfile']['size']) && $_FILES['picfile']['size'] > 0) { make_user_icon_dir(); $this->load->library('icon'); $this->icon->path = $_FILES['picfile']['tmp_name']; $this->icon->size = 16; $this->icon->dest = get_user_icon_path('small'); $this->icon->createIcon(); $this->icon->size = 48; $this->icon->dest = get_user_icon_path(); $this->icon->createIcon(); $this->icon->size = 100; $this->icon->dest = get_user_icon_path('big'); $this->icon->createIcon(); $time = time(); $source_image = ROOT . 'static/data/hash/user_icon/' . myhash() . $time . '.gif'; copy(get_user_icon_path('small'), ROOT . 'static/data/hash/user_icon/' . myhash() . $time . '_small.gif'); copy(get_user_icon_path(), ROOT . 'static/data/hash/user_icon/' . myhash() . $time . '_normal.gif'); copy(get_user_icon_path('big'), ROOT . 'static/data/hash/user_icon/' . myhash() . $time . '_big.gif'); move_uploaded_file($_FILES['picfile']['tmp_name'], $source_image); $this->user->add_user_upload_pic($time); $title = '<a href="/user/space/' . format_uid() . '">' . _sess('u2_nickname') . '</a>更换了新头像'; send_to_feed(format_uid(), 'system_user', $title, NULL, show_user_icon()); } $uid = $user_info['id']; $place = $uid + 10000; // add the inviter's info //set_cookie( 'x123' , 'er' ); // add money to user bank account // add money $sql = "INSERT INTO `app_ibank_account` ( `uid` , `g_count` , `gold_count` ) VALUES ( '" . $uid . "' , '" . intval(c('user_init_silver')) . "' , '" . intval(c('user_init_gold')) . "' ) "; lazy_run_sql($sql); // add cloth $sql = "INSERT INTO `app_ihome_shop` ( `uid` , `item_id` ) VALUES ( '" . $uid . "' , '844' ) , ( '" . $uid . "' , '879' )"; lazy_run_sql($sql); // add money to inviter $sql = "UPDATE `app_ibank_account` SET `g_count` = `g_count` + " . intval(c('user_invite_g')) . " WHERE `uid` = '" . intval($olduser['id']) . "' LIMIT 1 "; lazy_run_sql($sql); // header("Content-type: text/xml; charset=$charset"); header("Content-type: text/html;charset=utf-8"); echo '<SCRIPT LANGUAGE="JavaScript">window.parent.$("id_icon").setHTML(\'<img src="' . show_user_icon('', $user_info['id']) . '" class="icon"/><br/>' . $nickname . '\');window.parent.$("id_info").setHTML(\'NO. ' . $uid . '<br/>仙豆王国居民东区' . $place . '#\');</SCRIPT>'; echo '<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body><center style="font-size:12px;"><a href="/user/miniblog/" target="_parent">申请成功,赶快到你的小屋去看看吧</a></center></body></html>'; }