本文整理汇总了PHP中hg_getip函数的典型用法代码示例。如果您正苦于以下问题:PHP hg_getip函数的具体用法?PHP hg_getip怎么用?PHP hg_getip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hg_getip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addpoint
public function addpoint()
{
/*********************权限管理*****************/
if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
$this->verify_content_prms(array('_action' => 'manage'));
}
/*********************权限管理*****************/
if (!isset($this->input['videoid'])) {
return false;
}
if (!isset($this->input['point'])) {
return false;
}
$datas['videoid'] = intval($this->input['videoid']);
$datas['point'] = intval($this->input['point']);
//$datas['precent'] = $this->input['precent'];
if (isset($this->input['brief'])) {
$datas['brief'] = $this->input['brief'];
}
$datas['user_id'] = $this->user['id'];
$datas['create_time'] = TIMENOW;
$datas['ip'] = hg_getip();
$datas['appid'] = intval($this->user['appid']);
$datas['appname'] = trim($this->user['display_name']);
$return = $this->obj->insert('point', $datas);
$this->addItem($return);
$this->output();
if (!$return) {
return false;
}
return true;
}
示例2: create
public function create()
{
if (!isset($this->input['name'])) {
$this->errorOutput("NO_NAME");
}
$params['name'] = trim($this->input['name']);
if (isset($this->input['desc'])) {
$params['desc'] = trim($this->input['desc']);
}
//如果参数设置state=0表示审核未通过,则数据库中该字段默认为1表示审核通过
if (isset($this->input['state'])) {
$params['state'] = intval($this->input['state']);
}
//如果参数设置type=2表示用户自定义,则数据库中该字段默认为1表示系统用户设置
if (isset($this->input['type'])) {
$params['type'] = intval($this->input['type']);
}
if (isset($this->input['cate_mark_id'])) {
$params['cate_mark_id'] = intval($this->input['cate_mark_id']);
}
if (isset($this->input['sort_id'])) {
$params['sort_id'] = intval($this->input['sort_id']);
}
$params['user_id'] = $this->user['user_id'];
$params['org_id'] = $this->user['org_id'];
$params['user_name'] = $this->user['user_name'];
$params['appid'] = $this->user['appid'];
$params['appname'] = trim($this->user['display_name']);
$params['create_time'] = TIMENOW;
$params['id'] = $this->obj->insert($this->tbname, $params);
$params['ip'] = hg_getip();
$this->addItem($params);
$this->output();
}
示例3: create
public function create()
{
if (empty($this->input['name'])) {
$this->errorOutput('分类名称不能为空');
}
$info = array('title' => $this->input['name'], 'color' => $this->input['color'], 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'user_id' => intval($this->user['user_id']), 'user_name' => trim(urldecode($this->user['user_name'])), 'log' => htmlspecialchars_decode(urldecode($this->input['log'])), 'status' => $this->input['status']);
$info['log'] = json_decode($info['log'], 1);
$info['log'] = array('id' => $info['log'][0]['id'], 'host' => $info['log'][0]['host'], 'dir' => $info['log'][0]['dir'], 'filepath' => $info['log'][0]['filepath'], 'filename' => $info['log'][0]['filename']);
//file_put_contents('info.txt',var_export($info,1));
$info['log'] = json_encode($info['log']);
$sql = "INSERT INTO " . DB_PREFIX . "group SET ";
$space = '';
foreach ($info as $k => $v) {
$sql .= $space . $k . "='" . $v . "'";
$space = ',';
}
$this->db->query($sql);
$id = $this->db->insert_id();
$sql = "UPDATE " . DB_PREFIX . "group SET order_id = " . $id . " WHERE id = " . $id;
$this->db->query($sql);
if ($id) {
$this->addLogs('添加路况分类', '', $info, $info['title']);
$this->addItem($id);
$this->output();
}
$this->errorOutput('添加失败');
}
示例4: show
public function show()
{
$data = array('template_id' => $this->input['template_id'], 'member_id' => $this->input['member_id'], 'member_name' => $this->input['member_name'], 'ip' => hg_getip(), 'create_time' => TIMENOW, 'enterprise' => $this->input['enterprise'], 'cost' => 0);
$erro_text = array('template_id' => '未知的模板');
$this->curd->set_table('templates');
$template_info = $this->curd->detail($data['template_id']);
if (!$template_info) {
$this->errorOutput("模板不存在");
}
foreach (array('video_preview', 'index_pic', 'material') as $key) {
$template_info[$key] = unserialize($template_info['material']);
}
//$template_info['material'] = unserialize($template_info['material']);
foreach ($data as $key => $val) {
if (!$val && $erro_text[$key]) {
$this->errorOutput($erro_text[$key]);
}
}
$this->curd->set_table('member_order');
if ($id = $this->curd->create($data)) {
//模板下载计数
$sql = 'UPDATE ' . DB_PREFIX . 'templates SET record=record+1 WHERE id=' . $template_info['id'];
$this->db->query($sql);
$data['id'] = $id;
$this->addItem($template_info);
$this->output();
}
$this->errorOutput('下载失败');
}
示例5: create
public function create()
{
if (!isset($this->input['tag_id'])) {
$this->errorOutput("NO_TAG_ID");
}
//boke中视频表的id
if (!isset($this->input['video_id'])) {
$this->errorOutput("NO_VIDEO_ID");
}
$result = $this->exist_favor($tag_id, $video_id);
if ($result[0]['total']) {
$this->errorOutput("FAVOR_EXIST");
}
$parmas['tag_id'] = intval($this->input['tag_id']);
$parmas['video_id'] = intval($this->input['video_id']);
$params['user_id'] = $this->user['user_id'];
$params['org_id'] = $this->user['org_id'];
$params['user_name'] = $this->user['user_name'];
$params['appid'] = $this->user['appid'];
$params['appname'] = trim($this->user['display_name']);
$params['create_time'] = TIMENOW;
$params['ip'] = hg_getip();
$params['id'] = $this->obj->insert($this->tbname, $params);
$this->addItem($params);
$this->output();
}
示例6: create
/**
* 创建相册
*/
public function create()
{
$user_info = array('user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name'], 'org_id' => $this->user['org_id'], 'appid' => $this->user['appid'], 'appname' => $this->user['display_name'], 'create_time' => TIMENOW, 'ip' => hg_getip());
if ($_FILES['Filedata']) {
//上传相册封面
include_once ROOT_PATH . 'lib/class/material.class.php';
$material = new material();
$cover_info = $material->addMaterial($_FILES);
}
$albums_name = trim(urldecode($this->input['albums_name']));
if (empty($albums_name)) {
$this->errorOutput(PARAM_WRONG);
}
//判断是否重名
$info = $this->api->detail(array('albums_name' => $albums_name, 'user_id' => $this->user['user_id']), 'id');
if ($info) {
$this->errorOutput(NAME_EXISTS);
}
$insertData = array('albums_name' => $albums_name, 'albums_cover' => $cover_info ? serialize($cover_info) : '');
$cate_id = intval($this->input['cate_id']);
$cate_info = $this->api->get_category($cate_id);
if ($cate_info) {
$insertData['cate_id'] = $cate_id;
}
$insertData = array_merge($insertData, $user_info);
$result = $this->api->create('albums', $insertData);
if ($cate_info) {
//更新数据
$this->api->update('category', array('albums_num' => 1), array('id' => $cate_id), true);
}
$this->addItem($result);
$this->output();
}
示例7: update
public function update()
{
if (!$this->input['id']) {
$this->errorOutput(NOID);
}
$data = array('name' => $this->input['name'], 'description' => $this->input['description'], 'need_update' => intval($this->input['need_update']));
//处理logo图片
if ($_FILES['map_marker']) {
$_FILES['Filedata'] = $_FILES['map_marker'];
$material_pic = new material();
$img_info = $material_pic->addMaterial($_FILES);
if ($img_info) {
$map_marker = array('host' => $img_info['host'], 'dir' => $img_info['dir'], 'filepath' => $img_info['filepath'], 'filename' => $img_info['filename']);
$data['map_marker'] = @serialize($map_marker);
}
}
$ret = $this->mode->update($data, $this->input['id']);
if ($ret) {
$update_data = array('user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name'], 'update_time' => TIMENOW, 'ip' => hg_getip());
$pre_data = $this->mode->update($update_data, $this->input['id']);
$up_data = $data + $update_data;
$this->addLogs('更新停车场类型', $pre_data, $up_data, $up_data['name']);
}
$this->addItem('success');
$this->output();
}
示例8: update
public function update()
{
$info = array('url' => trim($this->input['url']), 'source' => $this->input['source'], 'sid' => intval($this->input['sid']), 'ip' => hg_getip(), 'create_time' => TIME_NOW);
if (empty($info['url']) || empty($this->input['id'])) {
return false;
}
include_once ROOT_PATH . 'lib/class/videoUrlParser.class.php';
$obj = new VideoUrlParser();
$tmp = $obj->parse($info['url']);
if (empty($tmp)) {
return false;
}
$info['title'] = $tmp['title'];
$info['img'] = $tmp['img'];
$info['url'] = $tmp['url'];
$info['swf'] = $tmp['swf'];
$info['object'] = addslashes($tmp['object']);
$sql = "UPDATE " . DB_PREFIX . "video SET ";
$space = "";
foreach ($info as $k => $v) {
$sql .= $space . $k . "='" . $v . "'";
$space = ',';
}
$sql .= " WHERE id=" . intval($this->input['id']);
$this->db->query($sql);
return array('img' => $info['img'], 'title' => $info['title'], 'url' => $info['url'], 'id' => $info['id']);
}
示例9: create
public function create()
{
if ($this->mNeedCheckIn && !$this->prms['manage']) {
$this->errorOutput(NO_OPRATION_PRIVILEGE);
}
if (empty($this->input['config_name'])) {
$this->errorOutput('配置名称不能为空');
}
if (intval($this->input['water_type']) == 1 && empty($this->input['water_filename'])) {
$this->errorOutput('水印图片不能为空');
}
if (intval($this->input['water_type']) == 0 && empty($this->input['water_text'])) {
$this->errorOutput('水印文字不能为空');
}
$config_name = urldecode($this->input['config_name']);
switch (intval($this->input['water_type'])) {
case 0:
//文字水印
if (empty($this->input['water_text'])) {
$this->errorOutput('水印文字不能为空');
}
$water = array('config_name' => $config_name, 'type' => 0, 'position' => intval($this->input['get_photo_waterpos']), 'filename' => '', 'margin_x' => intval($this->input['margin_x']), 'margin_y' => intval($this->input['margin_y']), 'condition_x' => intval($this->input['condition_x']), 'condition_y' => intval($this->input['condition_y']), 'water_text' => urldecode($this->input['water_text']), 'water_angle' => intval($this->input['water_angle']) ? intval($this->input['water_angle']) : 1, 'water_font' => urldecode($this->input['water_font']), 'font_size' => intval($this->input['font_size']), 'opacity' => urldecode($this->input['opacity']), 'water_color' => urldecode($this->input['water_color']), 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'user_name' => trim(urldecode($this->user['user_name'])), 'global_default' => $this->input['default'] ? 1 : '');
$this->obj->create($water);
$insert_id = $this->db->insert_id();
if ($water['global_default']) {
$this->obj->update_water_nodefault($insert_id);
}
break;
case 1:
//图片水印
if (empty($this->input['water_filename'])) {
$this->errorOutput('水印图片不能为空');
}
$water_name = urldecode($this->input['water_filename']);
$water = array('config_name' => $config_name, 'type' => 1, 'position' => intval($this->input['get_photo_waterpos']), 'filename' => $water_name, 'margin_x' => intval($this->input['margin_x']), 'margin_y' => intval($this->input['margin_y']), 'condition_x' => intval($this->input['condition_x']), 'condition_y' => intval($this->input['condition_y']), 'water_text' => '', 'water_angle' => '', 'water_font' => '', 'font_size' => '', 'opacity' => urldecode($this->input['opacity']), 'water_color' => '', 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'user_name' => trim(urldecode($this->user['user_name'])), 'global_default' => $this->input['default'] ? 1 : '');
$this->obj->create($water);
$insert_id = $this->db->insert_id();
if ($water['global_default']) {
$this->obj->update_water_nodefault($insert_id);
}
//移动水印图片
$temp_file = hg_getimg_default_dir() . MATERIAL_TMP_PATH . $water_name;
$path = hg_getimg_default_dir() . WATER_PATH;
if (!hg_mkdir($path)) {
return false;
}
if (file_exists($temp_file)) {
copy($temp_file, $path . $water_name);
}
break;
default:
break;
}
hg_unlink_file(CACHE_DIR, '.water.cache.php');
//删除水印缓存文件
$water['id'] = $insert_id;
$this->addLogs('添加水印配置', '', $water, $water['config_name']);
$this->addItem($water);
$this->output();
}
示例10: create
public function create()
{
if (!$this->input['name']) {
$this->errorOutput(NO_NAME);
}
if (!$this->input['market_id']) {
$this->errorOutput('门店所属的商店不能为空');
}
if ($this->input['tel']) {
$tel = implode(',', array_filter($this->input['tel']));
}
if ($this->input['logo_id']) {
$img_id = implode(',', array_filter($this->input['logo_id']));
//多图图片数组去空
}
$data = array('name' => trim($this->input['name']), 'logo_id' => isset($img_id) ? $img_id : '', 'index_pic' => intval($this->input['logo']), 'market_id' => intval($this->input['market_id']), 'address' => trim($this->input['address']), 'tel' => isset($tel) ? $tel : '', 'opening_time' => trim($this->input['opening_time']), 'parking_num' => $this->input['parking_num'], 'brief' => trim($this->input['brief']), 'traffic' => trim($this->input['traffic']), 'free_bus' => $this->input['free_bus'], 'baidu_longitude' => $this->input['baidu_longitude'], 'baidu_latitude' => $this->input['baidu_latitude'], 'ip' => hg_getip(), 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'user_name' => $this->user['user_name'], 'user_id' => $this->user['user_id'], 'org_id' => $this->user['org_id'], 'update_user_name' => $this->user['user_name'], 'update_user_id' => $this->user['user_id']);
//如果百度坐标存在的话,就转换为gps坐标也存起来
if ($data['baidu_latitude'] && $data['baidu_longitude']) {
$gps = FromBaiduToGpsXY($data['baidu_longitude'], $data['baidu_latitude']);
$data['gps_x'] = $gps['gps_x'];
$data['gps_y'] = $gps['gps_y'];
} else {
$data['gps_x'] = 0;
$data['gps_y'] = 0;
}
$ret = $this->mode->create($data);
if ($ret) {
$this->addLogs('创建门户信息', '', $ret, '创建门户信息' . $ret['id']);
$this->addItem('success');
$this->output();
}
}
示例11: update
public function update()
{
//检测是否具有配置权限
if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
if (!$this->user['prms']['app_prms'][APP_UNIQUEID]['setting']) {
$this->errorOutput(NO_PRIVILEGE);
}
$this->verify_create_node(intval($this->input['fid']));
}
if (!$this->input['id']) {
$this->errorOutput(NOID);
return;
}
if (!$this->input['name']) {
$this->errorOutput(NOSORTNAME);
}
$data = array('id' => intval($this->input['id']), 'name' => trim(urldecode($this->input['name'])), 'brief' => trim(urldecode($this->input['brief'])), 'update_time' => TIMENOW, 'user_name' => $this->user['user_name'], 'ip' => hg_getip(), 'fid' => intval($this->input['fid']));
//初始化
$this->initNodeData();
//设置新增或者需要更新的节点数据
$this->setNodeData($data);
//设置操作的节点ID
$this->setNodeID($data['id']);
//更新方法
$this->updateNode();
$this->addItem($data);
$this->output();
}
示例12: logout
/**
*/
public function logout()
{
if ($access_token = $this->input['access_token']) {
$data['access_token'] = $access_token;
} else {
$this->errorOutput(NO_ACCESS_TOKEN);
}
$Members = new members();
$device_token = $Members->check_device_token(trim($this->input['device_token']));
$udid = $Members->check_udid(trim($this->input['uuid']));
if ($device_token === 0) {
$this->errorOutput(ERROR_DEVICE_TOKEN);
}
if ($udid === 0) {
$this->errorOutput(ERROR_UDID);
}
$auth = new auth();
$logoutInfo = $auth->logout($data);
//会员痕迹
$member_trace_data = array('member_id' => $logoutInfo['user_id'], 'member_name' => $logoutInfo['user_name'], 'content_id' => $logoutInfo['user_id'], 'title' => $logoutInfo['user_name'], 'type' => 'logout', 'op_type' => '退出', 'appid' => $logoutInfo['appid'], 'appname' => $logoutInfo['display_name'], 'create_time' => TIMENOW, 'ip' => hg_getip(), 'device_token' => $device_token, 'udid' => $udid);
$mMember = new member();
$mMember->member_trace_create($member_trace_data);
$_logoutInfo = array('member_id' => $logoutInfo['user_id'], 'member_name' => $logoutInfo['user_name'], 'is_member' => $logoutInfo['is_member'], 'logout' => $logoutInfo['logout']);
$this->addItem($_logoutInfo);
$this->output();
}
示例13: get_content
function get_content()
{
$id = intval($this->input['from_id']);
$sort_id = intval($this->input['sort_id']);
$offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
$num = $this->input['num'] ? intval($this->input['num']) : 10;
$data_limit = ' LIMIT ' . $offset . ' , ' . $num;
if ($id) {
$sql = "SELECT * FROM " . DB_PREFIX . "feedback WHERE id = {$id}";
} else {
$sql = "SELECT * FROM " . DB_PREFIX . "feedback WHERE node_id = {$sort_id}";
}
$info = $this->db->query($sql);
$ret = array();
while ($row = $this->db->fetch_array($info)) {
$row['bundle_id'] = APP_UNIQUEID;
$row['module_id'] = MOD_UNIQUEID;
$row['struct_id'] = 'feedback';
$row['struct_ast_id'] = '';
$row['expand_id'] = '';
$row['content_fromid'] = $row['id'];
$row['ip'] = hg_getip();
$row['user_id'] = $row['user_id'];
$row['create_user'] = $row['user_name'];
unset($row['id']);
$ret[] = $row;
}
$this->addItem($ret);
$this->output();
}
示例14: update
public function update()
{
if ($this->mNeedCheckIn && !$this->prms['manage']) {
$this->errorOutput(NO_OPRATION_PRIVILEGE);
}
$id = intval($this->input['id']);
if (!$id) {
$this->errorOutput('未传入ID');
}
$name = trim($this->input['name']);
if (!$name) {
$this->errorOutput('名称不能为空');
}
if (!($subject = trim($this->input['subject']))) {
$this->errorOutput('请填写邮件标题');
}
if (!($body = trim($this->input['body']))) {
$this->errorOutput('请填写邮件内容');
}
$content_template_info = $this->ect->detail($id);
$appuniqueid = trim($this->input['appuniqueid']);
if ($appuniqueid != $content_template_info['appuniqueid']) {
$this->errorOutput('请勿修改应用标识');
}
$status = $this->user['group_type'] <= MAX_ADMIN_TYPE ? 1 : 0;
$data = array('name' => $name, 'subject' => strip_tags($subject), 'body' => $body, 'user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name'], 'update_time' => TIMENOW, 'ip' => hg_getip(), 'status' => $status);
$info = $this->ect->update(array('id' => $id), $data);
$this->addItem($info);
$this->output();
}
示例15: insert_plan_set
public function insert_plan_set()
{
$set_fid = urldecode($this->input['set_fid']);
$name = urldecode($this->input['name']);
$bundle_id = urldecode($this->input['bundle_id']);
$module_id = urldecode($this->input['module_id']);
$struct_id = urldecode($this->input['struct_id']);
$struct_ast_id = urldecode($this->input['struct_ast_id']);
$num = intval($this->input['num']) ? intval($this->input['num']) : 10;
$host = urldecode($this->input['host']);
$path = urldecode($this->input['path']);
$filename = urldecode($this->input['filename']);
$action_get_content = urldecode($this->input['action_get_content']);
$action_insert_contentid = urldecode($this->input['action_insert_contentid']);
if (empty($name) || empty($num) || empty($host) || empty($path) || empty($filename) || empty($action_get_content) || empty($action_insert_contentid)) {
$this->errorOutput('缺少相关参数');
}
//先插入节点
$sort_data = array('ip' => hg_getip(), 'create_time' => TIMENOW, 'fid' => $set_fid, 'update_time' => TIMENOW, 'name' => $name, 'brief' => '', 'user_name' => '');
$this->initNodeData();
$this->setNodeTable('plan_set');
$this->setCondition(",bundle_id='" . $bundle_id . "',module_id='" . $module_id . "',struct_id='" . $struct_id . "',struct_ast_id='" . $struct_ast_id . "',host='" . $host . "',path='" . $path . "',filename='" . $filename . "',action_insert_contentid='" . $action_insert_contentid . "',action_get_content='" . $action_get_content . "',num='" . $num . "'");
$this->setNodeData($sort_data);
$fid = $this->addNode();
}