The newest Destoon label Daquan list, novice must

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

1. Global Label

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]}<a href= "url" target= "_blank" >{$DT [icpno]}</a>┊{/if}
VIP member name: {VIP}
Real currency name: {$DT [Money_name]}
Real currency unit: {$DT [Money_unit]}
Virtual integral name: {$DT [Credit_name]}
Virtual integral unit: {$DT [Credit_unit]}

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


2. Link Address
Default individual module connections:
Member: {$MODULE [2][linkurl]}
Supply: {$MODULE [5][linkurl]}
Buy: {$MODULE [6][linkurl]}
Market: {$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]}
Topic: {$MODULE [11][linkurl]}
Photo gallery: {$MODULE [12][linkurl]}
Video: {$MODULE [14][linkurl]}
Download: {$MODULE [15][linkurl]}


Publish information: {$MODULE [2][linkurl]}{$DT [File_my]}
Business shop: {$MODULE [2][linkurl]}home.php
View 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: {ifextend_setting (' wap_enable ')} <a href= ' {extendurl (' wap ')} ' >wap browse </a>{/if}
RSS Feeds: {ifextend_setting (' feed_enable ')} | <ahref= ' {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 ')}
Links: {extendurl (' link ')}
Application Links: {extendurl (' link ')}{rewrite (' Index.php?action=reg ')}
Message book: {extendurl (' guestbook ')}
Vote: {Extendurl (' vote ')}


3. First Call

Navigation Menu:
<ul>
<li{if $moduleid <4} class= "Menuon" {/if}><ahref= "{Dt_path}" ><span> Home </span></a> </li>
{Loop $MODULE $m}
{if $m [Ismenu]}
<li{if $m [moduleid]== $moduleid} class= ' Menuon ' {/if}><ahref= ' {$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>


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

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


4. The call of each module data


Supply:

Latest Supply Information:
1.<!--{tag ("Moduleid=5&condition=status=3&length=34&condition=status=3&pagesize=5&order =addtimedesc&template=list-trade ")}-->

