当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayToString函数代码示例

本文整理汇总了PHP中ArrayToString函数的典型用法代码示例。如果您正苦于以下问题:PHP ArrayToString函数的具体用法?PHP ArrayToString怎么用?PHP ArrayToString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ArrayToString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: compile

    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);
    }
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:60,代码来源:smarty_internal_compile_msglist.php

示例2: compile

    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);
    }
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:34,代码来源:smarty_internal_compile_hrclass.php

示例3: compile

    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);
    }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:58,代码来源:smarty_internal_compile_mlist.php

示例4: compile

    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');
    }
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:58,代码来源:smarty_internal_compile_qrecom.php

示例5: SQLPrep

 public function SQLPrep($value)
 {
     if (is_array($value) == false) {
         $value = htmlentities($value, ENT_QUOTES);
     } else {
         $value = ArrayToString($value);
     }
     return "'" . $value . "'";
 }
开发者ID:erfg12,项目名称:web-media-center,代码行数:9,代码来源:tmdb.class.php

示例6: GetAccountChangesExample

/**
 * 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";
    }
}
开发者ID:havardorbech,项目名称:googleads-php-lib,代码行数:61,代码来源:GetAccountChanges.php

示例7: compile

    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);
    }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:57,代码来源:smarty_internal_compile_announcement.php

示例8: compile

    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);
    }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:55,代码来源:smarty_internal_compile_qcache.php

示例9: compile

    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');
    }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:50,代码来源:smarty_internal_compile_adlist.php

示例10: tenpay_action

 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'));
 }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:14,代码来源:payconfig.class.php

示例11: compile

    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');
    }
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:47,代码来源:smarty_internal_compile_navmap.php

示例12: compile

    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');
    }
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:41,代码来源:smarty_internal_compile_hrlist.php

示例13: ArrayToString

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";
    }
}
开发者ID:keyu199314,项目名称:php,代码行数:40,代码来源:public.function.php

示例14: index_action

 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);
         }
     }
 }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:37,代码来源:index.class.php

示例15: index

 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");
 }
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:24,代码来源:NoticeClassController.class.php


注:本文中的ArrayToString函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。