Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of letting dedecms implement shtml

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to let dedecms achieve shtml. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

How to make dedecms implement shtml?

Getting dedecms to implement shtml inclusion is a very simple and easy question. Through the secondary development of dedecms, we can realize the top navigation of dedecms, the middle part, the common part on the right, and the bottom.

Recommended study: dream weaving cms

Getting dedecms to implement shtml inclusion is a very simple and easy question. Through the secondary development of dedecms, we can achieve a good support for the top navigation of dedecms, the middle part, the public part on the right, and the bottom, so as to reduce the frequent consumption of system resources to generate dedecms html function when html is generated. This speeds up the generation of html by dedecms.

First of all, we need to implement a shtml inclusion to the right of the dedecms column. The last article talked about dedecms configuring the shtml environment.

1: first create the public template templates/default/right.htm on the right

2: write the following tags

The code is as follows:

Function lib_shtml (& $ctag,&$refObj) {if (isset ($_ GET ['tid'])) {return file_get_contents ('.. / data/'.$refObj- > Fields ['id'].' right.htm');} else {return';}}

3: when generating a column, generate the right side of the corresponding column.

Arc.listview.class.php

The code is as follows:

Var $tcp1;var $tcp3

$this- > tcp1 = new DedeTagParse (); $this- > tcp1- > SetRefObj ($this); $this- > tcp1- > SetNameSpace ("dede", "{", "}")

Load right.htm template

$this- > tcp1- > LoadTemplate ($GLOBALS ['cfg_basedir']. $GLOBALS [' cfg_templets_dir']. "/". $GLOBALS ['cfg_df_style']. "/ right.htm")

Generate html

$file = $this- > Fields ['id'].' right.htm'; $rightfile = $GLOBALS ['cfg_basedir']. $GLOBALS [' cfg_cmspath']. "/ data/". $file; if (! file_exists ($rightfile)) {$this- > tcp1- > SaveTo ($rightfile) } else {if ((time ()-filectime ($rightfile)) > 3600) {$this- > tcp1- > SaveTo ($rightfile);}}

Assign values to templates

MakeOneTag ($this- > tcp1,$this)

4: call {dede:shtml/} directly from the template

Background generation, the completion of the dedecms to achieve shtml include.

This is the end of the way to let dedecms achieve shtml. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report