function get_system_activeuser_data($para = NULL) { $uid = format_uid(); $para = unserialize($para); $data['title'] = isset($para['title']) && strip_tags($para['title']) != '' ? strip_tags($para['title']) : '活跃会员'; $days = isset($para['days']) && intval($para['days']) > 0 ? intval($para['days']) : 0; $data['linenum'] = isset($para['linenum']) && intval($para['linenum']) > 0 ? intval($para['linenum']) : 3; $data['aid'] = $aid = strip_tags($para['aid']) != '' ? strip_tags($para['aid']) : 'all'; if ($aid == 'all') { $where = "WHERE 1"; } else { $where = "WHERE `u2_app_aid` = '" . $aid . "'"; } if ($days == 0 || $days == '') { $days = NULL; } $day = date('Y-m-d H:i:s', strtotime('- ' . $days . ' days')); $days = "AND `u2_time` > '" . $day . "'"; $feed = lazy_get_data("SELECT *,COUNT(`u2_action`) AS `num` FROM `u2_mini_feed` {$where} {$days} GROUP BY `u2_uid` ORDER BY `num` DESC"); if ($feed) { foreach ($feed as $k => $v) { $uids[] = $v['u2_uid']; } //print_r( $uids ); $data['users'] = lazy_get_data("SELECT * FROM `u2_user` WHERE `id` IN (" . join(',', $uids) . ")"); } return $data; }
function get_iforum_originate_data($para = NULL) { $uid = format_uid(); $para = unserialize($para); $data['title'] = isset($para['title']) && strip_tags($para['title']) != '' ? strip_tags($para['title']) : '我发起的'; $data['num'] = $num = isset($para['num']) && intval($para['num']) > 0 ? intval($para['num']) : 5; $data['new_page'] = isset($para['new_page']) && intval($para['new_page']) > 0 ? intval($para['new_page']) : 0; $days = isset($para['days']) && intval($para['days']) > 0 ? intval($para['days']) : 0; if ($days == 0 || $days == '') { $days = NULL; } else { $day = date('Y-m-d H:i:s', strtotime(' - ' . $days . ' days ')); $days = " AND `time` > '{$day}' "; } $list = lazy_get_data("SELECT * FROM `app_iforum_posts` WHERE `parent_id` = '0' AND `is_active` = '1' AND `uid` = '" . intval($uid) . "' {$days} ORDER BY `time` DESC LIMIT 0 , {$num}"); if ($list) { foreach ($list as $v) { $uids[$v['uid']] = $v['uid']; $uids[$v['last_uid']] = $v['last_uid']; } $data['names'] = get_name_by_uids($uids); } $data['list'] = $list; return $data; }
function buy($number, $uid = NULL) { $uid = format_uid($uid); $money = intval(c('invite_price')) * $number; $key = c('invite_use_gold') ? 'gold' : 'g'; $this->db->select($key)->from('app_ihome_user')->where('uid', $uid)->limit(1); $now = lazy_get_var(); if ($now < $money) { return false; } $sql = "UPDATE app_ihome_user SET {$key} = {$key} - {$money} WHERE uid = '{$uid}'"; lazy_run_sql($sql); $data = array(); $data['u2_uid'] = $uid; $data['u2_is_use'] = '0'; $data['u2_is_copied'] = '0'; $data['u2_date'] = date("Y-m-d"); while ($number > 0) { do { $icode = newpassword(); $check = $this->count_invite_code($icode); } while ($check); $data['u2_invite_code'] = $icode; $this->db->insert('u2_invite', $data); $number--; } return true; }
function get_iforum_restore_data($para = NULL) { $uid = format_uid(); $para = unserialize($para); $data['title'] = isset($para['title']) && strip_tags($para['title']) != '' ? strip_tags($para['title']) : '我回复的'; $limit = isset($para['limit']) && intval($para['limit']) > 0 ? intval($para['limit']) : 5; $data['new_page'] = isset($para['new_page']) && intval($para['new_page']) > 0 ? intval($para['new_page']) : 0; $days = isset($para['days']) && intval($para['days']) > 0 ? intval($para['days']) : 0; if ($days == 0 || $days == '') { $days = NULL; } else { $day = date('Y-m-d H:i:s', strtotime(' - ' . $days . ' days ')); $days = " AND `time` > '{$day}' "; } $uids = lazy_get_vars("SELECT `parent_id` FROM `app_iforum_posts` WHERE `parent_id` > 0 AND `uid` = '" . intval($uid) . "' AND `del_uid` = '0' {$days} GROUP BY `parent_id` ORDER BY `id` DESC LIMIT {$limit}"); $list = array(); if ($uids) { $list = lazy_get_data("SELECT * FROM `app_iforum_posts` WHERE `id` IN (" . join(',', $uids) . ") and `parent_id` = 0 AND `is_active` = '1' ORDER BY `last_post_time` DESC LIMIT {$limit}"); foreach ($list as $v) { $uids[$v['uid']] = $v['uid']; $uids[$v['last_uid']] = $v['last_uid']; } $data['names'] = get_name_by_uids($uids); } $data['list'] = $list; return $data; }
function add($fid, $type = 'line') { $data = array(); $data['fid'] = intval($fid); $data['uid'] = format_uid(); $data['type'] = $type; $data['timeline'] = date("Y-m-d H:i:s"); $this->db->insert('w2_item', $data); return $this->db->insert_id(); }
function get_friends_by_uid($uid = NULL) { $uid = format_uid($uid); $where = "(`u2_uid1` = '" . $uid . "' AND `is_active` = '1' )OR( `u2_uid2` = '" . $uid . "' AND `is_active` = '1')"; $sql = "SELECT * FROM `u2_fans` where {$where} LIMIT 500 "; $fans = lazy_get_data($sql); $fid = array(); if (isset($fans[0]) && is_array($fans[0])) { foreach ($fans as $f) { if ($f['u2_uid1'] == $uid) { $fid[] = $f['u2_uid2']; } else { $fid[] = $f['u2_uid1']; } } } return $fid; }
function update() { $fid = intval(v('fid')); if ($fid < 1) { info_page('错误的form参数'); } $uid = format_uid(); $data = array(); $data['name'] = z(v('name')); $data['title'] = z(v('title')); $data['subtitle'] = z(v('subtitle')); $data['item_name'] = z(v('item_name')); $data['is_main_app'] = z(v('is_main_app')); $this->db->where('id', $fid); $this->db->where('uid', $uid); $this->db->update('w2_form', $data); header('Location: /design/build/' . $fid); }
function get_iforum_hit_data($para = NULL) { $uid = format_uid(); $para = unserialize($para); $limit = isset($para['limit']) && intval($para['limit']) > 0 ? intval($para['limit']) : 5; $type = isset($para['type']) && intval($para['type']) != '' ? intval($para['type']) : 1; $data['new_page'] = isset($para['new_page']) && intval($para['new_page']) > 0 ? intval($para['new_page']) : 0; $days = isset($para['days']) && intval($para['days']) > 0 ? intval($para['days']) : 0; if ($days == 0 || $days == '') { $days = NULL; } else { $day = date('Y-m-d H:i:s', strtotime(' - ' . $days . ' days ')); $days = " AND `time` > '{$day}' "; } if (isset($para['title']) && strip_tags($para['title']) != '') { $data['title'] = strip_tags($para['title']); } else { if ($type == 2) { $data['title'] = '回复最多的'; } else { $data['title'] = '点击最多的'; } } if ($type == 2) { $at = "ORDER BY `app_iforum_posts`.`reply` DESC"; } else { $at = "ORDER BY `app_iforum_posts`.`hit` DESC"; } $list = lazy_get_data("SELECT * FROM `app_iforum_posts` WHERE `parent_id` = '0' AND `is_active` = '1' {$days} {$at} LIMIT {$limit}"); if ($list) { foreach ($list as $v) { $uids[$v['uid']] = $v['uid']; $uids[$v['last_uid']] = $v['last_uid']; } $data['names'] = get_name_by_uids($uids); } $data['list'] = $list; return $data; }
function save() { check_login(); $mail = z(v('email')); if (strpos(_sess('u2_email'), '@') !== false) { info_page('你使用是正确的email'); } if (strpos($mail, '@') === false) { info_page('请填写正确的email'); } $sql = "select count(*) from u2_user where LCASE(u2_email) = '" . strtolower($mail) . "' "; if (lazy_get_var($sql)) { info_page('该email已经有人使用了,请重新填写'); } $this->load->database(); $data['u2_email'] = $mail; $uid = format_uid(); $this->db->where('id', $uid); $this->db->update('u2_user', $data); $this->load->library('session'); $this->session->set_userdata('u2_email', $mail); info_page('补充E-mail信息成功,以后请用email登陆.', '/', '返回首页'); }
private function save_view_infomation() { if (is_login()) { $new['time'] = time(); $new['date'] = date("Y-m-d"); if (_sess('statistics')) { $statistics = _sess('statistics'); $staytime = time() - $statistics['time']; $secondes = intval(c('online_seconds')) < 60 ? 300 : intval(c('online_seconds')); if ($statistics['date'] == date("Y-m-d") && $staytime > 60 && $staytime < $secondes) { if (_sess('online_date') == $statistics['date']) { lazy_run_sql("update `u2_user` set `online_today` = `online_today` + {$staytime} , `onlinetime` = `onlinetime` + {$staytime} where `id` = '" . format_uid() . "' limit 1"); } else { lazy_run_sql("update `u2_user` set `online_date` = '" . date("Y-m-d") . "' , `online_today` = {$staytime} , `onlinetime` = `onlinetime` + {$staytime} where `id` = '" . format_uid() . "' limit 1"); $res['online_date'] = date("Y-m-d"); } } elseif ($statistics['date'] == date("Y-m-d") && $staytime < 60) { $new = $statistics; } } $res['statistics'] = $new; set_sess($res); $this->load->database(); $uid = format_uid(); $data['u2_stay_time'] = date("Y-m-d H:i:s"); $data['u2_stay_location'] = $_SERVER['REQUEST_URI']; $data['u2_sid'] = _sess('session_id'); $data['u2_uid'] = $uid; $this->db->select('count(*)')->from('u2_online')->where('u2_uid', $uid); if (lazy_get_var()) { $this->db->where('u2_uid', $uid); $this->db->update('u2_online', $data); } else { $this->db->insert('u2_online', $data); } } }
function save($info, $extra = NULL) { if (is_array($extra)) { $data = $extra; } $data['u2_title'] = $info['u2_title']; $data['u2_desp'] = $info['u2_desp']; $data['u2_uid'] = format_uid(); $data['u2_nickname'] = _sess('u2_nickname'); $data['u2_addtime'] = date("Y-m-d H:i:s"); $data['u2_hit'] = 0; $data['u2_pic'] = $info['u2_pic']; if (check_active()) { $data['u2_is_active'] = 1; } else { $data['u2_is_active'] = 0; } $data['u2_cate'] = $info['cate']; $this->db->insert('u2_content', $data); $id = $this->db->insert_id(); $type = _text('system_pro'); $desc = '<a href="/riki/display/' . $id . '" target="_blank">' . $info['u2_title'] . '</a>'; add_to_manager('u2_content', $id, $desc, $type, $data['u2_is_active']); }
<TD valign="top" style="padding:10px;"><img src="http://' . $_SERVER['HTTP_HOST'] . show_user_icon('big') . '" style="border:1px solid #c8c8c8;padding:1px;"></TD> <TD valign="top" style="padding:10px;"> <p><strong>亲爱的朋友,我是' . _sess('u2_nickname') . '~</strong></p> 最近我加入了 ' . c('site_name') . ' ,每天在这里种仙豆养宠物,感觉还不错哦.你也来和我一起玩,顺便帮我挣点银币吧,呵呵.<br/> <br/>点下边的链接就可以了,我会仔细的给你做向导的哦~<br/><br/> <a href="http://' . $_SERVER['HTTP_HOST'] . '/gate/index/' . $icode . '">http://' . $_SERVER['HTTP_HOST'] . '/gate/index/' . $icode . '</a> <p>如果点击无效,你可以复制上边的链接,粘贴到地址栏,再按回车就行了</p><br/> <p>邀请函我好不容易才弄到的呢,如果你没兴趣的话,就转发给你的朋友吧~</p> </TD> </TR> </TABLE>'; /* $message = '<TABLE><TR><TD valign="top"><img src="http://'.$_SERVER['HTTP_HOST'].show_user_icon('big').'" style="border:1px solid #c8c8c8;padding:1px;"></TD><TD valign="top" style="padding:10px;"><b>你好我是'._sess('u2_nickname').'我在'.c('site_name').'上建立了个人主页,请你也加入并成为我的好友。</b><br/><br/>请点击以下链接,接受好友邀请:<br/><a href="http://'.$_SERVER['HTTP_HOST'].'/gate/index/'.$icode.'">http://'.$_SERVER['HTTP_HOST'].'/gate/index/'.$icode.'</a></TD></TR></TABLE>';*/ if (!sendmail($v, $title, $message, _sess('u2_email'))) { die('邮件系统不可用,请稍候在试'); } $i++; } $sql = "update u2_invite set u2_is_copied = '1' where id in (" . join(',', $copyid) . ")"; lazy_run_sql($sql); $sql = "delete from app_iinvite_emails where uid = '" . format_uid() . "' "; lazy_run_sql($sql); die('发送邮件成功.'); } else { die('网站目前不允许注册'); } ?>
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $data = array(); $data['ci_top_title'] = '我的衣柜'; $tab_type = 'cloth'; $page = array_shift($args); $page = intval($page) < 1 ? 1 : intval($page); $limit = '6'; $start = ($page - 1) * $limit; $base = '/app/native/ihome/cloth'; $sql = "SELECT count(*) FROM `app_ihome_shop` WHERE `uid` = '" . format_uid() . "' "; $count = lazy_get_var($sql); $page_all = ceil($count / $limit); $data['pager'] = get_pager($page, $page_all, $base); $data['tab_type'] = $tab_type; $data['tab_array'] = $tab_array; //$data['user'] = lazy_get_line( "SELECT * FROM `app_ihome_user` WHERE `uid` = '" . format_uid() . "' LIMIT 1" ); $data['shop'] = lazy_get_data("SELECT * FROM `app_ihome_shop` as s LEFT JOIN `app_ishop_items` as i ON ( s.item_id = i.fid ) WHERE `uid` = '" . format_uid() . "' order by s.id desc LIMIT {$start} , {$limit} "); layout($data, 'default', 'app');
function get_shop_draft_item() { $uid = format_uid(); $this->db->select('*')->from('u2_shop_items')->where('is_active', '0')->where('uid', $uid)->limit(1); $line = lazy_get_line(); if (!$line) { $data = array(); $data['is_active'] = 0; $data['uid'] = $uid; $data['time'] = date("Y-m-d H:i:s"); $this->db->insert('u2_shop_items', $data); //$data['id'] = $this->db->insert_id(); $this->db->select('*')->from('u2_shop_items')->where('is_active', '0')->where('uid', $uid)->limit(1); $line = lazy_get_line(); } return $line; }
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $data = array(); $data['ci_top_title'] = '邀请好友'; $tab_type = 'index'; $data['user'] = NULL; $data['tab_type'] = $tab_type; $data['tab_array'] = $tab_array; $data['emails'] = lazy_get_data("select * from app_iinvite_emails where uid = '" . format_uid() . "' and no_in_site = '1' "); layout($data, 'default', 'app');
function check_pincode($uid, $pincode) { $id = format_uid($uid); $this->db->select('count(*)')->from('u2_user')->where('id', $id)->where('u2_pincode', $pincode); return lazy_get_var(); }
if (file_exists(dirname(__FILE__) . '/snap.info.txt')) { $snap = unserialize(file_get_contents(dirname(__FILE__) . '/snap.info.txt')); } foreach ($item as $ik => $iv) { $snap_content = isset($snap[$iv['fid']]) ? true : false; $item[$ik]['desp'] = format_contents($iv['desp'], $snap_content); } $data['item'] = $item; $times = array(); $diged = array(); if ($item) { foreach ($item as $k => $v) { $times[$v['id']] = time2Units($v['time']); $iids[] = $v['id']; } $diged = lazy_get_vars("select `iid` from `app_feed_dig` where `uid` = '" . format_uid() . "' and `iid` IN(" . join(',', $iids) . ") "); } $data['diged'] = $diged; $data['times'] = $times; //分页 $base = '/app/native/ifeedig/index/' . $titleid . '/' . $day . '/' . $hit; $page_all = ceil($all / $limit); $data['pager'] = get_pager($page, $page_all, $base); $feed = lazy_get_data("SELECT * FROM `app_feed`"); if ($feed) { foreach ($feed as $k => $v) { $by[$v['id']] = $v['title']; } $data['by'] = $by; } $fdig = lazy_get_data("SELECT * FROM `app_feed_dig`");
$page = intval($page) < 1 ? 1 : intval($page); $start = ($page - 1) * $limit; $data['list'][] = lazy_get_line("SELECT * FROM `app_iforum_posts` WHERE id = '{$id}' AND `is_active` = 1 AND `parent_id` = '0' LIMIT 1"); if (!$data['list']) { info_page('错误的文章id'); } $data['forum'] = lazy_get_line("SELECT * from `app_iforum_status` where `id` = '{$data['list'][0]['fid']}' and `is_active` = '1' limit 1"); if (!$data['forum']) { info_page('错误的论坛id'); } $data['ci_top_title'] = $data['list'][0]['title']; $extra = lazy_get_data("SELECT sql_calc_found_rows * FROM `app_iforum_posts` WHERE `is_active` = 1 AND `parent_id` ='{$id}' LIMIT {$start} , {$limit}"); if ($extra) { $data['list'] = array_merge($data['list'], $extra); } foreach ($data['list'] as $v) { $uids[$v['uid']] = $v['uid']; } $all = get_count(); $base = '/app/native/iforum/display/' . $id; $page_all = ceil($all / $limit); $data['pager'] = get_pager($page, $page_all, $base, $data['return_page']); $data['names'] = iforum_get_names($uids); lazy_run_sql("update `app_iforum_posts` set `hit` = `hit` + 1 WHERE id = '{$id}' AND `is_active` = 1 LIMIT 1"); $data['tab_type'] = 'display'; $data['tab_array'] = array('display' => '浏览文章'); $data['id'] = $id; $data['page'] = $page; $data['limit'] = $limit; $data['show_del'] = is_admin() ? 1 : ($data['list'][0]['uid'] == format_uid() ? 1 : 0); layout($data, 'default', 'app');
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);
<?php include_once dirname(__FILE__) . '/function.php'; // clear data $type = intval(v('type')); $name = z(v('name')); $desp = n(v('desp')); if ($type < 1) { info_page('请为箱子选择用途'); } if (strlen($type) < 1) { info_page('箱子的名字不能为空哦'); } $data = array(); $data['type'] = $type; $data['name'] = $name; $data['timeline'] = date("Y-m-d H:i:s"); $data['desp'] = $desp; $data['uid'] = format_uid(); global $CI; $CI->load->database(); $CI->db->insert('app_icase_case', $data); header('Location: /app/native/' . $GLOBALS['app'] . '/index');
<?php include_once dirname(__FILE__) . '/function.php'; $fid = intval(array_shift($args)); if ($fid < 1) { die('wrong fid'); } else { $sql = "DELETE FROM `app_fav` WHERE `uid` = '" . format_uid() . "' AND `id` = '" . $fid . "' LIMIT 1"; lazy_run_sql($sql); if (mysql_affected_rows() == 1) { $sql = "DELETE FROM u2_restore WHERE u2_app_name = 'ishare' and u2_app_id = '{$fid}' "; lazy_run_sql($sql); } }
include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $data = array(); $data['ci_top_title'] = '分享'; $view_type = array_shift($args); if ($view_type == 'friends') { $fid = get_friends_by_uid(); if ($fid) { $where = " uid IN ( " . join(' , ', $fid) . " ) "; } else { $where = " 0 "; } } elseif ($view_type == 'self') { $where = " uid = '" . format_uid() . "' "; } else { $view_type = 'all'; $where = " 1 "; } $data['view_type'] = $view_type; $page = array_shift($args); $page = intval($page) < 1 ? 1 : intval($page); $limit = '10'; $start = ($page - 1) * $limit; $data['fav'] = lazy_get_data("SELECT sql_calc_found_rows *,f.id as fid FROM `app_fav` as f LEFT JOIN `u2_user` as u ON ( f.uid = u.id ) WHERE {$where} ORDER BY `time` DESC LIMIT {$start} , {$limit} "); $sql = "select found_rows()"; $all = lazy_get_var($sql); $base = '/app/native/ishare/index/' . $view_type; $page_all = ceil($all / $limit); $data['pager'] = get_pager($page, $page_all, $base);
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $data = array(); $data['ci_top_title'] = '社区银行'; $tab_type = 'index'; $data['tab_type'] = $tab_type; $data['tab_array'] = $tab_array; $data['user'] = lazy_get_line("SELECT * FROM `app_ihome_user` WHERE `uid` = '" . format_uid() . "' LIMIT 1"); $data['account'] = lazy_get_line("SELECT * FROM `app_ibank_account` WHERE `uid` = '" . format_uid() . "' LIMIT 1"); layout($data, 'default', 'app');
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $data = array(); $data['ci_top_title'] = '个人中心'; $tab_type = 'index'; $data['tab_type'] = $tab_type; $data['tab_array'] = $tab_array; $data['user'] = lazy_get_line("SELECT * FROM `app_ihome_user` WHERE `uid` = '" . format_uid() . "' LIMIT 1"); if (!$data['user']) { $sql = "insert into app_ihome_user ( uid,g,gold,hp,hp_max )values('" . format_uid() . "','0','0','0','0') "; lazy_run_sql($sql); } layout($data, 'default', 'app');
$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 money_add($money, $uid = NULL) { if ($uid == NULL) { $uid = format_uid(); } $sql = "UPDATE `app_ihome_user` SET `g` = `g` + " . intval($money) . " WHERE `uid` = '" . intval($uid) . "' LIMIT 1 "; lazy_run_sql($sql); }
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $uid = format_uid(); $folder = z(array_shift($args)); $cid = intval(array_shift($args)); $mid = app_config('mid', $folder); $bind = app_config('bind', $folder); if (!isset($mid)) { info_page('没有此表!'); } if ($bind['price'] == '' || $bind['price'] <= '0') { info_page('价格错误!'); } foreach ($bind as $k => $v) { $selected[] = " `{$v}` as {$k} "; } $com = lazy_get_line("SELECT " . join(',', $selected) . " FROM `app_content_{$mid}` WHERE `id` = '" . intval($cid) . "'"); $cnum = get_count(); if ($cnum == '0') { info_page('没有此件物品!'); } $num = lazy_get_var("SELECT COUNT(*) FROM `app_shopcart` WHERE `cid` = '" . intval($cid) . "' AND `uid` = '" . intval($uid) . "'"); if ($num != '0') { lazy_run_sql("UPDATE `app_shopcart` SET `num` = `num`+1 WHERE `cid` = '" . intval($cid) . "' AND `uid` = '" . intval($uid) . "'"); } else { lazy_run_sql("INSERT INTO `app_shopcart` ( `uid`, `cid`, `name`, `desp`, `num`, `money`, `date`, `folder` ) VALUES ( '" . intval($uid) . "' , '" . intval($cid) . "' , " . s($com['title']) . " , " . s($com['desp']) . " , '1' , " . s($com['price']) . " , '" . date('Y-m-d H:i:s') . "' , " . s($folder) . " )"); }
info_page('请登录后查看'); } if (v('email') == NULL) { info_page('请输入转账账号'); } $money = intval(v('money')); if ($money < 1) { info_page('请输入正确的金额'); } $touid = lazy_get_var("select id from u2_user where u2_email = '" . z(v('email')) . "' ", db()); if (!$touid) { info_page('没有此用户'); } if ($touid == _sess('id')) { info_page('不能对自己转账.'); } $now = lazy_get_var("SELECT g FROM `app_ihome_user` WHERE `uid` = '" . format_uid() . "' LIMIT 1"); if ($now < $money) { info_page('你身上没有足够的现金.'); } $sql = "update app_ihome_user set g = g - {$money} WHERE `uid` = '" . format_uid() . "' LIMIT 1"; lazy_run_sql($sql); $sql = "select * from app_ibank_account where uid='{$touid}' limit 1"; if (is_array(lazy_get_line($sql))) { $sql = "update app_ibank_account set g_count = g_count + {$money} where uid='{$touid}' limit 1 "; } else { ${$key} = $money; $sql = "insert into app_ibank_account (uid , g_count , glod_count )values ( '{$touid}','{$money}','0' ) "; } lazy_run_sql($sql); info_page('已成功转账到您的指定的用户.', '/app/native/ibank/transfer');
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 (!is_login()) { die('请登陆后操作!'); } $action = array_shift($args); $number = intval(array_shift($args)); if ($action == 'save') { $check = lazy_get_var("SELECT g FROM `app_iduoduo_duoduo` WHERE `uid` = '" . format_uid() . "' LIMIT 1 "); $sql1 = "update `app_iduoduo_duoduo` set `g` = `g` - '{$number}' WHERE `uid` = '" . format_uid() . "' "; $sql2 = "update `app_ihome_user` set `g` = `g` + '{$number}' WHERE `uid` = '" . format_uid() . "' "; $js_data[] = '$("duoduo_money").innerHTML = parseInt($("duoduo_money").innerHTML) - ' . $number; $js_data[] = '$("user_money").innerHTML = parseInt($("user_money").innerHTML) + ' . $number; $action_name = '存入'; } else { $check = lazy_get_var("SELECT g FROM `app_ihome_user` WHERE `uid` = '" . format_uid() . "' LIMIT 1 "); $sql1 = "update `app_ihome_user` set `g` = `g` - '{$number}' WHERE `uid` = '" . format_uid() . "' "; $sql2 = "update `app_iduoduo_duoduo` set `g` = `g` + '{$number}' WHERE `uid` = '" . format_uid() . "' "; $js_data[] = '$("user_money").innerHTML = parseInt($("user_money").innerHTML) - ' . $number; $js_data[] = '$("duoduo_money").innerHTML = parseInt($("duoduo_money").innerHTML) + ' . $number; $action_name = '取出'; } if ($check < $number) { die('您没足够的银币.'); } lazy_run_sql($sql1); lazy_run_sql($sql2); echo '您' . $action_name . '了' . $number . '银币'; if ($js_data) { $js_code = '<script>' . join(';', $js_data) . ';</script>'; echo $js_code; }