
How to let dedecms implement shtml?
Let dedecms implement shtml inclusion. This is a very simple and easy problem. We can realize the top navigation, middle part, public part on the right, and bottom of dedecms through the secondary development of dedecms
Recommended learning: 梦Weavercms
Let dedecms implement shtml inclusion. This is a very simple and easy problem. We can achieve good support for the top navigation, middle part, right public part, and bottom of dedecms through secondary development of dedecms, thereby reducing the frequent consumption of system resources when generating html to generate dedecms html. Function. This can speed up how dedecms generates HTML.
First we need to implement shtml inclusion on the right side of the dedecms column. Regarding the dedecms configuration of the shtml environment, the previous article has described it.
1: First create the right public template templates/default/right.htm
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 '<!--#include virtual="'.$GLOBALS['cfg_cmspath'].'/data/'.$refObj->Fields['id'].'right.htm"-->';
}
}3:Generate When creating a column, the right side of the corresponding column is generated.
arc.listview.class.php
The code is as follows:
var $tcp1;
var $tcp3;</p> <p> $this->tcp1 = new DedeTagParse();
$this->tcp1->SetRefObj($this);
$this->tcp1->SetNameSpace("dede", "{", "}");Load the 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 a value to the template
MakeOneTag($this->tcp1,$this);
4: Directly call {dede:shtml/}
in the template to generate background, and then let dedecms implement shtml inclusion.
The above is the detailed content of How to let dedecms implement shtml. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft





