Latest destoon template tags

Source: Internet
Author: User
Tags add time sorts

1. Global tag

Website name: {$ dt [sitename]}
Website address: {dt_path}
Website Logo: {if $ module [$ moduleid] [logo]} {dt_skin} image/logo_?$leid=.gif {elseif $ dt [logo]} {$ dt [logo]} {else} {dt_skin} Image /logo.gif {/if}
Copyright: {$ dt [copyright]}
Style path: {dt_path}
Customer Service Hotline: {$ dt [Telephone]}
ICP filing No: {if $ dt [icpno]} <a href = "http://www.miibeian.gov.cn" target = "_ blank" >{$ dt [icpno]} </a> else {/if}
VIP member name: {VIP}
Real currency name: {$ dt [money_name]}
Real currency unit: {$ dt [money_unit]}
Virtual Point name: {$ dt [credit_name]}
Virtual credit unit: {$ dt [credit_unit]}

Title (website title): {$ seo_title}
META keywords: {$ head_keywords}
Meta description (webpage description): {$ head_description}

2. Connection address
Default connection between modules:
Member: {$ module [2] [linkurl]}
Supply: {$ module [5] [linkurl]}
Purchase: {$ module [6] [linkurl]}
Quote: {$ module [7] [linkurl]}
Company: {$ module [4] [linkurl]}
Exhibition: {$ module [8] [linkurl]}
Information: {$ module [21] [linkurl]}
Investment Attraction: {$ module [22] [linkurl]}
Brand: {$ module [13] [linkurl]}
Talent: {$ module [9] [linkurl]}
{$ Module [10] [linkurl]}
Topic: {$ module [11] [linkurl]}
Gallery: {$ module [12] [linkurl]}
Video: {$ module [14] [linkurl]}
Download: {$ module [15] [linkurl]}

Release information: {$ module [2] [linkurl]} {$ dt [file_my]}
Enterprise stores: {$ module [2] [linkurl]} home. php
View insite Email: {$ module [2] [linkurl]} message. php
Manage trading transactions: {$ module [2] [linkurl]} trade. php
Improved Enterprise Information: {$ module [2] [linkurl]} edit. php? Tab = 2

Registration: {$ mod [linkurl]} {$ dt [file_register]}
Login: {$ module [2] [linkurl]} {$ dt [file_login]}
Retrieve password: {$ mod [linkurl]} Send. php
VIP page: {$ module [2] [linkurl]} grade. php
WAP browsing: {If extend_setting ('wap _ enabled')} <a href = "{extendurl ('wap ')}"> WAP browsing </a> {/if}
RSS subscription: {If extend_setting ('feed _ enabled')} | <a href = "{extendurl ('feed')}"> RSS subscription </a> {/if}

Market Express: {$ module [7] [linkurl]} {rewrite ('price. php? Product = all ')}
Enterprise news: {$ module [4] [linkurl]} {rewrite ('news. php? More = 1 ')}
Announcement: {extendurl ('announce ')}
Promotion: {extendurl ('spread ')}
Advertisement: {extendurl ('ad ')}
Link: {extendurl ('link ')}
Link: {extendurl ('link')} {rewrite ('index. php? Action = reg ')}
Message book: {extendurl ('guestbook ')}
Vote: {extendurl ('Vote ')}

3. Homepage call

Navigation menu:
<Ul>
<Li {if $ moduleid <4} class = "menuon" {/if}> <a href = "{dt_path}"> <span> homepage </span> </> </LI>
{Loop $ module $ m}
{If $ M [ismenu]}
<Li {if $ M [moduleid] ==$ moduleid} class = "menuon" {/if}> <a href = "{$ M [linkurl]}" {if $ M [isblank]} target = "_ blank" {/if}> <span {if $ M [style]} style = "color: {$ M [style]}; "{/if} >{$ M [name]} </span> </a> </LI>
{/If}
{/Loop}
</Ul>

Call the logon module:
{If $ dt [page_login]}
{Template 'user', 'chip '}
{/If}

Call classification module:
{PHP $ mid = 5 ;}
{Template 'catalog ', 'chip '}

4. Data calling of each module

Supply:

