There are three methods:
1: It's a stupid way to create an HTML single page, but it hurts that you need to modify that page every time. This is not in line with our lazy style! So I got along with the second method.
2: explain the method first, and then the principle:
Method: First find the template index.htm on the first page and pull it down. For comparison, you can find {dede: flink row = '24'/} (or {/dede: flink}) and change it to {dede: flink row = '24' typeid = "1 "/}.
Then, on other pages, such as the list page and the code of the homepage link, remember to copy it completely, and then change {dede: flink row = '24'/}
The code is as follows: |
Copy code |
{Dede: flink row = '24' typeid = "2 "/}. |
Usage:
When switching the connection on the home page, select 1 comprehensive website for the type, and the corresponding internal page. You need to see your typeid = "? ", Corresponding to your category information, this topic can be slightly modified, call our website Category ID, so that you can truly achieve classification display friendship connection
Classification channel call friendship connection
Find you/behind/templets/friendlink_add.htm and change the website type
The code is as follows: |
Copy code |
<Tr> <Td height = "25"> website Type: www.111cn.net </td> <Td> <Select name = "typeid" id = "typeid"> <Option value = "1"> homepage </option> <? Php $ Dsql-> SetQuery ("select * from # @__ arctype "); $ Dsql-> Execute (); While ($ row = $ dsql-> GetObject ()) { Echo "<option value = '". $ row-> id. "'>". $ row-> typename. "</option> rn "; } ?> </Select> </Td> </Tr> |
In this way, the website category will be displayed when a friendly connection is added. How can we call the classification page? Add a function to find/include/arc. listview. class. php file, before the end of the class}
The code is as follows: |
Copy code |
Function getlmlink ($ typeid) { $ Tsql = new DedeSql (false ); $ Typelink2 = '<div class = "pcs linkborder"> <p class = "linktitle"> Friendship connection & nbsp; </p> <div class = "links"> '; $ Tsql-> SetQuery ("select * from # @ _ flink where typeid = '$ typeid '"); $ Tsql-> Execute ('t '); While ($ row = $ tsql-> GetArray ('t', MYSQL_ASSOC )) { $ Typelink2. = "<a href = '". $ row ['URL']. "'target = _ blank> ". $ row ['webname']. "</a> "; } If (strlen ($ typelink2)> 90) { Return $ typelink2. "</div> 111cn.net "; } Else { Echo ''; } } |
The last step of the code is to add
The code is as follows: |
Copy code |
{Dede: pagelist listitem = "pagefirstlink" listsize = "0 "/} |
The result is as follows: