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_view_uids($mid, $cid, $limit = 5) { $uids = lazy_get_vars("select `uid` from `u2_app_view` where `mid` = '{$mid}' and `cid` = '{$cid}' order by `id` desc limit {$limit}"); if (is_login()) { $sql = "replace into `u2_app_view` (`mid`,`cid`,`uid`,`time`)values('{$mid}','{$cid}','" . format_uid() . "','" . date("Y-m-d H:i:s") . "')"; lazy_run_sql($sql); } return $uids; }
function iforum_save_cates($fid, $key, $desp) { if ($desp) { $sql = "REPLACE INTO `app_iforum_cate` (`fid`,`key`,`desp`)VALUES('" . intval($fid) . "','" . intval($key) . "'," . s($desp) . ")"; lazy_run_sql($sql); } else { $sql = "UPDATE `app_iforum_posts` SET `type` = '0' WHERE `fid` = '" . intval($fid) . "' AND `type` = '" . intval($key) . "'"; lazy_run_sql($sql); $sql = "DELETE FROM `app_iforum_cate` WHERE `fid` = '" . intval($fid) . "' AND `key` = '" . intval($key) . "' "; lazy_run_sql($sql); } }
function newone() { echo _sess('u2_first_time'); echo _sess('u2_inviter_uid'); echo _sess('u2_inviter_nickname'); //set_sess( 'u2_first_time' , '1' ); //info_page( 'ok' ); // add money $sql = "INSERT INTO `app_ibank_account` ( `uid` , `g_count` , `gold_count` ) VALUES ( '" . format_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 ( '" . format_uid() . "' , '844' ) , ( '" . format_uid() . "' , '879' )"; lazy_run_sql($sql); echo mysql_error(); info_page('初始化完毕'); }
if (!$feed || $feed == 'http://') { info_page('你提交的博客地址错误'); } if (strpos($feed, 'http://') === false) { $feed = 'http://' . $feed; } } $CI =& get_instance(); $CI->load->library('simplepie'); MakeDir(ROOT . 'static/data/cache'); $CI->simplepie->set_cache_location(ROOT . 'static/data/cache'); $CI->simplepie->set_feed_url($feed); $CI->simplepie->init(); $data['ftitle'] = $CI->simplepie->get_title(); //标题 $flink = $CI->simplepie->get_link(); //连接地址 if (!$flink) { $flink = $feed; } $data['flink'] = $flink; //delete feed lazy_run_sql("DELETE FROM `app_feed_recommend` WHERE `feed` = '" . $feed . "'"); //type list foreach (app_config('titles') as $k => $v) { $titles[$k] = $v; } unset($titles[1]); $data['fselect'] = $titles; $data['state'] = app_config('state'); layout($data, 'default', 'app');
$uid = format_uid(); $insert_feed = "INSERT INTO `app_feed` (`feed`, `tid`, `uid`, `title`, `time`, `img`, `state`) VALUES"; $insert_feed .= "(" . s($feed) . ", '" . intval($tid) . "', '" . intval($uid) . "', " . s($title) . ", '" . date('Y-m-d H:i:s') . "', '" . $img . "' , '" . $status . "')"; lazy_run_sql($insert_feed); $fid = lazy_last_id(); //add feed item $CI =& get_instance(); $CI->load->library('simplepie'); //MakeDir(ROOT.'static/data/cache'); //$CI->simplepie->set_cache_location(ROOT.'static/data/cache'); $CI->simplepie->set_feed_url($feed); $CI->simplepie->init(); $items = $CI->simplepie->get_items(); $values = array(); foreach ($items as $k => $v) { $title = $v->get_title(); // 标题 $desp = $v->get_content(); // 内容 $link = $v->get_link(); //连接 $date = date('Y-m-d H:i:s', strtotime($v->get_date())); $unistring = md5($link) . $date; $values[] = "('" . intval($tid) . "', '" . intval($fid) . "', " . s($title) . ", " . s($desp) . ", '" . $date . "' , '" . $link . "', '" . $status . "', " . s($unistring) . ", '" . intval($uid) . "')"; } $sql_insert_item = "INSERT INTO `app_feed_item` (`tid`, `fid`, `title`, `desp`, `time`, `link`, `state`, `unistring`, `admin_uid`) VALUES " . join(',', $values) . ""; //echo $sql_insert_item; lazy_run_sql($sql_insert_item); info_page("Feed成功保存!", "/app/native/" . $GLOBALS['app'] . "/feed/", "返回管理"); ?>
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } if (!is_admin()) { info_page('你没有权限进行操作!'); } $fid = intval(v('fid')); if (!isset($fid) || $fid < 1) { info_page("ID错误!"); } lazy_run_sql("DELETE FROM `app_feed_item` WHERE `fid` = '" . intval($fid) . "'"); lazy_run_sql("DELETE FROM `app_feed` WHERE `id` = '" . intval($fid) . "' LIMIT 1"); info_page('成功删除!', '/app/native/' . $GLOBALS['app'] . '/feed', '点击这里返回!'); ?>
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $id = intval(v('id')); $title = z(trim(v('title'))); $step = intval(v('step')); $desp = x(v('desp')); $uid = format_uid(); if (empty($title) || empty($desp)) { info_page('标题或内容不能为空!'); } if ($id < 1) { info_page('参数错误!'); } lazy_run_sql("update `u2_comment` set `step` = '{$step}' where `tid` = '{$id}' and `uid` = '{$uid}' and `mid` = '{$mid}' "); $sql = "INSERT INTO `u2_comment` (`tid`, `mid`, `uid`, `title`, `content`, `time`, `step`) VALUES ('" . intval($id) . "' , '" . intval($mid) . "' , '" . intval($uid) . "' , " . s($title) . " , " . s($desp) . " , '" . date('Y-m-d H:i:s') . "' , '" . intval($step) . "')"; lazy_run_sql($sql); lazy_run_sql("UPDATE `app_content_{$mid}` SET `comnum` = `comnum`+1 WHERE `id` = '" . intval($id) . "'"); lazy_run_sql("replace into `u2_rate` (`uid` , `mid` , `cid` , `rate` , `time` )values('{$uid}','{$mid}','{$id}','{$step}' , '" . date("Y-m-d H:i:s") . "')"); header('Location: /app/native/' . $GLOBALS['app'] . '/display/' . $id . ''); die;
//应付 $stint = $money - $money_end; //节省 $data = array(); $data['uid'] = intval($uid); $data['toname'] = $toname; $data['totell'] = $totell; $data['tocode'] = intval($tocode); $data['tohome'] = $tohome; $data['need'] = $need; $data['carry_type'] = intval($carry); $data['pack_type'] = intval($pack); $data['ware'] = $ware; $data['money'] = $money_end; $data['stint'] = $stint; $data['time'] = time(); $data['enter'] = 0; global $CI; $CI->load->database(); $CI->db->insert('app_shoporder', $data); $data['id'] = $id = $CI->db->insert_id(); $name_num = lazy_get_var("SELECT COUNT(*) FROM `app_shopuser` WHERE `uid` = '" . intval($uid) . "' AND `name` = " . s($toname) . " "); if ($name_num == '0') { $sql = "INSERT INTO `app_shopuser` (`uid`, `name`, `tell`, `code`, `home`)"; $sql .= "VALUES ('" . intval($uid) . "' , " . s($toname) . ", " . s($totell) . ", '" . intval($tocode) . "', " . s($tohome) . ")"; lazy_run_sql($sql); } else { lazy_run_sql("UPDATE `app_shopuser` SET `tell` = " . s($totell) . " , `code` = '" . intval($tocode) . "', `home` = " . s($tohome) . " WHERE `id` = '" . intval($suid) . "'"); } lazy_run_sql("DELETE FROM `app_shopcart` WHERE `uid` = '" . intval($uid) . "'"); layout($data, 'default', 'app');
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $cid = intval(array_shift($args)); $uid = format_uid(); $num = lazy_get_var("SELECT `uid` FROM `app_content_{$mid}` WHERE `id` = '" . intval($cid) . "' limit 1"); if (!$num) { info_page('错误的参数'); } if ($num != $uid) { info_page('您没有权限进行此操作'); } $com = lazy_get_var("SELECT COUNT(*) FROM `u2_comment` WHERE `tid` = '" . intval($cid) . "'"); if ($com != '0') { lazy_run_sql("DELETE FROM `u2_comment` WHERE `tid` = '" . $cid . "'"); lazy_run_sql("DELETE FROM `u2_comment_vote` WHERE `tid` = '" . $cid . "'"); lazy_run_sql("DELETE FROM `u2_comment_reply` WHERE `tid` = '" . $cid . "'"); } lazy_run_sql("DELETE FROM `app_content_{$mid}` WHERE `id` = '" . intval($cid) . "'"); lazy_run_sql("DELETE FROM `u2_comment_reply` WHERE `tid` = '" . $cid . "'"); lazy_run_sql("DELETE FROM `u2_manager` WHERE `tid` = '" . intval($cid) . "' AND `u2_table` = 'app_content_{$mid}' "); lazy_run_sql("DELETE FROM `u2_rate` WHERE `cid` = '" . intval($cid) . "' AND `mid` = '{$mid}' "); info_page('成功删除' . app_config('model_name'), '/app/native/' . $GLOBALS['app'] . '/', '返回'); ?>
<?php //include_once( dirname( __FILE__ ) . '/function.php' ); header("Content-Type:text/xml;charset=utf-8"); header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); if (!is_login()) { info_page('请登录后查看'); } if (!is_admin()) { info_page('你没有权限进行此次操作!'); } $id = intval(array_shift($args)); $sid = intval(array_shift($args)); lazy_run_sql("UPDATE `app_feed_item` SET `state` = '" . intval($sid) . "' WHERE `id` = '" . intval($id) . "'"); //$uid = format_uid(); if ($sid == '1') { echo "<span style='float:right'>\n\t\t <span id='state_" . $id . "'><img src='/static/images/tick.gif'></span>\n\t\t <INPUT TYPE='checkbox' onclick='Change_state( " . $id . " , 2)'>通过\n\t\t </span>"; } else { echo "<span style='float:right'>\n\t\t <span id='state_" . $id . "'><img src='/static/images/tick.gif'></span>\n\t\t <INPUT TYPE='checkbox' onclick='Change_state( " . $id . " , 1)' checked>通过\n\t\t </span>"; } die;
private function shop_update_type($args) { $id = intval(array_shift($args)); $line = $this->admin->get_shop_type_by_id($id); if (!$line) { info_page('此商品类型已被删除', '/admin/shop/add/type/', '添加商品类型'); } $data['name'] = z(v('name')); if (!$data['name']) { info_page('请填写商品类型名称'); } if ($line['name'] != $data['name']) { if ($this->admin->check_shop_type($data['name'])) { info_page("错误, 已存在此商品类型"); } } $brand_array = v('brand'); if (v('all_brand')) { $brand_array = array(); } $extra_field = v('extra_field'); $field = array(); $sql_fields = array(); if ($extra_field) { foreach ($extra_field as $v) { if ($v) { $v = unserialize(base64_decode($v)); $field[$v['id']] = $v; $sql_fields[] = '`extra_' . $v['id'] . '` varchar( 255 ) NULL'; } } } $extra['field'] = $field; $extra['brands'] = $brand_array; $data['extra'] = serialize($extra); $this->admin->update_shop_type($data, $id); $new = $field; $line['extra'] = unserialize($line['extra']); $old = $line['extra']['field']; if (!$new) { $eid = lazy_get_var("SHOW TABLES LIKE 'shop_extra_" . intval($id) . "' "); if ($eid) { lazy_run_sql("DROP TABLE `shop_extra_" . intval($id) . "`"); } } elseif (!$old && $sql_fields) { lazy_run_sql('CREATE TABLE IF NOT EXISTS `shop_extra_' . $line['id'] . '`(`id` int(11) NOT NULL auto_increment,`cid` int(11) NOT NULL ,' . join(',', $sql_fields) . ' ,PRIMARY KEY (`id`) ) ENGINE=MyISAM ;'); } else { $acts = array(); foreach ($new as $v) { if (isset($old[$v['id']])) { unset($old[$v['id']]); } else { $acts[] = 'ADD `extra_' . $v['id'] . '` VARCHAR( 255 ) NULL '; } } if ($old) { foreach ($old as $v) { $acts[] = 'DROP `extra_' . $v['id'] . '`'; } } if ($acts) { lazy_run_sql("ALTER TABLE `shop_extra_" . intval($id) . "` " . join(',', $acts) . ";"); } } info_page("修改商品类型成功", '/admin/shop/modify/type/' . $id, '返回'); }
function widgets_update() { if (!is_login()) { info_page('请登录后查看'); } if (!is_admin()) { info_page('你没有权限进行操作!'); } $id = intval(v('id')); $name = strip_tags(trim(v('name'))); $desp = strip_tags(v('desp')); $pic = strip_tags(v('plugs_file')); $big_pic = strip_tags(v('plugsbig_file')); if ($id < 1) { info_page('微件ID错误!'); } $mid = lazy_get_var("SELECT `mid` FROM `u2_plugs_widget` WHERE `id` = '" . intval($id) . "'"); if (!$mid) { info_page('微件ID错误!'); } if ($name == '') { info_page('微件名称不能为空!'); } if ($desp == '') { info_page('请填写微件简介!'); } $widgets_update = "UPDATE `u2_plugs_widget` SET `name` = " . s($name) . ", `pic` = " . s($pic) . ", `big_pic` = " . s($big_pic) . ","; $widgets_update .= "`desp` = " . s($desp) . ", `time` = '" . date('Y-m-d') . "' "; $widgets_update .= "WHERE `id` = '" . intval($id) . "'"; //echo $widgets_update; lazy_run_sql($widgets_update); info_page('修改成功!', '/plugs/index/' . $mid, '| 返回'); }
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $id = intval(array_shift($args)); $page = intval(array_shift($args)); $return_page = intval(array_shift($args)); $return_key = intval(array_shift($args)); $line = lazy_get_line("SELECT * FROM `app_iforum_posts` WHERE id = '{$id}' AND `is_active` = 1 LIMIT 1"); if (!$line || $line['uid'] != format_uid()) { info_page('你没有权限进行此操作'); } if ($line['parent_id'] != '0') { $desp = v('desp'); if (!$desp) { info_page('内容不能为空@'); } lazy_run_sql("update `app_iforum_posts` set `desp` = " . s($desp) . " WHERE id = '{$id}' LIMIT 1 "); } else { $title = htmlspecialchars(z(v('title'))); $type = intval(v('type')); $desp = v('desp'); if (!$title || !$desp) { info_page('标题和内容不能为空'); } lazy_run_sql("update `app_iforum_posts` set `title` = '{$title}' ,`desp`=" . s($desp) . ", `type` = '{$type}' WHERE id = '{$id}' LIMIT 1 "); } $dis_id = $line['parent_id'] == '0' ? $id : $line['parent_id']; header("Location: /app/native/iforum/display/" . $dis_id . '/' . $page . '/' . $return_page . '/' . $return_key);
$item = lazy_get_line("select * FROM `global_items` WHERE `id` = '{$id}' limit 1 "); if (!$item) { die('没有找道具资料'); } //装备检查 $weared = lazy_get_var("select count(*) from `global_items_carry` where `iid`='{$id}' and `uid` = '{$uid}' "); if ($weared) { die('你已经携带了此道具'); } $weared_count = lazy_get_var("select count(*) from `global_items_carry` where `uid` = '{$uid}' "); if ($weared_count >= 5) { die('你已经不能再携带东西了'); } if ($count == '1') { lazy_run_sql("DELETE FROM `global_user_items` WHERE `uid` ='{$uid}' and `iid` = '{$id}' limit 1 "); $js_data[] = '$("item_' . $id . '").remove()'; $js_data[] = '$("baggage_count").value =parseInt($("baggage_count").value) - 1 '; } else { lazy_run_sql("UPDATE `global_user_items` SET `count` = `count` - 1 WHERE `uid` = '{$uid}' and `iid` = '{$id}' limit 1 "); $js_data[] = '$("item_count_value_' . $id . '").value = parseInt($("item_count_value_' . $id . '").value ) - 1 '; $js_data[] = '$("item_count_' . $id . '").innerHTML =$("item_count_value_' . $id . '").value'; } lazy_run_sql("INSERT INTO `global_items_carry` (`uid` , `iid` ,`taked` )VALUES('{$uid}','{$item['id']}' , '0' ) "); $js_data[] = 'ihome_carry_item("' . $id . '","' . $item['pic'] . '" ,"' . $item['desp'] . '")'; //$js_data[] = '$("wear_'.$item['type'].'").setHTML("<a href=\"JavaScript:irpg_unset_item('.$item['id'].')\"><img src=\''.$item['pic'].'\' alt=\"'.$item['desp'].'\" /></a>")'; $display = '您携带了' . $item['name']; echo $display; if ($js_data) { $js_code = '<script>' . join(';', $js_data) . ';</script>'; echo $js_code; }
<?php include_once dirname(__FILE__) . '/function.php'; $data['ci_top_title'] = '验证文章信息成功!'; if (!is_login()) { info_page('请登录后查看'); } if (!is_admin()) { info_page('你没有权限进行操作!'); } $num = lazy_get_var("SELECT COUNT(*) FROM `app_feed_item` WHERE `state` = '1'"); if ($num == '0') { info_page('没有需要验证的文章!!', '/app/native/' . $GLOBALS['app'] . '/item/1/all'); } lazy_run_sql("UPDATE `app_feed_item` SET `state` = '2'"); info_page('验证文章信息成功!!', '/app/native/' . $GLOBALS['app'] . '/item/1/all');
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 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); }
$i++; } $ware = serialize($ware); $money_end = $money_sum * ($agio / 100); //应付 $stint = $money_sum - $money_end; //节省 $data = array(); $data['toname'] = $toname; $data['totell'] = $totell; $data['tocode'] = intval($tocode); $data['tohome'] = $tohome; $data['need'] = $need; $data['carry_type'] = intval($carry); $data['pack_type'] = intval($pack); $data['ware'] = $ware; $data['money'] = $money_end; $data['stint'] = $stint; global $CI; $CI->load->database(); $CI->db->where('id', $id); $CI->db->update('app_shoporder', $data); $name_num = lazy_get_var("SELECT COUNT(*) FROM `app_shopuser` WHERE `uid` = '" . intval($uid) . "' AND `name` = " . s($toname) . " "); if ($name_num == '0') { $sql = "INSERT INTO `app_shopuser` (`uid`, `name`, `tell`, `code`, `home`) VALUES"; $sql .= "('" . intval($uid) . "' , " . s($toname) . ", " . s($totell) . ", '" . intval($tocode) . "', " . s($tohome) . ")"; lazy_run_sql($sql); } else { lazy_run_sql("UPDATE `app_shopuser` SET `tell` = " . s($totell) . " , `code` = '" . intval($tocode) . "', `home` = " . s($tohome) . " WHERE `id` = '" . intval($suid) . "'"); } header('Location: /app/native/' . $GLOBALS['app'] . '/order_modify/' . $id);
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $cid = intval(array_shift($args)); $uid = format_uid(); $lines = lazy_get_line("SELECT sql_calc_found_rows `tid` FROM `u2_comment` WHERE `id` = '" . intval($cid) . "' AND `uid` = '" . intval($uid) . "'"); $num = get_count(); if ($num == '0') { info_page('你没有权限进行此次操作或参数错误!'); } lazy_run_sql("DELETE FROM `u2_comment_vote` WHERE `cid` = '" . intval($cid) . "'"); lazy_run_sql("DELETE FROM `u2_comment_reply` WHERE `cid` = '" . intval($cid) . "'"); lazy_run_sql("DELETE FROM `u2_comment` WHERE `id` = '" . intval($cid) . "'"); lazy_run_sql("UPDATE `app_content_{$mid}` SET `comnum` = `comnum`-1 WHERE `id` = '" . intval($tid) . "'"); header('Location: /app/native/' . $GLOBALS['app'] . '/display/' . $lines['tid'] . ''); die; ?>
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } $tid = intval(array_shift($args)); $text = trim(urldecode(array_shift($args))); if (empty($tid) || empty($text)) { info_page('参数错误'); } $uid = format_uid(); lazy_run_sql("DELETE FROM `u2_vote` WHERE `mid` = '" . intval($mid) . "' AND `uid` = '" . intval($uid) . "' AND `tid` = '" . intval($tid) . "' "); lazy_run_sql("INSERT INTO `u2_vote` (`mid`, `uid`, `tid`, `text`) VALUES ('" . intval($mid) . "', '" . intval($uid) . "', '" . intval($tid) . "', " . s($text) . " )"); header('Location: /app/native/' . $GLOBALS['app'] . '/display/' . $tid . ''); die;
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; }
<?php include_once dirname(__FILE__) . '/function.php'; if (!is_login()) { info_page('请登录后查看'); } if (!is_admin()) { info_page('你没有权限进行操作!'); } $wid = intval(array_shift($args)); if (!isset($wid) || $wid < 1) { info_page("ID错误!"); } $wnum = lazy_get_var("SELECT * FROM `app_feed_recommend` WHERE `id` = '" . intval($wid) . "'"); if (!$wnum) { info_page("没有此条记录"); } lazy_run_sql("DELETE FROM `app_feed_recommend` WHERE `id` = '" . intval($wid) . "' LIMIT 1"); header('Location:/app/native/' . $GLOBALS['app'] . '/feed'); ?>
private function feedig_auto_update() { $ifeed = lazy_get_line("SELECT * FROM `u2_app` WHERE `aid` = 'ifeedig' LIMIT 1"); if ($ifeed) { $ftime = file_get_contents(dirname(__FILE__) . '/feed_auto.txt'); if ($ftime) { $time = date('Y-m-d H:i:s', time() - app_config('update_time', $ifeed['u2_folder'])); if ($time > $ftime) { $info = lazy_get_data("SELECT * FROM `app_feed`"); foreach ($info as $k => $v) { $feed = $v['feed']; $tid = $v['tid']; $id = $v['id']; $state = $v['state']; $fuid = $v['uid']; if (!empty($feed)) { $CI =& get_instance(); $CI->load->library('simplepie'); $CI->simplepie->set_feed_url($feed); $CI->simplepie->init(); $items = $CI->simplepie->get_items(); foreach ($items as $item) { $title = $item->get_title(); // $desp = $item->get_content(); // $link = $item->get_link(); $date = date('Y-m-d H:i:s', strtotime($item->get_date())); $unistring = md5($link) . $date; $itid = lazy_get_var("SELECT `tid` FROM `app_feed_item` WHERE `unistring` = '" . $unistring . "'"); if ($itid > 0) { //update $sql = "UPDATE `app_feed_item` SET `tid` = '" . intval($itid) . "',"; $sql .= " `fid` = '" . intval($id) . "', `title` = " . s($title) . ","; $sql .= "`desp` = " . s($desp) . ",`time` = " . s($date) . ", `link` = " . s($link) . ""; $sql .= "WHERE `unistring` = '" . $unistring . "' LIMIT 1 "; lazy_run_sql($sql); } else { //insert $sql = "INSERT INTO `app_feed_item` (`tid`, `fid`, `title`,"; $sql .= " `desp`, `time`, `link`, `state`, `unistring`, `admin_uid`)"; $sql .= "VALUES ('" . intval($tid) . "', '" . intval($id) . "', " . s($title) . ","; $sql .= " " . s($desp) . ", " . s($date) . " , " . s($link) . ","; $sql .= "'" . $state . "', " . s($unistring) . ", '" . intval($fuid) . "')"; lazy_run_sql($sql); } lazy_run_sql("UPDATE `app_feed` SET `time` = '" . date('Y-m-d H:i:s') . "' WHERE `id` = '" . $id . "'"); } } } file_put_contents(dirname(__FILE__) . '/feed_auto.txt', date('Y-m-d H:i:s')); } } else { file_put_contents(dirname(__FILE__) . '/feed_auto.txt', date('Y-m-d H:i:s')); } } }
} $id = intval(array_shift($args)); $wid = intval(array_shift($args)); $uid = format_uid(); $order = lazy_get_line("SELECT * FROM `app_shoporder` WHERE `id` = '" . intval($id) . "' AND `enter` = '0' LIMIT 1"); if (!$order) { info_page('您没有此条订单'); } if ($uid != $order['uid']) { info_page('您没有权限进行此次操作!'); } $ware = unserialize($order['ware']); if (!in_array($ware[$wid], $ware)) { info_page('参数错误!'); } unset($ware[$wid]); $money_sum = 0; foreach ($ware as $k => $v) { $money_sum = $money_sum + $v['num'] * $v['money']; } $money_end = $money_sum * ($agio / 100); //应付 $stint = $money_sum - $money_end; //节省 if (!isset($ware) || empty($ware)) { lazy_run_sql("DELETE FROM `app_shoporder` WHERE `id` = '" . intval($id) . "'"); info_page('订单中没有商品了,订单已被删除!', '/app/native/' . $GLOBALS['app'], '反回购物车!'); } $ware = serialize($ware); lazy_run_sql("UPDATE `app_shoporder` SET `ware` = " . s($ware) . " , `money` = '" . $money_end . "' , `stint` = '" . $stint . "' WHERE `id` = '" . intval($id) . "'"); header('Location: /app/native/' . $GLOBALS['app'] . '/order_modify/' . $id);
$return_page = intval(array_shift($args)); $return_key = intval(array_shift($args)); $desp = v('desp'); if (!$desp) { info_page('回复内容不能为空'); } $check = lazy_get_line("SELECT * FROM `app_iforum_posts` WHERE id = '{$id}' AND `is_active` = 1 AND `parent_id` = '0' LIMIT 1"); if (!$check) { info_page('错误的参数'); } $forum = lazy_get_line("SELECT * from `app_iforum_status` where `id` = '{$check['fid']}' and `is_active` = '1' limit 1"); 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'];
function do_karma($karma, $uid, $type) { $sql = "SHOW TABLES LIKE 'app_ibank_account' "; if (lazy_get_var($sql)) { $uid = intval($uid); $karma = intval($karma); $key = $type == 'gold' ? 'gold_count' : 'g_count'; $line = lazy_get_line("select * from `app_ibank_account` where `uid` = '{$uid}' limit 1"); if ($karma > 0) { if ($line) { $sql = "update `app_ibank_account` set `{$key}` = `{$key}` + {$karma} where `id` = '{$line['id']}' limit 1 "; } else { $g_count = $key == 'g_count' ? $karma : 0; $gold_count = $key == 'gold_count' ? $karma : 0; $sql = "insert into `app_ibank_account` ( `uid` , `g_count` , `gold_count` )values('{$uid}','{$g_count}','{$gold_count}')"; } } else { if ($line) { $check = $line[$key] + $karma; if ($check > 0) { $sql = "update `app_ibank_account` set `{$key}` = `{$key}` + {$karma} where `id` = '{$line['id']}' limit 1 "; } else { $sql = "update `app_ibank_account` set `{$key}` 0 where `id` = '{$line['id']}' limit 1 "; } } else { return; } } lazy_run_sql($sql); } }
$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');
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) . " )"); } header('Location: /app/native/' . $GLOBALS['app']);
<?php if (!is_login()) { die('请登陆后操作'); } include_once dirname(__FILE__) . '/function.php'; $id = intval(array_shift($args)); $floor = intval(array_shift($args)); $line = lazy_get_line("SELECT * FROM `app_iforum_posts` WHERE id = '{$id}' AND `is_active` = 1 LIMIT 1"); if (!$line) { die('错误的参数'); } $post_uid = $line['parent_id'] ? lazy_get_var("SELECT `uid` FROM `app_iforum_posts` WHERE id = '{$line['parent_id']}' AND `parent_id` = '0' AND `is_active` = 1 LIMIT 1") : $line['uid']; $uid = format_uid(); if (!is_admin() && $uid != $line['uid'] && $uid != $post_uid) { die('你没有权限进行此操作'); } $del_uid = $uid; lazy_run_sql("update `app_iforum_posts` set `del_uid` = '{$uid}' WHERE id = '{$id}' LIMIT 1 "); echo '成功删除文章'; $name = $uid == $post_uid ? '楼主' : ($uid == $line['uid'] ? '发布者' : '管理员'); $js_data[] = '$("display_img_' . $id . '").setHTML("")'; $js_data[] = '$("display_info_' . $id . '").setHTML(\'<span class="r">' . show_floor($floor) . '</span><del>该楼已被' . $name . '删除</del>\')'; echo '<script>' . join(';', $js_data) . ';</script>'; ?>