{rtrim(trim(catpos($catid)),">")} {siteurl($siteid)} 2.引用 {template "content","footer"} 网站标题、网站关键字{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']} 显示结果条数{count($data)}或{sizeof($data)} 时间日期转换{format::date($lb[inputtime],1)} 5.文章正文 {$title}标题 {$username}作者 {date('Y-m-d',strtotime($inputtime))}发布日期 {$copyfrom}信息来源 {$content}正文 访问次数 9.嵌套循环 {loop subcat(38,$siteid) $r} {php $cid=$r[arrchildid]} {pc:get sql="SELECT * from xy_news where status=99 and catid=$cid and typeid in(54) order by listorder ASC,inputtime DESC" num="1" return="data"} {loop $data $jj} {/loop} {/pc} {/loop} 10.推荐信息 {pc:content action="position" posid="2" order="listorder ASC,id DESC" num="4"} {loop $data $key $val}{/loop} {/pc} 11.相关文章 {pc:content action="relation" relation="$relation" catid="$catid" num="5" keywords="$rs[keywords]"}{loop $data $r} ·({date('Y-m-d',$r[inputtime])}) {/loop}{/pc} 12.判断是否有数据 {if empty($data)} {/if} 13.日期转换 2014-11-20 11:11:11 {date('Y-m-d H:i:s',$v[inputtime])} 2014-11-20 {date('Y-m-d',$v[inputtime])} 14.循环显示子栏目信息 {pc:get sql="SELECT arrchildid from xy_category where catid=$catid" num="1" return="cata"} {loop $cata $lm} {pc:get sql="SELECT * from xy_news where status=99 and catid in($lm[arrchildid]) order by inputtime DESC,id DESC" num="10" return="data" page="$page"} {php $u=0}{if empty($data)}
- {/if} {loop $data $v} {php $u++}
- {if $u%5==0 && $u<10}
{/if} {/loop}
{/pc} {/loop} {/pc} 15.专题标签 首页 $id 专题ID $title 专题名称 列表 $id 专题ID $title 专题名称 $typeid 分类ID $info[name] 分类名称 专题当前位置 16.判断字符串是否含有子串 {if $hd[thumb] && stristr($hd[thumb],"dangyang.gov.cn/")} 17.从单信息获取图片和内容摘要(正则匹配) {pc:get sql="SELECT * from xy_page where catid=306" num="1"} {loop $data $v} {php $curl=$CATEGORYS[306][url]} {php $img=IMG_PATH.'nopic.gif'} {php preg_match('//i',$v[content],$out)} {php if($out[1]) $img=$out[1]} {if $out[0]} {php echo str_cut(preg_replace('/<[^>]+>/','',$out[0]),560,'...')} {else} {php echo str_cut(preg_replace('/<[^>]+>/',$v[content]),'...')} {/if} {/loop} {/pc} 18.读取用户真实姓名 phpcms\libs\functions\global.func.php /** * Function get_realname * 通过username值,查询真实姓名 * @param $username 用户名 */ function get_realname($username) { if(empty($username)){return false;} $admin_db = pc_base::load_model('admin_model'); $realname = $admin_db->get_one(array('username'=>$username),'realname'); //如果没有真实姓名返回用户名 if($realname['realname']) { return $realname['realname']; } else { return $username; } } 19.搜索、Tag页、模块页面不支持$CATEGORYS的解决方法 加上 20.对于图片相对路径进行的判断 {if $r[thumb] && stristr($r[thumb],"http://")} {else} {/if} 20.搜索框代码 以上是标签笔记由热心网友提供