How to use YT. CMS plug-in

web front end twenty-six thousand seven hundred and forty-one 13 years ago (2012-05-21)

The syntax of YTCMS 1.8 uses the statement in the form of angle brackets "<>". After upgrading to 2.0 plug-in unit The name is changed to "Content Management System", and the syntax is uniformly in the form of curly braces "{}". The following lists the YTCMS2.0 and YTCMS1.8 version label query manuals and YTCMS code tips.

zblog ASP 2.0-YTCMS Label Manual (full)

Call a single article with ID 5

 {YT: Article DataSource="GetArticleModel ('5 ')"} YTCMS code {/YT: Article}

5 site wide articles except the first one (parameter 1 cannot be 0)

 {YT: Article DataSource="GetArticleLimit (5,1)"} YTCMS code {/YT: Article}

5 articles with a classification ID of 1 after the first 3 articles (parameter 1 cannot be 0)

 {YT: Article DataSource="GetArticleCategoriesLimit (5,3, '1')"} YTCMS code {/YT: Article}

List of 5 Latest Articles

 {YT: Article DataSource="GetArticleRandomSortNew (5)"} YTCMS code {/YT: Article}

List of 5 random articles

 {YT: Article DataSource="GetArticleRandomSortRand (5)"} YTCMS code {/YT: Article}

Ranking of 5 comments this month

 {YT: Article DataSource="GetArticleRandomSortComMonth (5)"} YTCMS code {/YT: Article}

5 Comments ranking this year

 {YT: Article DataSource="GetArticleRandomSortComYear (5)"} YTCMS code {/YT: Article}

5 articles ranked this month

 {YT: Article DataSource="GetArticleRandomSortTopMonth (5)"} YTCMS code {/YT: Article}

5 articles ranked this year

 {YT: Article DataSource="GetArticleRandomSortTopYear (5)"} YTCMS code {/YT: Article}

5 top articles

 {YT: Article DataSource="GetArticleRandomSortTopHot (5)"} YTCMS code {/YT: Article}

5 articles with category ID 1

 {YT: Article DataSource="GetArticleCategories (5, '1')"} YTCMS code {/YT: Article}

5 random articles classified as 1

 {YT: Article DataSource="GetArticleCategoriesRandomSortRand (5, '1')"} YTCMS code {/YT: Article}

5 popular articles classified as 1

 {YT: Article DataSource="GetArticleCategoriesTophat (5,'1 ')"} YTCMS code {/YT: Article}

List of 5 articles with TagsID 1

 {YT: Article DataSource="GetArticleTag (5,0)"} YTCMS code {/YT: Article}

List of 5 articles with TAGSID 3 and classification ID 1

 {YT: Article DataSource="GetArticleCategoryTag (5,3, '1')"} YTCMS code {/YT: Article}

List of 5 top articles

 {YT: Article DataSource="GetArticleTop (5)"} YTCMS code {/YT: Article}

List of 5 top articles with category ID 1

 {YT: Article DataSource="GetArticleCategoryTop (5, '1')"} YTCMS code {/YT: Article}






When copying the following code, please change the braces in the code to English braces, otherwise the code may become invalid.

YTCMS 2.0 latest label manual (full)

Log call:

Log field information
number {$Article.ID}
jurisdiction {$Article.Level}
title {$Article.HtmlTitle}
abstract {$Article.HtmlIntro}
full text {$Article.HtmlContent}
time {$Article.PostTime}
Number of comments {$Article.Commnums}
Number of browses {$Article.Viewnums}
Number of references {$Article.Trackbacknums}
Reference link {$Article.TrackBack}
link {$Article.Url}

 

 

Classification field information
number {$Article.CateID}
name {$Categorys(Article.CateID).HtmlName}
S/N {$Categorys(Article.CateID).Order}
Number of articles {$Categorys(Article.CateID).Count}
link {$Categorys(Article.CateID).HtmlUrl}

 

Author field information
number {$Article.AuthorID}
name {$Users(Article.AuthorID).Name}
Grade {$ZVA_User_Level_Name(Users(Article.AuthorID).Level)}
Email {$Users(Article.AuthorID).Email}
Website link {$Users(Article.AuthorID).HomePage}
Number of articles {$Users(Article.AuthorID).Count}
link {$Users(Article.AuthorID).HtmlUrl}

 

Other field information
Blog comment RSS {$Article.WfwCommentRss}
Log Alias {$Article.StaticName}
TAGS {$Article.TagToName}
First TAG Summary {$Article.FirstTagIntro}


Comment call (comment on the data source information. This article takes 5 items as an example. You can change "5" to the corresponding number according to your own needs):

5 latest reply lists

 {YT: Comment DataSource="GetCommentComments (5)"} YTCMS code {/YT: Comment}

5 latest reply lists with category ID 1

 {YT: Comment DataSource="GetCommentCategoriesComments (5, '1')"} YTCMS code {/YT: Comment}

5 comment lists with article ID 1

 {YT: Comment DataSource="GetCommentArticleComments (5, '1')"} YTCMS code {/YT: Comment}

 

Comment field information
number { $Comment. ID}
S/N { $Comment. Count}
name { $Comment. Author}
website { $Comment. HomePage}
Email { $Comment. SafeEmail}
time { $Comment. PostTime}
content { $Comment. HtmlContent}
Author No { $Comment. AuthorID}
Primary contact { $Comment. FirstContact}
MD5 code of Email { $Comment. EmailMD5}


Tag call (tag data source information, this article takes 5 as examples, and can change "5" to the corresponding number according to your own needs):

5 tag lists

 {YT: Tag DataSource="GetTagLists (5)"} YTCMS code {/YT: Tag}

5 random tags

 {YT: Tag DataSource="GetTagListsRandomSortRand (5)"} YTCMS code {/YT: Tag}

 


Label field information
number { $Tag. ID}
name { $Tag. HtmlName}
abstract { $Tag. HtmlIntro}
Number of articles { $Tag. Count}
link { $Tag. HtmlUrl}
Encoded name { $Tag. EncodeName}



Common syntax skills of YTCMS 2.0

Call the first picture in a top article summary:

 {YT:Article DataSource="GetArticleTop(1)"} {$MiniTu_Build(article.title,article.intro,article.url)} {/YT:Article}

Call the first picture in the content of a top article:

 {YT:Article DataSource="GetArticleTop(1)"} {$MiniTu_Build(article.title,article.content,article.url)} {/YT:Article}

Call classification directory name:

 <! -- The first six YT call categories. If you want to call several, change the following 6 --> {for i=1 ubound(Categorys)} {if Categorys(i).ParentID = 0} <li class="linav"><a href="{$Categorys(i).Url}">{$Categorys(i).Name}</a></li> {/if} {if i=6}{eval exit for}{/if} {/next} <! -- YT call classification End -->

Take the first 80 words of the text and remove the HTML code

 <meta name="description" content="{eval set art = new TArticle}{if art. LoadInfoByID(<#article/id#>)}{$left(replace(TransferHTML(art.Content,"[nohtml]")," ",""),80)}{/if}{eval set art = nothing}" />

