当前位置: 首页>>代码示例>>PHP>>正文


PHP lazy_get_var函数代码示例

本文整理汇总了PHP中lazy_get_var函数的典型用法代码示例。如果您正苦于以下问题:PHP lazy_get_var函数的具体用法?PHP lazy_get_var怎么用?PHP lazy_get_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了lazy_get_var函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_page

 function add_page($page_info)
 {
     $this->db->select('COUNT(*)')->from('u2_page')->where('u2_tag', $page_info['page_title']);
     $data['u2_link'] = NULL;
     if (lazy_get_var()) {
         return false;
     }
     $data = $this->get_page_data($page_info);
     $this->db->select('MAX(u2_order)')->from('u2_page');
     $data['u2_order'] = lazy_get_var() + 1;
     $data['u2_is_system'] = '0';
     $data['u2_in_tab'] = '1';
     $this->db->insert('u2_page', $data);
     return $this->db->insert_id();
 }
开发者ID:yunsite,项目名称:easysns,代码行数:15,代码来源:riki_model.php

示例2: add

 function add($keywords, $modules, $sid)
 {
     // 检查是否存在
     $data = array();
     $data['sid'] = $sid;
     $data['keywords'] = $keywords;
     $data['modules'] = $modules;
     $data['created'] = date("Y-m-d H:i:s");
     $this->db->select('count(*) as c')->from('s_conf')->where('sid', $sid);
     if (lazy_get_var() > 0) {
         $this->db->where('sid', $sid);
         return $this->db->update('s_conf', $data);
     } else {
         return $this->db->insert('s_conf', $data);
     }
 }
开发者ID:yunsite,项目名称:easysns,代码行数:16,代码来源:config_model.php

示例3: form_save

 function form_save()
 {
     $this->check_admin();
     $name = z(v('name'));
     $title = z(v('title'));
     if (!$name || !$title) {
         info_page('英文标示和标题不能为空');
     }
     $path = 'application/app/' . $name . '/';
     if (is_dir(ROOT . $path)) {
         info_page($path . '目录已被占用');
     }
     $count = lazy_get_var("select count(*) from `w2_form` where `name` = '{$name}' ");
     if ($count) {
         info_page('英文唯一标示已被占用!');
     }
     $this->form->save();
 }
开发者ID:yunsite,项目名称:easysns,代码行数:18,代码来源:design.php

示例4: save

 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登陆.', '/', '返回首页');
 }
开发者ID:yunsite,项目名称:easysns,代码行数:23,代码来源:extra.php

示例5: check_pincode

 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();
 }
开发者ID:yunsite,项目名称:easysns,代码行数:6,代码来源:user_model.php

示例6: dirname

<?php

include_once dirname(__FILE__) . '/function.php';
$data['ci_top_title'] = 'ITEM列表';
if (!is_login()) {
    info_page('请登录后查看');
}
if (!is_admin()) {
    info_page('你没有权限进行操作!');
}
$fid = intval(array_shift($args));
if (!isset($fid) || $fid < 1) {
    info_page("参数错误!");
}
$fnum = lazy_get_var("SELECT COUNT(*) FROM `app_feed` WHERE `id` = '" . intval($fid) . "'");
if ($fnum == '0') {
    info_page("没有此条Feed!");
}
$data['items'] = lazy_get_data("SELECT sql_calc_found_rows * FROM `app_feed_item` WHERE `fid` = '" . intval($fid) . "' LIMIT 10");
$data['count'] = get_count();
$data['fid'] = $fid;
layout($data, 'default', 'app');
?>
 

开发者ID:yunsite,项目名称:easysns,代码行数:23,代码来源:feed_remove.php

示例7: die

<?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>';
?>
 
开发者ID:yunsite,项目名称:easysns,代码行数:25,代码来源:del.php

示例8: check_app_install

function check_app_install($id)
{
    $sql = "SHOW TABLES LIKE 'app_content_" . intval($id) . "' ";
    return lazy_get_var($sql);
}
开发者ID:yunsite,项目名称:easysns,代码行数:5,代码来源:design_helper.php

示例9: dirname

<?php

include_once dirname(__FILE__) . '/function.php';
$data['ci_top_title'] = '添加Feed';
if (!is_login()) {
    info_page('请登录后查看');
}
if (!is_admin()) {
    info_page('你没有权限进行操作!');
}
$feed_id = intval(array_shift($args));
if ($feed_id != '0') {
    $feed = lazy_get_var("SELECT `feed` FROM `app_feed_recommend` WHERE `id` = '" . $feed_id . "' LIMIT 1");
} else {
    $feed = v('fblog');
    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();
开发者ID:yunsite,项目名称:easysns,代码行数:31,代码来源:feed_add.php

示例10: array

}
$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');
开发者ID:yunsite,项目名称:easysns,代码行数:31,代码来源:index.php

示例11: admin_shop_del

 function admin_shop_del($action, $id)
 {
     $this->is_admin();
     $array = array('brands', 'type');
     if (in_array($action, $array)) {
         $id = intval($id);
         lazy_run_sql("delete from `u2_shop_" . $action . "` where `id` = '{$id}' limit 1");
     }
     if ($action == 'type') {
         lazy_run_sql("delete from `u2_shop_items` where `type` = '{$id}'");
         $eid = lazy_get_var("SHOW TABLES LIKE 'shop_extra_" . intval($id) . "' ");
         if ($eid) {
             lazy_run_sql("DROP TABLE `shop_extra_" . intval($id) . "`");
         }
     }
     if ($action == 'cate') {
         $count = lazy_get_var("select count(*) from `u2_shop_cate` where `pid` = '{$id}' limit 1");
         if ($count) {
             die('此分类下有其他分类,不能删除此分类');
         }
         $count = lazy_get_var("select count(*) from `u2_shop_items` where `type` = '{$id}' limit 1");
         if ($count) {
             die('此分类下有商品,不能删除此分类');
         }
         lazy_run_sql("delete from `u2_shop_cate` where `id` = '{$id}' limit 1");
     }
 }
开发者ID:yunsite,项目名称:easysns,代码行数:27,代码来源:ajax.php

示例12: dirname

<?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');
开发者ID:yunsite,项目名称:easysns,代码行数:16,代码来源:item_save.php

示例13: serialize

    $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);
开发者ID:yunsite,项目名称:easysns,代码行数:31,代码来源:order_update.php

示例14: dirname

<?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'] . '/', '返回');
?>
	
开发者ID:yunsite,项目名称:easysns,代码行数:27,代码来源:del.php

示例15: shop_update_type

 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, '返回');
 }
开发者ID:yunsite,项目名称:easysns,代码行数:66,代码来源:admin.php


注:本文中的lazy_get_var函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。