Parse error: syntax error, unexpected '{' in caches\caches_template\cmsyou\content\footer.php(6) : eval()'d code on line 1
3 个回复
CMSYOU - CMS企业网站定制专家
赞同来自:
string2array函数改成json处理,为了保持兼容函数名称没做变动
function show_ad($siteid, $id) {
$siteid = intval($siteid);
$id = intval($id);
if(!$id || !$siteid) return false;
$p = pc_base::load_model('poster_model');
$r = $p->get_one(array('spaceid'=>$id, 'siteid'=>$siteid), 'disabled, setting', '`id` ASC');
if ($r['disabled']) return '';
if ($r['setting']) {
$c = string2array($r['setting']);
} else {
$r['code'] = '';
}
return $c['code'];
}
{pc:get sql="SELECT setting FROM v9_poster WHERE spaceid = 1 AND type='text' AND disabled=0 ORDER BY listorder ASC" num="10"}
<ul>
{loop $data $r}
<?php eval("\$narry =$r[setting];"); ?>
<li><a href="{$narry[1][linkurl]}">{$narry[1][title]}</a></li>
{/loop}
</ul>
{/pc}
{pc:get sql="SELECT setting FROM v9_poster WHERE spaceid = 1 AND type='text' AND disabled=0 ORDER BY listorder ASC" num="10"}
<ul>
{loop $data $r}
<?php $narry = string2array($r[setting]); ?>
<li><a href="{$narry[1][linkurl]}">{$narry[1][title]}</a></li>
{/loop}
</ul>
{/pc}
CMSYOU - CMS企业网站定制专家
赞同来自:
<?php eval("\$narry =$r[setting];"); ?>
{php $mystr = substr($r[setting],1,1);}
{if $mystr=='a'}
{php eval("\$narry =$r[setting];");}
{else}
{php $narry = string2array($r[setting]);}
{/if}
最新活动:2016-01-05 15:01
浏览:3115 次
关注:1 人
Copyright © 2008-2025 CMSYOU - 互助问答社区 - 粤ICP备10060801号-3 RSS Feed
欢迎加入QQ群(346494585) “让我们一起来学习CMS建站吧!”
要评论问题请先登录或注册