public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //×Ô¶¨Òå±êÇ© START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
		$time=time();
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$where = "`reply`<>\'\' and `del_status`=\'0\'";
		if($paramer[id]){
			$where.=" and `jobid`=\'$paramer[id]\'";
		}
		//ÅÅÐò×ֶΠĬÈÏ°´ÕÕxuanshangÅÅÐò
		if($paramer[order]){
			$where.="  ORDER BY `".$paramer[order]."`";
		}else{
			$where.="  ORDER BY `datetime`";
		}
		//ÅÅÐò·½Ê½Ä¬Èϵ¹Ðò
		if($paramer[sort]){
			$where.=" ".$paramer[sort];
		}else{
			$where.=" DESC";
		}
		if($paramer[limit]){
			$limit=" LIMIT ".$paramer[limit];
		}else{
			$limit=" LIMIT 20";
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"msg",$where,$Purl,\'\',\'0\',$_smarty_tpl);
		}
		' . $name . '=$db->select_all("msg",$where.$limit);
		$user=$db->select_all("resume","","uid,def_job");
		if(is_array(' . $name . ')){
			foreach(' . $name . ' as $key=>$value){
				foreach($user as $v){
					if($value[uid]==$v[uid]){
						' . $name . '[$key][user_url] = Url("index","resume",array("id"=>$v[def_job]),"1");
					}
				}
				' . $name . '[$key][datetime]=date("Y-m-d",$value[datetime]);
				' . $name . '[$key][reply_time]=date("Y-m-d",$value[reply_time]);
			}
		}';
        //×Ô¶¨Òå±êÇ© END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'msglist', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
		//处理传入参数,并且构造分页参数
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$where = "1";
		//查询条数
		if($paramer[limit]){
			$limit=" LIMIT ".$paramer[limit];
		}else{
			$limit=" LIMIT 10";
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"toolbox_class",$where,$Purl,\'\',\'0\',$_smarty_tpl);
		}
		' . $name . '=$db->select_all("toolbox_class",$where.$limit);';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'hrclass', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');$attention=array();
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$atn=$db->select_all("atn","`uid`=\'".$_COOKIE[\'uid\']."\'","`sc_uid`");
		foreach($atn as $a_v){
			$atn_uid.=$a_v[\'sc_uid\'].\',\';//我已近关注过的用户id
		}
		$atn_uid =$atn_uid.$_COOKIE[\'uid\'];
		$attention=$db->select_all("attention","`type`=\'2\' and `uid` not in(".$atn_uid.") order by rand() limit 10","`uid`,`ids`");
		foreach($attention as $a_k=>$a_v){
			$uid[]=$a_v[\'uid\'];
			$class_id.=$a_v[\'ids\'];
		}
		$uids=@implode(\',\',$uid);
		$class_ids=@implode(\',\',array_unique(@explode(\',\',rtrim($class_id,\',\'))));
		$q_class = $db->select_all("q_class","id in(".$class_ids.")","`id`,`name`");
		$member = $db->select_all("friend_info","uid in(".$uids.") and `nickname`<>\'\'","`uid`,`nickname`,`pic`,`description`");
		foreach($attention as $key=>$val){
			$cid=@explode(\',\',rtrim($val[\'ids\'],\',\'));
			if($val[\'uid\']==$_COOKIE[\'uid\']){
				$attention[$key][\'is_atn\']=\'2\';//表示这是本人,不显示关注按钮
			}
			foreach($q_class as $q_v){
				if(in_array($q_v[\'id\'],$cid)){
					$class_name[]=$q_v[\'name\'];
				}
			}
			foreach($member as $m_val){
				if($val[\'uid\']==$m_val[\'uid\']){
					$attention[$key][\'nickname\']=$m_val[\'nickname\'];
					if($m_val[\'pic\']){
						$attention[$key][\'pic\']=str_replace("..",$config[\'sy_weburl\'],$m_val[\'pic\']);
					}else{
						$attention[$key][\'pic\']=$config[\'sy_weburl\']."/".$config[\'sy_friend_icon\'];
					}
					$attention[$key][\'description\']=$m_val[\'description\'];
				}
			}
			if($class_name){
				$attention[$key][\'class_name\']=@implode(\'、\',$class_name);
			}
			unset($class_name);
			unset($cid);
		}
		if(empty($attention)){
			$attention="";
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'qrecom', '$attention', $OutputStr, '$attention');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['item'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');$list=array();
		global $db,$db_config;
		$path = dirname(dirname(dirname(__FILE__)));
		$ParamerArr = GetSmarty($paramer,$_GET,$_smarty_tpl);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
        global $ModuleName;
        if(!$Purl["m"]){
            $Purl["m"]=$ModuleName;
        }
		$where=\'1\';
		if($paramer[usertype])
		{
			$where .= " and `usertype`=\'".$paramer[usertype]."\'";
		}
		if($paramer[status])
		{
			$where .= " and `status`=\'".$paramer[status]."\'";
		}
		if($paramer[ispage])
		{
			$limit = PageNav($paramer,$_GET,"q_class",$where,$Purl,\'\',\'2\');
		}
		if($paramer[order])
		{
			$order = " ORDER BY `".$paramer[order]."`  desc";
		}else{
			$order = " ORDER BY `uid` desc";
		}
		if($paramer[limit])
		{
			$limit=" limit ".$paramer[limit];
		}
		' . $name . ' = $db->select_all("member",$where.$order.$limit);
		if(is_array(' . $name . '))
		{
			foreach(' . $name . ' as $m_k=>$m_v)
			{
				' . $name . '[$m_k][\'url\']=Url("ask",array("c"=>"friend","uid"=>$m_v[\'uid\']));

			}
		}';
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'mlist', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['item'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = '' . $name . '=array();$time=time();eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		global $db,$db_config,$config;
		$ParamerArr = GetSmarty($paramer,$_GET,$_smarty_tpl);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
        global $ModuleName;
        if(!$Purl["m"]){
            $Purl["m"]=$ModuleName;
        }
		$where = 1;
		if($config[\'did\']){
			$where.=" and `did`=\'".$config[\'did\']."\'";
		} 
		if($paramer[order]){
			$where.="  ORDER BY `".$paramer[order]."`";
		}else{
			$where.="  ORDER BY `datetime`";
		}
		if($paramer[sort]){
			$where.=" ".$paramer[sort];
		}else{
			$where.=" DESC";
		}
		if($paramer[limit]){
			$limit=" LIMIT ".$paramer[limit];
		}else{
			$limit=" LIMIT 20";
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"admin_announcement",$where,$Purl,"",0,$_smarty_tpl);
		}
		' . $name . '=$db->select_all("admin_announcement",$where.$limit);
		if(is_array(' . $name . ')){
			foreach(' . $name . ' as $key=>$value){
				if($paramer[t_len]){
					' . $name . '[$key][title_n] = mb_substr($value[\'title\'],0,$paramer[t_len],"GBK");
				}
				' . $name . '[$key][time]=date("Y-m-d",$value[datetime]);
				' . $name . '[$key][url] = Url("announcement",array("id"=>$value[id]),"1");
			}
		}';
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'announcement', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $tem_type = $_attr['tem_type'];
        $type = $_attr['type'];
        $limit = $_attr['limit'];
        $OutputStr = 'global $config;
		//跨域名使用范围
		$domain=\'\';
		if($config["cityid"]!="" || $config["hyclass"]!=""){
			include(PLUS_PATH."/domain_cache.php");
			$host_url=$_SERVER[\'HTTP_HOST\'];
			foreach($site_domain as $v){
				if($v[\'host\']==$host_url){
					$domain=$v[\'id\'];
				}
			}
		}';
        //站内使用范围   1=全站 2=首页使用 3=猎头页使用
        $OutputStr .= '$tem_type = ' . (is_numeric($tem_type) ? $tem_type : 1) . ';
        include PLUS_PATH."/link.cache.php";
		if(is_array($link)){$linkList=array();
			$i=0;
			foreach($link as $key=>$value)
			{
				if($config["did"]!=0 && $value["did"]!=$config["did"])
				{
					continue;
				}elseif(is_numeric(\'' . $tem_type . '\') && $value[\'tem_type\']!=\'' . $tem_type . '\' && $value[\'tem_type\']!=\'1\'){
					continue;

				}elseif((!is_numeric(\'' . $tem_type . '\') || \'' . $tem_type . '\'==\'1\') && $value[\'tem_type\']!=\'1\'){

					continue;
				}elseif(!$config["did"] && $value["did"]>0){
					continue;
				}
				if(is_numeric(\'' . $type . '\') && $value[\'link_type\']!=\'' . $type . '\')
				{
					continue;
				}
				if(is_numeric(\'' . $limit . '\') && intval(\'' . $limit . '\')<=$i)
				{
					break;
				}
				$value[picurl] = $config[sy_weburl]."/".$value[pic];
				$linkList[] = $value;
				$i++;
			}
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'link', '$linkList', $OutputStr, '$linkList');
    }
 public function compile($args, $compiler, $parameter)
 {
     $_attr = $this->getAttributes($compiler, $args);
     $from = $_attr['from'];
     $item = $_attr['item'];
     if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
         $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
     }
     return SmartyOutputStr($this, $compiler, $_attr, 'looksq', '$from');
 }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['item'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
        global $ModuleName;

		include(PLUS_PATH.\'/ask.cache.php\');
		
		if(!$paramer[classid])
		{
			$askArr = $ask_index;

		}else{
			$askArr = @explode(\',\',$paramer[classid]);
		}
		$i=0;
		foreach($askArr as $key=>$value)
		{
			$i++;
			$askArray[\'key\'] = $i;
			$askArray[\'id\'] = $value;
			$askArray[\'name\'] = $ask_name[$value];
			$askArray[\'pic\'] = $ask_pic[$value]; 
			$askArray[\'intro\'] = $ask_intro[$value];
			' . $name . '[] = $askArray;
			if($paramer[limit] && $i>=$paramer[limit])
			{
				break;
			} 
		}
		if($paramer[son]){
			foreach(' . $name . ' as $key=>$val){ 
				foreach($ask_type[$val[\'id\']] as $v){
					' . $name . '[$key][son][]=array(\'name\'=>$ask_name[$v],"id"=>$v);
				} 
			}
		}  
		';
        //×Ô¶¨Òå±êÇ© END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'qcache', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['item'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $class_id = $_attr['classid'];
        $adid = $_attr['adid'];
        $limit = $_attr['limit'];
        $limit = is_numeric($limit) ? $limit : 0;
        $length = $_attr['length'];
        $length = is_numeric($length) ? $length : 0;
        if (isset($adid)) {
            $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
			$AdArr=array();
			include(PLUS_PATH.\'/pimg_cache.php\');  if(!empty($ad_label[$paramer[classid]][\'ad_\'.$paramer[adid]])&&($ad_label[$paramer[classid]][\'ad_\'.$paramer[adid]][\'did\']==$_SESSION[\'did\']||$ad_label[$paramer[classid]][\'ad_\'.$paramer[adid]][\'did\']==\'0\')&&$ad_label[$paramer[classid]][\'ad_\'.$paramer[adid]][\'start\']<time()&&$ad_label[$paramer[classid]][\'ad_\'.$paramer[adid]][\'end\']>time()){
				$AdArr[] = $ad_label[$paramer[classid]][\'ad_\'.$paramer[adid]];
			}';
        } else {
            $OutputStr = '$AdArr=array();$paramer=array();
			include(PLUS_PATH.\'/pimg_cache.php\');$add_arr = $ad_label[' . $class_id . '];if(is_array($add_arr) && !empty($add_arr)){
				$i=0;$limit = ' . $limit . ';$length = ' . $length . ';
				foreach($add_arr as $key=>$value){
					if(($value[\'did\']==$config[\'did\'] ||$value[\'did\']==\'0\')&&$value[\'start\']<time()&&$value[\'end\']>time()){
						if($i>0 && $limit==$i){
							break;
						}
						if($length>0){
							$value[\'name\'] = mb_substr($value[\'name\'],0,$length);
						}
						if($paramer[\'type\']!=""){
							if($paramer[\'type\'] == $value[\'type\']){
								$AdArr[] = $value;
							}
						}else{
							$AdArr[] = $value;
						}
						$i++;
					}
				}
			}';
        }
        return SmartyOutputStr($this, $compiler, $_attr, 'adlist', '$AdArr', $OutputStr, '$AdArr');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $db,$db_config,$config;$List=array();
		$Query = $db->query("SELECT * FROM $db_config[def]description where is_nav=\'1\' order by sort asc");
		while($rs = $db->fetch_array($Query)){
			$rs[\'url\']=$config[\'sy_weburl\']."/".$rs[\'url\'];
			$List[] =  $rs;
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'singlenav', '$List', $OutputStr, '$List');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		include(PLUS."/navmap.cache.php");$Navlist=array();
		if(is_array($navmap)){
			$ParamerArr = GetSmarty($paramer,$_GET);
			$paramer = $ParamerArr[arr];
			$Purl =  $ParamerArr[purl];
		}
		//默认调用头部导航
		$Navlist =$navmap[0];
		if(is_array($navmap)){
			foreach($navmap as $k=>$v){
				foreach($Navlist as $key=>$val){
					if($k==$val[id]){
						foreach($v as $kk=>$value){
							if($value[type]==\'1\'){
								if($config[sy_seo_rewrite]=="1" && $value[furl]!=\'\'){
									$v[$kk][url] = $config[sy_weburl]."/".$value[furl];
								}else{
									$v[$kk][url] = $config[sy_weburl]."/".$value[url];
								}
							}
						}
						$Navlist[$key][\'list\']=$v;
					}
				}
			}
			foreach($Navlist as $key=>$value){
				if($value[type]==\'1\'){
					if($config[sy_seo_rewrite]=="1" && $value[furl]!=\'\'){
						$Navlist[$key][url] = $config[sy_weburl]."/".$value[furl];
					}else{
						$Navlist[$key][url] = $config[sy_weburl]."/".$value[url];
					}
				}
			}
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'navmap', '$Navlist', $OutputStr, '$Navlist');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $OutputStr = '$AdArr=array();$paramer=array();';
        $class_id = $_attr['classid'];
        $adid = $_attr['adid'];
        $limit = $_attr['limit'];
        $limit = is_numeric($limit) ? $limit : 0;
        $length = $_attr['length'];
        $length = is_numeric($length) ? $length : 0;
        if (isset($adid)) {
            $OutputStr .= 'include(PLUS_PATH.\'/pimg_cache.php\');if(!empty($ad_label[$class_id][\'ad_\'' . $adid . '])&&($ad_label[$class_id][\'ad_\'' . $adid . '][\'did\']==$_SESSION[\'did\']||$ad_label[$class_id][\'ad_\'' . $adid . '][\'did\']==\'0\')&&$ad_label[$class_id][\'ad_\'' . $adid . '][\'start\']<time()&&$ad_label[$class_id][\'ad_\'' . $adid . '][\'end\']>time()){
				$AdArr[] = $ad_label[$class_id][\'ad_\'' . $adid . '];
			}';
        } else {
            $OutputStr .= 'include(PLUS_PATH.\'/pimg_cache.php\');$add_arr = $ad_label[' . $class_id . '];if(is_array($add_arr) && !empty($add_arr)){
				$i=0;$limit = ' . $limit . ';$length = ' . $length . ';
				foreach($add_arr as $key=>$value){
					if((stripos($value[\'did\'],$_SESSION[\'did\'])!==false ||$value[\'did\']==\'0\')&&$value[\'start\']<time()&&$value[\'end\']>time()){
						if($i>0 && $limit==$i){
							break;
						}
						if($length>0){
							$value[\'name\'] = mb_substr($value[\'name\'],0,$length);
						}
						if($paramer[\'type\']!=""){
							if($paramer[\'type\'] == $value[\'type\']){
								$AdArr[] = $value;
							}
						}else{
							$AdArr[] = $value;
						}
						$i++;
					}
				}
			}';
        }
        //自定义标签 END
        return SmartyOutputStr($this, $compiler, $_attr, 'adlist', '$AdArr', $OutputStr, '$AdArr');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');$List=array();
		//处理传入参数,并且构造分页参数
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$where = "`is_show`=\'1\'";
		if($paramer[\'id\']){
			$where.=" and `cid`=\'".$paramer[\'id\']."\'";
		}
		//关键字
		if($paramer[\'keyword\']){
			$where.=" AND `name` LIKE \'%".$paramer[\'keyword\']."%\'";
		}
		//排序字段 默认按照xuanshang排序
		if($paramer[order]){
			$where.="  ORDER BY `".$paramer[\'order\']."`";
		}else{
			$where.="  ORDER BY `id`";
		}
		//排序方式默认倒序
		if($paramer[\'sort\']){
			$where.=" ".$paramer[\'sort\'];
		}else{
			$where.=" DESC";
		}
		//查询条数
		if($paramer[\'limit\']){
			$limit=" LIMIT ".$paramer[\'limit\'];
		}
		$List=$db->select_all("toolbox_doc",$where.$limit);';
        return SmartyOutputStr($this, $compiler, $_attr, 'hrlist', '$List', $OutputStr, '$List');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
		include PLUS_PATH."/user.cache.php";
		//处理传入参数,并且构造分页参数
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$where = "status=\'1\' ";
		//关键字
		if($paramer[keyword]){
			$where.=" AND `username` LIKE \'%".$paramer[keyword]."%\' or `job` LIKE \'%".$paramer[keyword]."%\'";
		}
		if($paramer[\'add_time\']>0){
			$time=time()-$paramer[\'add_time\']*86400;
			$where.=" and `time`>".$time;
		}
		if($paramer[\'delid\']){
			$where.=" AND `id`<>\'".$paramer[\'delid\']."\'";
		}
		//排序字段默认为更新时间
		if($paramer[\'order\']){
			$order = " ORDER BY `".str_replace("\'","",$paramer[order])."`";
		}else{
			$order = " ORDER BY time ";
		}
		//排序规则 默认为倒序
		if($paramer[\'sort\']){
			$sort = $paramer[\'sort\'];
		}else{
			$sort = " DESC";
		}
		//查询条数
		if($paramer[limit]){
			$limit=" LIMIT ".$paramer[limit];
		}else{
			$limit=" LIMIT 20";
		}
		//自定义查询条件,默认取代上面任何参数直接使用该语句
		if($paramer[where]){
			$where = $paramer[where];
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"resume_tiny",$where,$Purl,\'\',\'0\',$_smarty_tpl);
		}
		$where.=$order.$sort.$limit;
		' . $name . '=$db->select_all("resume_tiny",$where);
		if(is_array(' . $name . ')){
			foreach(' . $name . ' as $key=>$value){
				$time=time()-$value[\'time\'];
				if($time>86400 && $time<604800){
					' . $name . '[$key][\'time\'] = ceil($time/86400)."天前";
				}elseif($time>3600 && $time<86400){
					' . $name . '[$key][\'time\'] = ceil($time/3600)."小时前";
				}elseif($time>60 && $time<3600){
					' . $name . '[$key][\'time\'] = ceil($time/60)."分钟前";
				}elseif($time<60){
					' . $name . '[$key][\'time\'] = "刚刚";
				}else{
					' . $name . '[$key][\'time\'] = date("Y-m-d",$value[\'time\']);
				}
				' . $name . '[$key][\'sex_name\'] =$userclass_name[$value[\'sex\']];
				' . $name . '[$key][\'exp_name\'] =$userclass_name[$value[\'exp\']];
			}
		}
		if(is_array(' . $name . ')){
			if($paramer[keyword]!=""&&!empty(' . $name . ')){
				addkeywords(\'1\',$paramer[keyword]);
			}
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'tiny', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['item'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $uptime = $_attr['uptime'];
        $order = $_attr['order'];
        $sort = $_attr['sort'];
        $limit = $_attr['limit'];
        $where = $_attr['where'];
        $ispage = $_attr['ispage'];
        $OutputStr = 'global $db,$db_config,$config;
        global $ModuleName;
        if(!$Purl["m"]){
            $Purl["m"]=$ModuleName;
        }
		$time = time();
		$where = "`time_start`<$time AND `time_end`>$time";';
        if ($uptime) {
            $OutputStr .= '$uptime = $time-' . $uptime . '*3600;
			$where.=" AND `lastupdate`>\'".$uptime."\'";';
        }
        $OutputStr .= '$order = " ORDER BY `' . ($order ? $order : 'sort') . '` ";';
        $OutputStr .= '$sort = \'' . ($sort ? $sort : 'ASC') . '\';';
        if ($limit) {
            $OutputStr .= '$limit=" LIMIT ' . $limit . '";';
        }
        $OutputStr .= '$where.=$order.$sort;';
        if ($where) {
            $OutputStr .= '$where = \'' . $where . '\';';
        }
        if ($ispage) {
            $OutputStr .= '$limit = PageNav($paramer,$_GET,"hotjob",$where,$Purl,\'0\',$_smarty_tpl);';
        }
        $OutputStr .= '
        $Query = $db->query("SELECT * FROM $db_config[def]hotjob where ".$where.$limit);
		while($rs = $db->fetch_array($Query)){
			' . $name . '[] = $rs;
			$ListId[] =  $rs[uid];
		}
		$jobwhere=1;
		if($config[sy_web_site]=="1"){
			if($config[cityid]>0 && $config[cityid]!=""){
				$jobwhere.=" and `cityid`=\'$config[cityid]\'";
			}
			if($config[three_cityid]>0 && $config[three_cityid]!=""){
				$jobwhere.=" and `three_cityid`=\'$config[three_cityid]\'";
			}
			if($config[hyclass]>0 && $config[hyclass]!=""){
				$jobwhere.=" and `hy`=\'".$config[hyclass]."\'";
			}
		}
		$JobId = @implode(",",$ListId);
		$JobList=$db->select_all("company_job","`uid` IN ($JobId) and `edate`>\'".mktime()."\' and state=1 and r_status<>\'2\' and status<>\'1\' and $jobwhere");
		$statis=$db->select_all("company_statis","`uid` IN ($JobId)","`uid`,`comtpl`");
		if(is_array($ListId)){
			$cache_array = $db->cacheget();
			foreach(' . $name . ' as $key=>$value){
				$i=0;
				if(is_array($JobList)){
					' . $name . '[$key]["job"].="<div class=\\"area_left\\"> ";
					foreach($JobList as $k=>$v){
						if($value[uid]==$v[uid] && $i<5){
							$job_url = Url("job",array("c"=>"comapply","id"=>"$v[id]"),"1");
							$v[name] = mb_substr($v[name],0,10,"GBK");
							' . $name . '[$key]["job"].="<a href=\'".$job_url."\'>".$v[name]."</a>";
							$i++;
						}
					}
					foreach($statis as $v){
						if($value[\'uid\']==$v[\'uid\']){
							if($v[\'comtpl\'] && $v[\'comtpl\']!="default"){
								$jobs_url = Url("company",array("c"=>"show","id"=>$value[uid]))."#job";
							}else{
								$jobs_url = Url("company",array("c"=>"show","id"=>$value[uid]));
							}
						}
					}
					$com_url = Url("company",array("c"=>"show","id"=>$value[uid]));
					$beizhu=mb_substr($value[\'beizhu\'],0,50,"GBK")."...";
					' . $name . '[$key]["job"].="</div><div class=\\"area_right\\"><a href=\'".$com_url."\'>".$value["username"]."</a>".$beizhu."</div><div class=\\"area_left_bot\\"><a href=\'".$jobs_url."\'>全部职位</a></div><div class=\'area_right_bot\'><a href=\'".$com_url."\'>公司详情</a></div>";
					' . $name . '[$key]["url"]=$com_url;
				}
			}
		}';
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'hotjob', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
        include PLUS_PATH."/ltjob.cache.php";
		include PLUS_PATH."/lthy.cache.php";
		//处理传入参数,并且构造分页参数
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$where = "`edate`>\'".time()."\' and `status`=\'1\' and `zp_status`<>\'1\' and `r_status`<>\'2\'";
		//是否属于分站下
		if($config[sy_web_site]=="1"){
			if($_SESSION[cityid]>0 && $_SESSION[cityid]!=""){
				$paramer[cityid]=$_SESSION[cityid];
			}
			if($_SESSION[three_cityid]>0 && $_SESSION[three_cityid]!=""){
				$paramer[three_cityid] = $_SESSION[three_cityid];
			}
		}
		//关键字
		if($paramer["keyword"]){
			$where.=" AND (`com_name` like \'%".$paramer["keyword"]."%\' or `job_name` like \'%".$paramer["keyword"]."%\')";
		}
		//期望行业大类
		if($paramer["hyclass"]){
			$hyid=$lthy_type[$paramer["hyclass"]];
			foreach($hyid as $v)
			{
				$hyarr[]= "FIND_IN_SET(\'".$v."\',qw_hy)";
			}
			$hyarr=@implode(" or ",$hyarr);
			$where.=" AND ($hyarr)";
		}
		//期望行业子类
		if($paramer["qw_hy"]){
			$where.= " AND FIND_IN_SET(\'".$paramer["qw_hy"]."\',qw_hy)";
		}
		//职位大类
		if($paramer["jobone"]){
			$where.=" AND `jobone`=\'".$paramer["jobone"]."\'";
		}
		//职位子类
		if($paramer["jobtwo"]){
			$where.=" AND `jobtwo`=\'".$paramer["jobtwo"]."\'";
		}
		//年薪
		if($paramer["salary"]){
			$where.=" AND `salary`=\'".$paramer["salary"]."\'";
		}
		//发布时间
		if($paramer["uptime"]){
			if($paramer["uptime"]>0){
				$time=time()-86400*30*$paramer["uptime"];
				$where.=" AND `lastupdate`>$time";
			}else{
				$time=time()-86400*30*12;
				$where.=" AND `lastupdate`<$time";
			}
		}
		//推荐
		if($paramer["rec"]){
			$where.=" AND `rec`=\'".$paramer["rec"]."\'";
		}
		//城市
		if($paramer["provinceid"]){
			$where.=" AND `provinceid`=\'".$paramer["provinceid"]."\'";
		}
		if($paramer["cityid"]){
			$where.=" AND `cityid`=\'".$paramer["cityid"]."\'";
		}
		if($paramer["three_cityid"]){
			$where.=" AND `three_cityid`=\'".$paramer["three_cityid"]."\'";
		}
		//用户uid
		if($paramer["uid"]){
			$where.=" AND `uid`=\'".$paramer["uid"]."\'";
		}
		if($paramer["rebates"]==\'1\'){
			$where.=" AND `rebates`<>\'\'";
		}
		//排序字段(默认按照uid排序)
		if($paramer[order]){
			$where .= " ORDER BY $paramer[order]";
		}else{
			$where .= " ORDER BY  `lastupdate`  ";
		}
		//排序规则(默认按照开始时间排序倒序)
		if($paramer["sort"]){
			$where .= " $paramer[sort]";
		}else{
			$where .= " DESC ";
		}
		if($paramer["limit"]){
			$limit= " limit $paramer[limit]";
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"lt_job",$where,$Purl,"","1",$_smarty_tpl);
            $_smarty_tpl->tpl_vars["firmurl"]=new Smarty_Variable;
			$_smarty_tpl->tpl_vars["firmurl"]->value = $config[\'sy_weburl\']."/lietou/index.php?c=post".$ParamerArr[firmurl];
		}
		' . $name . '=$db->select_all("lt_job",$where.$limit);
		if(!$paramer[ispage]){
            $_smarty_tpl->tpl_vars["firmurl"]=new Smarty_Variable;
			$_smarty_tpl->tpl_vars["t_count"]->value=count(' . $name . ');
		}
		if(is_array(' . $name . ')){
			foreach(' . $name . ' as $k=>$v){
				' . $name . '[$k] = $db->lt_array_action($v);
				//对job_name 截取
				if(intval($paramer[\'t_len\'])>0)
				{
					$len = intval($paramer[\'t_len\']);
					' . $name . '[$k][\'job_name\'] = mb_substr($v[\'job_name\'],0,$len,"GBK");
				}
				if($v[\'usertype\']==3){
					' . $name . '[$k]["job_url"] = Lurl(array("url"=>"c:jobshow,id:".$v[\'id\']));
				}else{
					' . $name . '[$k]["job_url"] = Lurl(array("url"=>"c:jobcomshow,id:".$v[\'id\']));
				}
				' . $name . '[$k]["lastupdate"] = date("Y-m-d",$v["lastupdate"]);
				' . $name . '[$k]["edate"] = date("Y-m-d",$v["edate"]);
			}
		}
		if($paramer[\'keyword\']!=""&&!empty(' . $name . ')){
			addkeywords(\'7\',$paramer[\'keyword\']);
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'ltjoblist', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签START
        $OutputStr = '' . $name . '=array();global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];extract($paramer);
		$Purl =  $ParamerArr[purl];include PLUS_PATH."/job.cache.php";
		$where = "a.status<>\'2\' and a.`r_status`<>\'2\' and b.`job_classid`<>\'\' and b.`open`=\'1\' and a.`uid`=b.`uid`";
		//是否属于分站下
		if($config[\'sy_web_sit\']=="1"){
			if($_SESSION[\'cityid\']>0 && $_SESSION[\'cityid\']!=""){
				$paramer[\'cityid\']=$_SESSION[\'cityid\'];
			}
			if($_SESSION[\'hyclass\']>0 && $_SESSION[\'hyclass\']!=""){
				$paramer[\'hy\']=$_SESSION[\'hyclass\'];
			}
		}
		//关注我公司的人才--条件
		if($paramer[where_uid]){
			$where .=" AND a.`uid` in (".$paramer[\'where_uid\'].")";
		}
		//身份认证
		if($paramer[idcard]){
			$where .=" AND a.`idcard_status`=\'1\'";
		}
		//高级人才
		if($paramer[height_status]){
			$where .=" AND b.height_status=.$paramer[height_status]";
		}else{
			$where .=" AND b.height_status<>\'2\' AND a.`def_job`=b.`id`";
		}
		//高级人才推荐
		if($paramer[rec]){
			$where .=" AND b.rec=1";
		}
		//普通推荐
		if($paramer[rec_resume]){
			$where .=" AND b.`rec_resume`=1";
		}
		//作品
		if($paramer[work]){
			$show=$db->select_all("resume_show","1 group by eid","`eid`");
			if(is_array($show))
			{
				foreach($show as $v)
				{
					$eid[]=$v[\'eid\'];
				}
			}
			$where .=" AND b.id in (".@implode(",",$eid).")";
		}
		//地区
		if($paramer[cid]){
			$where .= " AND (b.cityid=$paramer[cid] or b.three_cityid=$paramer[cid])";
		}
		//关键字
		if($paramer[keyword]){
			$where1[]="b.`name` LIKE \'%$paramer[keyword]%\'";
			foreach($job_name as $k=>$v){
				if(strpos($v,$paramer[keyword])!==false){
					$jobid[]=$k;
				}
			}
			if(is_array($jobid))
			{
				foreach($jobid as $value)
				{
					$class[]="FIND_IN_SET(\'".$value."\',b.job_classid)";
				}
				$where1[]=@implode(" or ",$class);
			}
			include PLUS_PATH."/city.cache.php";
			foreach($city_name as $k=>$v)
			{
				if(strpos($v,$paramer[keyword])!==false)
				{
					$cityid[]=$k;
				}
			}
			if(is_array($cityid))
			{
				foreach($cityid as $value)
				{
					$class[]= "(b.provinceid = \'".$value."\' or b.cityid = \'".$value."\')";
				}
				$where1[]=@implode(" or ",$class);
			}
			$where.=" AND (".@implode(" or ",$where1).")";
		}
		//是否有照片
		if($paramer[pic]=="0"||$paramer[pic]){
			$where .=" AND a.photo<>\'\'";
		}
		//名称不能为空
		if($paramer[name]=="0"){
			$where .=" AND a.name<>\'\'";
		}
		//求职行业不能为空
		if($paramer[hy]=="0"){
			$where .=" AND b.hy<>\'\'";
		}elseif($paramer[hy]!=""){
			$where .= " AND (b.`hy` IN (".$paramer[\'hy\']."))";
		}
		//职位类别
		if($paramer[jobids]){
			$joball=explode(",",$paramer[jobids]);
			foreach(explode(",",$paramer[jobids]) as $v){
				if($job_type[$v]){
					$joball[]=@implode(",",$job_type[$v]);
				}
			}
			$job_classid=implode(",",$joball);
		}
		if($paramer[job1_son]){
			$joball=$job_type[$paramer[job1_son]];
			foreach($job_type[$paramer[job1_son]] as $v)
			{
				$joball[]=@implode(",",$job_type[$v]);
			}
			$job_classid=@implode(",",$joball);
		}
		if($job_classid){
			$classid=@explode(",",$job_classid);
			foreach($classid as $value){
				$class[]="FIND_IN_SET(\'".$value."\',b.job_classid)";
			}
			$classid=@implode(" or ",$class);
			$where .= " AND ($classid)";
		}
		if($paramer[job_post]){
			foreach($paramer[\'job_post\'] as $v){
				$jobwhere[]="FIND_IN_SET(\'".$v."\',b.job_classid)";
			}
			$jobwhere=implode(" or ",$jobwhere);
			$where .=" AND (".$jobwhere.")";
		}
		//城市大类
		if($paramer[provinceid]){
			$where .= " AND b.provinceid = $paramer[provinceid]";
		}
		//城市子类
		if($paramer[cityid]){
			$where .= " AND (b.`cityid` IN ($paramer[cityid]))";
		}
		//城市三级子类
		if($paramer[three_cityid]){
			$where .= " AND (b.`three_cityid` IN ($paramer[three_cityid]))";
		}
		//城市区间,不建议执行该查询
		if($paramer[cityin]){
			$where .= " AND( AND b.provinceid IN ($paramer[cityin]) OR b.cityid IN ($paramer[cityin]) OR b.three_cityid IN ($paramer[cityin]))";
		}
		//工作经验
		if($paramer[exp]){
			$where .=" AND a.exp=$paramer[exp]";
		}else{
			$where .=" AND a.exp>0";
		}
		//学历
		if($paramer[edu]){
			$where .=" AND a.edu=$paramer[edu]";
		}else{
			$where .=" AND a.edu>0";
		}
		//性别
		if($paramer[sex]){
			$where .=" AND a.sex=$paramer[sex]";
		}
		//到岗时间
		if($paramer[report]){
			$where .=" AND b.report=$paramer[report]";
		}
		//到岗时间
		if($paramer[salary]){
			$where .=" AND b.salary=$paramer[salary]";
		}
		//工作性质
		if($paramer[type]){
			$where .= " AND b.type=$paramer[type]";
		}
		//更新时间区间
		if($paramer[uptime]){
			$time=time();
			$uptime = $time-($paramer[uptime]*86400);
			$where.=" AND b.lastupdate>$uptime";
		}
		//添加时间区间,即审核时间
		if($paramer[adtime]){
			$time=time();
			$adtime = $time-($paramer[adtime]*86400);
			$where.=" AND b.status_time>$adtime";
		}
        //排序字段默认为更新时间 edu
		if($paramer[order] && $paramer[order]!="lastdate"){
			if($paramer[order]==\'ant_num\'){
				$order = " ORDER BY a.`".str_replace("\'","",$paramer[order])."`";
			}elseif($paramer[order]==\'topdate\'){
				$nowtime=time();
				$order = " ORDER BY if(b.topdate>$nowtime,b.topdate,b.lastupdate)";
			}else{
				$order = " ORDER BY b.`".str_replace("\'","",$paramer[order])."`";
			}
		}else{
			$order = " ORDER BY b.lastupdate ";
		}
		//排序规则 默认为倒序
		$sort = $paramer[sort]?$paramer[sort]:\'DESC\';
		//查询条数
		if($paramer[limit]){
			$limit=" LIMIT ".$paramer[limit];
		}
		$where.=$order.$sort;
		//自定义查询条件,默认取代上面任何参数直接使用该语句
		if($paramer[where]){
			$where = $paramer[where];
		}
		if($paramer[ispage]){
			if($paramer["height_status"]){
				$limit = PageNav($paramer,$_GET,"resume",$where,$Purl,"resume_expect","3",$_smarty_tpl);
			}else{
				$limit = PageNav($paramer,$_GET,"resume",$where,$Purl,"resume_expect",\'0\',$_smarty_tpl);
			}
		}
		' . $name . '=$db->select_alls("resume","resume_expect",$where.$limit,"b.*,a.*,a.name as username,b.provinceid as provinceid,b.cityid as cityid");
		if(is_array(' . $name . ')){
			//处理类别字段
			$cache_array = $db->cacheget();
			$userclass_name = $cache_array["user_classname"];
			$city_name      = $cache_array["city_name"];
			$job_name		= $cache_array["job_name"];
			$industry_name	= $cache_array["industry_name"];
			$my_down=array();
			if($_COOKIE[\'usertype\']==\'2\')
			{
				$my_down=$db->select_all("down_resume","`comid`=\'".$_COOKIE[\'uid\']."\'","uid");
			}
			foreach(' . $name . ' as $k=>$v)
			{
				//更新时间显示方式
				$time=time()-$v[\'lastupdate\'];
				if($time>86400 && $time<259300){
					' . $name . '[$k][\'time\'] = ceil($time/86400)."天前";
				}elseif($time>3600 && $time<86400){
					' . $name . '[$k][\'time\'] = ceil($time/3600)."小时前";
				}elseif($time>60 && $time<3600){
					' . $name . '[$k][\'time\'] = ceil($time/60)."分钟前";
				}elseif($time<60){
					' . $name . '[$k][\'time\'] = "刚刚";
				}else{
					' . $name . '[$k][\'time\'] = date("Y-m-d",$v[\'lastupdate\']);
				}
				//同时满足两个条件才需对对头像进行处理
				if($config[\'sy_usertype_1\']==\'1\'&&$v[\'photo\']){
					if(!empty($my_down)){
						foreach($my_down as $m_k=>$m_v){
							$my_down_uid[]=$m_v[\'uid\'];
						}
						if(in_array($v[\'uid\'],$my_down_uid)==false){
							' . $name . '[$k][\'photo\']=\'./\'.$config[\'member_logo\'];
						}
					}else{
						' . $name . '[$k][\'photo\']=\'./\'.$config[\'member_logo\'];
					}
				}
				if($config["user_name"]==3)
				{
					' . $name . '[$k]["username_n"] = "NO.".$v["id"];
				}elseif($config["user_name"]==2){
					if($userclass_name[$v[\'sex\']]==\'男\'){
						' . $name . '[$k]["username_n"] = mb_substr($v["username"],0,1,\'GBK\')."先生";
					}else{
						' . $name . '[$k]["username_n"] = mb_substr($v["username"],0,1,\'GBK\')."女士";
					}
				}else{
					' . $name . '[$k]["username_n"] = $v["username"];
				}
				$a=date(\'Y\',strtotime(' . $name . '[$k][\'birthday\']));
				' . $name . '[$k][\'age\']=date("Y")-$a;
				' . $name . '[$k][\'sex_n\']=$userclass_name[$v[\'sex\']];
				' . $name . '[$k][\'edu_n\']=$userclass_name[$v[\'edu\']];
				' . $name . '[$k][\'exp_n\']=$userclass_name[$v[\'exp\']];
				' . $name . '[$k][\'job_city_one\']=$city_name[$v[\'provinceid\']];
				' . $name . '[$k][\'job_city_two\']=$city_name[$v[\'cityid\']];
				' . $name . '[$k][\'job_city_three\']=$city_name[$v[\'three_cityid\']];
				' . $name . '[$k][\'salary_n\']=$userclass_name[$v[\'salary\']];
				' . $name . '[$k][\'report_n\']=$userclass_name[$v[\'report\']];
				' . $name . '[$k][\'type_n\']=$userclass_name[$v[\'type\']];
				' . $name . '[$k][\'lastupdate\']=date("Y-m-d",$v[\'lastupdate\']);
				//如果存在top,则说明请求来自排行榜页面
				if($paramer[\'top\']){
					$m_name=$db->select_only($db_config[def]."member","`uid`=\'".$v[\'uid\']."\'","username");
					' . $name . '[$k][\'m_name\']=$m_name[0][\'username\'];
					' . $name . '[$k][\'user_url\']=Furl(array("url"=>"c:profile,id:".$v[\'uid\']));
				}else{
					' . $name . '[$k][\'user_url\']=Url("index","resume",array("id"=>$v[\'id\']),"1");
				}
				' . $name . '[$k]["hy_info"]=$industry_name[$v[\'hy\']];
				$job_classid=@explode(",",$v[\'job_classid\']);
				if(is_array($job_classid))
				{
					foreach($job_classid as $val)
					{
						$jobname[]=$job_name[$val];
					}
				}
				' . $name . '[$k][\'job_post\']=@implode(",",$jobname);
				//截取标题
				if($paramer[\'post_len\'])
				{
					$postname[$k]=@implode(",",$jobname);
					' . $name . '[$k][\'job_post_n\']=mb_substr($postname[$k],0,$paramer[post_len],"GBK");
				}
				if($paramer[\'keyword\'])
				{
					' . $name . '[$k][\'username\']=str_replace($paramer[\'keyword\'],"<font color=#FF6600 >".$paramer[\'keyword\']."</font>",$v[\'username\']);
					' . $name . '[$k][\'job_post\']=str_replace($paramer[\'keyword\'],"<font color=#FF6600 >".$paramer[\'keyword\']."</font>",' . $name . '[$k][\'job_post\']);
					' . $name . '[$k][\'job_post_n\']=str_replace($paramer[\'keyword\'],"<font color=#FF6600 >".$paramer[\'keyword\']."</font>",' . $name . '[$k][\'job_post_n\']);
					' . $name . '[$k][\'job_city_one\']=str_replace($paramer[\'keyword\'],"<font color=#FF6600 >".$paramer[\'keyword\']."</font>",$city_name[$v[\'provinceid\']]);
					' . $name . '[$k][\'job_city_two\']=str_replace($paramer[\'keyword\'],"<font color=#FF6600 >".$paramer[\'keyword\']."</font>",$city_name[$v[\'cityid\']]);
				}
				$jobname=array();
			}
			if($paramer[\'keyword\']!=""&&!empty(' . $name . ')){
				addkeywords(\'5\',$paramer[\'keyword\']);
			}
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'userlist', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'List';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $class_id = $paramer[class_id];
        $OutputStr = 'global $db,$db_config,$config;
		$time = time();
		if($config[sy_web_site]=="1"){
			if($_SESSION[cityid]>0 && $_SESSION[cityid]!=""){
				$paramer[cityid] = $_SESSION[cityid];
			}
			if($_SESSION[three_cityid]>0 && $_SESSION[three_cityid]!=""){
				$paramer[three_cityid] = $_SESSION[three_cityid];
			}
			if($_SESSION[hyclass]>0 && $_SESSION[hyclass]!=""){
				$paramer[hy]=$_SESSION[hyclass];
			}
		}
		//可以做缓存
        eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
        $Purl =  $ParamerArr[purl];
		if($paramer[sdate]){
			$where = "`sdate`>".strtotime("-".intval($paramer[sdate])." day",time())." and `edate`>\'$time\' and `state`=1";
		}else{
			$where = "`edate`>\'$time\' and `state`=1";
		}
		//按照UID来查询(按公司地址查询可用GET[id]获取当前公司ID)
		if($paramer[uid]){
			$where .= " AND `uid` = ' . $paramer[uid] . '";
		}
		//是否推荐职位
		if($paramer[rec]){
			$where.=" AND `rec_time`>".time();
		}
		//企业认证条件
		if($paramer[\'cert\']){
			$company=$db->select_all("company","`yyzz_status`=1","`uid`");
			if(is_array($company)){
				foreach($company as $v){
					$job_uid[]=$v[\'uid\'];
				}
			}
			$where.=" and `uid` in (".@implode(",",$job_uid).")";
		}
		//取不包含当前id的职位
		if($paramer[noid]){
			$where.= " and `id`<>$paramer[noid]";
		}
		//是否被锁定
		if($paramer[r_status]){
			$where.= " and `r_status`=2";
		}else{
			$where.= " and `r_status`<>2";
		}
		//是否暂停职位
		if($paramer[status]){
			$where.= " and `status`=1";
		}else{
			$where.= " and `status`<>1";
		}
		//公司体制
		if($paramer[pr]){
			$where .= " AND `pr` =$paramer[pr]";
		}
		//公司行业分类
		if($paramer[\'hy\']){
			$where .= " AND `hy` = $paramer[hy]";
		}
		//公司规模
		if($paramer[mun]){
			$where .= " AND `mun` = $paramer[mun]";
		}
		//职位大类
		if($paramer[job1]){
			$where .= " AND `job1` = $paramer[job1]";
		}
		//职位子类
		if($paramer[job1_son])
		{
			$where .= " AND `job1_son` = $paramer[job1_son]";
		}
		//职位三级分类
		if($paramer[job_post])
		{
			$where .= " AND (`job_post` IN ($paramer[job_post]))";
		}
		//您可能感兴趣的职位--个人会员中心
		if($paramer[\'jobwhere\']){
			$where .=" and ".$paramer[\'jobwhere\'];
		}
		//职位分类综合查询
		if($paramer[\'jobids\'])
		{
			$where.= " AND (`job1_son`=$paramer[jobids] OR `job_post`=$paramer[jobids])";
		}
		//职位分类区间,不建议执行该查询
		if($paramer[\'jobin\']){
			$where .= " AND (`job1` IN ($paramer[jobin]) OR `job1_son` IN ($paramer[jobin]) OR `job_post` IN ($paramer[jobin]))";
		}
		//城市大类
		if($paramer[provinceid]){
			$where .= " AND `provinceid` = $paramer[provinceid]";
		}
		//城市子类
		if($paramer[\'cityid\']){
			$where .= " AND (`cityid` IN ($paramer[cityid]))";
		}
		//城市三级子类
		if($paramer[\'three_cityid\']){
			$where .= " AND (`three_cityid` IN ($paramer[three_cityid]))";
		}
		//学历
		if($paramer[edu]){
			$where .= " AND `edu` = $paramer[edu]";
		}
		//工作经验
		if($paramer[exp]){
			$where .= " AND `exp` = $paramer[exp]";
		}
		//职位性质
		if($paramer[type]){
			$where .= " AND `type` = $paramer[type]";
		}
		//性别
		if($paramer[sex]){
			$where .= " AND `sex` = $paramer[sex]";
		}
		//月薪
		if($paramer[salary]){
			$where .= " AND `salary` = $paramer[salary]";
		}
		//城市区间,不建议执行该查询
		if($paramer[cityin]){
			$where .= " AND( AND `provinceid` IN ($paramer[cityin]) OR `cityid` IN ($paramer[cityin]) OR `three_cityid` IN ($paramer[cityin]))";
		}
		//紧急招聘urgent
		if($paramer[urgent]){
			$where.=" AND `urgent_time`>".time();
		}
		//更新时间区间
		if($paramer[uptime]){
			$uptime = $time-$paramer[uptime]*86400;
			$where.=" AND `lastupdate`>$uptime";
		}
		//按类似公司名称,不建议进行大数据量操作
		if($paramer[comname]){
			$where.=" AND `com_name` LIKE \'%".$paramer[comname]."%\'";
		}
		//按公司归属地,只适合查询一级城市分类
		if($paramer[com_pro]){
			$where.=" AND `com_provinceid` =\'".$paramer[com_pro]."\'";
		}
		//按照职位名称匹配
		if($paramer[keyword]){
			$where1[]="`name` LIKE \'%".$paramer[keyword]."%\'";
			$where1[]="`com_name` LIKE \'%".$paramer[keyword]."%\'";
			include PLUS_PATH."/city.cache.php";
			foreach($city_name as $k=>$v){
				if(strpos($v,$paramer[keyword])!==false){
					$cityid[]=$k;
				}
			}
			if(is_array($cityid)){
				foreach($cityid as $value){
					$class[]= "(provinceid = \'".$value."\' or cityid = \'".$value."\')";
				}
				$where1[]=@implode(" or ",$class);
			}
			$where.=" AND (".@implode(" or ",$where1).")";
		}
		//多选职位
		if($paramer["job"]){
			$where.=" AND `job_post` in ($paramer[job])";
		}
		//竞价招聘
		if($paramer[bid]){
			$where.=" AND `xuanshang`<>0";
		}
		//排序字段默认为更新时间
		if($paramer[order] && $paramer[order]!="lastdate"){
			$order = " ORDER BY ".str_replace("\'","",$paramer[order])."  ";
		}else{
			$order = " ORDER BY `lastupdate` ";
		}
		//排序规则 默认为倒序
		if($paramer[sort]){
			$sort = $paramer[sort];
		}else{
			$sort = " DESC";
		}
		if($paramer[\'orderby\']=="rec"){
			$nowtime=time();
			$where.=" ORDER BY if(rec_time>$nowtime,rec_time,lastupdate)  desc";
		}else{
			$where.=$order.$sort;
		}
		//自定义查询条件,默认取代上面任何参数直接使用该语句
		if($paramer[where]){
			$where = $paramer[where];
		}
		//查询条数
		if($paramer[limit]){
			$limit = " limit ".$paramer[limit];
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"company_job",$where,$Purl,"","6",$_smarty_tpl);
            $_smarty_tpl->tpl_vars["firmurl"]=new Smarty_Variable;
			$_smarty_tpl->tpl_vars["firmurl"]->value = $config[\'sy_weburl\']."/index.php?m=com".$ParamerArr[firmurl];
		}
		' . $name . ' = $db->select_all("company_job",$where.$limit);
		if(is_array(' . $name . ')){
			//处理类别字段
			$cache_array = $db->cacheget();
			foreach(' . $name . ' as $key=>$value){
				$comuid[] = $value[\'uid\'];
			}
			$comuids = @implode(\',\',$comuid);
			if($comuids){
				$r_uids=$db->select_all("company","`uid` IN (".$comuids.")","`uid`,`yyzz_status`");
				if(is_array($r_uids)){
					foreach($r_uids as $key=>$value){
						$r_uid[$value[\'uid\']] = $value[\'yyzz_status\'];
					}
				}
			}
			foreach(' . $name . ' as $key=>$value){
				' . $name . '[$key] = $db->array_action($value,$cache_array);
				' . $name . '[$key][stime] = date("Y-m-d",$value[sdate]);
				' . $name . '[$key][etime] = date("Y-m-d",$value[edate]);
				' . $name . '[$key][lastupdate] = date("Y-m-d",$value[lastupdate]);

				' . $name . '[$key][yyzz_status] =$r_uid[$value[\'uid\']][\'yyzz_status\'];
				$time=time()-$value[\'lastupdate\'];

				if($time>86400 && $time<604800){
					' . $name . '[$key][\'time\'] = ceil($time/86400)."天前";
				}elseif($time>3600 && $time<86400){
					' . $name . '[$key][\'time\'] = ceil($time/3600)."小时前";
				}elseif($time>60 && $time<3600){
					' . $name . '[$key][\'time\'] = ceil($time/60)."分钟前";
				}elseif($time<60){
					' . $name . '[$key][\'time\'] = "刚刚";
				}else{
					' . $name . '[$key][\'time\'] = date("Y-m-d",$value[\'lastupdate\']);
				}
				//获得福利待遇名称
				if(is_array(' . $name . '[$key][\'welfare\'])&&' . $name . '[$key][\'welfare\']){
					foreach(' . $name . '[$key][\'welfare\'] as $val){
						' . $name . '[$key][\'welfarename\'][]=$cache_array[\'comclass_name\'][$val];
					}

				}
				//截取公司名称
				if($paramer[comlen]){
					' . $name . '[$key][com_n] = mb_substr($value[\'com_name\'],0,$paramer[comlen],"GBK");
				}
				//截取职位名称
				if($paramer[namelen]){
					if($value[\'rec_time\']>time()){
						' . $name . '[$key][name_n] = "<font color=\'red\'>".mb_substr($value[\'name\'],0,$paramer[namelen],"GBK")."</font>";
					}else{
						' . $name . '[$key][name_n] = mb_substr($value[\'name\'],0,$paramer[namelen],"GBK");
					}
				}else{
					if($value[\'rec_time\']>time()){
						' . $name . '[$key][\'name_n\'] = "<font color=\'red\'>".$value[\'name\']."</font>";
					}
				}
				//构建职位伪静态URL
				' . $name . '[$key][job_url] = Url("index","job",array("c"=>"comapply","id"=>$value[id]),"1");
				//构建企业伪静态URL
				' . $name . '[$key][com_url] = Url("index","company",array("id"=>$value[uid]));
				foreach($comrat as $k=>$v){
					if($value[rating]==$v[id]){
						' . $name . '[$key][color] = $v[com_color];
						' . $name . '[$key][ratlogo] = $v[com_pic];
					}
				}
				if($paramer[keyword]){
					' . $name . '[$key][name]=str_replace($paramer[keyword],"<font color=#FF6600 >".$paramer[keyword]."</font>",$value[name]);
					' . $name . '[$key][com_name]=str_replace($paramer[keyword],"<font color=#FF6600 >".$paramer[keyword]."</font>",$value[com_name]);
					' . $name . '[$key][name_n]=str_replace($paramer[keyword],"<font color=#FF6600 >".$paramer[keyword]."</font>",' . $name . '[$key][name_n]);
					' . $name . '[$key][com_n]=str_replace($paramer[keyword],"<font color=#FF6600 >".$paramer[keyword]."</font>",' . $name . '[$key][com_n]);
					' . $name . '[$key][job_city_one]=str_replace($paramer[keyword],"<font color=#FF6600 >".$paramer[keyword]."</font>",$city_name[$value[provinceid]]);
					' . $name . '[$key][job_city_two]=str_replace($paramer[keyword],"<font color=#FF6600 >".$paramer[keyword]."</font>",$city_name[$value[cityid]]);
				}
			}
			if(is_array(' . $name . ')){
				if($paramer[keyword]!=""&&!empty(' . $name . '))
				{
					addkeywords(\'3\',$paramer[keyword]);
				}
			}
		}';
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'joblist', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];extract($paramer);
		$Purl =  $ParamerArr[purl];
		if($config[\'sy_web_site\']=="1"){
			if($_SESSION[\'cityid\']>0 && $_SESSION[\'cityid\']!=""){
				$cityid=$_SESSION[\'cityid\'];
			}
			if($_SESSION[\'three_cityid\']>0 && $_SESSION[\'three_cityid\']!=""){
				$three_cityid = $_SESSION[\'three_cityid\'];
			}
			if($_SESSION[\'hyclass\']>0 && $_SESSION[\'hyclass\']!=""){
				$hy=$_SESSION[\'hyclass\'];
			}
		}
		$time = time();
		$where = "`sdate`<$time AND `edate`>$time and  `state`=\'1\' and `r_status`<>\'2\' and `status`<>\'1\'";
		if($urgent){
			$where.=" AND `urgent_time`>$time";
		}
		if($cityid){
			$where.=\' AND `cityid`=\'.$cityid;
		}
		if($three_cityid){
			$where.=" AND `three_cityid`=$cityid";
		}
		if($paramer[pr]){
			$where.=" AND `rec_time`>$time";
		}
		if($limit){
			$limit =  " limit $limit";
		}
		include PLUS_PATH."/city.cache.php";
		$query = $db->query("select count(*) as num,uid,provinceid,cityid,three_cityid,lastupdate from $db_config[def]company_job where  $where GROUP BY uid ORDER BY lastupdate desc $limit");
		$uids=array();$ComList=array();
        while($rs = $db->fetch_array($query)){
			if($citylen){
				$one_city[$rs[\'uid\']]		= mb_substr($city_name[$rs[\'cityid\']],0,$citylen);
				$two_city[$rs[\'uid\']]  = mb_substr($city_name[$rs[\'three_cityid\']],0,$citylen);
			}else{
				$one_city[$rs[\'uid\']]			= $city_name[$rs[\'cityid\']];
				$two_city[$rs[\'uid\']]  = $city_name[$rs[\'three_cityid\']];
			}
			//若市级不存在,则取省一级
			if($one_city[$rs[\'uid\']]==\'\'){
				$one_city[$rs[\'uid\']]=$city_name[$rs[\'provinceid\']];
			}
			$lasttime[$rs[\'uid\']] = date(\'Y-m-d\',$rs[\'lastupdate\']);
			$uids[] = $rs[\'uid\'];
		}
		if(!empty($uids)){
			$comids = @implode(\',\',$uids);
			$joblist = $db->select_all("company_job","$where AND `uid` IN ($comids) ORDER BY lastupdate desc");
			foreach($joblist as $value){
				if(!$jobnum || count($job_list[$value[\'uid\']])<$jobnum){
					if($joblen){
						$value[\'name_n\'] = mb_substr($value[\'name\'],0,$joblen,\'gbk\');
					}
					$value[\'url\'] = Url("index","com",array("c"=>"comapply","id"=>$value[\'id\']),"1");
					$job_list[$value[\'uid\']][] = $value;
				}
				$comname[$value[\'uid\']] = $value[\'com_name\'];
			}
			foreach($uids as $key=>$value){
				$ComList[$key][\'curl\']     = Curl(array("url"=>"id:".$value));
				$ComList[$key][\'uid\']     = $value;
				$ComList[$key][\'name\']	  = $comname[$value];
				$ComList[$key][\'one_city\']	  = $one_city[$value];
				$ComList[$key][\'two_city\']	  = $two_city[$value];
				$ComList[$key][\'lasttime\']     = $lasttime[$value];
				if($comlen){
					$ComList[$key][\'name_n\'] = mb_substr($comname[$value],0,$comlen,\'gbk\');
				}
				$ComList[$key][\'joblist\'] =$job_list[$value];
			}
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'comjob', '$ComList', $OutputStr, '$ComList');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['item'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
		//处理传入参数,并且构造分页参数
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
        global $ModuleName;
        if(!$Purl["m"]){
            $Purl["m"]=$ModuleName;
        }
		$paramer[\'sid\']=(int)$paramer[\'sid\'];
		$where = "`status`=\'1\' and `sid`=\'".$paramer[\'sid\']."\'";
		//排序字段默认为更新时间
		if($paramer[\'order\']){
			$order = " ORDER BY `".str_replace("\'","",$paramer[order])."`";
		}else{
			$order = " ORDER BY id ";
		}
		//排序规则 默认为倒序
		if($paramer[\'sort\']){
			$sort = $paramer[\'sort\'];
		}else{
			$sort = " asc";
		}
		//查询条数
		if($paramer[limit]){
			$limit=" LIMIT ".$paramer[limit];
		}
		//自定义查询条件,默认取代上面任何参数直接使用该语句
		if($paramer[where]){
			$where = $paramer[where];
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"special_com",$where,$Purl,\'\',\'0\',$_smarty_tpl);
		}
		$where.=$order.$sort.$limit;
		' . $name . '=$db->select_all("special_com",$where);
		$time=time();		
		if(is_array(' . $name . ')&&' . $name . '){
			include(PLUS_PATH."/com.cache.php");
			include(PLUS_PATH."/city.cache.php");
			include(PLUS_PATH."/industry.cache.php");
			$uid=$jobinfo=array();
			foreach(' . $name . ' as $val){
				$uid[]=$val[\'uid\'];
			}
			$company=$db->select_all("company","`uid` in(".@implode(\',\',$uid).")","`uid`,`name`,`logo`,`provinceid`,`cityid`,`hy`,`pr`,`mun`,`content`");
			$job=$db->select_all("company_job","`uid` in(".@implode(\',\',$uid).") and `edate`>\'$time\' and `sdate`<\'$time\' and `state`=1 order by `lastupdate` desc","`uid`,`name`,`id`,`salary`");
			if($job&&is_array($job)){ 
				foreach($job as $k=>$v){
					$v[salary]=$comclass_name[$v[\'salary\']];
					if($paramer[jobnamelen]){
						$v[name_n] = mb_substr($v[\'name\'],0,$paramer[jobnamelen],"GBK");
					}
					$v[\'joburl\']=Url("job",array("c"=>"comapply","id"=>$v[id]));
					$jobinfo[$v[\'uid\']][]=$v;
				}
			} 
			foreach(' . $name . ' as $key=>$value){
				foreach($company as $val){
					if($value[\'uid\']==$val[\'uid\']){
						if($val[\'logo\']==\'\'){$val[\'logo\']=$config[\'sy_unit_icon\'];}
						if($paramer[namelen]){
							' . $name . '[$key][name_n] = mb_substr($val[\'name\'],0,$paramer[namelen],"GBK");
						}
						' . $name . '[$key][\'content\']=mb_substr(strip_tags($val[\'content\']),0,50,"GBK");
						' . $name . '[$key][\'provinceid\']=$city_name[$val[\'provinceid\']];
						' . $name . '[$key][\'cityid\']=$city_name[$val[\'cityid\']];
						' . $name . '[$key][\'hy\']=$val[\'hy\'];
						' . $name . '[$key][\'hyname\']=$industry_name[$val[\'hy\']];
						' . $name . '[$key][\'pr\']=$comclass_name[$val[\'pr\']];
						' . $name . '[$key][\'mun\']=$comclass_name[$val[\'mun\']];
						' . $name . '[$key][\'name\']=$val[\'name\'];
						' . $name . '[$key][\'logo\']=$val[\'logo\'];
						' . $name . '[$key][\'comurl\']=Url("company",array("c"=>"show","id"=>$val[uid]));
					}
				}
				' . $name . '[$key][\'jobnum\']=count($jobinfo[$value[\'uid\']]);				
				' . $name . '[$key][\'jobs\']=$jobinfo[$value[\'uid\']];				
			} 
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'specialcom', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();		
		//是否属于分站下
		if($config[sy_web_site]=="1"){
			if($_SESSION[cityid]>0 && $_SESSION[cityid]!=""){
				$paramer[cityid]=$_SESSION[cityid];
			}
			if($_SESSION[three_cityid]>0 && $_SESSION[three_cityid]!=""){
				$paramer[three_cityid] = $_SESSION[three_cityid];
			}
			if($_SESSION[hyclass]>0 && $_SESSION[hyclass]!=""){
				$paramer[hy]=$_SESSION[hyclass];
			}
		}
		$time = time();
		//处理传入参数,并且构造分页参数
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$where=1;
		$xy=getAround($paramer[x],$paramer[y],$paramer[r]);
		if($xy[0]){
			$where.=" AND `x`>=\'".$xy[0]."\' AND `x`<=\'".$xy[1]."\' AND `y`>=\'".$xy[3]."\' AND `y`<=\'".$xy[2]."\'";
		}
		//关键字
		if($paramer[keyword]){
			$where.=" AND `name` LIKE \'%".$paramer[keyword]."%\'";
		}
		//公司行业
		if($paramer[hy]){
			$where .= " AND `hy` = \'".$paramer[hy]."\'";
		}
		//公司体制
		if($paramer[pr]){
			$where .= " AND `pr` = \'".$paramer[pr]."\'";
		}
		//公司规模
		if($paramer[mun]){
			$where .= " AND `mun` = \'".$paramer[mun]."\'";
		}
		//公司地点
		if($paramer[provinceid]){
			$where .= " AND `provinceid` = \'".$paramer[provinceid]."\'";
		}
		//所在地 市区
		if($paramer[cityid]){
			$where .= " AND (`cityid` = \'".$paramer[cityid]."\' or `provinceid` = \'".$paramer[cityid]."\')";
		}
		//所在地 县
		if($paramer[three_cityid]){
			$where .= " AND `three_cityid` = \'".$paramer[three_cityid]."\'";
		}
		//联系人不为空
		if($paramer[linkman]){
			$where .= " AND `linkman`<>\'\'";
		}
		//联系人电话不为空
		if($paramer[linktel]){
			$where .= " AND `linktel`<>\'\'";
		}
		//联系人邮箱不为空
		if($paramer[linkmail]){
			$where .= " AND `linkmail`<>\'\'";
		}
		//是否有企业LOGO
		if($paramer[logo]){
			$where .= " AND `logo`<>\'\'";
		}
		//更新时间区间
		if($paramer[\'lastupdate\']){
			$lastupdate = $time-$paramer[\'lastupdate\']*3600;
			$where.=" AND `lastupdate`>\'".$lastupdate."\'";
		}
		//是否被锁定
		if($paramer[r_status]){
			$where .= " AND `r_status`=\'".$paramer[\'r_status\']."\'";
		}else{
			$where .= " AND `r_status`<>\'2\'";
		}
		//是否已经验证
		if($paramer[\'cert\']){
			$where .= " AND `yyzz_status`=\'1\'";
		}
		if($paramer[jobtime]){
			$where.=" AND `jobtime`<>\'\'";
		}
		///-------职位
		$jobwhere=1;
		if($paramer[job1]){
			$jobwhere.=" AND `job1`=\'$paramer[job1]\'";
		}
		if($paramer[job1_son]){
			$jobwhere.=" AND `job1_son`=\'$paramer[job1_son]\'";
		}
		if($paramer[job_post]){
			$jobwhere.=" AND `job_post`=\'$paramer[job_post]\'";
		}
		$joball=$db->select_all("company_job",$jobwhere,"`uid`");
		if(is_array($joball)){
			foreach($joball as $v){
				$uid[]=$v[uid];
			}
			$uid=@implode(",",$uid);
			$where.=" and `uid` in ($uid)";
		}
		//排序字段默认为更新时间
		if($paramer[order]){
			$order = " ORDER BY `".$paramer[order]."`  ";
		}else{
			$order = " ORDER BY `jobtime` ";
		}
		//排序规则 默认为倒序
		if($paramer[sort]){
			$sort = $paramer[sort];
		}else{
			$sort = " DESC";
		}
		//查询条数
		if($paramer[limit]){
			$limit.=" limit ".$paramer[limit];
		}
		$where.=$order.$sort;
		//自定义查询条件,默认取代上面任何参数直接使用该语句
		if($paramer[where]){
			$where = $paramer[where];
		}
		//处理类别字段
		$cache_array = $db->cacheget();

		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"company","`x`<>\'\' and ".$where,$Purl,"","0",$_smarty_tpl);
		}
		$Query = $db->query("SELECT * FROM $db_config[def]company where x<>\'\' and ".$where.$limit);
		while($rs = $db->fetch_array($Query)){
			' . $name . '[] = $db->array_action($rs,$cache_array);
			$ListId[] =  $rs[uid];
		}
        //$comnum = $db->select_num("company","x!=\'\' and ".$where);

		//是否需要查询对应职位
		if($paramer[isjob]){
			//查询职位
			$JobId = @implode(",",$ListId);
			$JobList=$db->select_only("(select * from `".$db_config[def]."company_job` order by `lastupdate` desc) `temp`","`uid` IN ($JobId) and `edate`>\'".mktime()."\' and r_status<>\'2\' and status<>\'1\' and state=1 order by `lastupdate` desc");
            if(is_array($ListId) && is_array($JobList)){
				foreach(' . $name . ' as $key=>$value){
					' . $name . '[$key][jobnum] = 0;
					foreach($JobList as $k=>$v){
						if($value[uid]==$v[uid]){
							' . $name . '[$key][newsjob] = $v[name];
							' . $name . '[$key][newsjob_status] = $v[status];
							' . $name . '[$key][r_status] = $v[r_status];
							' . $name . '[$key][job_url] = Url("index","com",array("c"=>"comapply","id"=>$v[id]),"1");
							$jobv = $db->array_action($v,$cache_array);
							$jobv[\'name\'] = ' . $name . '[$key][newsjob];
							$jobv[job_url] = Url("index","com",array("c"=>"comapply","id"=>$v[id]),"1");
							' . $name . '[$key][joblist][] = $jobv;
							' . $name . '[$key][jobnum] = ' . $name . '[$key][jobnum]+1;
						}
					}
				}
			}
		}
		if(is_array(' . $name . ')){
			$num=0;
			foreach(' . $name . ' as $key=>$value){
				' . $name . '[$key][com_url] = Curl(array("url"=>"id:".$value[uid]));
				' . $name . '[$key][joball_url] = Curl(array("url"=>"id:".$value[uid].",tp:post"));
				' . $name . '[$key][\'orderid\']=$num;
				if(!$value[x] && !$value[y]){
					$address=$value[job_city_one].$value[job_city_two].$value[address];
					$xydata=@file_get_contents("http://api.map.baidu.com/geocoder?address=".$address."&output=json&key=37492c0ee6f924cb5e934fa08c6b1676");
					$name=json_decode($xydata);
					' . $name . '[$key][x]=$name->result->location->lng;
					' . $name . '[$key][y]=$name->result->location->lat;
				}
				$num++;
			}
			if($paramer[keyword]!=""&&!empty(' . $name . ')){
				addkeywords(\'4\',$paramer[keyword]);
			}
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'maplist', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        //数据库操作
        $OutputStr = 'global $db,$db_config,$config;
		$where="1";
		if($paramer[\'order\'])
		{
			$where.=" ORDER BY `".$paramer[\'order\']."`";
		}else{
			$where.=" ORDER BY `id`";
		}
		if($paramer[\'sort\'])
		{
			$where.=" ".$paramer[\'sort\'];
		}else{
			$where.=" DESC";
		}
		if($paramer[\'limit\'])
		{
			$limit=" LIMIT ".$paramer[\'limit\'];
		}else{
			$limit=" LIMIT 10";
		}
		$list=$db->select_all("down_resume",$where.$limit);
		if($list&&is_array($list)){
			$uids=$comids=array();
			foreach($list as $val){
				$uids[]=$val[\'uid\'];
				$comids[]=$val[\'comid\'];
			}
			$resume=$db->select_all("resume","`uid` in(".@implode(\',\',$uids).")","`uid`,`name`");
			$company=$db->select_all("company","`uid` in(".@implode(\',\',$comids).")","`uid`,`name`");
			foreach($list as $key=>$val){
				$time=time()-$val[\'downtime\'];
				if($time>86400 && $time<259300){
					$list[$key][\'time\'] = ceil($time/86400)."天前";
				}elseif($time>3600 && $time<86400){
					$list[$key][\'time\'] = ceil($time/3600)."小时前";
				}elseif($time>60 && $time<3600){
					$list[$key][\'time\'] = ceil($time/60)."分钟前";
				}elseif($time<60){
					$list[$key][\'time\'] = "刚刚";
				}else{
					$list[$key][\'time\'] = date("Y-m-d",$val[\'downtime\']);
				}
				foreach($resume as $v){
					if($v[\'uid\']==$val[\'uid\']){
						$list[$key][\'username\']=$v[\'name\'];
					}
				}
				foreach($company as $value){
					if($val[\'comid\']==$value[\'uid\']){
						$list[$key][\'comname\']=$value[\'name\'];
					}
				}
				if($paramer[\'user_len\']){
					$list[$key][\'username\']=mb_substr($list[$key][\'username\'],0,$paramer[\'user_len\'],"GBK");
				}
				if($paramer[\'com_len\']){
					$list[$key][\'comname\']=mb_substr($list[$key][\'comname\'],0,$paramer[\'com_len\'],"GBK");
				}
				$list[$key][\'curl\']=Curl(array("url"=>"id:".$val[comid]));
				$list[$key][\'url\']=Url("index","resume",array("id"=>$val[\'eid\']),"1");
			}
		}';
        //TODO:Url的生成函数应当统一在模版中生成,或者此类方法放在一个函数文件中统一引用(王成茁)
        //自定义标签 END
        return SmartyOutputStr($this, $compiler, $_attr, 'downlist', '$list', $OutputStr, '$list');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        $OutputStr = 'global $config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');$list=array();
		//是否推荐
		if($paramer[recom]){
			$tuijian = 1;
		}
		//类别
		if($paramer[type]){
			$type = $paramer[type];
		}
		//查询条数
		if($paramer[limit]){
			$limit=$paramer[limit];
		}else{
			$limit=20;
		}
		include PLUS_PATH."/keyword.cache.php";
		if($paramer[iswap]){
			$wap = "/wap";
		}else{
			$index =1;
		}
		if(is_array($keyword)){
			if($paramer[iswap]){
				$i=0;
				foreach($keyword as $k=>$v){
					if($tuijian && $v[tuijian]!=1){
						continue;
					}
					if($type && $v[type]!=$type){
						continue;
					}
					$i++;
					if($v[type]=="1"){
						$v[url] = $config[sy_weburl].$wap."/index.php?m=once&keyword=".$v[key_name];
						$v[type_name]=\'一句话招聘\';
					}elseif($v[type]=="3"){
						$v[url] = $config[sy_weburl].$wap."/index.php?m=com&keyword=".$v[key_name];
						$v[type_name]=\'职位\';
					}elseif($v[\'type\']=="4"){
						$v[\'url\'] = $config[sy_weburl].$wap."/index.php?m=firm&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'公司\';
					}elseif($v[\'type\']=="5"){
						$v[\'url\'] = $config[\'sy_weburl\'].$wap."/index.php?m=user&c=search&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'人才\';
					}elseif($v[\'type\']=="6"){
						if($paramer[\'iswap\']){
							continue;
						}
						$v[\'url\'] = $config[\'sy_weburl\']."/lietou/index.php?c=service&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'猎头\';
					}elseif($v[\'type\']=="7"){
						if($paramer[\'iswap\']){
							continue;
						}
						$v[\'url\'] = $config[\'sy_weburl\']."/lietou/index.php?c=post&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'猎头职位\';
					}
					$v[\'key_title\']=$v[\'key_name\'];
					if($v[\'color\']){
						$v[\'key_name\']="<font color=\\"".$v[\'color\']."\\">".$v[\'key_name\']."</font>";
					}
					$list[] = $v;
					if($i==$limit){
						break;
					}
				}
			}else{
				$i=0;
				foreach($keyword as $k=>$v){
					if($tuijian && $v[\'tuijian\']!=1){
						continue;
					}
					if($type && $v[\'type\']!=$type){
						continue;
					}
					$i++;
					if($v[\'type\']=="1"){
						$v[\'url\'] = $config[\'sy_weburl\']."/index.php?m=once&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'一句话招聘\';
					}elseif($v[\'type\']=="3"){
						$v[\'url\'] = $config[\'sy_weburl\']."/index.php?m=com&c=search&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'职位\';
					}elseif($v[\'type\']=="4"){
						$v[\'url\'] = $config[\'sy_weburl\']."/index.php?m=firm&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'公司\';
					}elseif($v[\'type\']=="5"){
						$v[\'url\'] = $config[\'sy_weburl\']."/index.php?m=user&c=search&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'人才\';
					}elseif($v[\'type\']=="6"){
						if($paramer[\'iswap\']){
							continue;
						}
						$v[\'url\'] = $config[\'sy_weburl\']."/lietou/index.php?c=service&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'猎头\';
					}elseif($v[\'type\']=="7"){
						if($paramer[\'iswap\']){
							continue;
						}
						$v[\'url\'] = $config[\'sy_weburl\']."/lietou/index.php?c=post&keyword=".$v[\'key_name\'];
						$v[\'type_name\']=\'猎头职位\';
					}
					$v[\'key_title\']=$v[\'key_name\'];
					if($v[\'color\']){
						$v[\'key_name\']="<font color=\\"".$v[\'color\']."\\">".$v[\'key_name\']."</font>";
					}
					$list[] = $v;
					if($i==$limit){
						break;
					}
				}
			}
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'key', '$list', $OutputStr, '$list');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //×Ô¶¨Òå±êÇ© START
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		include PLUS_PATH."/group.cache.php";
		if($paramer[\'classid\']){
			$classid = @explode(\',\',$paramer[\'classid\']);
			if(is_array($classid)){
				foreach($classid as $key=>$value)
				{
					$Info[\'id\']   = $value;
					$Info[\'name\'] = $group_name[$value];
					$group[] = $Info;
				}
			}
		}else if($paramer[\'rec\']){
			if(is_array($group_rec)){
				foreach($group_rec as $key=>$value)
				{
					$Info[\'id\']   = $value;
					$Info[\'name\'] = $group_name[$value];
					$group[] = $Info;
				}
			}
		}else if($paramer[\'r_news\']){
			if(is_array($group_recnews)){
				foreach($group_recnews as $key=>$value)
				{
					$Info[\'id\']   = $value;
					$Info[\'name\'] = $group_name[$value];
					$group[] = $Info;
				}
			}
		}else{
			if(is_array($group_index)){
				foreach($group_index as $key=>$value)
				{
					$Info[\'id\']   = $value;
					$Info[\'name\'] = $group_name[$value];
					$group[] = $Info;
				}
			}
		}
		if(is_array($group))
		{
			foreach($group as $key=>$value)
			{
				if(intval($paramer[len])>0)
				{
					$len = intval($paramer[len]);
					$group[$key][name] = mb_substr($value[name],0,$len,"GBK");
				}
				if($group_type[$value[\'id\']])
				{
					$nids = $value[\'id\'].",".@implode(\',\',$group_type[$value[\'id\']]);
				}else{
					$nids = $value[\'id\'];
				}
				if($config[sy_news_rewrite]=="2"){
					$group[$key][url] = $config[\'sy_weburl\']."/news/".$value[id]."/";
				}else{
					 $group[$key][url] = Url("index",\'news\',array(\'c\'=>\'list\',"nid"=>$value[id]),"1");
				}
				if($paramer[arcpic])
				{
					$query = $db->query("SELECT * FROM `$db_config[def]news_base` WHERE `nid`=\'$value[id]\' AND `newsphoto`<>\'\'  ORDER BY `sort` DESC,`datetime` DESC limit $paramer[arcpic]");
					while($rs = $db->fetch_array($query)){
						if(intval($paramer[pt_len])>0)
						{
							$len = intval($paramer[pt_len]);
							if($rs[color]){
								$rs[title] = "<font color=\'".$rs[color]."\'>".mb_substr($rs[title],0,$len,"GBK")."</font>";
							}else{
								$rs[title] = mb_substr($rs[title],0,$len,"GBK");
							}
						}
						if(intval($paramer[pd_len])>0)
						{
							$len = intval($paramer[pd_len]);
							$rs[description] = mb_substr($rs[description],0,$len,"GBK");
						}
						foreach($group as $k=>$v)
						{
							if($v[id]==$rs[nid])
							{
								$rs[name] = $v[name];
							}
						}
					
						if($config[sy_news_rewrite]=="2"){
							$rs["url"]=$config[\'sy_weburl\']."/news/".date("Ymd",$rs["datetime"])."/".$rs[id].".html";
						}else{
							$rs["url"] = Url("index","news",array("id"=>$rs[id]),"1");
						}
						$arcpic[] = $rs;
					}
					$group[$key][arcpic] = $arcpic;
					unset($arcpic);

				}
				if($paramer[arclist])
				{
					$query = $db->query("SELECT * FROM `$db_config[def]news_base` WHERE `nid`=\'$value[id]\'  ORDER BY `sort` DESC,`datetime` DESC limit $paramer[arclist]");
					while($rs = $db->fetch_array($query))
					{
						if(intval($paramer[t_len])>0)
						{
							$len = intval($paramer[t_len]);
							if($rs[color]){
								$rs[title] = "<font color=\'".$rs[color]."\'>".mb_substr($rs[title],0,$len,"GBK")."</font>";
							}else{
								$rs[title] = mb_substr($rs[title],0,$len,"GBK");
							}
						}
						if(intval($paramer[d_len])>0)
						{
							$len = intval($paramer[d_len]);
							$rs[description] = mb_substr($rs[description],0,$len,"GBK");
						}
						foreach($group as $k=>$v)
						{
							if($v[id]==$rs[nid])
							{
								$rs[name] = $v[name];
							}
						}
					
						if($config[sy_news_rewrite]=="2"){
							$rs["url"]=$config[\'sy_weburl\']."/news/".date("Ymd",$rs["datetime"])."/".$rs[id].".html";
						}else{
							$rs["url"] = Url("index","news",array("c"=>"show","id"=>$rs[id]),"1");
						}
						$arclist[] = $rs;
					}
					$group[$key][arclist] = $arclist;
					unset($arclist);
				}
			}
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'articleclass', '$group', $OutputStr, '$group');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签START
        $OutputStr = 'global $db,$db_config,$config;include(PLUS_PATH."/menu.cache.php");$Navlist=array();
		if(is_array($menu_name)){
            eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
			$ParamerArr = GetSmarty($paramer,$_GET);
			$paramer = $ParamerArr[arr];
			$Purl =  $ParamerArr[purl];
			foreach($menu_name[12] as $key=>$val){
				if($val[\'type\']==\'2\'){
					if($config[\'sy_seo_rewrite\']=="1" && $val[furl]!=\'\'){
						$menu_name[12][$key][url] = $val[furl];
					}else{
						$menu_name[12][$key][url] = $val[url];
					}
					$menu_name[12][$key][navclass] = navcalss($val,$paramer[hovclass]);
				}
			}
			foreach($menu_name[1] as $key=>$value){
				if($value[\'type\']==\'1\'){
					if($config[\'sy_seo_rewrite\']=="1" && $value[furl]!=\'\'){
						$menu_name[1][$key][url] = $config[sy_weburl]."/".$value[furl];
					}else{
						$menu_name[1][$key][url] = $config[sy_weburl]."/".$value[url];
					}
					$menu_name[1][$key][navclass] = navcalss($value,$paramer[hovclass]);
				}
			}
			foreach($menu_name[2] as $key=>$value){
				if($value[\'type\']==\'1\'){
					if($config[\'sy_seo_rewrite\']=="1" && $value[furl]!=\'\'){
						$menu_name[2][$key][url] = $config[sy_weburl]."/".$value[furl];
					}else{
						$menu_name[2][$key][url] = $config[sy_weburl]."/".$value[url];
					}
					$menu_name[2][$key][navclass] = navcalss($value,$paramer[hovclass]);
				}
			}
			foreach($menu_name[4] as $key=>$value){
				if($value[\'type\']==\'1\' && $value[furl]!=\'\'){
					if($config[\'sy_seo_rewrite\']=="1"){
						$menu_name[4][$key][url] = $config[sy_weburl]."/".$value[furl];
					}else{
						$menu_name[4][$key][url] = $config[sy_weburl]."/".$value[url];
					}
					$menu_name[4][$key][navclass] = navcalss($value,$paramer[hovclass]);
				}
			}
			foreach($menu_name[5] as $key=>$value){
				if($value[\'type\']==\'1\' && $value[furl]!=\'\'){
					if($config[\'sy_seo_rewrite\']=="1"){
						$menu_name[5][$key][url] = $config[sy_weburl]."/".$value[furl];
					}else{
						$menu_name[5][$key][url] = $config[sy_weburl]."/".$value[url];
					}
					$menu_name[5][$key][navclass] = navcalss($value,$paramer[hovclass]);
				}
			}
		}
		//默认调用头部导航
		if($paramer[nid]){
			$Navlist =$menu_name[$paramer[nid]];
		}else{
			$Navlist =$menu_name[1];
		}';
        return SmartyOutputStr($this, $compiler, $_attr, 'nav', '$Navlist', $OutputStr, '$Navlist');
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];

		$where=1;
		//排序字段默认为更新时间
		if($paramer[order]){
			if($paramer[order]=="addtime"){
				$paramer[order]="add_time";
			}
			if($paramer[order]=="answernum"){
				$paramer[order]="answer_num";
			}
			$order = " ORDER BY `".$paramer[order]."`  desc";
		}else{
			$order = " ORDER BY `add_time` desc";
		}
		if($paramer[cid]){
			$where .=" and `cid`=\'".$paramer[cid]."\'";
		}
		if($paramer[uid]){
			$where .=" and `uid`=\'".$_COOKIE[uid]."\'";
		}
		if($paramer[recom]){//推荐 字段
			$where .=" and `is_recom`=\'1\'";
		}
		if($paramer[limit]){
			$limit=" limit ".$paramer[limit];
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"question",$where,$Purl,"","2",$_smarty_tpl);
		}
		' . $name . ' = $db->select_all("question",$where.$order.$limit);

		foreach(' . $name . ' as $key=>$val){
			if(intval($paramer[t_len])>0){
				$len = intval($paramer[t_len]);
				$val[title] = mb_substr($val[title],0,$len,"GBK");
			}
			' . $name . '[$key][url] = Aurl(array("c"=>"content","id"=>$val[id]));
			$ListId[] =  $val[uid];
			$Qclass[]=$val[cid];//问题类别
		}
		//获得提问者uid,并根据uid 获得头像、昵称
		$uids=@implode(",",$ListId);
		$friend_info=$db->select_all("friend_info","`uid` in (".$uids.")","`uid`,`nickname`,`pic`,`description`");
		$atn=$db->select_all("atn","`uid`=\'".$_COOKIE[\'uid\']."\'","`sc_uid`");

		foreach(' . $name . ' as $r_k=>$r_v){
			foreach($friend_info as $f_v){
				if($r_v[\'uid\']==$f_v[\'uid\']){
					if($f_v[\'pic\']){
						' . $name . '[$r_k][\'pic\']=str_replace("..",$config["sy_weburl"],$f_v[\'pic\']);
					}else{
						' . $name . '[$r_k][\'pic\']=$config["sy_weburl"]."/".$config[\'sy_friend_icon\'];
					}
					' . $name . '[$r_k][\'uid\']=$f_v[\'uid\'];
					' . $name . '[$r_k][\'nickname\']=$f_v[\'nickname\'];
					' . $name . '[$r_k][\'description\']=$f_v[\'description\'];
				}
			}
			if($r_v[\'uid\']==$_COOKIE[\'uid\']){
				' . $name . '[$r_k][\'is_atn\']=\'2\';//表示这是本人,不显示关注按钮
			}
			foreach($atn as $a_v){
				if($a_v[\'sc_uid\']==$r_v[\'uid\']){
					' . $name . '[$r_k][\'is_atn\']=\'1\';//表示已经关注用户
				}
			}
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'qlist', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签START
        $OutputStr = '' . $name . '=array();$time=time();eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		global $db,$db_config,$config;
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
		$where = "1";
		$time = date("Y-m-d",time());
		//未开始
		if($paramer[state]==\'1\'){
			$where .=" AND `starttime`>$time";
		}elseif($paramer[state]==\'2\'){//进行中
			$where .=" AND `starttime`<$time AND `endtime`>$time";
		}elseif($paramer[state]==\'3\'){//已结束
			$where .=" AND `endtime`<$time";
		}
		//排序字段(默认按照开始时间排序)
		if($paramer[order]){
			$where .= " ORDER BY $paramer[order] ";
		}else{
			$where .= " ORDER BY `starttime` ";
		}
		//排序规则(默认按照开始时间排序倒序)
		if($paramer[sort]){
			$where .= " $paramer[sort]";
		}else{
			$where .= " DESC ";
		}
		//查询条数
		if($paramer[limit]){
			$limit=" LIMIT ".$paramer[limit];
		}else{
			$limit=" LIMIT 20";
		}
		if($paramer[ispage]){
			$limit = PageNav($paramer,$_GET,"zhaopinhui",$where,$Purl);
		}
		' . $name . '=$db->select_all("zhaopinhui",$where.$limit);
		if(is_array(' . $name . ')){
			foreach(' . $name . ' as $key=>$v){
				' . $name . '[$key]["stime"]=strtotime($v[starttime])-mktime();
				' . $name . '[$key]["etime"]=strtotime($v[endtime])-mktime();
				if($paramer[len]){
					' . $name . '[$key]["title"]=mb_substr($v[\'title\'],0,$paramer[len],"GBK");
				}
				' . $name . '[$key]["url"]=Url("index","zph",array("c"=>\'show\',"id"=>$v[\'id\']),"1");
			}
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'fairs', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[arr];
		$Purl =  $ParamerArr[purl];
        global $ModuleName;
        if(!$Purl["m"]){
            $Purl["m"]=$ModuleName;
        }

		$where=1;
		include(PLUS_PATH.\'/ask.cache.php\');
		if(!$paramer[classid])
		{
			$paramer[classid] = $ask_index[0];
		}
		if(is_array($ask_type[$paramer[classid]]) && !empty($ask_type[$paramer[classid]]))
		{ 
			$Count = $ask_type[$paramer[classid]]; 
			if(!$paramer[limit])
			{
				$paramer[limit] = 5;
			}
			$List = $db->DB_query_all("SELECT A1.*  
						FROM $db_config[def]question AS A1  
							 INNER JOIN (SELECT A.cid,A.add_time 
										 FROM phpyun_question AS A  
											  LEFT JOIN phpyun_question AS B  
												ON A.cid = B.cid  
												   AND A.add_time <= B.add_time  
												   AND A.cid  IN (".@implode(\',\',$ask_type[$paramer[classid]]).") 
										 GROUP BY A.cid,A. add_time
										 HAVING COUNT(B.add_time) <= $paramer[limit] 
							) AS B1  
							ON A1.cid = B1.cid  
							   AND A1.add_time = B1.add_time 
							   AND A1.cid  IN (".@implode(\',\',$ask_type[$paramer[classid]]).") 
						ORDER BY A1.cid,A1.add_time DESC","all");

			

		}
		if(is_array($List)){ 
			if($_COOKIE[\'uid\']){$atn=$db->DB_select_once("attention","`uid`=\'".$_COOKIE[\'uid\']."\' and `type`=\'2\'","`ids`");} 
			$ids=@explode(\',\',$atn[\'ids\']);
			foreach($List as $key=>$value){				
				$value[url]=Url("ask",array("c"=>"content","id"=>$value[id]));
				$QusList[$value[\'cid\']][] =$value; 
			} 
			foreach($Count as $value){
				$QclassInfo=array();
				if(in_array($value,$ids)){
					$QclassInfo[\'isatn\']=\'1\';
				}
				$QclassInfo[\'id\'] = $value;
				$QclassInfo[\'name\'] = $ask_name[$value];
				$QclassInfo[\'pic\'] = $ask_pic[$value];
				$QclassInfo[\'atnnum\'] = $ask_atnnum[$value];
				$QclassInfo[\'qusnum\'] = $ask_qusnum[$value];
				$QclassInfo[\'intro\'] = $ask_intro[$value];
				$QclassInfo[\'list\'] = $QusList[$value];				
				' . $name . '[] = $QclassInfo;
			}
			
		}
		';
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'qclass', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['name'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        //自定义标签 START
        //数据库操作
        $OutputStr = 'global $db,$db_config,$config;include PLUS_PATH.\'/group.cache.php\';' . $name . '=array();eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');
		$ParamerArr = GetSmarty($paramer,$_GET);
		$paramer = $ParamerArr[\'arr\'];
		$Purl =  $ParamerArr[\'purl\'];$where=1;
		if($_SESSION[\'did\']){
			$where.=" and (FIND_IN_SET(\'".$_SESSION[\'did\']."\',did) or FIND_IN_SET(\'0\',did))";
		}else{
			$where.=" and `did`=\'0\'";
		}
		include PLUS_PATH."/group.cache.php";
		if(is_array($paramer)){
			if($paramer[\'nid\']!=""){
				$where .=" AND `nid` in ($paramer[nid])";
				$nids = @explode(\',\',$paramer[\'nid\']);$paramer[\'nid\']=$paramer[\'nid\'];
			}else if($paramer[\'rec\']!=""){
				$nids=array();if(is_array($group_rec)){
					foreach($group_rec as $key=>$value){
						if($key<=2){
							$nids[]=$value;
						}
					}
					$paramer[nid]=@implode(\',\',$nids);
				}
			}            
			if($paramer[\'nid\']){
				$nid_s = @explode(\',\',$paramer[nid]);				
				foreach($nid_s as $v){
					if($group_type[$v]){
						$paramer[nid] = $paramer[nid].",".@implode(\',\',$group_type[$v]);
					}
				}
			}			
			if($paramer[\'type\']){
				$type = str_replace("\\"","",$paramer[type]);
				$type_arr =	@explode(",",$type);
				if(is_array($type_arr) && !empty($type_arr))
				{
					foreach($type_arr as $key=>$value)
					{
						$where .=" AND FIND_IN_SET(\'".$value."\',`describe`)";
						if(count($nids)>0)
						{
							$picwhere .=" AND FIND_IN_SET(\'".$value."\',`describe`)";
						}
					}
				}
			}
			//拼接补充SQL条件
			if($paramer[\'pic\']!=""){
				$where .=" AND `newsphoto`<>\'\'";
			}
			//拼接字段排序
			if($paramer[\'order\']!=""){
				$order = str_replace("\'","",$paramer[\'order\']);
				$where .=" ORDER BY $order";
			}else{
				$where .=" ORDER BY `datetime`";
			}
			//排序方式默认倒序
			if($paramer[\'sort\']){
				$where.=" ".$paramer[sort];
			}else{
				$where.=" DESC";
			}
			//拼接查询条数
			if(intval($paramer[\'limit\'])>0){
				$limit = intval($paramer[\'limit\']);
				$limit = " limit ".$limit;
			}
			if($paramer[\'ispage\']){
				$limit = PageNav($paramer,$_GET,"news_base",$where,$Purl,"","5",$_smarty_tpl);
			}
		}
		//多类别新闻查找
		if(!intval($paramer[\'ispage\']) && count($nids)>0){
			$where = " and nid IN ($paramer[nid])";
			//查询带图新闻
			if($paramer[\'pic\']){
				if(!$paramer[\'piclimit\']){
					$piclimit = 1;
				}else{
					$piclimit = $paramer[\'piclimit\'];
				}
				$db->query("set @f=0,@n=0");
				$query = $db->query("select * from (select id,title,color,datetime,description,newsphoto,@n:=if(@f=nid,@n:=@n+1,1) as aid,@f:=nid as nid from $db_config[def]news_base  WHERE `nid` IN ($paramer[nid]) AND `newsphoto` <>\'\'  order by nid asc,datetime desc) a where aid <=".$piclimit);
				while($rs = $db->fetch_array($query)){
					//处理标题长度
					if(intval($paramer[t_len])>0){
						$len = intval($paramer[t_len]);
						if($rs[color]){
							$rs[title] = "<font color=\'".$rs[color]."\'>".mb_substr($rs[title],0,$len,"GBK")."</font>";
						}else{
							$rs[title] = mb_substr($rs[title],0,$len,"GBK");
						}
					}
					//处理描述内容长度
					if(intval($paramer[d_len])>0)
					{
						$len = intval($paramer[d_len]);
						$rs[description] = mb_substr($rs[description],0,$len,"GBK");
					}
					$rs[\'name\'] = $group_name[$rs[\'nid\']];

					//构建资讯静态链接
					if($config[sy_news_rewrite]=="2"){
						$rs["url"]=$config[\'sy_weburl\']."/news/".date("Ymd",$rs["datetime"])."/".$rs[id].".html";
					}else{
						$rs["url"] = Url("index","news",array("c"=>"show","id"=>$rs[id]),"1");
					}
					$rs[time]=date("Y-m-d",$rs[datetime]);
					$rs[\'datetime\']=date("m-d",$rs[datetime]);
					' . $name . '[$rs[\'nid\']][\'pic\'][] = $rs;
				}
			}
            $db->query("set @f=0,@n=0");
            $query = $db->query("select * from (select id,title,datetime,color,description,newsphoto,@n:=if(@f=nid,@n:=@n+1,1) as aid,@f:=nid as nid from $db_config[def]news_base  WHERE `nid` IN ($paramer[nid]) order by nid asc,datetime desc) a where aid <=' . $paramer['limit'] . '");
            while($rs = $db->fetch_array($query)){
                //处理标题长度
                if(intval($paramer[t_len])>0){
                    $len = intval($paramer[t_len]);
                    if($rs[color]){
                        $rs[title] = "<font color=\'".$rs[color]."\'>".mb_substr($rs[title],0,$len,"GBK")."</font>";
                    }else{
                        $rs[title] = mb_substr($rs[title],0,$len,"GBK");
                    }
                }
                //处理描述内容长度
                if(intval($paramer[d_len])>0){
                    $len = intval($paramer[d_len]);
                    $rs[description] = mb_substr($rs[description],0,$len,"GBK");
                }
                //获取所属类别名称
                $rs[\'name\'] = $group_name[$rs[\'nid\']];
                //构建资讯静态链接
                if($config[sy_news_rewrite]=="2"){
                    $rs["url"]=$config[\'sy_weburl\']."/news/".date("Ymd",$rs["datetime"])."/".$rs[id].".html";
                }else{
                    $rs["url"] = Url("index","news",array("c"=>"show","id"=>$rs[id]),"1");
                }
                $rs[time]=date("Y-m-d",$rs[datetime]);
                $rs[datetime]=date("m-d",$rs[datetime]);
                ' . $name . '[$rs[\'nid\']][\'arclist\'][] = $rs;
            }
		}else{
			$query = $db->query("SELECT * FROM `$db_config[def]news_base` WHERE ".$where.$limit);
			while($rs = $db->fetch_array($query)){
				//处理标题长度
                if(intval($paramer[t_len])>0)
                {
                    $len = intval($paramer[t_len]);
                    $rs[title] = mb_substr($rs[title],0,$len,"GBK");
                }
                //处理描述内容长度
                if(intval($paramer[d_len])>0)
                {
                    $len = intval($paramer[d_len]);
                    $rs[description] = mb_substr($rs[description],0,$len,"GBK");
                }
                //获取所属类别名称
                $rs[\'name\'] = $group_name[$rs[\'nid\']];
                //构建资讯静态链接
                if($config[sy_news_rewrite]=="2"){
                    $rs["url"]=$config[\'sy_weburl\']."/news/".date("Ymd",$rs["datetime"])."/".$rs[id].".html";
                }else{
                    $rs["url"] = Url("index","news",array("c"=>"show","id"=>$rs[id]),"1");
                }
                $rs[time]=date("Y-m-d",$rs[datetime]);
                $rs[datetime]=date("m-d",$rs[datetime]);
                ' . $name . '[] = $rs;
            }
		}';
        //自定义标签 END
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'article', $name, '', $name);
    }
    public function compile($args, $compiler, $parameter)
    {
        $_attr = $this->getAttributes($compiler, $args);
        $from = $_attr['from'];
        $item = $_attr['item'];
        $name = $_attr['item'];
        $name = str_replace('\'', '', $name);
        $name = $name ? $name : 'list';
        $name = '$' . $name;
        if (!strncmp("\$_smarty_tpl->tpl_vars[{$item}]", $from, strlen($item) + 24)) {
            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
        }
        $OutputStr = 'global $db,$db_config,$config;eval(\'$paramer=' . str_replace('\'', '\\\'', ArrayToString($_attr, true)) . ';\');' . $name . '=array();

		
		$time = time();
		$ParamerArr = GetSmarty($paramer,$_GET,$_smarty_tpl);
		$paramer = $ParamerArr[\'arr\'];
		$Purl =  $ParamerArr[\'purl\'];
        global $ModuleName;
        if(!$Purl["m"]){
            $Purl["m"]=$ModuleName;
        }
        
		$where="`name`<>\'\'";
		if($paramer[\'keyword\']){
			$where.=" AND `name` LIKE \'%".$paramer[\'keyword\']."%\'";
		}
		if($paramer[\'hy\']){
			$where .= " AND `hy` = \'".$paramer[\'hy\']."\'";
		}
		if($paramer[\'pr\']){
			$where .= " AND `pr` = \'".$paramer[\'pr\']."\'";
		}
		if($paramer[\'mun\']){
			$where .= " AND `mun` = \'".$paramer[\'mun\']."\'";
		}
		if($paramer[\'provinceid\']){
			$where .= " AND `provinceid` = \'".$paramer[\'provinceid\']."\'";
		}
		if($paramer[\'cityid\']){
			$where .= " AND (`cityid` = \'".$paramer[\'cityid\']."\' or `provinceid` = \'".$paramer[\'cityid\']."\')";
		}
		if($paramer[\'linkman\']){
			$where .= " AND `linkman`<>\'\'";
		}
		if($paramer[\'linktel\']){
			$where .= " AND `linktel`<>\'\'";
		}
		if($paramer[\'linkmail\']){
			$where .= " AND `linkmail`<>\'\'";
		}
		if($paramer[\'logo\']){
			$where .= " AND `logo`<>\'\'";
		}
		if($paramer[\'r_status\']){
			$where .= " AND `r_status`=\'".$paramer[\'r_status\']."\'";
		}else{
			$where .= " AND `r_status`<>\'2\'";
		}
		if($paramer[\'cert\']){
			$where .= " AND `yyzz_status`=\'1\'";
		}
		if($paramer[\'uptime\']){
			$uptime = $time-$paramer[\'uptime\']*3600;
			$where.=" AND `lastupdate`>\'".$uptime."\'";
		}
		if($paramer[\'jobtime\']){
			$where.=" AND `jobtime`<>\'\'";
		}
		if($paramer[\'rec\']){
			$where.=" AND `rec`=\'1\'";
		}
		if($paramer[\'order\']){
			if($paramer[\'order\']=="lastUpdate"){
				$paramer[\'order\']="lastupdate";
			}
			$order = " ORDER BY `".$paramer[\'order\']."`  ";
		}else{
			$order = " ORDER BY `jobtime` ";
		}
		if($paramer[\'sort\']){
			$sort = $paramer[\'sort\'];
		}else{
			$sort = " DESC";
		}
		if($paramer[\'limit\']){
			$limit=" limit ".$paramer[\'limit\'];
		}
		$where.=$order.$sort;
		if($paramer[\'where\']){
			$where = $paramer[\'where\'];
		}
		$cache_array = $db->cacheget();
		if($paramer[\'ispage\']){
			if($paramer[\'rec\']==1){
				$limit = PageNav($paramer,$_GET,"company",$where,$Purl,"","1",$_smarty_tpl);
			}else{
				$limit = PageNav($paramer,$_GET,"company",$where,$Purl,"","0",$_smarty_tpl);
			}

            $_smarty_tpl->tpl_vars[\'firmurl\']=new Smarty_Variable;
			$_smarty_tpl->tpl_vars[\'firmurl\']->value = $ParamerArr[\'firmurl\'];
		}
		$Query = $db->query("SELECT * FROM $db_config[def]company where ".$where.$limit);
		while($rs = $db->fetch_array($Query)){
			' . $name . '[] = $db->array_action($rs,$cache_array);
			$ListId[] = $rs[\'uid\'];
		}
		if($paramer[\'ismsg\']){
			$Msgid = @implode(",",$ListId);
			$msglist = $db->select_alls("company_msg","resume","a.`cuid` in ($Msgid) and a.`uid`=b.`uid` order by a.`id` desc","a.cuid,a.content,b.name,b.photo,b.def_job");
			if(is_array($ListId) && is_array($msglist)){
				foreach(' . $name . ' as $key=>$value){
					foreach($msglist as $k=>$v){
						if($value[\'uid\']==$v[\'cuid\']){
							' . $name . '[$key][\'msg\'][$k][\'content\'] = $v[\'content\'];
							' . $name . '[$key][\'msg\'][$k][\'name\'] = $v[\'name\'];
							' . $name . '[$key][\'msg\'][$k][\'photo\'] = $v[\'photo\'];
							' . $name . '[$key][\'msg\'][$k][\'eid\'] = $v[\'def_job\'];
						}
					}
				}
			}
		}
		if($paramer[\'isjob\']){
			$JobId = @implode(",",$ListId);
			$JobList=$db->select_all("company_job","`uid` IN ($JobId) and `edate`>\'".mktime()."\' and r_status<>\'2\' and status<>\'1\' and state=1  order by `lastupdate` desc");
			if(is_array($ListId) && is_array($JobList)){
				foreach(' . $name . ' as $key=>$value){
					' . $name . '[$key][\'jobnum\'] = 0;
					foreach($JobList as $k=>$v){
						if($value[\'uid\']==$v[\'uid\']){
							$id = $v[\'id\'];
							' . $name . '[$key][\'newsjob\'] = $v[\'name\'];
							' . $name . '[$key][\'newsjob_status\'] = $v[\'status\'];
							' . $name . '[$key][\'r_status\'] = $v[\'r_status\'];

							$v = $db->array_action($value,$cache_array);
							$v[\'job_url\'] = Url("job",array("c"=>"comapply","id"=>$JobList[$k][\'id\']),"1");
							$v[\'id\']= $id;
							$v[\'name\'] = ' . $name . '[$key][\'newsjob\'];
							' . $name . '[$key][\'joblist\'][] = $v;
							' . $name . '[$key][\'jobnum\'] = ' . $name . '[$key][\'jobnum\']+1;
						}
					}
					foreach($comrat as $k=>$v){
						if($value[\'rating\']==$v[\'id\']){
							' . $name . '[$key][\'color\'] = $v[\'com_color\'];
							' . $name . '[$key][\'ratlogo\'] = $v[\'com_pic\'];
						}
					}
				}
			}
		}
		if($paramer[\'isnews\']){
			$JobId = @implode(",",$ListId);
			$NewsList=$db->select_all("company_news","`uid` IN ($JobId) and status=1  order by `id` desc");
			if(is_array($ListId) && is_array($NewsList)){
				foreach(' . $name . ' as $key=>$value){
					' . $name . '[$key][\'newsnum\'] = 0;
					foreach($NewsList as $k=>$v){
						if($value[\'uid\']==$v[\'uid\']){
							' . $name . '[$key][\'newslist\'][] = $v;
							' . $name . '[$key][\'newsnum\'] = ' . $name . '[$key][\'newsnum\']+1;
						}
					}
				}
			}
		}
		if($paramer[\'isshow\']){
			$JobId = @implode(",",$ListId);
			$ShowList=$db->select_all("company_show","`uid` IN ($JobId) order by `id` desc");
			if(is_array($ListId) && is_array($ShowList)){
				foreach(' . $name . ' as $key=>$value){
					' . $name . '[$key][\'shownum\'] = 0;
					foreach($ShowList as $k=>$v){
						if($value[\'uid\']==$v[\'uid\']){
							' . $name . '[$key][\'showlist\'][] = $v;
							' . $name . '[$key][\'shownum\'] = ' . $name . '[$key][\'shownum\']+1;
						}
					}
				}
			}
		}
		if($paramer[\'firm\']){
			if($_COOKIE[uid]){$atnlist = $db->select_all("atn","`uid`=\'$_COOKIE[uid]\'");}
			if(is_array(' . $name . ')){
				foreach(' . $name . ' as $key=>$value){
					if(!empty($atnlist)){
						foreach($atnlist as $v){
							if($value[\'uid\'] == $v[\'sc_uid\']){
								' . $name . '[$key][\'atn\'] = "取消关注";
                                ' . $name . '[$key][\'atnstatus\'] = "1";
								break;
							}else{
								' . $name . '[$key][\'atn\'] = "关注";
							}
						}
					}else{
						' . $name . '[$key][\'atn\'] = "关注";
					}
				}
			}
		}
		if(is_array(' . $name . ')){
			foreach(' . $name . ' as $key=>$value){
				' . $name . '[$key][\'com_url\'] = Url("company",array("c"=>"show","id"=>$value[\'uid\']));
				' . $name . '[$key][\'joball_url\'] = Url("company",array("c"=>"show","id"=>$value[\'uid\'],"tp"=>"post"));
				if($value[\'logo\']!=""){
					' . $name . '[$key][\'logo\'] = str_replace("./",$config[\'sy_weburl\']."/",$value[\'logo\']);
				}else{
					' . $name . '[$key][\'logo\'] = $config[\'sy_weburl\']."/".$config[\'sy_unit_icon\'];
				}
			}
			if($paramer[\'keyword\']!=""&&!empty(' . $name . ')){
				addkeywords(\'4\',$paramer[\'keyword\']);
			}
		}';
        global $DiyTagOutputStr;
        $DiyTagOutputStr[] = $OutputStr;
        return SmartyOutputStr($this, $compiler, $_attr, 'comlist', $name, '', $name);
    }