yzmcms手机模板常用标签

全局部分

描述、关键词、页面标题

<title>{$seo_title}</title>
<meta name="keywords" content="{$keywords}" />
<meta name="description" content="{$description}" />

格式化时间

{date('Y-m-d H:i:s',$inputtime)}

css、js链接

<link rel="stylesheet" href="{STATIC_URL}peiyinm/css/phone.css" type="text/css"/>
<script type="text/javascript" src="{STATIC_URL}peiyinm/js/audio.min.js"></script>

站点名称 {$site[site_name]}
站点地址

{$site[site_url]}{SITE_URL}

标题 {$seo_title}
关键字 {$keywords}
描述 {$description}
网站版权信息 {$site[site_copyright]}
网站备案号 {$site[site_filing]}
统计代码 {$site[site_code]}

头部文件

{m:include "mobile","header"} 

底部文件

{m:include "mobile","footer"} 

导航部分的首页链接地址

首页部分

{U('mobile/index/init')}

手机导航条调用

{m:nav field="mobname,catid,type,pclink,catname" where="where="parentid=0" limit="19" return="nav_data"}
{loop $nav_data $v}
     <a href="{if $v['type']!=2}{U('mobile/index/lists', array('catid'=>$v['catid']))}{else}{$v[pclink]}{/if}" >{$v[catname]}</a>    
{/loop} 

单独调用某个栏目(指定catid)

{m:nav field="mobname,catid,type,pclink,catname" where="catid=6" limit="1" return="nav_data"}
{loop $nav_data $v}
     <a href="{if $v['type']!=2}{U('mobile/index/lists', array('catid'=>$v['catid']))}{else}{$v[pclink]}{/if}" >{$v[catname]}</a>    
{/loop} 

只调用单个栏目的链接

{U('mobile/index/lists', array('catid'=6))}

调用轮播图

{m:banner field="title,image,url,typeid,status" limit="10"}
      {loop $data $v} 
      <li style="background:url({$v[image]}) 50% 0 no-repeat;" title="{$v[title]}">
        <a href="{$v[url]}" target="_blank"></a>
      </li>
      {/loop}

手机模板调用某个栏目下的文章

{m:lists field="title,updatetime,url,color,thumb,peiyin,shoujiimg" order="id ASC"  catid="6" limit="20"}
						  {loop $data $k $v}
						  <li>
							<div class="left">
							  <img src="{$v[shoujiimg]}" width="75" height="75"/>
							</div>
							<div class="right">
								<a href="tencent://message/?uin={$site[qq]}&Site=Sambow&Menu=yes" title="文字转语音">{$v[title]}</a>
								<p><a href="tencent://message/?uin={$site[qq]}&Site=Sambow&Menu=yes" title="文字转语音">联系客服配音</a></p>
							</div>
							<div class="bf">
								 <img src="{STATIC_URL}peiyinm/picture/bf.png" width="40" height="40" data="{$v[peiyin]}" class="bfimg" alt="{$v[title]}"/>
							</div>
					    </li>
						{/loop}		

列表页部分

调用当前栏目的父级栏目和兄弟栏目

 {php $arrparentid = get_category($catid, 'arrparentid');}        
        {if $arrparentid=='0'}
        {php $arrparentid=$catid;}
        {else}
        {php $res = explode(',', $arrparentid); $arrparentid=$res[1];}
        {/if}
        {m:nav field="catid,catname,arrchildid,pclink,type" where="catid=$arrparentid" limit="1"}
        {loop $data $v}        
                <li><a href="{if $v['type']!=2}{U('mobile/index/lists', array('catid'=>$v['catid']))}{else}{$v[pclink]}{/if}">全部</a></li>
        {/loop}
        {m:nav field="catid,catname,arrchildid,pclink,type" where="parentid=$arrparentid" limit="10"}
        {loop $data $v}        
                <li><a href="{if $v['type']!=2}{U('mobile/index/lists', array('catid'=>$v['catid']))}{else}{$v[pclink]}{/if}">{$v[catname]}</a></li>
        {/loop}

调用栏目下的文章列表

 {m:lists field="title,updatetime,url,color,flag,thumb,peiyin,shoujiimg" catid="$catid" limit="20"   page="page"}  
          {loop $data $v}
         <li>
            <div class="left">
                <img src="{$v[shoujiimg]}" width="75" height="75"/>
            </div>
            <div class="right">
                <a href="tencent://message/?uin={$site[qq]}&Site=Sambow&Menu=yes" title="联系音品汇">{$v[title]}</a>
                <p><a href="tencent://message/?uin={$site[qq]}&Site=Sambow&Menu=yes" title="联系音品汇">立即配音</a></p>
            </div>
            <div class="bf">
                <img src="{STATIC_URL}peiyinm/picture/bf.png" width="40" height="40" data="{$v[peiyin]}" class="bfimg" alt="{$v[title]}" alt="播放器按钮ico"/>
            </div>
        </li>
         {/loop}

页码

{$pages}

面包屑导航

{get_location($catid)}

获取栏目的链接

{get_category(2, 'pclink')}

内容页

标题 {$title}
来源: {$copyfrom}
发布日期 {date('Y-m-d H:i:s',$inputtime)}
更新日期 {date('Y-m-d H:i:s',$updatetime)}
作者昵称 {$nickname}
浏览次数 {$click}
缩略图

<img src="{get_thumb($thumb)}" title="{$title}" alt="{$title}"">

摘要 {$description}
内容 {$content}
上一篇 {$pre}
下一篇 {$next}
调用随机内容

{m:lists field="id,catid,title,thumb,updatetime,description" modelid="$modelid" order="RAND()" limit="4"}
                {loop $data $k=>$v}
                <li>
                    <a href="{mobile_url($v['catid'], $v['id'])}">
                        <img src="{get_thumb($v['thumb'])}" alt="{$v[title]}">
                    </a>
                    <p><a href="{mobile_url($v['catid'], $v['id'])}">{$v[title]}</a></p>
                    <span>{date('Y-m-d', $v['updatetime'])}</span>
                </li>
                {/loop}

添加文章评论功能

<form action="{U('comment/index/init')}" method="post"  onsubmit="return check_comm(this)">
                    <input type="hidden" name="modelid" value="{$modelid}">
                    <input type="hidden" name="catid" value="{$catid}">
                    <input type="hidden" name="id" value="{$id}">
                    <input type="hidden" name="title" value="{$title}">
                    <input type="hidden" name="url" value="{$url}">
                    <textarea class="textarea" id="content" name="content" placeholder="我来说两句~"></textarea>
                    <p><input type="submit" class="yzm-comment-submit" name="dosubmit" value="提交"></p>
                    </form>

调用评论内容

{m:comment_list modelid="$modelid" catid="$catid" id="$id" limit="20"}
                    <div class="yzm-comment-list-top">{get_comment_total($id, $catid, $modelid)} 条评论</div>
                    <div class="yzm-comment-list-body">
                    <ul>
                        {loop $data $v}
                        <li>
                            <a class="user_pic" href="{U('member/myhome/init', array('userid'=>$v['userid']))}" target="blank"><img src="{if !empty($v['userpic'])}{$v[userpic]}{else}{STATIC_URL}images/default.gif{/if}" height="35" width="35"></a>
                            <div class="yzm-comm-right">
                                <a class="user_name" href="{U('member/myhome/init', array('userid'=>$v['userid']))}" target="blank">{$v[username]}</a>
                                <p>{nl2br($v['content'])}</p>
                                <p><span class="comm_time">{date('Y-m-d H:i:s',$v['inputtime'])}</span> <a href="javascript:toreply('{$v[id]}');" class="comm_a">回复</a></p>
                                <div id="rep_{$v[id]}" class="none">
                                <form action="{U('comment/index/init')}" method="post"  onsubmit="return check_rep(this)">
                                <input type="hidden" name="modelid" value="{$modelid}">
                                <input type="hidden" name="catid" value="{$catid}">
                                <input type="hidden" name="id" value="{$id}">
                                <input type="hidden" name="title" value="{$title}">
                                <input type="hidden" name="url" value="{$url}">
                                <input type="hidden" name="reply" value="{$v[id]}">
                                <input type="hidden" name="reply_to" value="{$v[username]}">
                                <textarea name="content" class="textarea textarea2" placeholder="我来说两句~"></textarea>
                                <input type="submit" class="yzm-comment-submit static" name="dosubmit" value="提交">
                                </form>
                                </div>
                            </div>
                        </li>
                        {/loop}
                        {if empty($data)}<li>这篇文章还没有收到评论,赶紧来抢沙发吧~</li>{/if}
©️2020 CSDN 皮肤主题: 1024 设计师:上身试试 返回首页