| | |
| | | <?php |
| | | |
| | | |
| | | |
| | | /** |
| | | * 全局的权限验证 数据验证库 |
| | | */ |
| | |
| | | |
| | | }else{ |
| | | $this->protocol_wap = $this->config['sy_wapssl']=='1' ? 'https://' : 'http://'; |
| | | if(strpos($this->config['sy_wapdomain'],'http://')===false && strpos($this->config['sy_wapdomain'],'https://')===false) |
| | | { |
| | | if (strpos($this->config['sy_wapdomain'], 'http://') === FALSE && strpos($this->config['sy_wapdomain'], 'https://') === FALSE) { |
| | | $this->config['sy_wapdomain'] = $this->protocol_wap.$this->config['sy_wapdomain']; |
| | | } |
| | | |
| | |
| | | $this->member_fabudata(); |
| | | } |
| | | } |
| | | |
| | | //底部导航的发布所需数据 |
| | | function member_fabudata(){ |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | //同步登录时间 |
| | | function upLoginLog($logindate) |
| | | { |
| | | function upLoginLog($logindate) { |
| | | |
| | | |
| | | if ($logindate < strtotime('today') && $this->usertype > 0) { |
| | |
| | | * @param null $uid |
| | | * @param null $usertype |
| | | */ |
| | | function webLog($model, $uid=null, $usertype=null) |
| | | { |
| | | function webLog($model, $uid = NULL, $usertype = NULL) { |
| | | |
| | | $weblogM = $this->MODEL('weblog'); |
| | | $data = array( |
| | |
| | | function DoException(){ |
| | | $this->ACT_msg("index.php","您请求的页面不存在"); |
| | | } |
| | | |
| | | //后台模板 |
| | | function yuntpl($tplarr=array()){ |
| | | if(is_array($tplarr) && $tplarr!=''){ |
| | |
| | | exit(); |
| | | |
| | | }else{ |
| | | echo "模版不能为空!";die; |
| | | echo "模版不能为空!"; |
| | | die; |
| | | } |
| | | } |
| | | |
| | | //前台模板 |
| | | function yun_tpl($tplarr=array()){ |
| | | if(is_array($tplarr) && $tplarr!=''){ |
| | |
| | | } |
| | | exit(); |
| | | }else{ |
| | | echo "模版不能为空!";die; |
| | | echo "模版不能为空!"; |
| | | die; |
| | | } |
| | | } |
| | | |
| | | //UC资料修改 |
| | | function uc_edit_pw($post, $old = "1", $url) |
| | | { |
| | | function uc_edit_pw($post, $old = "1", $url) { |
| | | |
| | | $old_info = $this->obj->select_once('member', array('uid' => $post['uid']), "`name_repeat`,`username`"); |
| | | if ($post['password'] != "") { |
| | |
| | | * @param mixed $name 单个变量变量名:如“webname”,或包含多个变量的数据:如“array('webname'=>'phpyun人才系统')” |
| | | * @param mixed $value |
| | | */ |
| | | function yunset($name, $value = null) |
| | | { |
| | | function yunset($name, $value = NULL) { |
| | | if (is_array($name)) { |
| | | foreach ($name as $k => $v) { |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | function company() |
| | | { |
| | | function company() { |
| | | $this->tpl->is_fun(); |
| | | |
| | | $company = $this->obj->select_once('company', array('uid' => $_GET['id']), "`name`,`content`"); |
| | |
| | | //前台公共部分 |
| | | function index(){ |
| | | $UA = strtoupper($_SERVER['HTTP_USER_AGENT']); |
| | | if(strpos($UA, 'WINDOWS NT') === true){ |
| | | if (strpos($UA, 'WINDOWS NT') === TRUE) { |
| | | |
| | | header("location:".Url('index',array('c'=>'wap'))); |
| | | exit(); |
| | |
| | | $aArray = array('getHbBase'); |
| | | |
| | | $UA = strtoupper($_SERVER['HTTP_USER_AGENT']); |
| | | if($this->config['sy_pc_jump_wap']!='1' && strpos($UA, 'WINDOWS NT') !== false && !in_array($a,$aArray)){ |
| | | if ($this->config['sy_pc_jump_wap'] != '1' && strpos($UA, 'WINDOWS NT') !== FALSE && !in_array($a, $aArray)) { |
| | | //电脑访问手机端 匹配相关链接 |
| | | header('location:'.Url('index',array('c'=>'wap'))); |
| | | } |
| | |
| | | header('location:'.$this->config['sy_weburl']); |
| | | } |
| | | $UA = strtoupper($_SERVER['HTTP_USER_AGENT']); |
| | | if($this->config['sy_pc_jump_wap']!='1' && strpos($UA, 'WINDOWS NT') !== false){ |
| | | if ($this->config['sy_pc_jump_wap'] != '1' && strpos($UA, 'WINDOWS NT') !== FALSE) { |
| | | header('location:'.Url('index',array('c'=>'wap'))); |
| | | } |
| | | |
| | |
| | | // 外部链接访问,会员中心的,进入微信授权页面,已绑定的,直接登录,进到会员中心首页 |
| | | if (!$_SERVER['HTTP_REFERER']){ |
| | | |
| | | header('location:'.Url('wap',array('c'=>'wxoauth')));die; |
| | | header('location:' . Url('wap', array('c' => 'wxoauth'))); |
| | | die; |
| | | } |
| | | } |
| | | |
| | | header('location:'.Url('wap',array('c'=>'login')));die; |
| | | header('location:' . Url('wap', array('c' => 'login'))); |
| | | die; |
| | | }else{ |
| | | |
| | | $shell=$this->GET_user_shell($this->uid,$_COOKIE['shell']); |
| | |
| | | if(!is_array($shell) && !$this->spid){ |
| | | |
| | | $this->cookie->unset_cookie(); |
| | | header('location:'.Url('wap',array('c'=>'login')));die; |
| | | header('location:' . Url('wap', array('c' => 'login'))); |
| | | die; |
| | | }else{ |
| | | if(is_weixin()){ |
| | | if(in_array($_GET['c'],array('integral','finance','job'))){ |
| | |
| | | } |
| | | } |
| | | |
| | | function member() |
| | | { |
| | | function member() { |
| | | $this->tpl->is_fun(); |
| | | if (!$this->uid) { |
| | | $login = Url('login'); |
| | |
| | | $this->yunset("useremail", $_COOKIE['email']); |
| | | $this->yunset("is_member", 1); |
| | | } |
| | | |
| | | function wxapp(){ |
| | | |
| | | } |
| | |
| | | function datav(){ |
| | | |
| | | } |
| | | |
| | | //生成缓存-------------开始 |
| | | function web_config(){ |
| | | $configM = $this->MODEL('config'); |
| | |
| | | } |
| | | } |
| | | |
| | | function header_desc($title = "", $keyword = "", $description = "") |
| | | { |
| | | function header_desc($title = "", $keyword = "", $description = "") { |
| | | $this->yunset("title", $title); |
| | | $this->yunset("keywords", $keyword); |
| | | $this->yunset("description", $description); |
| | |
| | | |
| | | //TODO:已移动到当前目录的model.php中,待修改完成后删除 |
| | | //调用分页,$table表名,$where条件,$pageurl分页链接,$limit条数,$rowsname模板接收变量,$pagenavname分页模板接收变量 |
| | | function get_page($table, $where = "", $pageurl = "", $limit = 20, $field = "*", $rowsname = "rows", $pagenavname = "pagenav") |
| | | { |
| | | function get_page($table, $where = "", $pageurl = "", $limit = 20, $field = "*", $rowsname = "rows", $pagenavname = "pagenav") { |
| | | |
| | | $rows = array(); |
| | | $page = $_GET['page'] < 1 ? 1 : $_GET['page']; |
| | |
| | | $this->yunset("total", $num); |
| | | if ($num > $limit) { |
| | | $pages = ceil($num / $limit); |
| | | $pagenav = Page($page, $num, $limit, $pageurl, $notpl = false, $this->tpl, $pagenavname); |
| | | $pagenav = Page($page, $num, $limit, $pageurl, $notpl = FALSE, $this->tpl, $pagenavname); |
| | | $this->yunset("pages", $pages); |
| | | } |
| | | $rows = $this->obj->DB_select_all($table, "$where limit $ststrsql,$limit", $field); |
| | |
| | | } |
| | | |
| | | //验证手机是否存在 |
| | | function FetchMoblie($moblie) |
| | | { |
| | | function FetchMoblie($moblie) { |
| | | $UserInfoM = $this->MODEL('userinfo'); |
| | | return $UserInfoM->GetMemberOne(array('moblie' => $moblie), array('field' => "`uid`,`username`")); |
| | | } |
| | | |
| | | function logout($result = true) |
| | | { |
| | | function logout($result = TRUE) { |
| | | |
| | | if ($this->config['sy_uc_type'] == "uc_center") { |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | function del_dir($dir_adds = '', $del_def = 0) |
| | | { |
| | | function del_dir($dir_adds = '', $del_def = 0) { |
| | | |
| | | $result = false; |
| | | $result = FALSE; |
| | | if (!is_dir($dir_adds)) { |
| | | return false; |
| | | return FALSE; |
| | | } |
| | | $handle = opendir($dir_adds); |
| | | while (($file = readdir($handle)) !== false) { |
| | | while (($file = readdir($handle)) !== FALSE) { |
| | | if ($file != '.' && $file != '..') { |
| | | $dir = $dir_adds.DIRECTORY_SEPARATOR.$file; |
| | | is_dir($dir) ? $this->del_dir($dir) : @unlink($dir); |
| | |
| | | } |
| | | closedir($handle); |
| | | if ($del_def == 0) { |
| | | $result = @rmdir($dir_adds) ? true : false; |
| | | $result = @rmdir($dir_adds) ? TRUE : FALSE; |
| | | } else { |
| | | $result = true; |
| | | $result = TRUE; |
| | | } |
| | | return $result; |
| | | } |
| | | |
| | | function seo($ident,$title='',$keyword='',$description='',$settpl = true, $iswxapp = false) |
| | | { |
| | | function seo($ident, $title = '', $keyword = '', $description = '', $settpl = TRUE, $iswxapp = FALSE) { |
| | | if ($iswxapp){ |
| | | // 微信小程序用seo |
| | | include DATA_PATH.'api/wxapp/wxseo.cache.php'; |
| | |
| | | } |
| | | |
| | | //获取搜索类别 |
| | | function get_seacrh_class($ident,$type='title') |
| | | { |
| | | function get_seacrh_class($ident, $type = 'title') { |
| | | $cacheM = $this->MODEL('cache'); |
| | | $cache = $cacheM->GetCache(array('hy')); |
| | | |
| | |
| | | } |
| | | |
| | | //获取搜索职能 |
| | | function get_search_job($ident, $type = 'title') |
| | | { |
| | | function get_search_job($ident, $type = 'title') { |
| | | $cacheM = $this->MODEL('cache'); |
| | | $cache = $cacheM->GetCache(array('job')); |
| | | |
| | |
| | | } |
| | | |
| | | //获取搜索城市 |
| | | function get_search_city($ident, $type = 'title') |
| | | { |
| | | function get_search_city($ident, $type = 'title') { |
| | | $cacheM = $this->MODEL('cache'); |
| | | $cache = $cacheM->GetCache(array('city')); |
| | | $city_name = $cache['city_name']; |
| | |
| | | return $data; |
| | | } |
| | | |
| | | function addkeywords($type, $keyword) |
| | | { |
| | | function addkeywords($type, $keyword) { |
| | | $info = $this->obj->select_once('hot_key', array('key_name' => $keyword, 'type' => $type)); |
| | | |
| | | if (is_array($info)) { |
| | |
| | | /** |
| | | * 系统消息提醒 |
| | | */ |
| | | function automsg($content, $uid) |
| | | { |
| | | function automsg($content, $uid) { |
| | | |
| | | $msgM = $this->MODEL('sysmsg'); |
| | | |
| | |
| | | * @param $data |
| | | * @return mixed |
| | | */ |
| | | function post_trim($data) |
| | | { |
| | | function post_trim($data) { |
| | | foreach ($data as $d_k => $d_v) { |
| | | if (is_array($d_v)) { |
| | | |
| | |
| | | return $data; |
| | | } |
| | | |
| | | function get_moblie() |
| | | { |
| | | function get_moblie() { |
| | | if ($this->config['sy_wap_web'] == "2") { |
| | | |
| | | header('location:' . $this->config['sy_weburl']); |
| | | } |
| | | |
| | | $UA = strtoupper($_SERVER['HTTP_USER_AGENT']); |
| | | if ($this->config['sy_pc_jump_wap'] != '1' && strpos($UA, 'WINDOWS NT') !== false) { |
| | | if ($this->config['sy_pc_jump_wap'] != '1' && strpos($UA, 'WINDOWS NT') !== FALSE) { |
| | | |
| | | header('location:' . Url('index', array('c' => 'wap'))); |
| | | } |
| | |
| | | * @param $type |
| | | */ |
| | | // TODO 订阅已调整为计划任务推送,采集职位/简历 不做订阅信息查询推送,待删除 |
| | | function send_dingyue($id, $type) |
| | | { |
| | | function send_dingyue($id, $type) { |
| | | |
| | | $notice = $this->MODEL('notice'); |
| | | if ($type == "2") { |
| | |
| | | * @param int $tm 跳转时间 |
| | | * @param string $type 1:后台操作 |
| | | */ |
| | | function ACT_layer_msg($msg = "操作已成功!", $st = 9, $url = '', $tm = 2, $type = '0') |
| | | { |
| | | function ACT_layer_msg(string $msg = "操作已成功!", int $st = 9, string $url = '', int $tm = 2, string $type = '0') { |
| | | //解决ie9 $.get $.post 回调函数的返回值为undefine |
| | | header("Content-Type: text/html; charset=UTF-8"); |
| | | |
| | |
| | | /** |
| | | * @desc 消息返回 |
| | | * |
| | | * @param $msg 信息提示 |
| | | * @param string $msg 信息提示 |
| | | * @param string $st 图标编号9 成功 8 失败 |
| | | * @param string $type 1-批量 0-单条 |
| | | * @param string $url 跳转地址 |
| | | * @param string $tm 时间 |
| | | * @param string $error |
| | | */ |
| | | function layer_msg($msg, $st = '9', $type = '0', $url = '', $tm = '2', $error = '0') |
| | | { |
| | | function layer_msg(string $msg, string $st = '9', string $type = '0', string $url = '', string $tm = '2', string $error = '0') { |
| | | if ($type == '1') { |
| | | |
| | | $this->ACT_layer_msg($msg, $st, $url, $tm, $type); |
| | |
| | | } |
| | | } |
| | | |
| | | function wapheader($url) |
| | | { |
| | | function wapheader($url) { |
| | | $url = $this->config['sy_wapdomain'] . "/" . $url; |
| | | header('Location: '.$url); |
| | | exit(); |
| | |
| | | * @param $string |
| | | * @return |
| | | */ |
| | | function stringfilter($string) |
| | | { |
| | | function stringfilter($string) { |
| | | $str = trim($string); |
| | | |
| | | $regex = "/\\$|\'|\\\|/"; |
| | |
| | | return $str; |
| | | } |
| | | |
| | | public function MODEL($ModelName = null, $ModelPath = null) |
| | | { |
| | | public function MODEL($ModelName = NULL, $ModelPath = NULL) { |
| | | // var_dump($ModelName); |
| | | // var_dump($ModelPath); |
| | | require_once(APP_PATH.'app/public/action.class.php'); |
| | | if ($ModelName) { |
| | | if ($ModelPath) { |
| | |
| | | require_once($ModelPath . '/' . $ModelName . '.class.php'); |
| | | } else { |
| | | |
| | | return null; |
| | | return NULL; |
| | | } |
| | | } else { |
| | | |
| | |
| | | require_once($ModelPath.$ModelFileName); |
| | | } else { |
| | | |
| | | return null; |
| | | return NULL; |
| | | } |
| | | } |
| | | $ModelName = $ModelName.'_model'; |
| | |
| | | |
| | | $ModelName = 'model'; |
| | | } |
| | | // var_dump($ModelName); |
| | | // exit(); |
| | | if (!class_exists($ModelName)) { |
| | | return NULL; |
| | | } |
| | | $Model = new $ModelName($this->db, $this->def, array('uid' => $this->uid, 'username' => $this->username, 'usertype' => $this->usertype), $this->tpl); |
| | | return $Model; |
| | | } |
| | | |
| | | //获取描述 |
| | | function GET_content_desc($cont) |
| | | { |
| | | function GET_content_desc($cont) { |
| | | return mb_substr(strip_tags($cont), 0, 200, "utf-8"); |
| | | } |
| | | |
| | |
| | | * @param int $st 1成功2失败 |
| | | * @param int $tm 跳转时间 |
| | | */ |
| | | function ACT_msg($url = '', $msg = "操作已成功!", $st = 8, $tm = 3) |
| | | { |
| | | function ACT_msg($url = '', $msg = "操作已成功!", $st = 8, $tm = 3) { |
| | | if ($url == '') { |
| | | $url = $this->config['sy_weburl']; |
| | | } |
| | |
| | | * @param int $st 1成功 2失败 |
| | | * @param int $tm 跳转时间 |
| | | */ |
| | | function ACT_msg_wap($url = '', $msg = null, $st = 1, $tm = 5) |
| | | { |
| | | function ACT_msg_wap($url = '', $msg = NULL, $st = 1, $tm = 5) { |
| | | |
| | | if ($url == '') { |
| | | $url = $this->config['sy_weburl']; |
| | | } |
| | | |
| | | if ($msg == null) { |
| | | if ($msg == NULL) { |
| | | $msg = '操作已成功!'; |
| | | } |
| | | |
| | |
| | | * @param $shell |
| | | * @return bool|null |
| | | */ |
| | | function GET_user_shell($uid, $shell) |
| | | { |
| | | function GET_user_shell($uid, $shell) { |
| | | |
| | | if (!preg_match("/^\d*$/", $uid)) { |
| | | return false; |
| | | return FALSE; |
| | | } |
| | | |
| | | if (!preg_match("/^\d*$/", $_COOKIE['usertype'])) { |
| | | return false; |
| | | return FALSE; |
| | | } |
| | | |
| | | $SQL = "SELECT `uid`,`username`,`usertype`,`password`,`salt`,`pid`,`status`,`login_date` FROM `".$this->def."member` WHERE `uid`='$uid' limit 1"; |
| | |
| | | * @param $html |
| | | * @return string |
| | | */ |
| | | function CloseTags($html) |
| | | { |
| | | function CloseTags($html) { |
| | | $html = preg_replace('/<[^>]*$/', '', $html); |
| | | preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result); |
| | | |
| | |
| | | * @return string |
| | | */ |
| | | // TODO:暂时无调用,待删除 |
| | | function checksrc($post, $url = '') |
| | | { |
| | | function checksrc($post, $url = '') { |
| | | |
| | | if (strpos($post, $this->config['sy_weburl']) !== false) { |
| | | if (strpos($post, $this->config['sy_weburl']) !== FALSE) { |
| | | |
| | | $post = str_replace($this->config['sy_weburl'], '.', $post); |
| | | } |
| | | |
| | | $post = str_replace(array('./data', '../data'), 'data', $post); |
| | | |
| | | if ((strpos($post, 'data/logo/') !== false || strpos($post, 'data/upload/special/') !== false) && file_exists(APP_PATH.$post)) { |
| | | if ((strpos($post, 'data/logo/') !== FALSE || strpos($post, 'data/upload/special/') !== FALSE) && file_exists(APP_PATH . $post)) { |
| | | |
| | | $picUrl = $post; |
| | | } else { |
| | |
| | | * @param $uid |
| | | * @param array $data |
| | | */ |
| | | function MemberLock($uid, $data = array()) |
| | | { |
| | | function MemberLock($uid, $data = array()) { |
| | | |
| | | $userInfoM = $this->MODEL('userinfo'); |
| | | $uInfo = $userInfoM->getInfo(array('uid' => $uid), array('field' => '`status`')); |
| | |
| | | /** |
| | | * 更多栏目导航 |
| | | */ |
| | | function moreMenu() |
| | | { |
| | | function moreMenu() { |
| | | |
| | | include PLUS_PATH.'menu.cache.php'; |
| | | |
| | |
| | | $navList[$k]['url_n'] = $v['url']; |
| | | } else { |
| | | |
| | | if (strpos($v['url'], '&') !== false && strpos($v['url'], '=') !== false) { |
| | | if (strpos($v['url'], '&') !== FALSE && strpos($v['url'], '=') !== FALSE) { |
| | | |
| | | $url = explode('&', $v['url']); |
| | | $sonUrl = array(); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |