找回密码
 立即注册
搜索
查看: 2024|回复: 0

【discuz x3.1教程】view.htm 文章内容页解析

[复制链接]

581

主题

110

回帖

4066

积分

管理员

积分
4066

众神之神

发表于 2014-9-26 09:54:58 | 显示全部楼层 |阅读模式
下面这个是面包屑
  1. <div id="pt" class="bm cl">
  2.         <div class="z">
  3.                 <a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a> <em>›</em>
  4.                 <a href="$_G[setting][navs][1][filename]">{lang nav_index}</a> <em>›</em>
  5.                 <!--{loop $cat[ups] $value}-->
  6.                         <a href="{echo getportalcategoryurl($value[catid])}">$value[catname]</a><em>›</em>
  7.                 <!--{/loop}-->
  8.                 <a href="{echo getportalcategoryurl($cat[catid])}">$cat[catname]</a> <em>›</em>
  9.                 {lang view_content}
  10.         </div>
  11. </div>
复制代码

<div class="bm vw">....</div>显示的是文章主体的部分
$article[title] 文章标题
$article[dateline]文章发布时间
{lang view_publisher} (语言包)发布者
$article[username] 发布者
{lang view_views}  (语言包)查看
{lang view_author_original} (语言包)原作者
    $article[author] 原作者
    $article[viewnum] 查看次数 也就是点击量
    $article[commentnum] 评论总次数
$article[from] 文章来源
  1. <div class="h hm">
  2.                                 <h1 class="ph">$article[title] <!--{if $article['status'] == 1}-->({lang moderate_need})<!--{elseif $article['status'] == 2}-->({lang ignored})<!--{/if}--></h1>
  3.                                 <p class="xg1">
  4.                                         $article[dateline]<span class="pipe">|</span>
  5.                                         {lang view_publisher}: <a href="home.php?mod=space&uid=$article[uid]">$article[username]</a><span class="pipe">|</span>
  6.                                         {lang view_views}: <em id="_viewnum"><!--{if $article[viewnum] > 0}-->$article[viewnum]<!--{else}-->0<!--{/if}--></em><span class="pipe">|</span>
  7.                                         {lang view_comments}: <!--{if $article[commentnum] > 0}--><a href="$common_url" title="{lang view_all_comments}"><em id="_commentnum">$article[commentnum]</em></a><!--{else}-->0<!--{/if}-->
  8.                                         <!--{if $article[author]}--><span class="pipe">|</span>{lang view_author_original}: $article[author]<!--{/if}-->
  9.                                         <!--{if $article[from]}--><span class="pipe">|</span>{lang from}: <!--{if $article[fromurl]}--><a href="$article[fromurl]" target="_blank">$article[from]</a><!--{else}-->$article[from]<!--{/if}--><!--{/if}-->

  10.                                         <!--{if $_G['group']['allowmanagearticle'] || ($_G['group']['allowpostarticle'] && $article['uid'] == $_G['uid'] && (empty($_G['group']['allowpostarticlemod']) || $_G['group']['allowpostarticlemod'] && $article['status'] == 1)) || $categoryperm[$value['catid']]['allowmanage']}-->
  11.                                                 <span class="pipe">|</span><a href="portal.php?mod=portalcp&ac=article&op=edit&aid=$article[aid]">{lang edit}</a>
  12.                                                 <!--{if $article[status]>0 && ($_G['group']['allowmanagearticle'] || $categoryperm[$value['catid']]['allowmanage'])}-->
  13.                                                         <span class="pipe">|</span><a href="portal.php?mod=portalcp&ac=article&op=verify&aid=$article[aid]" id="article_verify_$article[aid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang moderate}</a>
  14.                                                 <!--{else}-->
  15.                                                         <span class="pipe">|</span><a href="portal.php?mod=portalcp&ac=article&op=delete&aid=$article[aid]" id="article_delete_$article[aid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang delete}</a>
  16.                                                 <!--{/if}-->
  17.                                         <!--{/if}-->
  18.                                         <!--{hook/view_article_subtitle}-->
  19.                                 </p>
  20.                         </div>
复制代码

下面这一块可以理解为如果有管理权限的话,会显示 编辑、审核、删除、按钮
  1. <!--{if $_G['group']['allowmanagearticle'] || ($_G['group']['allowpostarticle'] && $article['uid'] == $_G['uid'] && (empty($_G['group']['allowpostarticlemod']) || $_G['group']['allowpostarticlemod'] && $article['status'] == 1)) || $categoryperm[$value['catid']]['allowmanage']}-->
  2.                                                 <span class="pipe">|</span><a href="portal.php?mod=portalcp&ac=article&op=edit&aid=$article[aid]">{lang edit}</a>
  3.                                                 <!--{if $article[status]>0 && ($_G['group']['allowmanagearticle'] || $categoryperm[$value['catid']]['allowmanage'])}-->
  4.                                                         <span class="pipe">|</span><a href="portal.php?mod=portalcp&ac=article&op=verify&aid=$article[aid]" id="article_verify_$article[aid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang moderate}</a>
  5.                                                 <!--{else}-->
  6.                                                         <span class="pipe">|</span><a href="portal.php?mod=portalcp&ac=article&op=delete&aid=$article[aid]" id="article_delete_$article[aid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang delete}</a>
  7.                                                 <!--{/if}-->
  8.                                         <!--{/if}-->
复制代码

内容页显示摘要的地方
$article[summary] 内容页的摘要
{lang article_description}  (语言包)摘要
  1. <!--{if $article[summary] && empty($cat[notshowarticlesummay])}--><div class="s"><div><strong>{lang article_description}</strong>: $article[summary]</div><!--{hook/view_article_summary}--></div><!--{/if}-->
复制代码

$content[title] 内容页的标题
$content[content] 内容页内容

如果有分页就显示分页按钮
  1. <!--{if $multi}--><div class="ptw pbw cl">$multi</div><!--{/if}-->
复制代码

显示上一篇下一篇的地方
  1. <!--{if $article['preaid'] || $article['nextaid']}-->
  2.                         <div class="pren pbm cl">
  3.                                 <!--{if $article['prearticle']}--><em>{lang pre_article}<a href="{$article['prearticle']['url']}">{$article['prearticle']['title']}</a></em><!--{/if}-->
  4.                                 <!--{if $article['nextarticle']}--><em>{lang next_article}<a href="{$article['nextarticle']['url']}">{$article['nextarticle']['title']}</a></em><!--{/if}-->
  5.                         </div>
  6.                         <!--{/if}-->
复制代码

            {lang favorite}收藏
            {lang share}分享
            {lang invite}邀请
            {lang article_related}添加相关文章
            {lang moderate}审核
            {lang edit}编辑
            {lang delete}删除
            {lang blockdata_recommend}模块推送

如果在设置里把相关文章打开了,下面代码会有用
  1. <div id="related_article" class="bm">
  2.                         <div class="bm_h cl">
  3.                                 <h3>{lang view_related}</h3>
  4.                         </div>
  5.                         <div class="bm_c">
  6.                                 <ul class="xl xl2 cl" id="raid_div">
  7.                                 <!--{loop $article['related'] $raid $rvalue}-->
  8.                                         <input type="hidden" value="$raid" />
  9.                                         <li>• <a href="{$rvalue[uri]}">{$rvalue[title]}</a></li>
  10.                                 <!--{/loop}-->
  11.                                 </ul>
  12.                         </div>
  13.                 </div>
复制代码

如果在后台设置把允许评论打开会显示下面代码会有用
  1. <!--{if $article['allowcomment']==1}-->
  2.                         <!--{eval $data = &$article}-->
  3.                         <!--{subtemplate portal/portal_comment}-->
  4.                 <!--{/if}-->
复制代码

展示相关分类
  1. <!--{if $cat[others]}-->
  2.                 <div class="bm">
  3.                         <div class="bm_h cl">
  4.                                 <h2>{lang category_related}</h2>
  5.                         </div>
  6.                         <div class="bm_c">
  7.                                 <ul class="xl xl2 cl">
  8.                                         <!--{loop $cat[others] $value}-->
  9.                                         <li><a href="{echo getportalcategoryurl($value[catid])}">$value[catname]</a></li>
  10.                                         <!--{/loop}-->
  11.                                 </ul>
  12.                         </div>
  13.                 </div>
  14.                 <!--{/if}-->
复制代码
展示下级分类
  1. <!--{if $cat[subs]}-->
  2.                 <div class="bm">
  3.                         <div class="bm_h cl">
  4.                                 <h2>{lang sub_category}</h2>
  5.                         </div>
  6.                         <div class="bm_c">
  7.                                 <ul class="xl xl2 cl">
  8.                                 <!--{loop $cat[subs] $value}-->
  9.                                         <li><a href="{echo getportalcategoryurl($value[catid])}">$value[catname]</a></li>
  10.                                 <!--{/loop}-->
  11.                                 </ul>
  12.                         </div>
  13.                 </div>
  14.                 <!--{/if}-->
复制代码

下面这是关联连接,我也不知道干啥用
  1. <!--{if $_G['relatedlinks']}-->
  2.         <script type="text/javascript">
  3.                 var relatedlink = [];
  4.                 <!--{loop $_G['relatedlinks'] $key $link}-->
  5.                 relatedlink[$key] = {'sname':'$link[name]', 'surl':'$link[url]'};
  6.                 <!--{/loop}-->
  7.                 relatedlinks('article_content');
  8.         </script>
  9. <!--{/if}-->
复制代码

  1. <script type="text/javascript" src="{$_G[setting][jspath]}home.js?{VERHASH}"></script>
  2.                                 <div id="click_div">
  3.                                         <!--{template home/space_click}-->
  4.                                 </div>
复制代码



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|十三博客 ( 鲁ICP备2023000528号 )

GMT+8, 2026-6-1 16:13 , Processed in 0.108646 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表