Commit 1fb59528 authored by zhangjun's avatar zhangjun

修改

parent 80f6e2ea
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* sendsms($mobile,$msg) * sendsms($mobile,$msg)
* *
* ���Ͷ��� * 发送短信
* @param none * @param none
* @global none * @global none
* @return void * @return void
...@@ -16,7 +16,7 @@ function sendsms($mobile,$msg,$type='ad',$yzm="") ...@@ -16,7 +16,7 @@ function sendsms($mobile,$msg,$type='ad',$yzm="")
/** /**
* get_api($url, $nocache = 0) * get_api($url, $nocache = 0)
* *
* �ӿں��� Fisher 2013-1-12 * 接口函数 Fisher 2013-1-12
*/ */
if(!function_exists('get_api')) if(!function_exists('get_api'))
{ {
...@@ -61,7 +61,7 @@ function curl_get_contents_new($str,$t_url="", $cookie = '') ...@@ -61,7 +61,7 @@ function curl_get_contents_new($str,$t_url="", $cookie = '')
/** /**
* random($length) * random($length)
* *
* ������������� * 产生随机数函数
* @param none * @param none
* @global none * @global none
* @return void * @return void
...@@ -90,14 +90,14 @@ if(!function_exists('jumpto')) ...@@ -90,14 +90,14 @@ if(!function_exists('jumpto'))
if(!function_exists('jumptotk')) if(!function_exists('jumptotk'))
{ {
function jumptotk($url, $message = "ִ����ϣ�", $sec = 3000, $template = "tips") function jumptotk($url, $message = "执行完毕!", $sec = 3000, $template = "tips")
{ {
if($template == 'tips') if($template == 'tips')
{ {
echo '<div class="pop" style="width:390px;height:160px; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;border:1px solid #ccc;"> echo '<div class="pop" style="width:390px;height:160px; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;border:1px solid #ccc;">
<div class="hd" style="height:40px;background:#FF8400"> <div class="hd" style="height:40px;background:#FF8400">
<h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">��ʾ</h2> <h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">提示</h2>
<a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">�ر�</a> <a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">关闭</a>
</div> </div>
<div class="bd" style="background:#fff;height:120px"> <div class="bd" style="background:#fff;height:120px">
<div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat; position:absolute;left:70px;top:60px"></div> <div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat; position:absolute;left:70px;top:60px"></div>
...@@ -107,8 +107,8 @@ if(!function_exists('jumptotk')) ...@@ -107,8 +107,8 @@ if(!function_exists('jumptotk'))
}elseif($template == 'tipswaring'){ }elseif($template == 'tipswaring'){
echo '<div class="pop" style="width:390px;height:160px;border:1px solid #ccc; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;"> echo '<div class="pop" style="width:390px;height:160px;border:1px solid #ccc; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;">
<div class="hd" style="height:40px;background:#FF8400"> <div class="hd" style="height:40px;background:#FF8400">
<h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">��ʾ</h2> <h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">提示</h2>
<a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">�ر�</a> <a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">关闭</a>
</div> </div>
<div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat -2px -113px; position:absolute;left:70px;top:60px"></div> <div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat -2px -113px; position:absolute;left:70px;top:60px"></div>
<p style="position:absolute;left:160px;top:85px;font-size:14px">'.$message.'</p> <p style="position:absolute;left:160px;top:85px;font-size:14px">'.$message.'</p>
...@@ -123,7 +123,7 @@ if(!function_exists('jumptotk')) ...@@ -123,7 +123,7 @@ if(!function_exists('jumptotk'))
function tel_yc($tel) function tel_yc($tel)
{ {
//�����ֻ��Ų������� //隐藏手机号部分数字
$pattern = "/(1\d{1,2})\d\d(\d{0,3})/"; $pattern = "/(1\d{1,2})\d\d(\d{0,3})/";
$replacement = "\$1****\$3"; $replacement = "\$1****\$3";
...@@ -131,7 +131,7 @@ function tel_yc($tel) ...@@ -131,7 +131,7 @@ function tel_yc($tel)
} }
/*���õ�¼cookie*/ /*设置登录cookie*/
function vbsetcookie($name,$value="",$permanent=1) { function vbsetcookie($name,$value="",$permanent=1) {
$cookiedomain=".house365.com"; $cookiedomain=".house365.com";
...@@ -147,7 +147,7 @@ function vbsetcookie($name,$value="",$permanent=1) { ...@@ -147,7 +147,7 @@ function vbsetcookie($name,$value="",$permanent=1) {
} }
/*����cookie,session*/ /*设置cookie,session*/
function setcoandsess($name,$value="",$permanent=1) { function setcoandsess($name,$value="",$permanent=1) {
$cookiedomain=".house365.com"; $cookiedomain=".house365.com";
...@@ -179,11 +179,11 @@ function StrCode($string,$action='ENCODE'){ ...@@ -179,11 +179,11 @@ function StrCode($string,$action='ENCODE'){
/** /**
* GetIP - ��ȡ�ͻ���IP��ַ * GetIP - 获取客户端IP地址
* *
* @access public * @access public
* @param none * @param none
* @return string IP��ַ * @return string IP地址
*/ */
if ( ! function_exists('get_ip')) if ( ! function_exists('get_ip'))
{ {
...@@ -205,7 +205,7 @@ if ( ! function_exists('get_ip')) ...@@ -205,7 +205,7 @@ if ( ! function_exists('get_ip'))
//�Ͼ�վ���ݱ����ͷ�ԴID��ȡ��ԴͼƬ�洢�ı����� //南京站根据表名和房源ID获取房源图片存储的表名称
if ( ! function_exists('get_upload_tblname')) if ( ! function_exists('get_upload_tblname'))
{ {
function get_upload_tblname($tbl,$id){ function get_upload_tblname($tbl,$id){
...@@ -356,8 +356,8 @@ if ( ! function_exists('get_upload_tblname')) ...@@ -356,8 +356,8 @@ if ( ! function_exists('get_upload_tblname'))
/** /**
* ��ȡ���ַ��ķ�Դ��ַ * 获取二手房的房源地址
* @param array $row ��Դ��Ϣ,���뺬��id * @param array $row 房源信息,必须含有id
* @return stirng * @return stirng
*/ */
if(!function_exists('get_sellinfo_url')) if(!function_exists('get_sellinfo_url'))
...@@ -377,8 +377,8 @@ if(!function_exists('get_sellinfo_url')) ...@@ -377,8 +377,8 @@ if(!function_exists('get_sellinfo_url'))
/** /**
* ��ȡ�󹺵�ַ * 获取求购地址
* @param array $row ��Դ��Ϣ,���뺬��id * @param array $row 房源信息,必须含有id
* @return stirng * @return stirng
*/ */
if(!function_exists('get_buyinfo_url')) if(!function_exists('get_buyinfo_url'))
...@@ -396,8 +396,8 @@ if(!function_exists('get_buyinfo_url')) ...@@ -396,8 +396,8 @@ if(!function_exists('get_buyinfo_url'))
} }
/** /**
* ��ȡ�ⷿ�ķ�Դ��ַ * 获取租房的房源地址
* @param array $row ��Դ��Ϣ,���뺬��id * @param array $row 房源信息,必须含有id
* @return stirng * @return stirng
*/ */
if(!function_exists('get_rentinfo_url')) if(!function_exists('get_rentinfo_url'))
...@@ -418,7 +418,7 @@ if(!function_exists('get_rentinfo_url')) ...@@ -418,7 +418,7 @@ if(!function_exists('get_rentinfo_url'))
} }
/** /**
* ��ȡ�ʴ��ַ * 获取问答地址
* @param array $qid * @param array $qid
* @return stirng * @return stirng
*/ */
...@@ -434,7 +434,7 @@ if(!function_exists('get_questioninfo_url')) ...@@ -434,7 +434,7 @@ if(!function_exists('get_questioninfo_url'))
/** /**
* ��ȡС����ַ * 获取小区地址
* @param array $id * @param array $id
* @return stirng * @return stirng
*/ */
...@@ -446,7 +446,7 @@ if(!function_exists('get_questioninfo_url')) ...@@ -446,7 +446,7 @@ if(!function_exists('get_questioninfo_url'))
} }
/** /**
*��ȡѧУ��ַ *获取学校地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
...@@ -457,7 +457,7 @@ if(!function_exists('get_questioninfo_url')) ...@@ -457,7 +457,7 @@ if(!function_exists('get_questioninfo_url'))
/** /**
*��ȡѧУС����ַ *获取学校小区地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
...@@ -467,7 +467,7 @@ if(!function_exists('get_questioninfo_url')) ...@@ -467,7 +467,7 @@ if(!function_exists('get_questioninfo_url'))
} }
/** /**
*��ȡѧУ���ַ���ַ *获取学校二手房地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
...@@ -477,7 +477,7 @@ if(!function_exists('get_questioninfo_url')) ...@@ -477,7 +477,7 @@ if(!function_exists('get_questioninfo_url'))
} }
/** /**
*��ȡѧУ�ⷿ��ַ *获取学校租房地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
...@@ -489,7 +489,7 @@ if(!function_exists('get_questioninfo_url')) ...@@ -489,7 +489,7 @@ if(!function_exists('get_questioninfo_url'))
/** /**
* �ж�ֵ�Ƿ�Ϊ���� * 判断值是否为数组
* @param array $arrValue * @param array $arrValue
* @return bool true or false * @return bool true or false
* @author sun * @author sun
...@@ -499,10 +499,10 @@ function isFullArray($arrValue) { ...@@ -499,10 +499,10 @@ function isFullArray($arrValue) {
} }
/** /**
* time_tran ��������ʱ���� * time_tran 距离现在时间多久
* *
* @param string $the_time ʱ����� * @param string $the_time 时间参数
* @return string �����ַ��� * @return string 描述字符串
*/ */
function time_tran ($the_time) { function time_tran ($the_time) {
...@@ -528,7 +528,7 @@ function time_tran ($the_time) { ...@@ -528,7 +528,7 @@ function time_tran ($the_time) {
return $str; return $str;
} }
//���ܣ����ܺ��� FISHER 2014-3-5 //加密,解密函数 FISHER 2014-3-5
function passport_encrypt($txt, $key='fisher.house365.com') { function passport_encrypt($txt, $key='fisher.house365.com') {
srand((double)microtime() * 1000000); srand((double)microtime() * 1000000);
$encrypt_key = md5(rand(0, 32000)); $encrypt_key = md5(rand(0, 32000));
...@@ -563,12 +563,12 @@ function passport_key($txt, $encrypt_key) { ...@@ -563,12 +563,12 @@ function passport_key($txt, $encrypt_key) {
function check_input($value) function check_input($value)
{ {
// ȥ��б�� // 去除斜杠
if (get_magic_quotes_gpc()) if (get_magic_quotes_gpc())
{ {
$value = stripslashes($value); $value = stripslashes($value);
} }
// ������������������ // 如果不是数字则加引号
if (!is_numeric($value)) if (!is_numeric($value))
{ {
$value = "'" . mysql_real_escape_string($value) . "'"; $value = "'" . mysql_real_escape_string($value) . "'";
...@@ -578,9 +578,9 @@ return $value; ...@@ -578,9 +578,9 @@ return $value;
/** /**
* jsonNew �����ݽ���gbkתutf8��json���� json($data) * jsonNew 对数据进行gbk转utf8后json编码 json($data)
* @param mixed $data ��Ҫ��������� * @param mixed $data 需要编码的数据
* @return mixed $data_json ���������� * @return mixed $data_json 编码后的数据
* @ 2012-10-16 xz * @ 2012-10-16 xz
**/ **/
function jsonNew($data,$inChar="GBK",$outChar="UTF-8") { function jsonNew($data,$inChar="GBK",$outChar="UTF-8") {
...@@ -592,7 +592,7 @@ function jsonNew($data,$inChar="GBK",$outChar="UTF-8") { ...@@ -592,7 +592,7 @@ function jsonNew($data,$inChar="GBK",$outChar="UTF-8") {
/** /**
* �滻�������(֧���ַ����Ͷ�ά����) * 替换数组编码(支持字符串和多维数组)
* @param mixed $strInput * @param mixed $strInput
* @param string $inChar * @param string $inChar
* @param string $outChar * @param string $outChar
...@@ -617,25 +617,25 @@ function strIconv($strInput,$inChar="GBK",$outChar="UTF-8"){ ...@@ -617,25 +617,25 @@ function strIconv($strInput,$inChar="GBK",$outChar="UTF-8"){
} }
//ͨ��curlģ��post������ //通过curl模拟post的请求;
function SendDataByCurl($url,$data=array()){ function SendDataByCurl($url,$data=array()){
//�Կո����ת�� //对空格进行转义
$url = str_replace(' ','+',$url); $url = str_replace(' ','+',$url);
$ch = curl_init(); $ch = curl_init();
//����ѡ�����URL //设置选项,包括URL
curl_setopt($ch, CURLOPT_URL, "$url"); curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch,CURLOPT_TIMEOUT,3); //���峬ʱ3���� curl_setopt($ch,CURLOPT_TIMEOUT,3); //定义超时3秒钟
// POST���� // POST数据
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
// ��post�ı������� // 把post的变量加上
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); //���贫��������http_bulid_query()��������һ�£���ok�� curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); //所需传的数组用http_bulid_query()函数处理一下,就ok了
//ִ�в���ȡurl��ַ������ //执行并获取url地址的内容
$output = curl_exec($ch); $output = curl_exec($ch);
$errorCode = curl_errno($ch); $errorCode = curl_errno($ch);
//�ͷ�curl��� //释放curl句柄
curl_close($ch); curl_close($ch);
if(0 !== $errorCode) { if(0 !== $errorCode) {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment