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'];
        $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'];
        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');
    }
Example #5
0
 public function SQLPrep($value)
 {
     if (is_array($value) == false) {
         $value = htmlentities($value, ENT_QUOTES);
     } else {
         $value = ArrayToString($value);
     }
     return "'" . $value . "'";
 }
/**
 * Runs the example.
 * @param AdWordsUser $user the user to run the example with
 */
function GetAccountChangesExample(AdWordsUser $user)
{
    // Get the service, which loads the required classes.
    $campaignService = $user->GetService('CampaignService', ADWORDS_VERSION);
    $customerSyncService = $user->GetService('CustomerSyncService', ADWORDS_VERSION);
    // Get an array of all campaign ids.
    $campaignIds = array();
    $selector = new Selector();
    $selector->fields = array('Id');
    $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
    do {
        $page = $campaignService->get($selector);
        if (isset($page->entries)) {
            foreach ($page->entries as $campaign) {
                $campaignIds[] = $campaign->id;
            }
        }
        $selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
    } while ($page->totalNumEntries > $selector->paging->startIndex);
    // Set the date time range, from 24 hours ago until now.
    $dateTimeRange = new DateTimeRange();
    $dateTimeRange->min = date('Ymd his', strtotime('-1 day'));
    $dateTimeRange->max = date('Ymd his');
    // Create selector.
    $selector = new CustomerSyncSelector();
    $selector->dateTimeRange = $dateTimeRange;
    $selector->campaignIds = $campaignIds;
    // Make the get request.
    $accountChanges = $customerSyncService->get($selector);
    // Display results.
    if (isset($accountChanges)) {
        printf("Most recent change: %s\n", $accountChanges->lastChangeTimestamp);
        if (isset($accountChanges->changedCampaigns)) {
            foreach ($accountChanges->changedCampaigns as $campaignChangeData) {
                printf("Campaign with id '%.0f' has change status '%s'.\n", $campaignChangeData->campaignId, $campaignChangeData->campaignChangeStatus);
                if ($campaignChangeData->campaignChangeStatus != 'NEW') {
                    printf("\tAdded ad extensions: %s\n", ArrayToString($campaignChangeData->addedAdExtensions));
                    printf("\tRemoved ad extensions: %s\n", ArrayToString($campaignChangeData->removedAdExtensions));
                    printf("\tAdded campaign criteria: %s\n", ArrayToString($campaignChangeData->addedCampaignCriteria));
                    printf("\tRemoved campaign criteria: %s\n", ArrayToString($campaignChangeData->removedCampaignCriteria));
                    if (isset($campaignChangeData->changedAdGroups)) {
                        foreach ($campaignChangeData->changedAdGroups as $adGroupChangeData) {
                            printf("\tAd Group with id '%.0f' has change status '%s'.\n", $adGroupChangeData->adGroupId, $adGroupChangeData->adGroupChangeStatus);
                            if ($adGroupChangeData->adGroupChangeStatus != 'NEW') {
                                printf("\t\tChanged ads: %s\n", ArrayToString($adGroupChangeData->changedAds));
                                printf("\t\tChanged criteria: %s\n", ArrayToString($adGroupChangeData->changedCriteria));
                                printf("\t\tRemoved criteria: %s\n", ArrayToString($adGroupChangeData->removedCriteria));
                            }
                        }
                    }
                }
            }
        }
    } else {
        print "No changes were found.\n";
    }
}
    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'];
        $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');
    }
Example #10
0
 function tenpay_action()
 {
     extract($_POST);
     if ($pay_config) {
         $tenpay['sy_weburl'] = $this->config['sy_weburl'];
         $tenpay['sy_tenpayid'] = iconv("utf-8", "gbk", trim($_POST['sy_tenpayid']));
         $tenpay['sy_tenpaycode'] = iconv("utf-8", "gbk", trim($_POST['sy_tenpaycode']));
         made_web("../api/tenpay/tenpay_data.php", ArrayToString($tenpay), "tenpaydata");
         $this->ACT_layer_msg("财付通配置成功!", 9, $_SERVER['HTTP_REFERER'], 2, 1);
     }
     @(include APP_PATH . "/api/tenpay/tenpay_data.php");
     $this->yunset("tenpaydata", $tenpaydata);
     $this->yuntpl(array('admin/admin_tenpay_config'));
 }
    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 = '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');
    }
Example #13
0
function ArrayToString($obj, $withKey = true, $two = false)
{
    if (empty($obj)) {
        return array();
    }
    $objType = gettype($obj);
    if ($objType == 'array') {
        $objstring = "array(";
        foreach ($obj as $objkey => $objv) {
            if ($withKey) {
                $objstring .= "\"{$objkey}\"=>";
            }
            $vtype = gettype($objv);
            if ($vtype == 'integer') {
                $objstring .= "{$objv},";
            } else {
                if ($vtype == 'double') {
                    $objstring .= "{$objv},";
                } else {
                    if ($vtype == 'string') {
                        $objv = str_replace('"', "\\\"", $objv);
                        $objstring .= "\"" . $objv . "\",";
                    } else {
                        if ($vtype == 'array') {
                            $objstring .= "" . ArrayToString($objv, false) . ",";
                        } else {
                            if ($vtype == 'object') {
                                $objstring .= "" . ArrayToString($objv, false) . ",";
                            } else {
                                $objstring .= "\"" . $objv . "\",";
                            }
                        }
                    }
                }
            }
        }
        $objstring = substr($objstring, 0, -1) . "";
        return $objstring . ")\n";
    }
}
Example #14
0
 function index_action($id = '')
 {
     @(include PLUS_PATH . 'cron.cache.php');
     if (is_array($cron) && !empty($cron)) {
         foreach ($cron as $key => $value) {
             if ($id) {
                 if ($value['id'] == $id) {
                     $timestamp[$value['nexttime']] = $value;
                     $timestamp[$value['nexttime']]['cronkey'] = $key;
                 }
             } else {
                 if ($value['nexttime'] <= time()) {
                     $timestamp[$value['nexttime']] = $value;
                     $timestamp[$value['nexttime']]['cronkey'] = $key;
                 }
             }
         }
         if ($timestamp) {
             krsort($timestamp);
             $croncache = current($timestamp);
             ignore_user_abort();
             set_time_limit(600);
             if (file_exists(LIB_PATH . 'cron/' . $croncache['dir'])) {
                 include LIB_PATH . 'cron/' . $croncache['dir'];
                 if ($croncache['dir'] == "notice.php") {
                     $notice = new notice($this->obj);
                     $notice->index();
                 }
             }
             $nexttime = $this->nextexe($croncache);
             $this->obj->DB_update_all("cron", "`nowtime`='" . time() . "',`nexttime`='" . strtotime($nexttime) . "'", "`id`='" . $value['id'] . "'");
             $cron[$croncache['cronkey']]['nexttime'] = strtotime($nexttime);
             $data['cron'] = ArrayToString($cron);
             made_web_array(PLUS_PATH . 'cron.cache.php', $data);
         }
     }
 }
 public function index()
 {
     //$this->DBInsertOne();
     $MemberList = M('member')->select();
     $this->assign("MemberList", $MemberList);
     $rows = M("admin_link")->where("`link_state`='1'")->select();
     //print_r($rows);die;
     if (is_array($rows)) {
         foreach ($rows as $key => $value) {
             $row[$key]['id'] = $value["id"];
             $row[$key]['link_name'] = $value["link_name"];
             $row[$key]['link_url'] = $value["link_url"];
             $row[$key]['img_type'] = $value["img_type"];
             $row[$key]['pic'] = $value["pic"];
             $row[$key]['link_type'] = $value["link_type"];
             $row[$key]['domain'] = $value["domain"];
             $row[$key]['tem_type'] = $value["tem_type"];
         }
     }
     $data['link'] = ArrayToString($row);
     CacheMake('link.cache.php', $data, ROOT_PATH . '/Cache/');
     //echo "asdfasdf";
     $this->display("index");
 }
    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];
		$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 $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');
    }
Example #19
0
 public function desc_cache($dir)
 {
     $DescClassList = $this->obj->DB_select_all('desc_class', '1 order by sort asc');
     $DescList = $this->obj->DB_select_all('description', '1 AND `is_nav`=1 order by sort asc', '`id`,`nid`,`name`,`url`,`title`,`is_type`');
     foreach ($DescList as $k => $v) {
         foreach ($DescClassList as $k => $val) {
             if ($v['nid'] == $val['id']) {
                 $DescList[$k]['classname'] = $val['name'];
             }
         }
     }
     $data['desc_class'] = ArrayToString($DescClassList, true, true);
     $data['desc_list'] = ArrayToString($DescList, true, true);
     return made_web_array($this->cachedir . $dir, $data);
 }
    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);
    }
Example #21
0
 public function cache($filename, $data)
 {
     $data_new['data'] = ArrayToString($data, true);
     $this->obj->DB_update_all("outside", "`lasttime`='" . mktime() . "'", "id='" . $filename . "'");
     return made_web_array($this->cachedir . $filename . ".php", $data_new);
 }
Example #22
0
function getToken($config)
{
    $Token = $config['token'];
    $TokenTime = $config['token_time'];
    $NowTime = time();
    if ($NowTime - $TokenTime > 7000) {
        $Appid = $config['wx_appid'];
        $Appsecert = $config['wx_appsecret'];
        $Url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $Appid . '&secret=' . $Appsecert;
        $CurlReturn = CurlPost($Url);
        $Token = json_decode($CurlReturn);
        $config['token'] = $Token->access_token;
        $config['token_time'] = time();
        made_web(PLUS_PATH . "config.php", ArrayToString($config), "config");
        return $config['token'];
    } else {
        return $Token;
    }
}
    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);
    }
</form>
</div>

<script>
	$(document).ready(function() {
		$( "#htmlEditor" ).dialog({
				title: "Content Management",
				autoOpen: false,
				width: 800,
				modal: true
			});
		
		$(".hotspot").each(
			function() {
				var roles = <?php 
echo ArrayToString($_SESSION['ROLES']);
?>
;
				var role = $(this).attr("role");
				var file = $(this).attr("file");
				var i;
				var isOk = false;
				
				for (i = 0; i < roles.length; i++) {
					if (role == roles[i]) {
						isOk = true;
						break;
					}
				}
					
				if (isOk) {
    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);
    }
    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'];
        $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'];
        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'];
        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');
    }