The summary text is limited to 100 words, and the remainder is shown with ellipsis:

 {eval set art = new TArticle} {if art. LoadInfoByID(<#article/id#>)} {$left(replace(TransferHTML(art.Content,"[nohtml]")," ",""),100)} {/if} {eval set art = nothing}... Or use the following code: {$left(replace(TransferHTML(Article.intro,"[nohtml]")," ",""),100)&"... "}

Specify the YTCMS code for the first three article styles:

 {eval i=0} {YT:Article....} {if i=0} This is the first style of the first article {/if} {if i=1} This is the second style of the second article {/if} {if i=2} This is the third style of the third article {/if} {if i>2} This is the Nth style of the Nth article {/if} {eval i = i + 1} {/YT:Article}

Call the small category list with the big category ID of 1:

 {eval aryCateInOrder=GetCategoryOrder()} {if isArray(aryCateInOrder)} {for i=lbound(aryCateInOrder)+1 ubound(aryCateInOrder)} {if Categorys(aryCateInOrder(i)).ParentID=1} <li class="cat-item cat-item-3"><a href="{$Categorys(aryCateInOrder(i)).Url}">{$Categorys(aryCateInOrder(i)).Name}</a></li> {/if} {/next} {/if}

Common date format:

 {$Year (Article. PostTime)&"Year"&Month (Article. PostTime)&"Month"&Day (Article. PostTime)} Year {$year (Article. PostTime)} Month {$month (Article. PostTime)} Day {$day (Article. PostTime)} Time {$hour (Article. PostTime)} Fen {$minute (Article. PostTime)} Seconds {$second (Article. PostTime)}

N random tags are displayed. If 5 tags are displayed, please change the following N to 5, or set N to<# TEMPLATE_INCLUDE_TAGSNUM #>for convenience in the background theme Modify in plug-in:

 {eval i=N} {if i>0} {YT:Tag DataSource="GetTagListsRandomSortRand(i)"} <a href="{$Tag.HtmlUrl}">{$Tag.HtmlName}</a> {/YT:Tag} {/if}

Call the subcategory and change the 0 in the code to your current classification ID:

 {if Categorys(aryCateInOrder(i)).ParentID=0}

ZBlog secondary drop-down menu code:

 <ul> {eval aryCateInOrder=GetCategoryOrder()}     {if isArray(aryCateInOrder)}     {for i=lbound(aryCateInOrder)+1 ubound(aryCateInOrder)}     {if Categorys(aryCateInOrder(i)).ParentID=0}           <li><a href="{$Categorys(aryCateInOrder(i)).Url}">{$Categorys(aryCateInOrder(i)).Name}</a>           <ul class="ul-subcates">     {for j=lbound(aryCateInOrder)+1 ubound(aryCateInOrder)}     {if Categorys(aryCateInOrder(j)).ParentID = Categorys(aryCateInOrder(i)).ID}             <li><a href="{$Categorys(aryCateInOrder(j)).Url}">{$Categorys(aryCateInOrder(j)).Name}</a></li>     {/if}     {/next}           </ul></li>     {/if}     {/next}     {/if} </ul>

Zblog2.0 enables articles published within 24 hours plus new Icon Method of:

 {YT:Article DataSource="GetArticleRandomSortNew(7)"} <li><span class="you">{$month (Article. PostTime)} Month {$day (Article. PostTime)} Day</span>[{$Categories (Article. CateID). HtmlName}]<a href="{$Article. Url}">{$Article. HtmlTitle}</a> {if (DATEDIFF ("h", Article. PostTime, now())<24)}<img src="/zb_users/THEME/Topic Name/STYLE/images/new. gif" border="0"/>{/if}</li> {/YT:Article}

{ If (DATEDIFF ("h", Article. PostTime, now())<24)} The 24 in this function represents articles within 24 hours, which can be changed to any number you want. Finally, the above style can be modified according to existing projects.

 


YTCMS 1.8 Common Syntax Examples

The format used by YT.CMS is:

 <YT: Type DataSource="Data Source"> Circulatory body </YT>


Types include:

explain

code

journal

Article

comment

Comment

label

Tag

custom

Cmd


Example 1:
In this example, the call type is log, and the call data source is the latest article, calling 10 entries

 <YT:Article DataSource="GetArticleRandomSortNew(10)"> <a href="<#article/url#>"><#article/title#></a> </YT>


Sample 1 Supported Built in Data Sources

explain

code

Parameters( Number type)

Latest articles

GetArticleRandomSortNew

(Number of lines)

Random articles

GetArticleRandomSortRand

(Number of lines)

Ranking of comments this month

GetArticleRandomSortComMonth

(Number of lines)

Review ranking this year

GetArticleRandomSortComYear

(Number of lines)

Monthly Best Sellers

GetArticleRandomSortTopMonth

(Number of lines)

Ranking this year

GetArticleRandomSortTopYear

(Number of lines)

Hot article ranking

GetArticleRandomSortTopHot

(Number of lines)

List of classified articles

GetArticleCategorys

(Number of lines, article category)

List of classified popular articles

GetArticleCategorysTophot

(Number of lines, article category)


Example 1 Labels supported in the loop

explain

code

number

<#article/id#>

link

<#article/url#>

jurisdiction

<#article/level#>

title

<#article/title#>

alias

<#article/staticname#>

abstract

<#article/intro#>

full text

<#article/content#>

time

<#article/posttime#>

Number of comments

<#article/commnums#>

Number of browses

<#article/viewnums#>

Number of references

<#article/trackbacknums#>

Reference link

<#article/trackback_url#>

Comment RSS

<#article/commentrss#>

tags

<#article/tagtoname#>

The first tag summary

<#article/firsttagintro#>

Full text first picture

<#article/picture#>


Example 2:
In this example, the call type is comment, and the call data source is the latest reply list. There are 10 calls, and the call category is 1. The article type can be obtained in the background classification

 <YT:Comment DataSource="GetCommentCategorysComments(10,1)"> Comments:< a href="<#article/comment/commenturl#>"><#article/title#></a> </YT>


Sample 2 Supported Built in Data Sources

explain

code

Parameters( Number type)

Latest reply list

GetCommentComments

(Number of lines)

Sort the latest reply list

GetCommentCategorysComments

(Number of lines, article category)


Example 2 Supported tags in loop body

explain

code

number

<#article/comment/id#>

S/N

<#article/comment/count#>

name

<#article/comment/name#>

website

<#article/comment/url#>

Email

<#article/comment/email#>

time

<#article/comment/posttimei#>

content

<#article/comment/content#>

Author No

<#article/comment/authorid#>

Primary contact

<#article/comment/firstcontact#>

MD5 code of Email

<#article/comment/emailmd5#>

Encoded URL link

<#article/comment/urlencoder#>

Article Title

<#article/title#>

link

<#article/comment/commenturl#>

 

Example 3:
In this example, the call type is label, and the call data source is label list. Eight calls are made

 <YT:Tag DataSource="GetTagLists(8)"> Keyword call:< a href="<#article/tag/url#>"><#article/tag/name#></a> </YT>


Sample 3 Supported Built in Data Sources

explain

code

Parameters( Number type)

Label List

GetTagLists

(Number of lines)


Example 3 Labels supported in the loop

explain

code

number

<#article/tag/id#>

name

<#article/tag/name#>

abstract

<#article/tag/intro#>

Number of articles

<#article/tag/count#>

link

<#article/tag/url#>

Encoded name

<#article/tag/encodename#>

 

Call model label:

<# article/model/field name #>

If the model field is title, the call label is:<# article/model/title#>

 

Call the specified classification:

 <YT: Cmd DataSource="SELECT 1">//The number 1 is the number of call classifications, which does not need to be modified Category link:<# Eval/Categories (1). HtmlUrl #>//Change the 1 in brackets to the category ID Classification name:<# Eval/Categories (1). HtmlName #>//Change the 1 in brackets to the classification ID Classification alias:<# Eval/Categories (1). Staticname #>//Change the 1 in parentheses to the classification ID </YT>

 

Call to specify classification Next N articles:

 <YT:Article DataSource="GetArticleCategorysLimit(5,3,'1')"> The 5 in the bracket refers to the call of 5 articles. The 3 in the bracket is the index value of classified articles, that is, ignore the first three articles and call from the fourth article; Fill in N if calling from the Nth article; The parameter cannot be 0. The 1 in the bracket is the classification ID. Please check the background of zblog&ldquo; Classification Management&rdquo; ID number before classification in. </YT>

 

Call to specify label Next N articles:

 <YT:Article DataSource="GetArticleTag(5,1)"> The 5 in the bracket refers to the call of 5 articles. The 1 in the bracket is the tag with ID 1. To query the tag ID, please check the background of zblog&ldquo; Classification Management&rdquo; ID number before Tags in. </YT>

 

call Whole station roof article:

 <YT:Article DataSource="GetArticleTop(3)"> This code enables YT to call the first three top articles of the whole site. </YT>

 

call Classified topping article:

 <YT:Article DataSource="GetArticleCategoryTop(10,'1')"> This code enables YT to call the top 10 articles with a classification ID of 1. </YT>

 

call one-shot article:

 <YT:Article DataSource="GetArticleModel('1')"> This code implements the article whose YT call ID is 1. If the homepage of the enterprise station calls our module, you need to call the ID of our article. </YT>

 

Controls the number of output text displayed:

 <YT:Article DataSource=" GetArticleCategorysLimit (5,3,'1')"> Note: The number of displayed article titles is controlled by {left: N}, and N is the number of characters output. If the title is limited to 10 characters, it is: {left:10}。 <li><a href="<#article/url#>" target="_blank"><#article/title{left:10}#></a></li> </YT>

 

When the tag page and message page call article links, titles, summaries, and home images are invalid, please use the following tags to call.

 Article Title:<# eval/row(2)#> Abstract:<# eval/row(3)#> Article link:<# eval/row(10)#> First picture of the article:<# eval/row(11)#>

 

Make the classification display on the navigation specify the number, otherwise it will not be displayed. Note: It cannot be used in the file under the include folder, otherwise it will be invalid. This method will easily cause an error that the subscript of the new category is out of range and disable YT CMS plug-in is easy to cause data clearing. Please use it with caution.

 <YT:Cmd DataSource="select top 6 * from blog_Category order by cate_Order asc"> <li><a href="<#eval/Categorys(DataSource(0,i)).HtmlUrl#>"><#field/cate_Name#></a></li> The number 6 is the number of call classifications. If the number exceeds 6 classifications, it will not be displayed. <# eval/Categories (DataSource (0, i)). HtmlUrl #>is a classified link <# field/cate_Name #>is the name of the classification <# field/cate_Intro #>is a classified alias </YT>

 

Using YT CMS calls all articles of a user

 <YT: Cmd DataSource="select * from blog_Article WHERE log_AuthorID=author ID order by log_PostTime asc"> <li><#field/log_Title#></li> </YT>