Example #1
0
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;
}
Example #2
0
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;
}
Example #3
0
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;
}
Example #4
0
 function plist($cid, $start, $limit)
 {
     if ($cid > 0) {
         $this->db->select('*')->from('u2_content')->where('u2_cate', $cid)->where('u2_is_active', 1)->orderby('id', 'DESC')->limit($limit, $start);
     } else {
         $this->db->select('*')->from('u2_content')->where('u2_is_active', 1)->orderby('id', 'DESC')->limit($limit, $start);
     }
     return lazy_get_data();
 }
Example #5
0
function get_system_newuser_data($para = NULL)
{
    $para = unserialize($para);
    $limit = isset($para['limit']) && intval($para['limit']) > 0 ? intval($para['limit']) : 9;
    $cpl = isset($para['cpl']) && intval($para['cpl']) > 0 ? intval($para['cpl']) : 3;
    $data['title'] = (isset($para['title']) && strip_tags($para['title'])) != '' ? strip_tags($para['title']) : 'New Members';
    $CI =& get_instance();
    $CI->db->select('*')->from('u2_user')->orderby('id', 'desc')->limit($limit);
    $data['members'] = array_chunk(lazy_get_data(), $cpl);
    return $data;
}
Example #6
0
function iforum_get_cates($fid)
{
    $cates = array();
    $list = lazy_get_data("select * from app_iforum_cate where fid = '{$fid}' order by `key` ");
    if ($list) {
        foreach ($list as $v) {
            $cates[$v['key']] = $v;
        }
    }
    return $cates;
}
Example #7
0
 function index()
 {
     //$data = array();
     $data['ci_top_title'] = '微件列表';
     $args = func_get_args();
     if (isset($args[2])) {
         $search = strip_tags(trim($args[2]));
         $search = urldecode($search);
     } else {
         $search = strip_tags(trim(v('search')));
     }
     $data['search'] = $search;
     $type = intval(v('type'));
     if ($args) {
         $mid = intval($args[0]);
     }
     if (!isset($mid) || $mid == '') {
         $mid = $type;
     }
     //
     if ($mid == '0') {
         $where = " AND `name` LIKE '%" . $search . "%' ";
         //$data['name'] = '全部范围';
     } elseif ($mid > '0') {
         $where = " AND `mid` = '" . intval($mid) . "' AND `name` LIKE '%" . $search . "%'";
         $name = lazy_get_var("SELECT `name` FROM `u2_plugs` WHERE 1 AND `id` = '" . intval($mid) . "'");
         if (!$name) {
             info_page('错误的组件ID');
         }
     } else {
         info_page('错误的组件ID');
     }
     $data['mid'] = $mid;
     $data['plugs_name'] = lazy_get_data("SELECT * FROM `u2_plugs`");
     $data['page'] = $page = !isset($args[1]) || intval($args[1]) < 1 ? 1 : intval($args[1]);
     $limit = 5;
     $start = ($page - 1) * $limit;
     $item = lazy_get_data("SELECT sql_calc_found_rows * FROM `u2_plugs_widget` WHERE 1 {$where} ORDER BY `id` DESC  LIMIT {$start},{$limit}");
     $all = get_count();
     $data['item'] = $item;
     //$type = urlencode( $type );
     $base = '/plugs/index/' . $mid;
     $page_all = ceil($all / $limit);
     $text = urlencode($search);
     $data['pager'] = get_pager($page, $page_all, $base, $text);
     $data['is_admin'] = is_admin() ? true : false;
     $domain = _sess('domain');
     if ($domain != '') {
         $data['domain'] = $domain;
     }
     $this->view('list', $data);
 }
Example #8
0
function get_system_news_data($para = NULL)
{
    $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;
    $limit = isset($para['limit']) && intval($para['limit']) > 0 ? intval($para['limit']) : 10;
    $where = NULL;
    if ($days > 0) {
        $where = " where `u2_time` > '" . date("Y-m-d", strtotime(" - {$days} days")) . "' ";
    }
    $data['items'] = lazy_get_data("select * from `u2_mini_feed` {$where} order by `id` desc limit {$limit} ");
    return $data;
}
Example #9
0
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;
}
Example #10
0
 function index()
 {
     set_time_limit(0);
     $limit = 1000;
     $step = 11;
     $start = ($step - 1) * $limit;
     $sql = "SELECT DISTINCT cid FROM `app_icase_pictures` limit {$start},{$limit} ";
     $temp = lazy_get_data($sql);
     $this->load->database();
     if ($temp) {
         foreach ($temp as $v) {
             $data['id'] = $v['cid'];
             $this->db->insert('temp', $data);
         }
     }
     $step++;
     echo $step;
     die;
 }
Example #11
0
function get_state_html_by_id($id)
{
    $mid = intval(app_config('mid'));
    $html = NULL;
    $votes = array();
    $state = app_config('model_state');
    $keys = array();
    if ($state) {
        $app = explode('|', $state);
        $i = 0;
        foreach ($app as $v) {
            $v = trim($v);
            if ($v) {
                $keys[] = " `text` = '{$v}' ";
            }
        }
    }
    if ($keys) {
        $first = trim($app[0]);
        $data = lazy_get_data("select `text` , count(*) as c from `u2_vote` where(" . join('or', $keys) . ") and `tid` = '{$id}' and `mid` = '{$mid}' group by `text` ");
        if ($data) {
            $html .= '<h5 class="w2">谁' . $first . '这' . app_config('model_name') . '</h5><br/>';
            foreach ($data as $v) {
                if ($v['text'] == $first) {
                    $uids = lazy_get_vars("select `uid` from `u2_vote` where `text` = '{$first}' and `tid` = '{$id}' and `mid` = '{$mid}' limit 3 ");
                    $names = get_name_by_uids($uids);
                    foreach ($uids as $v) {
                        $html .= '<div class="app_user_div"><center><a href="/user/space/' . $v . '" target="_blank"><img src="' . show_user_icon('normal', $v) . '" class="icon" /><br/>' . $names[$v]['u2_nickname'] . '</a></center></div>';
                    }
                    $html .= '<br clear="all"/>';
                    if ($v['c'] > 3) {
                        $html .= '<a href="/app/native/' . $GLOBALS['app'] . '/votepeople/' . $id . '/' . urlencode($first) . '"> > 还有' . ($v['c'] - 3) . '人' . $first . '</a><br/>';
                    }
                } else {
                    $html .= '<a href="/app/native/' . $GLOBALS['app'] . '/votepeople/' . $id . '/' . urlencode($v['text']) . '"> > ' . $v['c'] . '人' . $v['text'] . '</a><br/>';
                }
            }
        }
    }
    return $html;
}
Example #12
0
function get_system_plugs_data($para = NULL)
{
    $para = unserialize($para);
    $page = 1;
    if (isset($para['args'])) {
        $page = intval(array_shift($para['args']));
    }
    $page = $page < 1 ? 1 : $page;
    $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;
    $start = ($page - 1) * $limit;
    $data['lines'] = 4;
    $apps = lazy_get_data("SELECT sql_calc_found_rows * FROM `u2_plugs` WHERE `is_active` = 1 ORDER BY `has_widget` DESC LIMIT {$start},{$limit} ");
    $all = get_count();
    $wid = intval($GLOBALS['widget_id']);
    $page_all = ceil($all / $limit);
    $data['pager'] = get_widget_pager($wid, $page, $page_all);
    if ($apps) {
        foreach ($apps as $k => $v) {
            $aids[$v['aid']] = $v['aid'];
            $uids[$v['uid']] = $v['uid'];
        }
        if ($uids) {
            $data['names'] = get_name_by_uids($uids);
        }
        $data['aids'] = $aids;
        $data['apps'] = $apps;
    }
    $wids = lazy_get_data("SELECT * FROM `u2_plugs_widget`");
    if ($wids) {
        $data['wids'] = $wids;
    }
    $domain = _sess('domain');
    if ($domain != '') {
        $data['domain'] = $domain;
    }
    if (is_login()) {
        $data['is_login'] = true;
    }
    return $data;
}
Example #13
0
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;
}
Example #14
0
 function get_shop_orders($start = 0, $limit = 10)
 {
     $this->db->select('sql_calc_found_rows *')->from('app_shoporder')->orderby('id', 'desc')->limit($limit, $start);
     return lazy_get_data();
 }
