Destoon System Label Call Daquan

Source: Internet
Author: User
Tags add time manual function prototype

Destoon System Label Call Daquan

1. Destoon System Global Tab

Site name: {$DT [sitename]}
Website address: {Dt_path}
Website Logo: {if $MODULE [$moduleid][logo]} {dt_skin}image/logo_{$moduleid}.gif{elseif $DT [logo]}{$DT [Logo]}{else}{dt_ SKIN}IMAGE/LOGO.GIF{/IF}
Copyright information: {$DT [copyright]}
Style path: {Dt_path}
Customer Service Tel: {$DT [telephone]}
ICP Record number: {if $DT [icpno]}{$DT [icpno]}┊{/if}
VIP member name: {VIP}
Real currency name: {$DT [Money_name]}
Real currency unit: {$DT [Money_unit]}
Virtual Credit Name: {$DT [Credit_name]}
Virtual Integration unit: {$DT [Credit_unit]}

Title (site title): {$seo _title}
Meta Keywords (Web keywords): {$head _keywords}
Meta Description (page description): {$head _description}

2. Connection Address
Default individual module connections:
Member: {$MODULE [2][linkurl]}
Supply: {$MODULE [5][linkurl]}
Buy: {$MODULE [6][linkurl]}
Quotes: {$MODULE [7][linkurl]}
Company: {$MODULE [4][linkurl]}
Exhibition: {$MODULE [8][linkurl]}
Info: {$MODULE [21][linkurl]}
Investment: {$MODULE [22][linkurl]}
Brand: {$MODULE [13][linkurl]}
Talent: {$MODULE [9][linkurl]}
Know: {$MODULE [10][linkurl]}
Project: {$MODULE [11][linkurl]}
Gallery: {$MODULE [12][linkurl]}
Video: {$MODULE [14][linkurl]}
Download: {$MODULE [15][linkurl]}

Release information: {$MODULE [2][linkurl]}{$DT [File_my]}
Business shop: {$MODULE [2][linkurl]}home.php
View in-station letter: {$MODULE [2][linkurl]}message.php
Manage trading transactions: {$MODULE [2][linkurl]}trade.php
Perfect 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_enable ')} WAP browsing {/if}
RSS Subscription: {If extend_setting (' feed_enable ')} | RSS Subscription {/if}

Market Courier: {$MODULE [7][linkurl]}{rewrite (' Price.php?product=all ')}
Enterprise News: {$MODULE [4][linkurl]}{rewrite (' news.php?more=1 ')}
Announcement: {extendurl (' announce ')}
Promotion: {Extendurl (' spread ')}
Ad: {extendurl (' ad ')}
Links: {extendurl (' link ')}
Application Links: {extendurl (' link ')}{rewrite (' Index.php?action=reg ')}
Message book: {extendurl (' guestbook ')}
Vote: {Extendurl (' vote ')}

3. Home Page Call

Navigation Menu:

<4} class= "Menuon" {/if}> Home
{Loop $MODULE $m}
{if $m [Ismenu]} {$m [name]}

To invoke the login module:
{if $DT [Page_login]}
{Template ' user ', ' Chip '}

Call Classification module:
{PHP $mid = 5;}
{Template ' catalog ', ' Chip '}

4. Invocation of individual module data


Latest Supply Information:

{Loop $tags $k $t}
[{Area_pos ($t [Areaid], '/', 1)}] {$t [title]}

It is theoretically necessary for the website manager to have a certain knowledge of html+css and to have a preliminary understanding of Php+mysql.
The calling procedure actually reads the call number bar data from the data table according to the invocation criteria, sorts it in sorted order, and ultimately outputs the data through the layout of the label template.
Function prototype tag ($parameter, $expires = 0) $parameter represents a string passed to the tag function, the system automatically converts it to multiple variables such as passing table=destoon&pagesize=10, the system is equivalent to getting $ Table = ' Destoon '; $pagesize = 10;
Two variables $expires indicates cache expiration >0 cache $expires seconds, 0– system default time, -1– does not cache, -2– cache SQL, and general conditions remain default.
Variable $tags saves the data called by the tag in an array type, which can be traversed through the loop syntax.
$pages Save the data paging code, only valid when paging is called. $
Path module paths. Characters commonly used section title title; Linkurl link; catid category ID; introduce introduction; Addtime add time;
The common function dsubstr ($string, $length, $suffix = ") intercepts the string $string to $length long and the trailing $suffix (for example:).
Set_style ($string, $style = ", $tag = ' span ') places the string $string in the $taghtml label and sets the style to $style Linkurl ($linkurl, $absurl = 0) relative to the path $linkurl Patching to absolute path (prevents link errors)
Date ($format, $timestamp) converts timestamp $timestamp to $format (for example, y-m-d) format
The label template template is saved in the./template/default/tag/directory, it is recommended that you do not delete or modify your own templates, and recommend that you create a new template and apply it on your own template.
Category:destoon Tag Invocation
Comments (0)
Destoon Show Area posted Byjinpeng998on Monday, 12 July, 2010
Show Area:
The required function is Include/module.func.php/get_mainarea ($areaid, $area);
PHP page: $AREA =cache_read (' area.php '); Reading cache files
Static page invocation:
{php $mainarea = Get_mainarea (0, $AREA)}
{Loop $mainarea $k $v}
{if $k%2==0}


{if $k%2==1} {/if}

Another way is to directly tag the call,, yes, directly from the Destoon database to take out information
Category:destoondestoon Show Area
Comments (0)
Destoon Learning Tag Call posted Byjinpeng998on Sunday, 11 July, 2010
Link: $t [linkurl]
Supply module MORE: $MODULE [---module ID---][linkurl] module ID put the mouse on the link below it appears moduleid=. You can see
Picture path: $t
Information Module MORE: {$MOD [linkurl]}{$c [Linkurl]}
See which field the name belongs to. --check-right-see name value eg Name=post[brand] that is the brand field
The first page of each module is the index.htm of its template/folder
Pagesize= ". $MOD [pagesize]." Can be written pagesize=4; remember not to add single quotes or double quotes
Calling Paging:
Paging tab:

$dtype &catid= $catid &pagesize=4&page= $page &showpage=1&datetype=5&order= ". $MOD [order]." &template=list-sell ")}–>
Paging: {if $showpage && $pages} {$pages}{/if}
Call Classification:
Main methods
$maincat = Get_maincat (0, $CATEGORY);
Get_maincat (0, $CATEGORY)--in include/global_func.php
$childcat = Get_maincat (0, $CATEGORY, 1);-Call the 1 level directory under the Super column
0 represents the most root directory 1 represents the level 1 of the directory level manually set the default is 1
If 0 is changed to 3 then the directory of CATID is 3
Small Note: $CATEGORY = cache_read (' category-'. $moduleid. php '); This file is in the page of the module page
{Loop $maincat $k $v}
{If $k% $DT [page_subcat]==0} {/if}

{If $k% $DT [page_subcat]== ($DT [Page_subcat]-1)} {/if}
There must be $maincat in the PHP page under its Module modules folder
$MOD [Linkurl] is the module also the home address $v [Linkurl] The following table page plus CATID
Category:destoon Tag Invocation
Comments (0)
Very good destoon business-to-business label call Manual Posted Byjinpeng998on Sunday, 11 July, 2010
Destoon-to-business label call Manual what is a label call.
The label call is to read the call quantity (pagesize) bar data from the Data table (table) according to the invocation criteria (condition) and sort by sort (order), eventually outputting the data through the layout of the label template.
It can be seen that the work of the label is divided into two parts, one is to read the data, and the other is to display the data.
Label function prototypes
Label function saved in include/tag.func.php
Tag ($parameter, $expires = 0)
$parameter A string that is passed to the tag function, the system automatically converts it to multiple variables
such as passing Table=destoon&pagesize=10&hello=world
System is equivalent to getting
$table = ' Destoon ';
$pagesize = 10;
$hello = ' world ';
Three variables
$expires indicates the label cache expiration Time
>0 cache $expires seconds, 0– system default tag cache time, -1– not cache; -2– cache SQL results;
The general situation remains by default and does not need to be passed.
Data read process
For example, the following tags:

will be converted to the following SQL statement:
From Destoon_sell
WHERE status=3
ORDER by Addtime DESC
LIMIT 0,10
The read data is stored in the $tags array.
Data display Process

1, through the label template display
Pass &TEMPLATE=ABC to the label function, for example:

The default label template is saved in the template directory/tag/directory, for example &TEMPLATE=ABC will invoke the template catalog/tag/abc.htm template to display the data
If the label template is placed in another directory, such as Def, the &DIR=DEF&TEMPLATE=ABC is passed and the template directory/def/abc.htm template is called

2, directly in the template loop data

This notation passes the label template null, and returns the data directly to the $tags array, which can be looped directly in the template.
The following is a complete example:

{Loop $tags $t}

The first one is generally used for multiple invocations of data, and the second is typically used for data that is called only once.
Common parameters and meanings
ModuleID refers to the module ID, which can be queried in the background module management. For directly invoking the module's data, after setting the correct module ID, the table parameter will not be passed, and the system will get it automatically.
For example, by passing moduleid=5, the system will recognize the call provisioning information and automatically set the table parameter to sell
Table refers to the name, which can be queried in the background database maintenance. For Destoon system tables, no table prefixes are required; for non-destoon system tables, complete table names are required, and prefix parameters are passed
For example, for Destoon system tables, passing Table=sell, if the table prefix is destoon_, the system will recognize the table named Destoon_sell
For non-destoon system tables, passing table=tb_abc&prefix= or table=abc&prefix=tb_, the system will recognize the table named TB_ABC
Fields refers to the field of the query, which by default is an asterisk. such as Fields=title,addtime can be passed, but in general there is no need to pass, and Destoon's unique tag caching mechanism automatically caches query results without worrying about efficiency issues.

Order refers to the sorting method of the data (this item requires an understanding of SQL syntax).
For example Order=addtime desc means descending by add time, Order=itemid desc means descending by itemid, Order=rand () representing random data, and so on.
PageSize refers to the number of call data, which, if not passed, defaults to 10.

The template refers to the specified label templates, if not passed, the default is list, which is located in the template directory/tag/list.htm, if passed to null, indicates that the label template is not applied. See the data display procedure above.
Other common usage examples
Control title length
Pass the length parameter in the label, for example, &LENGTH=20 is 20 characters long (GBK a Chinese character is 2 characters, UTF-8 a Chinese character is 3 characters), it is generally recommended to hide extra characters with CSS (define height and overflow: Hidden
Pass the length parameter, the system only automatically intercepts the title field, if you need to intercept other fields, you can use the DSUBSTR function
For example {dsubstr ($t [Company], 20, ' ... ')} indicates that the Intercept company field is 20 characters, after interception, the end is appended ...
Set Date display format
The Datetype parameter can be passed in the label:

1 means year;
2 means month-day;
3 means year-month-day;
4 means month-day time: minute;
5 means year-month-day time: minute;
6 = year-month-day time: minutes: seconds
You can also use the DATE function directly in the template, such as {date (' y-m-d ', $t [Addtime])} to convert the time to year-month-day format
Call information for a taxonomy
Pass the CATID parameter in the tag, for example &catid=5 represents all information that invokes the class ID of 5.
If multiple classifications are called, separate the classification IDs with commas, for example &catid=5,6,7 for all information that calls the class ID 5, 6, 7.
The classification call contains the information for the subcategory by default, and you can set the &child=0 parameter if you do not need to include a subcategory.
For example, &catid=5&child=0 indicates that only the information for the class ID 5 is called, not the subcategory.
Call information for a region
Call the region information and the above call classification information exactly the same way, the CATID can be changed to Areaid.
Show information in the category
{$CATEGORY [$t [Catid]][catname]}
Number of control columns
This item is commonly used for the layout of pictures and can be used with the cols parameter.
For example, call 12 pictures, one row shows 4, a total of 3 rows, then pass &pagesize=12&cols=4
Label templates that support cols parameters are limited to thumb-table.htm and list-table.htm
Where thumb-table.htm displays a list of pictures, list-table.htm displays a list of text
If you create a new label template or a direct loop $tags that supports cols, you can refer to the above two templates
The above effects can also be implemented through CSS, without the use of tables, please write your own
Show an introduction to an article
Using {$t [introduce]} variables, if you want to intercept words, such as 80 characters, you can use {dsubstr ($t [introduce], 80, ' ... ')}
The label seems complex and difficult to understand, in fact, after understanding the meaning of each parameter and invoking the process, you will learn that the label is actually simple and free, flexible and easy to use, powerful.
A number of invocation examples and label templates are available in the default template, which you can refer to and debug in learning.
Tag call is the necessary knowledge to make template, I hope you can grasp it soon.

Part II

1. General description of the label format



Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.