Evaluate the method of writing php native code in the {dede: SQL} tag script! {Dede: SQL & nbsp; SQL... & nbsp; runphpyes} echo & nbsp; fuck; {dede: SQL} it's useless to write this code. how can I find it in & nbsp; {dede: SQL} Native php code written in the tag script & nbsp ;?? ------ Solution ----------- evaluate the {dede: SQL} label script to write php native code!
{Dede: SQL = '... 'runphp = 'yes '}
Echo 'fuck ';
{/Dede: SQL}
How can I write php native code in the {dede: SQL} tag script ??
------ Solution --------------------
The following are the php applications in dede. I hope they will help you.
Call tag: {dede: field name = 'keyword' runphp = 'yes '}
If (! Empty (@ me )){
$ Kws = explode ('', @ me );
@ Me = "";
Foreach ($ kws as $ k ){
@ Me. = "$ k ";
}
@ Me = str_replace ('+', '', trim (@ me ));
}
{/Dede: field}
Dede calls the document content on the homepage
-------------------------------------------------
Method 1: {dede: SQL = "SELECT aid, typeid, body, body1, body2, body3, body4, body5 FROM
'Dede _ addonarticle' where typeid = 2 order by 'aid 'desc limit 0, 1 "}
[Field: body/] [field: body1/] [field: body2/] [field: body3/] [field: body4/] [field: body5
/]
{/Dede: SQL}
Method 2: {dede: SQL = "SELECT aid, typeid, body FROM 'dede _ addonarticle' where typeid = 2 ORDER
BY 'aid 'desc limit 0, 1 "}
[Field: body/]
{/Dede: SQL}
Call description: typeid = 2, column ID, indicates to call the article in this ID column. if it is changed to aid = 1, it indicates that the name of the called aid is 1.
Chapter (which article aid is specific and can be viewed in the database or in the background), DESC indicates sorting, from large to small, and changed
ASC is sorted in ascending order. LIMIT 0, 1 indicates the number of calls, and can also be written as the number of LIMIT 1. this 1 indicates the number of calls.
Add a line to each of the five rows in the list:
{Dede: list pagesize = '50 '}
Target = _ blank> [field: title function = "cn_substr (@ me, 48)"/] [field: pubdate
Runphp = 'yes']
$ A = "". strftime ('% m-% d', @ me )."";
$ B = strftime ('% m-% d', @ me );
$ Ntime = time ();
$ Day3 = 24X3600;
If ($ ntime-@ me) <$ day3) @ me = $;
Else @ me = $ B;
[/Field: pubdate]
[Field: global name = autoindex runphp = "yes"]
If (@ me % 5 = 0) @ me =" ";
Else @ me = "";
[/Field: global]
{/Dede: list}
--------------------------------------------
Method for changing the color of the last article list
{Dede: arclist orderby = pubdate titlelen = '26' row = '10 '}
[Field: global runphp = 'yes' name = autoindex]
$ A ="
";
$ B ="
";
If (@ me % 2) = 0) @ me = $;
Else @ me = $ B;
[/Field: global]
{/Dede: arclist}
--------------------------------------------
Ad Code: {dede: myad name = 'ad space identifi '/}
The update time of the article within 24 hours is displayed in red:
[Field: pubdate runphp = 'yes']
$ A = "". strftime ('% m-% d', @ me )."";
$ B = strftime ('% m-% d', @ me );
$ Ntime = time ();
$ Day3 = 24X3600;
If ($ ntime-@ me) <$ day3) @ me = $;
Else @ me = $ B;
[/Field: pubdate]
Implement the form of "article title-level 2 topic-Level 1 topic-site name"
{Dede: field name = 'title'/}-{dede: field name = 'position' runphp = 'yes '}
$ Tc = "-"; // delimiter
$ Tw = $ GLOBALS ['cfg _ list_symbol']; // call location separator
@ Me = html2text (@ me); // remove html tags
$ Tf = split ($ tw, @ me); // it is decomposed into arrays.
For ($ ta = (count ($ tf)-2); $ ta> = 1; $ ta --) {// cyclically assigned to $ tk
$ Tk. = trim ($ tf [$ ta]). $ tc;