Example #15
0
$data['fselect'] = $titles;
$view = array_shift($args);
if ($view == 'add') {
    $data['view'] = 'add';
}
//分类ID
$tnum = intval($view);
if ($tnum != '0') {
    if (!in_array($tnum, $t**s)) {
        info_page('错误的分类');
    }
    $where = "AND `tid` = '" . intval($tnum) . "'";
    $data['tnum'] = $tnum;
}
//待处理
$waiting = lazy_get_data("SELECT * FROM `app_feed_recommend` ORDER BY `timeline` DESC LIMIT 30 ");
if ($waiting) {
    $data['content'] = $content = $waiting;
    foreach ($content as $k => $v) {
        $uids[] = $v['uid'];
        $times[$v['id']] = time2Units($v['timeline']);
    }
    $data['unames'] = get_name_by_uids($uids);
    $data['waiting'] = $waiting;
    $data['times'] = $times;
}
//列表
$data['list'] = lazy_get_data("SELECT * FROM `app_feed` WHERE 1 {$where} ORDER BY `time` DESC");
$files = @file_get_contents(dirname(__FILE__) . '/snap.info.txt');
$data['snap'] = unserialize($files);
layout($data, 'default', 'app');
Example #16
0
$data['tab_type'] = $tab_type;
$data['tab_array'] = $tab_array;
$page = array_shift($args);
$page = intval($page) < 1 ? 1 : intval($page);
$limit = '48';
$start = ($page - 1) * $limit;
$uid = format_uid();
$items = lazy_get_data("select sql_calc_found_rows * from `global_user_items` where `uid` = '{$uid}' and `count` > 0 LIMIT {$start} , {$limit} ");
$all = get_count();
$base = '/app/native/ihome/items';
$page_all = ceil($all / $limit);
$data['pager'] = get_pager($page, $page_all, $base);
$data['list'] = array();
if ($items) {
    foreach ($items as $v) {
        $iid[] = $v['iid'];
        $count[$v['iid']] = $v['count'];
    }
    $items_info = lazy_get_data("select * from `global_items` where `id` IN(" . join(',', $iid) . ") ");
    if ($items_info) {
        foreach ($items_info as $v) {
            $v['count'] = $count[$v['id']];
            $data['list'][] = $v;
        }
    }
}
$data['baggage_count'] = count($data['list']);
$weared = array();
$wears = lazy_get_data("select * from `global_items` where id IN(select iid from  `global_items_carry` where uid = '{$uid}' )");
$data['wear'] = $wears;
layout($data, 'default', 'app');
Example #17
0
function get_old_fields($id)
{
    if (check_app_install($id)) {
        $fields = lazy_get_data("SHOW COLUMNS FROM app_content_" . intval($id));
        return $fields;
    } else {
        return NULL;
    }
}
Example #18
0
<?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');
Example #19
0
    $height = $pic_height ? 'height:' . $pic_height . 'px;' : NULL;
    $pic_style = ' style="' . $width . $height . '" ';
}
$data['pic_style'] = $pic_style;
$data['index_title'] = array('1' => '最新发布的', '2' => '最多点击的', '3' => '最多评论的');
$index_order = $view_type > 0 && $view_type < 4 ? $view_type : 1;
switch ($index_order) {
    case '1':
        $order = "ORDER BY `id` DESC";
        break;
    case '2':
        $order = "ORDER BY `hit` DESC";
        break;
    case '3':
        $order = "ORDER BY `comnum` DESC";
        break;
}
$data['index_order'] = $index_order;
$data['list_top'] = lazy_get_data("SELECT `id` , " . join(',', $selected) . " FROM `app_content_{$mid}` WHERE `is_active` = '1' {$order} ");
$data['coms'] = lazy_get_data("SELECT * FROM `u2_comment` where `mid` = '" . intval($mid) . "'  ORDER BY `id` DESC LIMIT 5");
$names = array();
if ($data['coms']) {
    foreach ($data['coms'] as $v) {
        $uids[$v['uid']] = $v['uid'];
        $cids[$v['tid']] = $v['tid'];
    }
    $data['contents'] = lazy_get_data("SELECT `id` , `{$bind['title']}` as title , `{$bind['pic']}` as pic FROM `app_content_{$mid}` WHERE `is_active` = '1' ", 'id');
    $names = get_user_names($uids);
}
$data['names'] = $names;
layout($data, 'default', 'app');
Example #20
0
 function get_user_invite($start, $limit, $uid = NULL)
 {
     $uid = format_uid($uid);
     $this->db->select('*')->from('u2_invite')->where('u2_uid', $uid)->orderby('id', 'desc')->limit($limit, $start);
     return lazy_get_data();
 }
