mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 14:22:54 +09:00
#19735137 remove krzip module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8355 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e4d9c0d3b9
commit
25d2f6af1e
18 changed files with 0 additions and 498 deletions
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @class krzipModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief model class of the krzip module
|
||||
**/
|
||||
|
||||
class krzipModel extends krzip {
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Zip Code Search
|
||||
* Request a zip code to the server with user-entered address
|
||||
**/
|
||||
function getKrzipCodeList() {
|
||||
// Get configurations (using module model object)
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('krzip');
|
||||
if($config->krzip_server_hostname) $this->hostname = $config->krzip_server_hostname;
|
||||
if($config->krzip_server_port) $this->port = $config->krzip_server_port;
|
||||
if($config->krzip_server_query) $this->query = $config->krzip_server_query;
|
||||
// Get address(town)
|
||||
$addr = trim(Context::get('addr'));
|
||||
if(!$addr) return new Object(-1,'msg_not_exists_addr');
|
||||
// Attempt to request to the server
|
||||
$query_string = $this->query.urlencode($addr);
|
||||
|
||||
$fp = @fsockopen($this->hostname, $this->port, $errno, $errstr);
|
||||
if(!$fp) return new Object(-1, 'msg_fail_to_socket_open');
|
||||
|
||||
fputs($fp, "GET {$query_string} HTTP/1.0\r\n");
|
||||
fputs($fp, "Host: {$this->hostname}\r\n\r\n");
|
||||
|
||||
$buff = '';
|
||||
while(!feof($fp)) {
|
||||
$str = fgets($fp, 1024);
|
||||
if(trim($str)=='') $start = true;
|
||||
if($start) $buff .= $str;
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
|
||||
$address_list = unserialize(base64_decode($buff));
|
||||
if(!$address_list) return new Object(-1, 'msg_no_result');
|
||||
|
||||
$this->add('address_list', implode("\n",$address_list)."\n");
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue