• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_ip_address函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: info

 /**
  * Standard modular info function for award hooks. Provides information to allow task reporting, randomisation, and add-screen linking, to function.
  *
  * @param  ?ID_TEXT	Catalogue we'll be using (NULL: unknown).
  * @return ?array		Map of award content-type info (NULL: disabled).
  */
 function info($catalogue_name = NULL)
 {
     $info = array();
     $info['connection'] = $GLOBALS['SITE_DB'];
     $info['table'] = 'catalogue_entries';
     $info['date_field'] = 'ce_add_date';
     $info['id_field'] = 'id';
     $info['add_url'] = has_submit_permission('mid', get_member(), get_ip_address(), 'cms_catalogues') ? build_url(array('page' => 'cms_catalogues', 'type' => 'add_entry', 'catalogue_name' => $catalogue_name), get_module_zone('cms_catalogues')) : new ocp_tempcode();
     $info['category_field'] = array('c_name', 'cc_id');
     $info['category_type'] = array('catalogues_catalogue', 'catalogues_category');
     $info['parent_spec__table_name'] = 'catalogue_categories';
     $info['parent_spec__parent_name'] = 'cc_parent_id';
     $info['parent_spec__field_name'] = 'id';
     $info['parent_field_name'] = 'cc_id';
     $info['submitter_field'] = 'ce_submitter';
     $info['id_is_string'] = false;
     require_lang('catalogues');
     $info['title'] = do_lang_tempcode('CATALOGUE_ENTRIES');
     $info['validated_field'] = 'ce_validated';
     $info['category_is_string'] = array(true, false);
     $info['archive_url'] = build_url(array('page' => 'catalogues'), get_module_zone('catalogues'));
     $info['cms_page'] = 'cms_catalogues';
     $info['views_field'] = 'ce_views';
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:31,代码来源:catalogue_entry.php


示例2: info

 /**
  * Standard modular info function for award hooks. Provides information to allow task reporting, randomisation, and add-screen linking, to function.
  *
  * @return ?array	Map of award content-type info (NULL: disabled).
  */
 function info()
 {
     $info = array();
     $info['connection'] = $GLOBALS['SITE_DB'];
     $info['table'] = 'download_downloads';
     $info['date_field'] = 'add_date';
     $info['id_field'] = 'id';
     $info['add_url'] = has_submit_permission('mid', get_member(), get_ip_address(), 'cms_downloads') ? build_url(array('page' => 'cms_downloads', 'type' => 'ad'), get_module_zone('cms_downloads')) : new ocp_tempcode();
     $info['category_field'] = 'category_id';
     $info['category_type'] = 'downloads';
     $info['parent_spec__table_name'] = 'download_categories';
     $info['parent_spec__parent_name'] = 'parent_id';
     $info['parent_spec__field_name'] = 'id';
     $info['parent_field_name'] = 'id';
     $info['submitter_field'] = 'submitter';
     $info['id_is_string'] = false;
     require_lang('downloads');
     $info['title'] = do_lang_tempcode('SECTION_DOWNLOADS');
     $info['validated_field'] = 'validated';
     $info['category_is_string'] = false;
     $info['archive_url'] = build_url(array('page' => 'downloads'), get_module_zone('downloads'));
     $info['cms_page'] = 'cms_downloads';
     $info['views_field'] = 'download_views';
     $info['supports_custom_fields'] = true;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:31,代码来源:download.php


示例3: info

 /**
  * Standard modular info function for award hooks. Provides information to allow task reporting, randomisation, and add-screen linking, to function.
  *
  * @return ?array	Map of award content-type info (NULL: disabled).
  */
 function info()
 {
     $info = array();
     $info['connection'] = $GLOBALS['SITE_DB'];
     $info['table'] = 'seedy_posts';
     $info['date_field'] = 'date_and_time';
     $info['id_field'] = 'id';
     $info['add_url'] = has_submit_permission('low', get_member(), get_ip_address(), 'cedi') ? build_url(array('page' => 'cedi', 'type' => 'add_post'), get_module_zone('cedi')) : new ocp_tempcode();
     $info['category_field'] = 'page_id';
     $info['category_type'] = 'seedy_page';
     $info['parent_spec__table_name'] = 'seedy_children';
     $info['parent_spec__parent_name'] = 'parent_id';
     $info['parent_spec__field_name'] = 'child_id';
     $info['parent_field_name'] = 'page_id';
     $info['submitter_field'] = 'the_user';
     $info['id_is_string'] = false;
     require_lang('cedi');
     $info['title'] = do_lang_tempcode('CEDI_POSTS');
     $info['validated_field'] = 'validated';
     $info['category_is_string'] = false;
     $info['archive_url'] = build_url(array('page' => 'cedi'), get_module_zone('cedi'));
     $info['cms_page'] = 'cedi';
     $info['supports_custom_fields'] = true;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:seedy_post.php


示例4: add_report

 function add_report()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     #Get the report details if the user is editing
     if (!empty($data['i'])) {
         $editid = decryptValue($data['i']);
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_report_by_id', array('id' => $editid));
     }
     #Save the report details
     if ($this->input->post('savereport')) {
         $required_fields = array('reportname');
         $_POST = clean_form_data($_POST);
         $validation_results = validate_form('', $_POST, $required_fields);
         #Only proceed if the validation for required fields passes
         if ($validation_results['bool']) {
             $save_result = false;
             #Save/Update an existing report's details
             if (!empty($data['formdata']) && !empty($data['i'])) {
                 $updateStr = '';
                 #check if report has changed
                 if (!empty($_FILES['fileurl']['tmp_name'])) {
                     $new_file_url = 'ny_' . strtotime('now') . generate_random_letter() . "." . end(explode('.', $_FILES['fileurl']['name']));
                     if (copy(str_replace("/kunden/", "/", $_FILES['fileurl']['tmp_name']), UPLOAD_DIRECTORY . "reports/" . $new_file_url)) {
                         #Delete the previous report from the server if it exists
                         if (!empty($data['formdata']['fileurl'])) {
                             @unlink(UPLOAD_DIRECTORY . "reports/" . $data['formdata']['fileurl']);
                         }
                         $save_result = $this->db->query($this->Query_reader->get_query_by_code('update_report', array('updatestring' => ', fileurl = \'' . $new_file_url . '\' , uploadip = \'' . get_ip_address() . '\'', 'reportname' => $_POST['reportname'], 'id' => $editid)));
                     }
                 } else {
                     $save_result = $this->db->query($this->Query_reader->get_query_by_code('update_report', array_merge($_POST, array('id' => $editid, 'updatestring' => ''))));
                 }
             } else {
                 $new_file_url = 'ny_' . strtotime('now') . generate_random_letter() . "." . end(explode('.', $_FILES['fileurl']['name']));
                 #First move the report to the correct folder and then add the report
                 if (copy(str_replace("/kunden/", "/", $_FILES['fileurl']['tmp_name']), UPLOAD_DIRECTORY . "reports/" . $new_file_url)) {
                     $save_result = $this->db->query($this->Query_reader->get_query_by_code('add_report', array('fileurl' => $new_file_url, 'reportname' => $_POST['reportname'], 'uploadip' => get_ip_address())));
                 }
             }
             if ($save_result) {
                 $data['msg'] = "The report has been saved.";
                 $this->session->set_userdata('sres', $data['msg']);
                 redirect(base_url() . "reports/manage_reports/m/sres");
             } else {
                 $data['msg'] = "ERROR: The report was not saved. Please contact your administrator.";
             }
         }
         #VALIDATION end
         if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) {
             $data['msg'] = "WARNING: The highlighted fields are required.";
         }
         $data['requiredfields'] = $validation_results['requiredfields'];
         $data['formdata'] = $_POST;
     }
     $this->load->view('reports/add_report_view', $data);
 }
开发者ID:nwtug,项目名称:academia,代码行数:60,代码来源:reports.php


示例5: run

 /**
  * Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
  *
  * @param  boolean		Whether to look deep into the database (or whatever else might be time-intensive) for links
  * @return array			Array of links and where to show
  */
 function run($exhaustive = false)
 {
     if (!addon_installed('catalogues')) {
         return array();
     }
     $ret = array();
     if (has_specific_permission(get_member(), 'submit_cat_highrange_content', 'cms_catalogues')) {
         $ret[] = array('cms', 'catalogues', array('cms_catalogues', array('type' => 'misc'), get_module_zone('cms_catalogues')), do_lang_tempcode('ITEMS_HERE', do_lang_tempcode('CATALOGUES'), make_string_tempcode(escape_html(integer_format($GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'COUNT(*)', NULL, '', true))))), 'DOC_CATALOGUES');
     }
     if ($exhaustive) {
         $catalogues = $GLOBALS['SITE_DB']->query_select('catalogues', array('c_name', 'c_title', 'c_description', 'c_ecommerce'), NULL, '', 10, NULL, true);
         if (!is_null($catalogues)) {
             $ret2 = array();
             foreach ($catalogues as $row) {
                 if (substr($row['c_name'], 0, 1) == '_') {
                     continue;
                 }
                 if ($row['c_ecommerce'] == 0 || addon_installed('shopping')) {
                     if (has_submit_permission('mid', get_member(), get_ip_address(), 'cms_catalogues', array('catalogues_catalogue', $row['c_name']))) {
                         $ret2[] = array('cms', 'of_catalogues', array('cms_catalogues', array('type' => 'misc', 'catalogue_name' => $row['c_name']), get_module_zone('cms_catalogues')), do_lang_tempcode('ITEMS_HERE', escape_html(get_translated_text($row['c_title'])), escape_html(integer_format($GLOBALS['SITE_DB']->query_value_null_ok('catalogue_entries', 'COUNT(*)', array('c_name' => $row['c_name']), '', true)))), get_translated_text($row['c_description']));
                     }
                 }
             }
             if (count($ret2) < 10) {
                 $ret = array_merge($ret, $ret2);
             }
         }
     }
     return $ret;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:36,代码来源:catalogues.php


示例6: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     require_code('catalogues');
     require_lang('catalogues');
     require_css('catalogues');
     $number = array_key_exists('param', $map) ? intval($map['param']) : 10;
     $catalogue = array_key_exists('catalogue', $map) ? $map['catalogue'] : 'faqs';
     $zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('catalogues');
     $root = array_key_exists('root', $map) && $map['root'] != '' ? intval($map['root']) : NULL;
     $catalogues = $GLOBALS['SITE_DB']->query_select('catalogues', array('*'), array('c_name' => $catalogue), '', 1);
     if (!array_key_exists(0, $catalogues)) {
         return do_lang_tempcode('MISSING_RESOURCE', escape_html($catalogue));
     }
     $catalogue_row = $catalogues[0];
     $entries = $GLOBALS['SITE_DB']->query_select('catalogue_entries', array('*'), array('c_name' => $catalogue, 'ce_validated' => 1), 'ORDER BY ce_add_date DESC', $number);
     $tpl_set = $catalogue;
     $display_type = array_key_exists('display_type', $map) ? intval($map['display_type']) : NULL;
     list($content, , ) = get_catalogue_category_entry_buildup(db_get_first_id(), $catalogue, $catalogue_row, 'SEARCH', $tpl_set, $number, 0, NULL, $root, $display_type, false, $entries);
     $catalogue_title = get_translated_text($catalogue_row['c_title']);
     if ($content->is_empty()) {
         if (has_actual_page_access(NULL, 'cms_catalogues', NULL, NULL) && has_submit_permission('mid', get_member(), get_ip_address(), 'cms_catalogues')) {
             $submit_url = build_url(array('page' => 'cms_catalogues', 'type' => 'add_entry', 'catalogue_name' => $catalogue, 'redirect' => SELF_REDIRECT), get_module_zone('cms_catalogues'));
         } else {
             $submit_url = new ocp_tempcode();
         }
         return do_template('BLOCK_NO_ENTRIES', array('HIGH' => false, 'TITLE' => do_lang_tempcode('RECENT', escape_html(integer_format($number)), escape_html($catalogue_title)), 'MESSAGE' => do_lang_tempcode('NO_ENTRIES'), 'ADD_NAME' => do_lang_tempcode('CATALOGUE_GENERIC_ADD', escape_html($catalogue_title)), 'SUBMIT_URL' => $submit_url));
     }
     return do_template('BLOCK_MAIN_RECENT_CC_ENTRIES', array('_GUID' => 'a57fa1b83d1b6fe3acbceb2b618e6d7f', 'CATALOGUE_TITLE' => $catalogue_title, 'CATALOGUE' => $catalogue, 'CONTENT' => $content, 'NUMBER' => integer_format($number)));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:main_recent_cc_entries.php


示例7: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     require_code('downloads');
     require_css('downloads');
     require_lang('downloads');
     require_code('ocfiltering');
     $number = array_key_exists('param', $map) ? intval($map['param']) : 10;
     $filter = array_key_exists('filter', $map) ? $map['filter'] : '*';
     $zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('downloads');
     $sql_filter = ocfilter_to_sqlfragment($filter, 'p.category_id', 'download_categories', 'parent_id', 'p.category_id', 'id');
     // Note that the parameters are fiddled here so that category-set and record-set are the same, yet SQL is returned to deal in an entirely different record-set (entries' record-set)
     $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'download_downloads p WHERE validated=1 AND (' . $sql_filter . ') ORDER BY add_date DESC', $number);
     $title = do_lang_tempcode('RECENT', make_string_tempcode(integer_format($number)), do_lang_tempcode('SECTION_DOWNLOADS'));
     if (array_key_exists('title', $map) && $map['title'] != '') {
         $title = protect_from_escaping(escape_html($map['title']));
     }
     $out = new ocp_tempcode();
     foreach ($rows as $i => $row) {
         if ($i != 0) {
             $out->attach(do_template('BLOCK_SEPARATOR'));
         }
         $out->attach(get_download_html($row, true, true, $zone));
     }
     if ($out->is_empty()) {
         if (has_actual_page_access(NULL, 'cms_downloads', NULL, NULL) && has_submit_permission('mid', get_member(), get_ip_address(), 'cms_downloads')) {
             $submit_url = build_url(array('page' => 'cms_downloads', 'type' => 'ad', 'redirect' => SELF_REDIRECT), get_module_zone('cms_downloads'));
         } else {
             $submit_url = new ocp_tempcode();
         }
         return do_template('BLOCK_NO_ENTRIES', array('_GUID' => '74399763a51102bdd6e6d92c2c11354f', 'HIGH' => false, 'TITLE' => $title, 'MESSAGE' => do_lang_tempcode('NO_DOWNLOADS_YET'), 'ADD_NAME' => do_lang_tempcode('ADD_DOWNLOAD'), 'SUBMIT_URL' => $submit_url));
     }
     return do_template('BLOCK_MAIN_RECENT_DOWNLOADS', array('_GUID' => '257fa1b83d1b6fe3acbceb2b618e6d7f', 'TITLE' => $title, 'CONTENT' => $out, 'NUMBER' => integer_format($number)));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:39,代码来源:main_recent_downloads.php