Example #21
0
$fid = $fid < 1 ? 1 : $fid;
$data['forum'] = lazy_get_line("SELECT * from `app_iforum_status` where `id` = '{$fid}' and `is_active` = '1' limit 1");
if (!$data['forum']) {
    info_page('错误的讨论区id');
}
$cates = iforum_get_cates($fid);
if ($cates) {
    foreach ($cates as $v) {
        $tab_array[$v['key']] = $v['desp'];
    }
}
$data['fid'] = $fid;
$page = intval($page) < 1 ? 1 : intval($page);
$data['page'] = $page;
$start = ($page - 1) * $limit;
$list = lazy_get_data("SELECT sql_calc_found_rows * FROM `app_iforum_posts` WHERE (`fid` = '{$fid}' AND `parent_id` = '0' AND `is_active` = 1 {$where})OR(`fid` = '{$fid}' AND `parent_id` = '0' AND `is_active` = 1 AND `top_level` = '1') ORDER BY `top_level` DESC , `last_post_time` DESC LIMIT {$start} , {$limit} ");
$all = get_count();
$base = '/app/native/iforum/index/' . $fid;
$page_all = ceil($all / $limit);
$data['pager'] = get_pager($page, $page_all, $base, $type);
if ($list) {
    foreach ($list as $v) {
        $uids[$v['uid']] = $v['uid'];
        $uids[$v['last_uid']] = $v['last_uid'];
    }
    $data['names'] = iforum_get_names($uids);
}
$data['list'] = $list;
$tab_type = 'index';
$data['tab_type'] = intval($type);
$data['tab_array'] = $tab_array;
Example #22
0
$id = intval(array_shift($args));
$page = intval(array_shift($args));
$data['return_page'] = intval(array_shift($args));
$data['return_key'] = intval(array_shift($args));
$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;
Example #23
0
 function get_items_by_fid($fid)
 {
     $this->db->select('*')->from('w2_item')->where('fid', $fid)->orderby('display_order', 'DESC')->orderby('id', 'ASC')->limit(100);
     return lazy_get_data();
 }
