DEDECMS system Function List and usage explanation

Source: Internet
Author: User

Weaving Dream (dedecms) system V5.7 Start, the function is mostly in the "small helper" pattern encapsulation, loading on demand, the storage path is:/include/helpers/

Getonearchive ($id)

Function: used primarily to get the individual information of a specified document, which returns an array.

Parameter meaning:

$ID Pass the ID number of a document;

Return Explanation: This function returns an array that contains all the document elements.

RELATED links: Baidu Encyclopedia on the interpretation of functions: http://baike.baidu.com/view/15061.htm#2

Getchanneltable ($id, $formtype = ' channel ')

Function: Gets the table name information for the specified model

Parameter meaning:

$ID Pass the ID number, the specific category is determined by $formtype;

Type of $formtype passed (default is model ID, optional archive and typeID)

function return: An array is returned (the name of the primary table table and the appended table table, respectively)

GetTags ($aid)

function: Gets all tag tags for the specified document ID

Parameter meaning:

$aid Specify the document ID number;

function return: Returns all tag tags as a string (note: The tag returned is a non-linked plain text)

Gettopids ($tid)

Function: Gets a list of all parent column IDs for the specified column

Parameter meaning:

$tid the ID number of the specified column

function return: Returns a list of all ancestor column IDs as a string

Gettopid ($tid)

Function: Gets the top-level column ID of the specified column;

Parameter meaning:

$tid the ID number of the specified column

function return: Returns the column ID number of the top-level column directly.

Note the difference between gettopid ($tid) and Gettopids ($tid), one is to return all, and the other is to return a single.

Getsonids ($id, $channel =0, $addthis =true)

function: Get a list of all the subordinate column IDs for a column

Parameter meaning:

$id Specify the column ID number

$channel qualified content Model ID

Whether the $addthis contains itself

function return: Returns the structure as a string

Getonetypeurla ($typeinfos)

Function: Gets the URL address of the column according to the specified column information

Parameter meaning:

$typeinfos some of the specified information, of course, you can directly pass a column of all the information (array);

function return: Returns the URL address as a string

Let's list some simple and common dedecms functions:

UTF82GB ($UTFSTR) UTF8 encoding is converted to GBK encoding;

Gb2utf8 ($GBSTR) GBK encoding is converted to UTF8 encoding;

Ajaxhead () Disable caching of pages;

GetIP () Gets the user client IP address;

Htmlreplace ($str, $rptype =0) removes irregular characters from HTML;

REMOVEXSS ($val) Remove the vulnerability of browser XSS;

Trimmsg ($msg) disables HTML for the variable but allows newline characters to be used;

Filtersearch ($keyword) filter the searched string;

Cn_substr ($str, $slen, $STARTDD =0) string length interception;

Text2html ($txt) plain text to HTML;

Html2text ($str, $r =0) convert HTML to plain text;

Getpinyin ($str, $ishead =0, $isclose =1) gets the phonetic alphabet of the specified character;

MyDate ($format = ' y-m-d h:i:s ', $timest =0) formats the Linux timestamp as standard time;

Getmktime ($dtime) converts the standard time to the Linux timestamp;

Floortime ($seconds) converts the time to the exact time of the distance;

Getcururl () Gets the script address of the current page;

Geteditor ($fname, $fvalue, $nheight = "", $etype = "Basic", $gtype = "Print", $isfullpage = "FALSE", $bbcode =false) Get the editor in the program;

Dd2char ($ddnum) generates a random character;

Json_encode ($DATA) JSON encoding of variables;

Json_decode ($json, $assoc =false) JSON decode the variables;

The above is the weaving dream dedecms system built-in functions, selected parts of the sorting out, for reference only.

DEDECMS system Function List and usage explanation

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.