2.<!--{php$tags=tag ("moduleid=5&condition=status=3&length=34&condition=status=3&pagesize=5 &order=addtimedesc&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 theory, it requires site managers to have a certain html+css knowledge, and a preliminary understanding of Php+mysql.
The call procedure actually reads the call number bar data from the datasheet according to the call condition, and sorts it by sort, and ultimately outputs the data through the layout of the label template.
The function prototype tag ($parameter, $expires = 0) $parameter represents the string passed to the tag function, which is automatically converted to multiple variables such as passing table=destoon&pagesize=10, which is equivalent to getting $ Table = ' Destoon '; $pagesize = 10;
Two variable $expires indicates cache expiration >0 cache $expires seconds; 0 &ndash; system default time; -1 &ndash; Not cached; -2 &ndash; caching SQL; The general situation remains the default.
Variable $tags the data that the tag invocation is saved as an array type, which can be traversed through the loop syntax.
$pages Save the data paging code, which is only valid when paging is called.

$path module PATH. The title of the frequently-linkurl link; CatID category ID; introduce introduction; Addtime add time;
The common function dsubstr ($string, $length, $suffix = ") intercepts the string $string to $length length, and the tail appends $suffix (for example ...).
Set_style ($string, $style = ", $tag = ' span ') puts the string $string in the $taghtml label and sets the style to $stylelinkurl ($linkurl, $absurl = 0) to the relative path $linkurl patched to absolute path (prevent link errors)
Date ($format, $timestamp) converts the 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 template, and recommend that you create a new template and apply it with your template.


Destoon Display Area
Show Area:
The required function is Include/module.func.php/get_mainarea ($areaid, $area);
PHP page: $AREA =cache_read (' area.php ');//Read cache file
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><ahref= ' {$MOD [Linkurl]}{rewrite (' search.php?areaid= '. $v [' Areaid ']. ' &typeid= '. $typeid)} ' >{$v [areaname]}</a></td>
{if $k%2==1}</tr>{/if}
{/loop}
</table>
There is also a way to direct tag calls, and, yes, directly from the Destoon database to retrieve information


Links: $t [Linkurl]
Supply module MORE: $MODULE [---module ID---][linkurl] module ID to put the mouse on its next link appears moduleid=. You can see
Picture path: $t;
More information modules: {$MOD [linkurl]}{$c [Linkurl]}
See which field the name belongs to. --Select &ndash; right-see name Value Egname=post[brand] is brand field
The first page of each module is the index.htm under its template/folder.
Pagesize= ". $MOD [pagesize]." Can be written as pagesize=4; remember not to add single or double quotes
Call Paging:
Paging Label:
<!--{tag ("moduleid= $moduleid &c=3
$dtype &catid= $catid &pagesize=4&page= $page &showpage=1&datetype=5&order= ". $MOD [order]." &template=list-sell ")}-->
Paging: {if$showpage && $pages}<div class= "pages" >{$pages}</div>{/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 Level 1 directory under the Super column
0 represents the very root directory 1 represents the Level 1 directory level manual setting defaults to 1
If 0 is changed to 3 then the directory of CATID 3
Small Note: $CATEGORY = cache_read (' category-'. $moduleid. php '); This file is in 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}
Attention:
There must be a $maincat in the PHP page under its Modules Module module folder
$MOD [Linkurl] is the module also home address $v[linkurl] Its following table page plus CATID


Very good destoonb2b tag call manual
Destoon business-to-business Tag Call manual what is tag call.
A tag invocation reads the number of calls (pagesize) from a datasheet (table) based on the invocation condition (condition) and sorts by sort order, eventually outputting the data through the layout of the label template.
As you can see, the label's work is divided into two parts, one is to read the data, and the other is to display the data.
Label function prototype
tag function stored in include/tag.func.php
Tag ($parameter, $expires = 0)
$parameter represents a string passed to the tag function that the system automatically converts 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 &ndash; System default label cache time; -1 &ndash; Not cached; -2 &ndash; caching SQL results;
The general situation remains the default and does not need to be passed.
Data read process
For example, the following tags:
<!--{tag ("table=sell&c=3&order=addtimedesc&pagesize=10&prime;")}-->
will be converted to the following SQL statement:
SELECT *
From Destoon_sell
WHERE status=3
ORDER BY Addtime DESC
LIMIT 0,10
The read data will be stored in the $tags array.



Data display Process

1, through the label template display
Pass &TEMPLATE=ABC to the label function, for example:
<!--{tag ("table=...&template=abc")}-->
The default label template is saved in the template directory/tag/directory, for example, &TEMPLATE=ABC will call the template directory/tag/abc.htm template to display the data
If the label template is placed in a different 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
<!--{php $tags =tag ("Table=...&template=null");} -->
This writing passes the label template to null and returns the data directly to the $tags array, which can be cycled directly in the template.
The following is a complete example:
<!--{php $tags =tag ("Table=...&template=null");} -->
{Loop $tags $t}
...
{/loop>

The first method is commonly used for multiple invocations of data, and the second is typically used for data that is invoked only once.
Common parameters and meanings
ModuleID
ModuleID refers to the module ID, which can be queried in the background module management. For data that directly invokes the module, the correct module ID is not required to pass the table parameter, and the system is automatically fetched.
For example, passing moduleid=5, the system will be recognized as invoking the provisioning information, automatically setting the table parameter to sell
Table
Table refers to the list name, which can be queried in the background database maintenance. For Destoon system tables, you do not need to prefix the table, and for a destoon system table, you need to complete the table name and pass the prefix parameter
For example, for Destoon system tables, pass Table=sell, and if the table prefix is destoon_, the system will recognize the table name as Destoon_sell
For Destoon system tables, passing table=tb_abc&prefix= or table=abc&prefix=tb_, the system will recognize the table name as Tb_abc
Fields
Fields refers to the field of the query, which defaults to an asterisk. such as Fields=title,addtime can be passed, but in general there is no need for delivery, Destoon unique tag caching mechanism automatically caches query results without worrying about efficiency issues.


Order
Order refers to the sorting method of the data (this item needs to understand SQL syntax).
For example, order=addtimedesc means descending by add time, order=itemiddesc in descending order by Itemid, Order=rand () representing random data, and so on.
PageSize
PageSize refers to the number of call data, which defaults to 10 if not passed.

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

1 expression year;
2 means month-day;
3 means year-month-day;
4 means month-day: cent;
5 means year-month-day: cent;
6 means year-month-day: minutes: sec
You can also use the DATE function directly in the template, such as {date (' y-m-d ', $t [Addtime]}}, which means converting time to year-month-day format
Calling information for a category
Pass the CATID parameter in the label, such as &catid=5, to invoke all information that has a category ID of 5.
If you call multiple classifications, separate the category IDs with commas, for example, &catid=5,6,7 represents all the information that calls the category ID 5, 6, 7.
The classification call defaults to the information that contains subcategories, and you can set the &child=0 parameter if you do not need to include subcategories.
For example, &catid=5&child=0 indicates that only information with a taxonomy ID of 5 is invoked, excluding the information for subcategories.
Call information for a region
The method of calling the locale information is exactly the same as that of the call classification information above, and the CATID is replaced with the Areaid.
Display information in categories
<ahref= ' {$MODULE [$moduleid][linkurl]}{$CATEGORY [$t [Catid]][linkurl]} ' >{$CATEGORY [$t [Catid]][catname]} </a>
Control Number of columns
This item is commonly used in the layout of pictures, and you can use the cols parameter.
For example, call 12 pictures, one row shows 4, a total of 3 rows, then pass &pagesize=12&cols=4
Label template limits thumb-table.htm and list-table.htm that support cols parameters
Where thumb-table.htm displays a list of pictures, list-table.htm displays a list of words
If you create a new cols label template or direct loop $tags, refer to the above two templates
The above effects can also be implemented through CSS, without using the table, please write your own
Show an introduction to the article
Using the {$t [introduce]} variable, if you want to intercept the number of words, such as 80 characters, you can use {dsubstr ($t [introduce], 80, ' ... ')}
Summary
tags seem complex and difficult to understand, in fact, after understanding the meaning of each parameter and invoke 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 see and debug in your learning.
Tag call is the necessary knowledge to make a template, I hope you can grasp it soon.

Part II

1. General description of label format
<!–{tag

("moduleid=9&table=article_9&length=40&condition=status=3&pagesize=

10&datetype=2&order=ad

Dtimedesc&target=_blank ")}–>

Moduleid=9 is the information module ID, module ID to the module management view;
Article is the directory name of the information module;
&LENGTH=40 is the label intercept word number
&PAGESIZE=10 is the number of call bars
&datetype=2 is to show time to add time

2. Call Latest Join Enterprise
<!–{tag ("moduleid=4&table=company&condition=groupid>4&pagesize=10&order=useriddesc& Template=list-com ")}–>


3. How to call one of the corporate members of the supply and demand and information
In condition= riga and username= ' xxx ' xxx as member login name

4. How to call a product under the purchase of a category
The information under the call classification can be set &catid= industry id&child=1child=1 indicates that the subordinate industry is also invoked


5. Call level two column information list
<!–{tag ("moduleid= $moduleid &table=article_$moduleid&catid= $catid &child=1
&condition=status=3&order= ". $MOD [order]." &pagesize=6&datetype=2&target=_blank ")}–>
If you are calling in the article module you can use the above code $catid change to the column ID you want to call
If you need to call the information in the column at the same time child=1, otherwise child=0
If you are calling elsewhere on the site, you can use the following code:
<!–{tag

("Moduleid=9&table=article_9&catid= $catid &child=1&condition=status=3&order=addtime

Desc&pagesize=6&datetype=2&target=_blank ")}–>
Note that the value of the ModuleID is consistent with the module ID you are calling
Add:
The following is a successful call on the home page
<!--{Tag

("Moduleid=9&table=article_9&catid= $catid &child=1&condition=status=3&order=addtime

Desc&pagesize=6&datetype=2&target=_blank ")}–>
But I want a list of templates inside the information page, which shows only 22 words per article.


6. Homepage information column how to call here
"9" is the ID of your module
{php $C = get_maincat (0, Cache_read (' category-9.php '));}
{Loop $C $k $v}
<a href= "{$MODULE [9][linkurl]}{$v [Linkurl]}" >{$v [catname]}</a>
{/loop}
7. The list of companies cannot control the number of words.
You can modify the list-com.htm directly.
{$t [Company]} is {dsubstr ($t [Company], $length)}
8.TAG Common Label
{$CATEGORY [$t [catid]][' CatName ']} belongs to the column name; {timetodate ($t [' Addtime '], $datetype)}

Publish Time


9. Other
You can specify the label template by &template=.
If it doesn't work, this parameter defaults to list.
In the template catalog tag directory
Level 1 is the recommended article, 2 is the slide picture, 3 is the recommended text, 4 is the headline, and the 5 is the headline-related.


10, below, in the company template home and List page call out the company's phone and number of each label properties, how to call out
Join on list-company.htm page

<liclass= "F_gray" > main: {$t [business]}</li>

<liclass= "F_gray" > Address: {$t [address]}</li>

<liclass= "F_gray" > Tel: {$t [telephone]}</li>

<liclass= "F_gray" > Fax: {$t [fax]}</li>

<liclass= "F_gray" > mailbox: {$t [mail]}</li>

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.