yourphp2版本常用的数据调用

2621
{__NOLAYOUT__}
============包含文件   <include file="Home:header"/>
============ 函数 str_cut($arr, 10, '...')
=========== 时间函数 {$r.createtime|toDate=###,'m'}
==== 系统变量
---- {$site_name} 网站名称
---- {$seo_title} 网站标题
---- {$seo_keywords} 关键词
---- {$seo_description} 简介
---- {$logo}  LOGO图片
---- YP_PUB/Js/jquery.min.js
=============== 导航
实例:
<YP:nav  catid="0" level="3"  home="1" />  {if $r['id']==$bcid} class="on"{/if}
 
参数设置:
id="nav" 为ul的css定义的ID名称.
catid="0" 为调用一级栏目导航;
level="3" 为共调用3级栏目;
bcid="0" 调用大栏目下所有子栏目
class=""  样式名称
enhome="Home"  导航是否同时显示英文的名称值为首页显示的的名称例:home
home="网站首页" 中文导航显示首页的文字
YOURPHP 模板命名 规则 -》
单页模型 Page_xxxx.html
============语言包调用 {:L(catpos)}
============首页判断
{if $module_name==Index}   {if isset($bcid)}
{/if}
============ 幻灯片
<YP:flash flashid="1" />
                                   ---模板在slide_1-4.html
{loop}{$r}{/loop}
========== 当前页 (面包屑)
<YP:catpos  catid="catid" space=" &gt; " />
========== 当前栏目名称 
{$Categorys[$catid]['catdir']}   {$Categorys[$catid]['catname']}
========== 子栏目
<YP:subcat  catid="8">
  <li><a href="{$r.url}">{$r.catname}</a></li>
</YP:subcat>
<YP:subcat catid="$parentid" key="n"}
          <a href="{$k.url}" class="current">{$k.catname}</a>
    </YP:subcat>    
==== 列表标签 产品页
<YP:list m="Product" catid="$catid" num="15" return="data" page="$p" >
    {loop $data $r}
       {toDate($r[createtime],'m')}  {:str_cut($r[description],140,'...')}
    {/loop}
</YP:list}
==== 列表标签 新闻页
<YP:list order="id desc" catid="$catid" num="15" return="data" page="$p" >
   {loop $data $r}
       
    {/loop}
</YP}
==============下载
<YP:list m="Download" catid="$catid" num="1" return="data" page="$p" >
    {loop $data $r}
      YP_PATH/index.php?m={$module_name}&a=down&id={$r.id}
    {/loop}
</YP>
============内容标签
----------- 图片集
{loop $pics $r}
    {if  !empty($r[filepath])}
    {/if}
{/loop}
------------- 标题  {$title}
------------- 来源  {$source}
------------- 时间 {toDate($createtime,'Y-m-d')}
------------- 作者 {$authors}
------------ 类型 {$Categorys[$catid][catname]}
------------ 关键字 {$keywords}
------------ 点击数次 {$hits}
------------ 描述  {$description}
------------内容 {$content}
------------ 上下页
<span>
  上一篇:<yp:pre msg='没有了' blank='target="_self"'/>
</span>
<span>
  下一篇:<yp:next msg='没有了' blank='target="_self"' />
</span>
<【
catid="8"       设置调取那些栏目数据.多个栏目用半角逗号分开3,4,5,10 当设置为大栏目ID时取此栏目下所有子栏目数据.也可为变量$catid .
posid="1"      设置数据推荐位
linktype="2"  设置调用什么类型的链接 1为文字链接.2为图片链接
id = "r"          定义数据查询的结果存放变量
key = "n"        返回数据主键变量名称
where ='''     数据筛选条件
order = 'id desc';  排序方式
limit ="10"    调用条数 默认10条
field="*"       调用那些字段
thumb="1"   值为1时调用有标题图片的数据.
name="Article" 设置模型名称
sql=""          自定义sql语句查询
】>
==== 友情链接
<YP:link  typeid="2"  linktype="2" >
  <li><a href="{$r['siteurl']}" target="_blank" title="{$r['name']}"><img src="{$r['logo']}" alt="{$r['name']}"></a></li>
</YP:link>
<【
typeid="2"            为友情链接所有类别ID
linktype="2"         设置调用什么类型的链接 1为文字链接.2为图片链接
id = "r"                 定义数据查询的结果存放变量
key = "i"               返回数据主键变量名称
order = 'id desc';  排序方式
limit ="10"           调用条数 默认10条
】>
==== 碎片
{YP:block pos="contact" /}   pos = “碎片标识” about
==== if语句
{if  $catid==1} 
      新闻栏目 
{elseif  $catid==2} 
     产品栏目 
{else} 
     图片栏目 
{/if} 
========================== 首页推荐
{$Categorys[$T[m_news_catid]]['catname']}   {$Categorys[$T[m_news_catid]]['url']}
{YP:list order="id desc" catid="$T[m_news_catid]" num="3" posid="7" }
  thumb="1"  field="title,url,thumb"  key="n"
    {loop $data $r}
<li><a href="{$r.url}" target="_blank">{str_cut($r[title],40,'..')}</a></li>
    {/loop}
{/YP} 
==== 客服
<YP:kefu id="kefu" left="-10" top="180" />

玄玄博客 www.blogxuan.com