Provide zblog template_zblog them_wordpress template download and customization

Reprint: Collection of tips for using the YTCMS plug-in of zblog

Tianxing Studio 2014-03-20 13:39 course eleven thousand and forty-seven 0 Comments


This article is reproduced from "toyean", original address: Click to enter , I think it is very useful. I gave 32 likes and reprinted them for a rainy day.

Log call

Log data source information (this article takes 5 articles as an example, and you can change "5" to the corresponding number of articles according to your own needs)
Call the 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="GetArticleCategorysLimit (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="GetArticleCategorysRandomSortRand (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}

 

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 data source information (this article takes 5 items as an example, and 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="GetCommentCategorysComments (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}

Label call

Label data source information (this article takes 5 as examples, and you 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 calls are classified. 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 describe

<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)}

Hour { $hour(Article.PostTime)}

branch { $minute(Article.PostTime)}

second { $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 modification in background theme 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 can add new icons to articles published within 24 hours:

{ YT:Article DataSource="GetArticleRandomSortNew(7)"}
<li><span class="you"> { $month (Article. PostTime)} { $day (Article. PostTime)} day</span>[ { $Categorys(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}

Note that the red part is the NEW image address, which you can modify. In addition, { 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 parentheses to the classification ID

Classification name:<# eval/Categories (1) HtmlName #>//Change 1 in parentheses to classification ID

Category alias:<# eval/Categories (1) Staticname #>//Change 1 in parentheses to classification ID

</YT>

 

Call to specify classification Next N articles:

<YT:Article DataSource="GetArticleCategorysLimit( five , three ,' one ')">

The 5 in the bracket is the call five Articles.

In parentheses three 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

In parentheses one For classification ID, please check Zblog background &ldquo; Classification Management&rdquo; ID number before classification in.

</YT>

 

Call to specify label Next N articles:

<YT:Article DataSource="GetArticleTag( five , one )">

In parentheses five Call 5 articles for.

In parentheses one It is a tag with ID 1. To query the tag ID, please check the background of the zblog&ldquo; Classification Management&rdquo; ID number before Tags in.

</YT>

 

call Whole station roof article:

<YT:Article DataSource="GetArticleTop( three )">

This code implements the front of YT calling the whole station three Top articles.

</YT>

 

call Classified topping article:

<YT:Article DataSource="GetArticleCategoryTop( ten ,' one ')">

This code realizes that the YT call classification ID is one Before ten Top articles.

</YT>

 

call one-shot article:

<YT:Article DataSource="GetArticleModel(' one ')">

This code realizes that the YT call ID is one 's article. 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}, where N is the number of characters output. If the title is controlled within ten Characters, then: {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) #>

The 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>

 

Use the Cmd mode of YT

The red part is replaced by the user ID,

The blue part is the field name. If you need other fields, you can query the database to replace them.


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation
  • Sign in
  • Registered account Forgot your password?
  • register
  • Already have an account? Direct login Forgot your password?
  • Social account login