示例8: signin

 public function signin($id, $password, $type = UserContact::TYPE_EMAIL)
 {
     if (!is_scalar($id)) {
         return false;
     }
     $auth = UserContact::where('type', '=', $type)->where('value', '=', $id)->first();
     if (empty($auth)) {
         return false;
     }
     $obj = User::where('id', '=', $auth->user_id)->where('password', '=', password_crypt($password))->with('session')->first();
     if (!empty($obj->id)) {
         $session = $obj->session;
         if (empty($session->id)) {
             $session = new UserSession();
         }
         $session->session_id = $this->session->id(true);
         $session->user_id = $obj->id;
         $session->ip_address = get_ip_address();
         $session->stamp = time();
         $session->save();
         $this->autorization = true;
         $this->user = $session->user;
         $smarty = new \Smarty();
         $smarty->assignGlobal('auth_user', $this->user);
         $smarty->assignGlobal('auth', $this);
         return true;
     }
     return false;
 }
开发者ID:cruide,项目名称:wasp,代码行数:29,代码来源:auth.php


示例9: info

 /**
  * Standard modular info function for award hooks. Provides information to allow task reporting, randomisation, and add-screen linking, to function.
  *
  * @return ?array	Map of award content-type info (NULL: disabled).
  */
 function info()
 {
     $info = array();
     $info['connection'] = $GLOBALS['SITE_DB'];
     $info['table'] = 'videos';
     $info['date_field'] = 'add_date';
     $info['id_field'] = 'id';
     $info['add_url'] = has_submit_permission('mid', get_member(), get_ip_address(), 'cms_galleries') ? build_url(array('page' => 'cms_galleries', 'type' => 'av'), get_module_zone('cms_galleries')) : new ocp_tempcode();
     $info['category_field'] = 'cat';
     $info['category_type'] = 'galleries';
     $info['parent_spec__table_name'] = 'galleries';
     $info['parent_spec__parent_name'] = 'parent_id';
     $info['parent_spec__field_name'] = 'name';
     $info['parent_field_name'] = 'cat';
     $info['submitter_field'] = 'submitter';
     $info['id_is_string'] = false;
     require_lang('galleries');
     $info['title'] = do_lang_tempcode('VIDEOS');
     $info['validated_field'] = 'validated';
     $info['category_is_string'] = true;
     $info['archive_url'] = build_url(array('page' => 'galleries'), get_module_zone('galleries'));
     $info['cms_page'] = 'cms_galleries';
     $info['where'] = 'cat NOT LIKE \'' . db_encode_like('download\\_%') . '\'';
     $info['views_field'] = 'video_views';
     $info['supports_custom_fields'] = true;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:32,代码来源:video.php


示例10: _initialize

 protected function _initialize()
 {
     /* 读取站点配置 */
     $config = api('Config/lists');
     C($config);
     //添加配置
     if (!C('WEB_SITE_CLOSE')) {
         $this->error('站点已经关闭,请稍后访问~');
     }
     /**垂直菜单**/
     $category = D('Category')->getCategory();
     $this->assign('category', $category);
     /**购物车**/
     $cart = D('shopcart')->getcart();
     $this->assign('usercart', $cart);
     /* 热门搜索 */
     $str = M('config')->where('id="40"')->getField("value");
     $hotsearch = explode(",", $str);
     $this->assign('hotsearch', $hotsearch);
     /* 广告位 */
     $adData = D('ad')->getlist();
     $this->assign('adData', $adData);
     /**底部菜单**/
     $footer = D('Category')->getfooter();
     $this->assign('footer', $footer);
     /**所在地**/
     if (!session("user_area")) {
         $arr = get_ip_address();
         $area = $arr->city;
     } else {
         $area = session("user_area");
     }
     $this->assign("user_area", $area);
 }
开发者ID:gitchenze,项目名称:soloshop,代码行数:34,代码来源:HomeController.class.php


示例11: settings

 function settings($data)
 {
     # a) save the main record
     $result = $this->_query_reader->run('update_organization_settings', array('logo_url' => $data['logo_url'], 'name' => htmlentities($data['name'], ENT_QUOTES), 'description' => htmlentities($data['description'], ENT_QUOTES), 'contact_address' => $data['address'], 'contact_city' => $data['city'], 'contact_region' => $data['region'], 'contact_zipcode' => $data['zipcode'], 'contact_country_id' => $data['contact__countries'], 'date_established' => !empty($data['registrationdate']) ? $data['registrationdate'] : '', 'registration_number' => $data['registrationno'], 'registration_country_id' => !empty($data['registration__countries']) ? $data['registration__countries'] : '', 'user_id' => $this->native_session->get('__user_id'), 'organization_id' => $this->native_session->get('__organization_id')));
     # d) log action
     $this->_logger->add_event(array('user_id' => $this->native_session->get('__user_id'), 'activity_code' => 'updated_organization_settings', 'result' => $result ? 'SUCCESS' : 'FAIL', 'log_details' => "organization_id=" . $this->native_session->get('__organization_id') . "|device=" . get_user_device() . "|browser=" . $this->agent->browser(), 'uri' => uri_string(), 'ip_address' => get_ip_address()));
     return array('boolean' => $result, 'reason' => '');
 }
开发者ID:nwtug,项目名称:pss-version-1.0,代码行数:8,代码来源:_organization.php


示例12: ip_to_currency

/**
 * Convert an IP address to a currency code.
 *
 * @param  ?IP			IP address (NULL: that of current member).
 * @return ID_TEXT	The currency code.
 */
function ip_to_currency($ip = NULL)
{
    if (is_null($ip)) {
        $ip = get_ip_address();
    }
    $country = geolocate_ip($ip);
    return country_to_currency($country);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:14,代码来源:currency.php


示例13: post_create

function post_create($fid, $tid, $reply_pid, $fuid, $tuid, $content, $hide_ipaddress = false)
{
    if (!($db = db::get())) {
        return -1;
    }
    $post_content = $db->escape($content);
    $ipaddress = $hide_ipaddress == false ? get_ip_address() : '';
    if (!is_numeric($tid)) {
        return -1;
    }
    if (!is_numeric($reply_pid)) {
        return -1;
    }
    if (!is_numeric($fuid)) {
        return -1;
    }
    if (!is_numeric($tuid)) {
        return -1;
    }
    $current_datetime = date(MYSQL_DATETIME, time());
    if (!($table_prefix = get_table_prefix())) {
        return -1;
    }
    // Check that the post needs approval. If the user is a moderator their posts are self-approved.
    if (perm_check_folder_permissions($fid, USER_PERM_POST_APPROVAL, $fuid) && !perm_is_moderator($fuid, $fid)) {
        $sql = "INSERT INTO `{$table_prefix}POST` (TID, REPLY_TO_PID, FROM_UID, ";
        $sql .= "TO_UID, CREATED, APPROVED, IPADDRESS) VALUES ({$tid}, {$reply_pid}, {$fuid}, ";
        $sql .= "{$tuid}, CAST('{$current_datetime}' AS DATETIME), NULL, '{$ipaddress}')";
    } else {
        $sql = "INSERT INTO `{$table_prefix}POST` (TID, REPLY_TO_PID, FROM_UID, ";
        $sql .= "TO_UID, CREATED, APPROVED, APPROVED_BY, IPADDRESS) VALUES ({$tid}, {$reply_pid}, ";
        $sql .= "{$fuid}, {$tuid}, CAST('{$current_datetime}' AS DATETIME), ";
        $sql .= "CAST('{$current_datetime}' AS DATETIME), {$fuid}, '{$ipaddress}')";
    }
    if (!$db->query($sql)) {
        return -1;
    }
    $new_pid = $db->insert_id;
    $sql = "INSERT INTO `{$table_prefix}POST_CONTENT` (TID, PID, CONTENT) ";
    $sql .= "VALUES ('{$tid}', '{$new_pid}', '{$post_content}')";
    if (!$db->query($sql)) {
        return -1;
    }
    $sql = "INSERT INTO `{$table_prefix}POST_SEARCH_ID` (TID, PID) ";
    $sql .= "VALUES('{$tid}', '{$new_pid}')";
    if (!$db->query($sql)) {
        return -1;
    }
    post_update_thread_length($tid, $new_pid);
    user_increment_post_count($fuid);
    if (perm_check_folder_permissions($fid, USER_PERM_POST_APPROVAL, $fuid) && !perm_is_moderator($fuid, $fid)) {
        admin_send_post_approval_notification($fid);
    }
    return $new_pid;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:55,代码来源:post.inc.php


示例14: IsProxy

function IsProxy()
{
    $proxyAPI = file_get_contents('http://winmxunlimited.net/api/proxydetection/v1/query/?ip=' . get_ip_address());
    if ($proxyAPI === false) {
        return false;
    }
    if ($proxyAPI != "0" || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1)) {
        return true;
    } else {
        return false;
    }
}
开发者ID:Galaxy421,项目名称:WOWMeter,代码行数:12,代码来源:give_process.php


示例15: get_proxy_ip_address

/**
 * Получение IP-адреса проскси.
 * Возвращает IP-адрес прокси или пустую строку
 *
 * @return string
 */
function get_proxy_ip_address()
{
    $obj =& get_instance();
    $ip_address = $obj->input->storage_server('REMOTE_ADDR');
    // Проверяем на валидность
    if (!$obj->input->valid_ip($ip_address)) {
        $ip_address = '';
    }
    if ($ip_address == get_ip_address()) {
        $ip_address = '';
    }
    return $ip_address;
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:19,代码来源:location_helper.php


示例16: retrieve_location_from_cookie_or_service

 private function retrieve_location_from_cookie_or_service()
 {
     if (isset($_COOKIE['geo_location'])) {
         $yaml_to_array = new AkYamlToArray();
         $yaml_to_array->source = $_COOKIE['geo_location'];
         return new GeoLoc($yaml_to_array->convert());
     }
     $location = IpGeocoder::geocode(get_ip_address());
     if ($location->success) {
         return $location;
     }
     return null;
 }
开发者ID:joeymetal,项目名称:v1,代码行数:13,代码来源:ip_geocode_lookup.php


示例17: setUp

 function setUp()
 {
     parent::setUp();
     require_code('calendar2');
     require_code('feedback');
     $this->event_id = add_calendar_event(8, '1', NULL, 0, 'test_event', '', 3, 1, 2010, 1, 10, 10, 15, 2010, NULL, 1, 1, 19, NULL, 1, 1, 1, 1, 1, '', NULL, 0, NULL, NULL, NULL);
     if ('test_event' == get_translated_text($GLOBALS['SITE_DB']->query_value('calendar_events', 'e_title ', array('id' => $this->event_id)))) {
         $GLOBALS['SITE_DB']->query_insert('rating', array('rating_for_type' => 'events', 'rating_for_id' => $this->event_id, 'rating_member' => get_member(), 'rating_ip' => get_ip_address(), 'rating_time' => time(), 'rating' => 4));
     }
     $data = $GLOBALS['SITE_DB']->query_select('rating', array('rating '), array('rating_for_id' => $this->event_id, 'rating_member' => get_member()));
     $rating = $data[0]['rating'];
     // Test the forum was actually created
     $this->assertTrue(4 == $rating);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:14,代码来源:rating.php


示例18: update_status

 function update_status($newStatus, $linkIds)
 {
     $msg = '';
     $links = implode("','", $linkIds);
     $status = array('archive' => 'inactive', 'reactivate' => 'active');
     # Remove the link record completely
     if ($newStatus == 'delete') {
         $result = $this->_query_reader->run('delete_link_record', array('link_ids' => $links));
     } else {
         $result = $this->_query_reader->run('update_link_status', array('new_status' => $status[$newStatus], 'link_ids' => $links, 'user_id' => $this->native_session->get('__user_id')));
     }
     # log action
     $this->_logger->add_event(array('user_id' => $this->native_session->get('__user_id'), 'activity_code' => 'link_status_change', 'result' => $result ? 'SUCCESS' : 'FAIL', 'log_details' => "newstatus=" . $newStatus . "|device=" . get_user_device() . "|browser=" . $this->agent->browser(), 'uri' => uri_string(), 'ip_address' => get_ip_address()));
     return array('boolean' => $result, 'reason' => $msg);
 }
开发者ID:nwtug,项目名称:pss-version-1.0,代码行数:15,代码来源:_link.php


示例19: ocf_get_topic_where

/**
 * Get an SQL 'WHERE' clause for the posts in a topic.
 *
 * @param  AUTO_LINK		The ID of the topic we are getting details of.
 * @param  ?MEMBER		The member doing the lookup (NULL: current member).
 * @return string			The WHERE clause.
 */
function ocf_get_topic_where($topic_id, $member_id = NULL)
{
    if (is_null($member_id)) {
        $member_id = get_member();
    }
    $where = 'p_topic_id=' . strval((int) $topic_id);
    if (is_guest()) {
        $where .= ' AND p_intended_solely_for IS NULL';
    } elseif (!has_specific_permission($member_id, 'view_other_pt')) {
        $where .= ' AND (p_intended_solely_for=' . strval((int) $member_id) . ' OR p_poster=' . strval((int) $member_id) . ' OR p_intended_solely_for IS NULL)';
    }
    if (!has_specific_permission($member_id, 'see_unvalidated')) {
        $where .= ' AND (p_validated=1 OR ((p_poster<>' . strval($GLOBALS['FORUM_DRIVER']->get_guest_id()) . ' OR ' . db_string_equal_to('p_ip_address', get_ip_address()) . ') AND p_poster=' . strval((int) $member_id) . '))';
    }
    return $where;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:ocf_topics.php


示例20: update_status

 function update_status($newStatus, $groupIds)
 {
     $msg = '';
     $result = FALSE;
     $groups = implode("','", $groupIds);
     # Remove the document record completely
     if ($newStatus == 'delete') {
         $result = $this->_query_reader->run('delete_group_mapping', array('group_ids' => $groups));
         if ($result) {
             $result = $this->_query_reader->run('delete_permission_group', array('group_ids' => $groups));
         }
     }
     # log action
     $this->_logger->add_event(array('user_id' => $this->native_session->get('__user_id'), 'activity_code' => 'permission_group_status_change', 'result' => $result ? 'SUCCESS' : 'FAIL', 'log_details' => "newstatus=" . $newStatus . "|device=" . get_user_device() . "|browser=" . $this->agent->browser(), 'uri' => uri_string(), 'ip_address' => get_ip_address()));
     return array('boolean' => $result, 'reason' => $msg);
 }
开发者ID:nwtug,项目名称:pss-version-1.0,代码行数:16,代码来源:_permission.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_ipaddress函数代码示例发布时间:2022-05-15
下一篇:
PHP get_ip函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap