Datalife Engine · 2020年02月21号 0

Datalife Engine 用户指南 » 模板基本主要标签和页面显示

{banner_sponsor-right}模板文件main.tpl中页面的基本布局该文件首先加载引擎,并将其连接到任何其他引擎组件,这是加载所有模块并显示结果的主文件。{AJAX},{info},{content},{custom}这些标记用于正确的新闻结论。

标签{AJAX}获取并打印引擎正常运行所必需的一组javascript,尤其是AJAX技术以及9.x版本中的jquery。建议放置在模板的开头,标记为<body>
标记{info}显示和处理引擎信息以及有关所执行操作的错误(例如“登录失败,密码错误”或“所有字段”等)。建议将此标签放在标签{content}之前
标签{content},用于通用引擎以及引擎中文章和其他内置模块的内容和显示
标签{tags}用于标签云列表(新闻中的特定关键字和标签云)
标签[sort] {sort} [/ sort]用于选择新闻分类页面,该页面允许按不同顺序查看和分类。

标签{custom}用于以自定义格式显示新闻或项目,该自定义格式具有以下选项:

{custom id =“ 1,2,5-8” category =“ 2,3,5-8” author =“ x” days =“ x” template =“ custom” aviable =“ global” from =“ 0” limit =“ 10” fixed =“ yes” order =“日期” cache =“ yes”}

选件

id是您要打印的新闻的ID列表,以逗号分隔,没有空格。您还可以使用破折号指定一系列ID新闻。1,4-8,11示例显示新闻ID 1,新闻ID 4至8,以及ID11。
– category是要显示新闻的类别ID的列表,以逗号(,)分隔,且不允许使用空格。


– 模板是将用于显示在这种情况下,消息将custom.tpl,如果您使用的是网站上多个模板,这个文件必须在每个模板创建的模板文件。该模板使用类似于短消息的标签。


– 可行的选项是指定当您在网站内浏览时将显示哪个部分。可用选项如下:


  • 全球-整个网站的所有部分
  • main-仅在主页中
  • 日期-查看某些日期的新闻时
  • 猫-查看类别时
  • showfull-查看完整新闻时
  • 搜索-查看搜索和搜索结果时
  • userinfo-查看用户信息和个人资料时
  • 注册-在注册页面中显示
  • 统计-查看网站统计信息时
  • 下午-查看个人消息(PM)
  • 反馈-使用反馈/联系表格时
  • 收藏夹-查看书签/收藏夹页面时
  • newposts-查看新帖子时
  • addnews-向网站添加新闻时
  • 最新评论-查看最新评论时
  • 静态-查看静态页面时
  • 目录-查看页面目录时
  • alltags-查看标签云页面时
  • 标签-查看标签云中的新闻时

您可以使用“ |”组合多个部分 符号,例如aviable =“ userinfo | register | main”将在查看用户个人资料,站点注册和主页时显示自定义页面。(选项不应在节名称之间使用任何空格)


– 用于物品的特定数目来启动或开始与(0,从第一条开始)


– 限制是指定要显示多少个项目或文章


– 为了:新闻的排序顺序可采取下列值
– 日期按日期排序的消息-
– 评级 -按排名排序新闻
– 通过查看排序新闻-
– 评论通过注释类别新闻-
– 标题按标题排序新闻-
– 兰特 -随机排序新闻


– 作者新闻,如果指定此参数,则仅显示特定用户发布的新闻。仅使用一位作者。例如,标签{custom author =“ admin” limit =“ 5”}显示5个用户“ admin”发布的新闻。


– 指定的时间段,其中X是天的出版物的的量,输出的数目。例如,标签{custom days =“ 2” limit =“ 5”}显示最近2天的5条新闻。


– 缓存(仅接受值yesno-是将输出设置为缓存还是建议不缓存以减少负载。


– 固定值采用是或否或仅设置值来考虑出版物的派生,新闻是否已提交。如果指定值,则将仅显示记录的新闻。


– 注意:此标记的所有参数都是可选的,您需要指定任何选项中的至少一个,所有其他选项(如果未指定)将从脚本的常规设置中获取。例如:


{custom id =“ 1,2” order =“ date”} -显示ID为1和2的新闻,并按日期排序
{custom category =“ 2,7” from =“ 5” cache =“ yes”} -显示来自类别2和7的新闻,而新闻数量将从脚本配置中获取,并且将在5个满足此条件的新闻之后进行采样
{custom order =“ date” from =“ 9” limit =“ 5 “} -5从最新消息开始显示最新消息

注意:您必须指定所有必需的参数,并且必须遵守订单
注意:请记住,每次使用{custom}标记都会对数据库造成额外的负担,因为这是对同一新闻或文章的额外显示,因此,如果要节省资源,请明智地使用它。
标记[aviable = section] Text [/ aviable],如果可以看到并显示网站的指定部分,则显示标记中结束的文本:
-标记可用选项类似于以上针对{custom}列出的部分可用标签。
-例如:
[aviable = userinfo | register | main 文本[/ aviable]
当查看用户个人资料时,在注册期间和在主页中,这将显示标记内的文本。


附加标签:您还可以指定与aviable]标签完全相反的标签[not-aviable = userinfo | register | main 文本[/ not-aviable],并显示除列出部分以外的所有地方可用的文本。

标签[category = X] Text [/ category],如果指定的类别,则可以看到标签中包含的文本。
-标签使用类别ID并允许指定多个类别:
[category = 1,2,3] 文本[/ category]
如果用户浏览类别ID等于1的类别,它将显示标签中包含的文本或2或3。


附加标签:还可以指定标签[未类别= 1,2,3] 文本[/不类别]这是完全相反的标签类别和到处显示文本除了这些指定的类别。

标签[group = X] Text [/ group],如果用户属于指定的用户组成员,则显示在标签中结束的文本:
-标签使用组ID并允许指定多个组
[group = 1,2,3 ] 文本[/ group]
如果用户是管理员,主持人或编辑者,则将显示标记内的文本。


附加标签:还可以指定标签[未组= 1,2,3] 文本[/不团]这是完全相反的标签用于除了所列基团的所有组和显示文本。

[page-count = 1,2,3]文本[/ page-count]
如果用户在新闻导航中位于特定页面编号处,则将显示其中包含的文本,而不管该站点的哪个部分是1,2,3页码进行浏览。该标签允许灵活地自定义特定页面上某些信息的输出以及有关块和广告的有用信息。您可以将此标记与网站的其他部分以及房屋类别结合使用。例如,标记 [aviable = cat] [category = 1] [page-count = 1] 文本 [/ page-count] [/ category] ​​[/ aviable]的组合 仅当用户正在查看具有id1的类别的第一页并且看起来简短的新闻并移至该类别的另一页时,该文本才会显示。
[not-page-count = 1,2,3]文本[/ not-page-count]
在标签之外的任何页码上显示在标签中发布的文本。
{banner_ name }此标签用于显示此网站上的广告信息。标语名称是在Admin CP中的广告模块中生成的。
[banner_name]文本[/ banner_name]如果在网页上显示了指定的标题,则显示标记中包含的文本。
{inform_ name }此标签用于显示RSS通知程序和其他站点的新闻。名称和在Admin CP中设置的该标签的所有设置。
[static =页面名称] 文本[/ static] 如果访问者查看具有指定名称的静态页面,则显示标记中包含的文本。
[非静态=页面名称]如果访问者查看具有指定名称的静态页面以外的其他静态页面,则文本[/非静态]将显示标记中包含的文本。
您还可以使用标签{include file =“ my_block.tpl”}将一个主题文件添加到另一文件中。此标签将文件附加到模板my_block.tpl。如果您的网站具有复杂的布局和带有多个标签的样式,则该标签旨在易于分别编辑或修改内容。

模板英文原文:

Basic Main tag and page displays

The basic layout of your page in the template file main.tpl This file loads the engine in the first place and connect it to any other engine components, which is the main file to load all modules and display results. {AJAX}, {info}, {content}, {custom} these tags are used for the correct News conclusions.
 Tag {AJAX} acquires and prints the group of javascript necessary for normal functioning of the engine in general and AJAX technology in particular as well as jquery in 9.x version. Recommended to be placed at the beginning of the template after the tag <body>
 Tag {info} displays and handling the engine information and errors on the actions performed (such as “Login failed, bad password” or “All fields” etc.). This tag is recommended to be placed before the tag {content}
 Tag {content}, is used for the general engine and content and display of articles and other built-in modules in the engine
 Tag {tags}, is used for the list of the tag cloud (specific keywords and tag clouds in the news)
 Tag [sort]{sort}[/sort], is used for selection of news sorts page which allow to be viewed and sorted in different orders.

 Tag {custom}, is used to display the news or items in a custom format which has the following options:

{custom id=”1,2,5-8″ category=”2,3,5-8″ author=”x” days=”x” template=”custom” aviable=”global” from=”0″ limit=”10″ fixed=”yes” order=”date” cache=”yes”}

Options

id is the ID list of news that you want to print, separated by a comma with no spaces. You can also specify a range of ID news using dashes. 1,4-8,11 example displays news ID 1, news id 4 to 8, as well as ID 11.
– category is a list of category ID to be displayed news, separated by comma (,) and no spaces allowed.


– template is the template file that will be used to display the news in this case it will custom.tpl, if you are using multiple templates on the site, this file must be created in each template. This template uses tags similar to the short news.


– aviable option is to specify which section will be displayed when you browse inside your website. The available options as following:


  • global – all sections in the entire website
  • main  – only in the main page
  • date  – when viewing news for some dates
  • cat  – when viewing category
  • showfull – when viewing the full news
  • search – when viewing search and search results
  • userinfo  – when viewing user info and profile
  • register – show in the registration page
  • stats – when viewing site statistics
  • pm – when viewing personal message (PM)
  • feedback – when using feedback/contact form
  • favorites – when viewing bookmarks/favorite page
  • newposts – when viewing the new posts
  • addnews – when adding news to the site
  • lastcomments – when viewing the most recent comments
  • static – when viewing static pages
  • catalog – when viewing the page directory
  • alltags – when viewing the tag cloud page
  • tags – when viewing the news from the tag cloud

You can combine the multiple sections by using the “|” symbol, for example aviable=”userinfo|register|main” will show custom page when view user profile, site registration and main homepage. (the options should not use any spaces between section names)


– from is used for specific number of article to start or begin with (0 is started from the first article)


– limit is to specify how many items or articles will be displayed


– order the sort order of news can take the following values:
– date – sort news by date
– rating – sort news by rating
– reads – Sorting News by Views
– comments – sort news by comments
– title – sort news by title
– rand – sort news randomly


– author news, when specifying this parameter will be displayed only news posted by specific user. Use only one author. For example, the tag {custom author=”admin” limit=”5″} displays 5 News posted by user “admin”.


– days specifies the time period, where x is the number of days for which the output of publication. For example, the tag {custom days=”2″ limit=”5″} displays 5 News for the last 2 days.


– cache (only accept the value yes or no – is to sets the output to cache or not cache is recommended to reduce the load.


– fixed takes values yes or no or only-sets to consider whether the derivation of publications, that news has been committed or not. If the specified value only, it will be displayed only recorded news.


– Attention: All the parameters of this tag is optional, you need to specify at least one of any option, all other options if they are not specified, will be taken from the general settings of the script. for example:


{custom id=”1,2″ order=”date”} – displays news with ID 1 and 2, and sort them by date
{custom category=”2,7″ from=”5″ cache=”yes”} – displays news from categories 2 and 7, while the number of news will be taken from the script configuration, and sampling will be carried out after 5 news that meets this condition
{custom order=”date” from=”9″ limit=”5″} – 5 displays the latest news, starting with the tenth news

Caution: You must specify all the parameters required and must comply with the order
Note: remember that each use of the {custom} tag creates an additional load on the database, because is an additional display of the same news or article, so use it wisely if you want to save on resources.
 Tag [aviable=section]Text[/aviable], displays the text concluded in tag if the specified section(s) of the site can be seen and displayed:
– The tag available options are similar available to sections listed above for {custom} tag.
– for example:
[aviable=userinfo|register|main] Text[/aviable]
This will display the text enclosed within tags when viewing a user profile, during registration and in the main page.


Additional Tag: you can also specify the tag [not-aviable=userinfo|register|main] Text [/not-aviable] which is completely opposite to the “aviable” tag and display text available everywhere except the listed sections.

 Tag [category=X]Text[/category], displays a text enclosed in tags can be seen if the specified category.
– Tag uses a category ID and allows the multiple categories to be specified:
[category=1,2,3] Text [/category]
This will display the text enclosed in tags, if a user browses category whatever category ID is equal to 1 or 2 or 3.


Additional Tag: you can also specify the tag [not-category=1,2,3] Text [/not-category] which is completely opposite to the tag category and display the text everywhere except for these specified categories.

 Tag [group=X]Text[/group], displays the text concluded in tag if the user belongs to a specified usergroup members:
– Tag uses a group ID and allows the multiple groups to be specified
[group=1,2,3] Text [/group]
This will display the text enclosed in tags, if the user is an administrator, Moderator or editor.


Additional Tag: you can also specify the tag [not-group=1,2,3] Text [/not-group] which is completely opposite to the tag group and display text for all groups except the listed groups.

 [page-count=1,2,3] text [/page-count]
Will display the text enclosed in them if the user is at a certain page number in the navigation on the news, regardless of the section of the site where it is 1,2,3 page numbers to navigate. This tag allows flexibly customize the output of certain information on a particular page and useful information for the blocks and advertising. You can use this tag in conjunction with other sections of the site and the home’s category.For example, a combination of tags [aviable=cat][category=1][page-count=1] text [/page-count][/category][/aviable] will withdraw the text only if the user is viewing the first page of the category with id1, and while it looks brief news, and move to another page in this category, this text will not see it.
 [not-page-count=1,2,3] text [/not-page-count]
Displays the text published in the tags on any page numbers other than those of the tag.
 {banner_name} this tag is to display the advertising information on this site. The name of banner is generated in Advertising Module within Admin CP.
[banner_name] text [/banner_name] displays the text enclosed in tag, if the specified banner is displayed on a web page.
 {inform_name} this tag is to display the RSS informers and news from other sites. Name and all the settings for this tag set in Admin CP.
 [static=Page Name] Text [/static] display the text enclosed in tags, if a visitor views a static page with the specified name.
 [not-static=Page Name] Text [/not-static] will display the text enclosed in tags, if the visitor view the other static page than static page with the specified name.
You can also add one theme files to another file, using the tag {include file=”my_block.tpl”} This tag attaches the file to the template my_block.tpl. The tag is intended easy to edit or modify the content separately if your site have the complex layout and styles with multiple tags..