Hongmu Notes
Home Program Notes

Program Notes

In the final analysis, programmers taking notes is an efficient behavior of recording work experience. It can not only record the various technical problems encountered in the process of program development, but also record the beneficial experiences gained in learning technical knowledge. It can both help...

Empire cms adds custom lists and uses your own php code

Empire cms adds custom lists and uses your own php code Program Notes Empire cms

Secondary development for lists; <?php require('../../class/connect.php'); require('../../class/db_sql.php'); require('../../class/functions.php'); require('../../class/t_fu...');
👁 222
Empire cms, insert a picture in the first paragraph of the article

Empire cms, insert a picture in the first paragraph of the article Program Notes Empire cms

&lt;?php $img = '&lt;p&gt;&lt;img src=&quot;/skin/images/'.mt_rand(1,1).'.png&quot; alt=&quot;'.$navinfor['title'].'&quot;&gt;&lt;/p&gt;'; $pos = strp…
👁 203
Empire cms dynamic mode list page pseudo-static, new method

Empire cms dynamic mode list page pseudo-static, new method Program Notes Empire cms

Empire CMS can sometimes encounter issues where static lists fail to update automatically, or where newly updated articles do not appear immediately on the page. To address this seemingly minor issue, we have created a tutorial. The modified approach displays links to static web pages, but these pages actually operate in dynamic mode – i.e., they use pseudo-static URLs. The pseudo-static URL format is: http(s)://domain/section_filename/index_2.html – something like that! Pseudo...
👁 795
Empire's high-efficiency random calling function expansion

Empire's high-efficiency random calling function expansion Program Notes Empire cms

Key Concept Summary: 1. PHP function `ZQrand($classid, $num) {global $dbtbpre, $empire; /* Check whether the JSON file exists */ $file_arrays = glob(ECMS_PATH. "/d/json/*.json"); $file...`
👁 188
Summary of experience in installing sphinx on Linux

Summary of experience in installing sphinx on Linux Program Notes sphinx

1. The installation directory must be located within the same directory as MySQL; the Ptao directory is: /www/server/2. The `etc` folder contains three files: `example.sql`, `sphinx.conf.dist`, and `sphinx-min.conf.dist`. The first file is an MySQL instance file provided for importing your database; using this instance can help you better understand the setup. The second file is for configuration...
👁 351
Empire Big Data Project Notes

Empire Big Data Project Notes Program Notes Empire cms

October 6, 2022:1. Create an aggregated table – the vanguard of big data! To create an aggregated table, use the following syntax: CREATE TABLE `i9j_cn`. `phome_book_1` (`id` INT(10) NOT NULL AUTO_INCREMENT COMMENT 'id', `book` VARCHAR(255) NOT NULL...
👁 148
pbootcms common code storage

pbootcms common code storage Program Notes PbootCms

1. When using pbootcms for data collection, if you wish to configure a scheduled publishing task, you can add the following code to your PHP publishing script: if (file_exists('num.txt')) {$updata_num = file_get_contents('num.txt'); $updata_num++;...
👁 227
pbootcms ajax no refresh loading next page technology

pbootcms ajax no refresh loading next page technology Program Notes PbootCms

JS code: // Define some basic variables // `Page` represents the current page number, calculated as `{page: current} + 1` – for example, this would be the second page; `parseInt` ensures that this value is of type `Int`. `var Page = parseInt('{page: current}') + 1;` // `Num` represents the number of items per page; by default, the list displays 2 items per page,...
👁 249
Empire cms gets the pictures inside the content php

Empire cms gets the pictures inside the content php Program Notes Empire cms

if(empty($add['titlepic'])){ $str = $add['newstext']; $isMatched = preg_match(&quot;/&lt;img .*?(?=src)src=\&quot;([^\&quot;]+)\&quot;/si&quot;, $str,…
👁 200
Empire cms 4 million article homepage high-efficiency calling code

Empire cms 4 million article homepage high-efficiency calling code Program Notes Empire cms

Due to the relatively low server specifications, using SQL's `RAND()` function for randomization is definitely not feasible—it's too slow. Therefore, I changed my approach: I first created a table with two fields—one for the article ID and one for the category ID—and then used this table to perform region-based randomization. This approach enables efficient randomization. However, there's a problem: relying solely on SQL isn't reliable, so I wrote some PHP code. After testing, the homepage loads within two seconds—but...
👁 210
1 10 11 12 13 14 23