本文整理汇总了PHP中SmartyOutputStr函数的典型用法代码示例。如果您正苦于以下问题:PHP SmartyOutputStr函数的具体用法?PHP SmartyOutputStr怎么用?PHP SmartyOutputStr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SmartyOutputStr函数的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);
}
示例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);
}
示例3: 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');
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
$tem_type = $_attr['tem_type'];
$type = $_attr['type'];
$limit = $_attr['limit'];
$OutputStr = 'global $config;
//跨域名使用范围
$domain=\'\';
if($config["cityid"]!="" || $config["hyclass"]!=""){
include(PLUS_PATH."/domain_cache.php");
$host_url=$_SERVER[\'HTTP_HOST\'];
foreach($site_domain as $v){
if($v[\'host\']==$host_url){
$domain=$v[\'id\'];
}
}
}';
//站内使用范围 1=全站 2=首页使用 3=猎头页使用
$OutputStr .= '$tem_type = ' . (is_numeric($tem_type) ? $tem_type : 1) . ';
include PLUS_PATH."/link.cache.php";
if(is_array($link)){$linkList=array();
$i=0;
foreach($link as $key=>$value)
{
if($config["did"]!=0 && $value["did"]!=$config["did"])
{
continue;
}elseif(is_numeric(\'' . $tem_type . '\') && $value[\'tem_type\']!=\'' . $tem_type . '\' && $value[\'tem_type\']!=\'1\'){
continue;
}elseif((!is_numeric(\'' . $tem_type . '\') || \'' . $tem_type . '\'==\'1\') && $value[\'tem_type\']!=\'1\'){
continue;
}elseif(!$config["did"] && $value["did"]>0){
continue;
}
if(is_numeric(\'' . $type . '\') && $value[\'link_type\']!=\'' . $type . '\')
{
continue;
}
if(is_numeric(\'' . $limit . '\') && intval(\'' . $limit . '\')<=$i)
{
break;
}
$value[picurl] = $config[sy_weburl]."/".$value[pic];
$linkList[] = $value;
$i++;
}
}';
return SmartyOutputStr($this, $compiler, $_attr, 'link', '$linkList', $OutputStr, '$linkList');
}
示例7: 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);
}
return SmartyOutputStr($this, $compiler, $_attr, 'looksq', '$from');
}
示例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);
}
示例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');
}
示例10: 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;$List=array();
$Query = $db->query("SELECT * FROM $db_config[def]description where is_nav=\'1\' order by sort asc");
while($rs = $db->fetch_array($Query)){
$rs[\'url\']=$config[\'sy_weburl\']."/".$rs[\'url\'];
$List[] = $rs;
}';
return SmartyOutputStr($this, $compiler, $_attr, 'singlenav', '$List', $OutputStr, '$List');
}
示例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');
}
示例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 = '$AdArr=array();$paramer=array();';
$class_id = $_attr['classid'];
$adid = $_attr['adid'];
$limit = $_attr['limit'];
$limit = is_numeric($limit) ? $limit : 0;
$length = $_attr['length'];
$length = is_numeric($length) ? $length : 0;
if (isset($adid)) {
$OutputStr .= 'include(PLUS_PATH.\'/pimg_cache.php\');if(!empty($ad_label[$class_id][\'ad_\'' . $adid . '])&&($ad_label[$class_id][\'ad_\'' . $adid . '][\'did\']==$_SESSION[\'did\']||$ad_label[$class_id][\'ad_\'' . $adid . '][\'did\']==\'0\')&&$ad_label[$class_id][\'ad_\'' . $adid . '][\'start\']<time()&&$ad_label[$class_id][\'ad_\'' . $adid . '][\'end\']>time()){
$AdArr[] = $ad_label[$class_id][\'ad_\'' . $adid . '];
}';
} else {
$OutputStr .= 'include(PLUS_PATH.\'/pimg_cache.php\');$add_arr = $ad_label[' . $class_id . '];if(is_array($add_arr) && !empty($add_arr)){
$i=0;$limit = ' . $limit . ';$length = ' . $length . ';
foreach($add_arr as $key=>$value){
if((stripos($value[\'did\'],$_SESSION[\'did\'])!==false ||$value[\'did\']==\'0\')&&$value[\'start\']<time()&&$value[\'end\']>time()){
if($i>0 && $limit==$i){
break;
}
if($length>0){
$value[\'name\'] = mb_substr($value[\'name\'],0,$length);
}
if($paramer[\'type\']!=""){
if($paramer[\'type\'] == $value[\'type\']){
$AdArr[] = $value;
}
}else{
$AdArr[] = $value;
}
$i++;
}
}
}';
}
//自定义标签 END
return SmartyOutputStr($this, $compiler, $_attr, 'adlist', '$AdArr', $OutputStr, '$AdArr');
}
示例13: 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');
}
示例14: 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();
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);
}
示例15: 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);
}
$uptime = $_attr['uptime'];
$order = $_attr['order'];
$sort = $_attr['sort'];
$limit = $_attr['limit'];
$where = $_attr['where'];
$ispage = $_attr['ispage'];
$OutputStr = 'global $db,$db_config,$config;
global $ModuleName;
if(!$Purl["m"]){
$Purl["m"]=$ModuleName;
}
$time = time();
$where = "`time_start`<$time AND `time_end`>$time";';
if ($uptime) {
$OutputStr .= '$uptime = $time-' . $uptime . '*3600;
$where.=" AND `lastupdate`>\'".$uptime."\'";';
}
$OutputStr .= '$order = " ORDER BY `' . ($order ? $order : 'sort') . '` ";';
$OutputStr .= '$sort = \'' . ($sort ? $sort : 'ASC') . '\';';
if ($limit) {
$OutputStr .= '$limit=" LIMIT ' . $limit . '";';
}
$OutputStr .= '$where.=$order.$sort;';
if ($where) {
$OutputStr .= '$where = \'' . $where . '\';';
}
if ($ispage) {
$OutputStr .= '$limit = PageNav($paramer,$_GET,"hotjob",$where,$Purl,\'0\',$_smarty_tpl);';
}
$OutputStr .= '
$Query = $db->query("SELECT * FROM $db_config[def]hotjob where ".$where.$limit);
while($rs = $db->fetch_array($Query)){
' . $name . '[] = $rs;
$ListId[] = $rs[uid];
}
$jobwhere=1;
if($config[sy_web_site]=="1"){
if($config[cityid]>0 && $config[cityid]!=""){
$jobwhere.=" and `cityid`=\'$config[cityid]\'";
}
if($config[three_cityid]>0 && $config[three_cityid]!=""){
$jobwhere.=" and `three_cityid`=\'$config[three_cityid]\'";
}
if($config[hyclass]>0 && $config[hyclass]!=""){
$jobwhere.=" and `hy`=\'".$config[hyclass]."\'";
}
}
$JobId = @implode(",",$ListId);
$JobList=$db->select_all("company_job","`uid` IN ($JobId) and `edate`>\'".mktime()."\' and state=1 and r_status<>\'2\' and status<>\'1\' and $jobwhere");
$statis=$db->select_all("company_statis","`uid` IN ($JobId)","`uid`,`comtpl`");
if(is_array($ListId)){
$cache_array = $db->cacheget();
foreach(' . $name . ' as $key=>$value){
$i=0;
if(is_array($JobList)){
' . $name . '[$key]["job"].="<div class=\\"area_left\\"> ";
foreach($JobList as $k=>$v){
if($value[uid]==$v[uid] && $i<5){
$job_url = Url("job",array("c"=>"comapply","id"=>"$v[id]"),"1");
$v[name] = mb_substr($v[name],0,10,"GBK");
' . $name . '[$key]["job"].="<a href=\'".$job_url."\'>".$v[name]."</a>";
$i++;
}
}
foreach($statis as $v){
if($value[\'uid\']==$v[\'uid\']){
if($v[\'comtpl\'] && $v[\'comtpl\']!="default"){
$jobs_url = Url("company",array("c"=>"show","id"=>$value[uid]))."#job";
}else{
$jobs_url = Url("company",array("c"=>"show","id"=>$value[uid]));
}
}
}
$com_url = Url("company",array("c"=>"show","id"=>$value[uid]));
$beizhu=mb_substr($value[\'beizhu\'],0,50,"GBK")."...";
' . $name . '[$key]["job"].="</div><div class=\\"area_right\\"><a href=\'".$com_url."\'>".$value["username"]."</a>".$beizhu."</div><div class=\\"area_left_bot\\"><a href=\'".$jobs_url."\'>全部职位</a></div><div class=\'area_right_bot\'><a href=\'".$com_url."\'>公司详情</a></div>";
' . $name . '[$key]["url"]=$com_url;
}
}
}';
global $DiyTagOutputStr;
$DiyTagOutputStr[] = $OutputStr;
return SmartyOutputStr($this, $compiler, $_attr, 'hotjob', $name, '', $name);
}