Example #24
0
$page = array_shift($args);
$type = array_shift($args);
$type = urldecode($type);
$data['tab_type'] = 'search';
$data['tab_array'] = array('search' => '搜索论坛');
$page = intval($page) < 1 ? 1 : intval($page);
$data['page'] = $page;
$types = z(trim(v('search')));
$type = empty($types) ? $type : $types;
$limit = 10;
$start = ($page - 1) * $limit;
$where = NULL;
if ($type) {
    $where = " AND `title` LIKE '%" . $type . "%'";
}
$list = lazy_get_data("SELECT sql_calc_found_rows * FROM `app_iforum_posts` WHERE `parent_id` = '0' AND `is_active` = '1' {$where} ORDER BY `last_post_time` DESC  LIMIT {$start} , {$limit} ");
$type = urlencode($type);
$all = get_count();
$base = '/app/native/iforum/search';
$page_all = ceil($all / $limit);
$data['pager'] = get_pager($page, $page_all, $base, $type);
if ($list) {
    foreach ($list as $v) {
        $uids[$v['uid']] = $v['uid'];
        $uids[$v['last_uid']] = $v['last_uid'];
    }
    $data['names'] = iforum_get_names($uids);
}
$data['list'] = $list;
$data['forum'] = lazy_get_line("SELECT * from `app_iforum_status` where `id` = '1' and `is_active` = '1' limit 1");
if (!$data['forum']) {
Example #25
0
}
$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`");
if ($fdig) {
    foreach ($fdig as $k => $v) {
        $udig[$v['uid']][] = $v['id'];
    }
}
layout($data, 'default', 'app');
Example #26
0
 function wall_get_by_uid($uid)
 {
     $ret = array();
     $this->db->select('*')->from('u2_wall')->where('u2_uid', $uid)->orderby('u2_time', 'desc')->limit(30);
     $ret['wall'] = lazy_get_data();
     $ret['user'] = $this->get_user_info_by_array($ret['wall'], 'u2_guest_uid');
     return $ret;
 }
Example #27
0
 function get_forms($start, $limit)
 {
     $this->db->select('sql_calc_found_rows *')->from('w2_form')->orderby('id', 'DESC')->limit($limit, $start);
     return lazy_get_data();
 }
Example #28
0
}
$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);
//$data['user'] = lazy_get_data( "SELECT * FROM `u2_user` LIMIT 1" );
//echo '123';
layout($data, 'default', 'app');
Example #29
0
$toname = z(trim(v('username')));
if ($toname != '' && intval($toname) != '0') {
    $suid = $toname;
    $toname = lazy_get_var("SELECT `name` FROM `app_shopuser` WHERE `id` = '" . $toname . "'");
} else {
    $toname = z(trim(v('custom_name')));
}
$totell = z(trim(v('usertell')));
$tocode = intval(v('usercode'));
$tohome = z(trim(v('userhome')));
$pack = intval(v('pack'));
$need = z(v('need'));
if ($tocode == '0' || empty($tocode)) {
    info_page('请输入正确的邮编!');
}
$shop = lazy_get_data("SELECT * FROM `app_shopcart` WHERE `uid` = '" . intval($uid) . "'");
if (!$shop) {
    info_page('您还没有选购商品', '/app/native/' . $GLOBALS['app'], '热卖物品!');
}
$money = 0;
foreach ($shop as $v) {
    $ware[$v['id']] = $v;
    $money = $money + $v['money'] * $v['num'];
}
$ware = serialize($ware);
//购买的物品
if (empty($toname) || empty($totell) || empty($tohome)) {
    info_page('收货信息不能为空!');
}
$money_end = $money * ($agio / 100);
//应付
Example #30
0
<?php

include_once dirname(__FILE__) . '/function.php';
include_once dirname(__FILE__) . '/carry_config.php';
$data['ci_top_title'] = '浏览订单';
if (!is_login()) {
    info_page('请登录后查看');
}
$data['id'] = $id = intval(array_shift($args));
$uid = format_uid();
$data['orders'] = $orders = lazy_get_line("SELECT * FROM `app_shoporder` WHERE `id` = '" . intval($id) . "' AND `enter` = '0' LIMIT 1");
if (!$orders) {
    info_page('您没有此条订单');
}
if ($uid != $orders['uid']) {
    info_page('您没有权限进行此次操作!');
}
$data['ware'] = unserialize($orders['ware']);
$data['names'] = lazy_get_data("SELECT * FROM `app_shopuser` WHERE `uid` = '" . intval($uid) . "'");
$data['carrys'] = $carrys;
$data['agio'] = $agio;
layout($data, 'default', 'app');