Latest supply information:
1. <! -- {Tag ("moduleid = 5 & condition = status = 3 & length = 34 & condition = status = 3 & pagesize = 5 & Order = addtime DESC & template = List-trade" )} -->

2. <! -- {PHP $ tags = tag ("moduleid = 5 & condition = status = 3 & length = 34 & condition = status = 3 & pagesize = 5 & Order = addtime DESC & template = null ");} -->
{Loop $ tags $ K $ t}
<Li> <SPAN class = "f_r"> [{area_pos ($ t [areaid], '/', 1)}] </span> <a href = "{$ t [linkurl]}" target = "_ blank" Title = "{$ t [alt]}" >{$ T [Title ]} </a> </LI>
{/Loop}

In terms of tag calling, website administrators should have some knowledge about HTML + CSS and have a preliminary understanding of PHP + MySQL.
The calling process actually reads the number of data records from the data table according to the calling conditions, sorts the data in order, and outputs the data through the layout of the tag template.
Function prototype tag ($ parameter, $ expires = 0) $ parameter indicates the string passed to the tag function. The system automatically converts it to multiple variables, for example, passing table = destoon & pagesize = 10, the system returns $ table = 'deston'; $ pagesize = 10;
Two variables $ expires indicate cache expiration time> 0 cache $ expires seconds; 0 & ndash; default system time;-1 & ndash; no cache;-2 & ndash; cache SQL; in general, keep the default value.
The variable $ tags saves the data called by the tag as an array and can be displayed through loop syntax traversal.
$ Pages: saves the data paging code, which is only valid when paging is called. $
Path of the module. Title of common fields; linkurl link; catid category ID; Introduce introduction; addtime addition time;
Common Function dsubstr ($ string, $ length, $ suffix = ") truncate the string $ string to $ length, append the string $ suffix (for example ..)
Set_style ($ string, $ style = ", $ tag = 'span ') Place the string $ string in the $ taghtml tag and set the style to $ style linkurl ($ linkurl, $ absurl = 0) fix the relative path $ linkurl to an absolute path (to prevent Link errors)
Date ($ format, $ timestamp) converts timestamp $ timestamp to $ format (for example, Y-m-d) Format
The tag template is saved in the./template/default/Tag/directory. We recommend that you do not delete or modify the built-in template. We recommend that you create and apply the template based on the built-in template.
Category: destoon tag call
Comments (0)
Destoon display region posted by jinpeng998 on Monday, 12 August 1, 2010
Display region:
The required function is include/module. func. php/get_mainarea ($ areaid, $ area );
PHP page: $ area = cache_read ('area. php'); // read cached files
Static Page call: <Table width = "100%" cellpadding = "3 & prime;>
{PHP $ mainarea = get_mainarea (0, $ area )}
{Loop $ mainarea $ K $ v}
{If $ K % 2 = 0} <tr >{/ if}
<TD> <a href = "{$ mod [linkurl]} {rewrite ('search. php? Areaid = '. $ V ['areaid']. '& typeid ='. $ typeid)} ">{$ V [areaname]} </a> </TD>
{If $ K % 2 = 1} </tr> {/if}
{/Loop}
</Table>
Another method is to directly call the tag, which is good. Retrieve the information directly from the destoon database.
Category: destoon display Region
Comments (0)
Destoon learning label call posted by jinpeng998 on Sunday, 11 Aug, 2010
Link: $ t [linkurl]
Supply Module more: $ module [--- module ID ---] [linkurl] module ID put the mouse over the link below, moduleid =? You can see
Image path: $ t;
More information modules: {$ mod [linkurl]} {$ C [linkurl]}
Check which field the name belongs? -- Right-click & ndash; and choose "view name"> "eg name = post [brand]" as the "brand" field.
The homepage of each module is index.htm in its template/folder.
Pagesize = ". $ mod [pagesize]." can be written as pagesize = 4. Remember not to add single or double quotation marks.
Call page:
Tab:
<! & Ndash; {tag ("moduleid = $ moduleid & C = 3
$ Dtype & catid = $ catid & pagesize = 4 & page = $ page & showpage = 1 & datetype = 5 & Order = ". $ mod [order]. "& template = List-items")} & ndash;>
Pagination: {if $ showpage & $ pages} <Div class = "pages" >{$ pages} </Div >{/ if}
Call type:
Main Method
$ Maincat = get_maincat (0, $ category );
Get_maincat (0, $ category) -- In include/global_func.php
$ Childcat = get_maincat (0, $ category, 1);-calls the level 1 directory under the super Column
0 indicates that the root directory 1 indicates that the level of the directory with Level 1 is set to 1 by default.
If 0 is changed to 3, The catid is 3.
Note: $ Category = cache_read ('category-'. $ moduleid.'. php'); this file is on the common. Inc. PHP page of the module page.
Call
{Loop $ maincat $ K $ v}
{If $ K % $ dt [page_subcat] = 0} <tr >{/ if}
<TD>
<A href = "{$ mod [linkurl]} {$ V [linkurl]}"> {set_style ($ V [catname], $ V [style])} </a> <span >{$ items [$ V [catid]}) </span>
</TD>
{If $ K % $ dt [page_subcat] = ($ dt [page_subcat]-1)} </TR >{/ if}
{/Loop}
Note:
The PHP page in the module folder must contain $ maincat
$ Mod [linkurl] is the module and Homepage Address. $ V [linkurl] adds a catid to the list page under it.
Category: destoon tag call
Comments (0)
Very good destoon B2B label call manual posted by jinpeng998 on Sunday, 11 August 15, 2010
Destoon B2B tag call manual what is tag call?
Tag calling reads the number of pagesize data records from the table based on the condition of the call, and sorts the data by order, finally, data is output through the layout of the tag template.
It can be seen that the tag operation is divided into two parts: Reading data and displaying data.
Tag function prototype
The tag function is stored in include/Tag. func. php.
Tag ($ parameter, $ expires = 0)
$ Parameter indicates the string passed to the tag function. The system automatically converts the string to multiple variables.
For example, pass table = destoon & pagesize = 10 & Hello = World
The system is equivalent
$ Table = 'deston ';
$ Pagesize = 10;
$ Hello = 'World ';
Three Variables
$ Expires indicates the tag cache expiration time
> 0 cache $ expires seconds; 0 & ndash; default tag cache time of the system;-1 & ndash; no cache;-2 & ndash; cache SQL results;
In general, it is left empty by default.
Data Reading Process
For example, the following labels:
<! & Ndash; {tag ("Table = tables & C = 3 & Order = addtime DESC & pagesize = 10 & prime;)} & ndash;>
Is converted to the following SQL statement:
Select *
From destoon_detail
Where status = 3
Order by addtime DESC
Limit 0, 10
The read data is saved in the $ tags array.
Data Display Process
1. Display by TAG Template
Pass & template = ABC to the tag function, for example:
<! & Ndash; {tag ("Table =... & Template = ABC ")} & ndash;>
The default tag template is saved in the template directory/Tag/directory. For example, & template = ABC will call the template directory/Tag/abc.htm template to display data.
If the tag template is stored in another directory, for example, def, & dir = def & template = ABC is passed. The system calls the template directory/DEF/abc.htm template.
2. Loop data directly in the template
<! & Ndash; {PHP $ tags = tag ("Table =... & Template = NULL ") ;}& ndash;>
In this way, the tag template is null and data is directly returned to the $ tags array. In this case, you can loop through the template directly.
The following is a complete example:
<! & Ndash; {PHP $ tags = tag ("Table =... & Template = NULL ") ;}& ndash;>
{Loop $ tags $ t}
...
{/Loop>
The first method is generally used for data that is called multiple times, and the second method is generally used for data that is called only once.
Common Parameters and definitions
Moduleid
Moduleid refers to the module ID, which can be queried in the background module management. After you set the correct module ID for directly calling the module data, you do not need to pass the table parameter. The system automatically obtains the data.
For example, if moduleid = 5 is passed, the system will identify it as calling the supply information and automatically set the table parameter to dynamic
Table
Table refers to the table name, which can be queried in the background database maintenance. For a destoon system table, you do not need to add the table prefix. For a non-destoon system table, you must enter the complete table name and pass the prefix parameter.
For example, for a destoon system table, pass table = partition. If the table prefix is destoon _, the system recognizes the table name destoon_partition.
For non-destoon system tables, pass table = tb_abc & prefix = or table = ABC & prefix = Tb _. The system recognizes the table name tb_abc.
Fields
Fields indicates the query field. The default value is *. It can be passed, for example, fields = title, addtime, but generally does not need to be passed. The tag cache mechanism unique to destoon automatically caches the query results without worrying about efficiency issues.
Condition
Condition refers to the query condition. If it is not passed, it is 1, which indicates the data of any condition (this item requires understanding of the SQL syntax ). All destoon modules follow the unified standard development, so many conditions are common.
For example, status = 3 indicates the information that passes normally, status = 3 and level = 1 indicates the information of level 1, status = 3 and thumb <> "indicates the information of the title image.
Order
Order index data sorting method (this item requires an understanding of the SQL syntax ).
For example, order = addtime DESC indicates sort by add time in descending order, order = Itemid DESC indicates sort by Itemid in descending order, and order = rand () indicates random data.
Pagesize
Pagesize indicates the number of data calls. If not passed, the default value is 10.
Template
Template refers to the specified tag template. If it is not passed, the default value is list, which is located in the template directory/Tag/list.htm. If it is passed as null, the tag template is not applied. See the preceding data display process.
Examples of other common usage
Control title Length
Pass the length parameter in the label, for example, & length = 20 represents 20 characters length (GBK a Chinese character occupies 2 characters, UTF-8 a Chinese character occupies 3 characters ), we recommend that you use CSS to hide extra characters (define height and overflow: hidden)
The length parameter is passed. The system only automatically intercepts the title field. To intercept other fields, use the dsubstr function.
For example, {dsubstr ($ t [Company], 20 ,'... ')} Indicates to intercept the company field with 20 characters. After intercept, append it to the end...
Set date display format
You can pass the datetype parameter in the tag:
1 indicates the year;
2 indicates the month-day;
3 indicates year-month-day;
4 indicates the month-day hour: minute;
5 indicates year-month-day hour: minute;
6 indicates year-month-day hour: minute: Second
You can also directly use the date function in the template. For example, {date ('Y-m-d', $ t [addtime])} indicates converting the time to the year-month-day format.
Call the information of a certain category
Pass the catid parameter in the tag. For example, & catid = 5 indicates that all information with category ID 5 is called.
If multiple categories are called, use commas (,) to separate the category IDs. For example, & catid = 5, 6, and 7 indicate all the information of the called category IDs of 5, 6, and 7.
By default, a category call contains sub-categories. If you do not need to include sub-categories, you can set the & Child = 0 parameter.
For example, & catid = 5 & Child = 0 indicates that only the information with the category ID 5 is called, excluding the information of the subcategory.
Call the information of a region
The called region information is exactly the same as the method used to call the classification information. Replace the catid with areaid.
Category of the displayed information
<A href = "{$ module [$ moduleid] [linkurl]} {$ category [$ t [catid] [linkurl]}"> {$ category [$ t [catid] [catname]} </a>
Control Columns
This item is commonly used for image layout. You can use the Cols parameter.
For example, if you call 12 images and display 4 images in one row and 3 rows in total, pass & pagesize = 12 & Cols = 4
Label templates supporting colsparts are limited to thumb-table.htmand list-table.htm
Among them, thumb-table.htmdisplays the image watermark and list-table.htm displays the text list.
If you create a new label template that supports Cols or directly cycle $ tags, refer to the preceding two templates.
The preceding results can also be implemented through CSS. You do not need to use tables. Please write them by yourself.
Show Article Introduction
Use the {$ t [introduce]} variable. To intercept characters such as 80 characters, use {dsubstr ($ t [introduce], 80 ,'... ')}
Summary
Tags seem complicated and difficult to understand. In fact, after understanding the meaning of each parameter and calling process, you will understand that tags are actually simple, flexible, and easy to use, with powerful functions.
A large number of call examples and tag templates are provided in the default template. You can refer to and debug them in learning.
Tag calling is a required knowledge for template creation. We hope you can learn about it as soon as possible.

 

Source: dianwei caotang
Link: http://blog.100-tea.com/j/20120308459.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.