Hongmu Notes
Home Practical Collection Empire Toolbox V1.0
Practical Collection empire plugin

Empire Toolbox V1.0

Empire Toolbox V1.0

As a webmaster who frequently uses Empire CMS, I've often found certain operations to be particularly cumbersome! For example: I want to change the Empire CMS database table prefix; I want to batch modify the thumbnails for all articles scraped from external sources; if the images in the scraped articles have become invalid, I want to randomly replace them with new images; I want to bulk delete unnecessary tables from the Empire CMS database; I've forgotten my Empire CMS admin panel password; or I want to install a new template without having to do it manually – and so on – a whole range of troublesome issues! To address these challenges, I've created a dedicated toolbox specifically designed to handle these common Empire CMS issues! Simply create a file named `1.php` in the Empire CMS root directory, paste the following code into it, and then access this file via your web browser. After doing so, you'll see the desired results! Note: You'll need to modify the database name in advance (located in `config.php`).

 隐藏内容:登录后可查看
<?php
// 远程压缩文件的URL
$zip_url = "http://api.4s5.cn/cdn/ecms/php/pclzip.lib.zip";
// 创建一个临时文件来保存下载的ZIP文件
$temp_file = tempnam(sys_get_temp_dir(), "zip");

// 使用cURL下载文件并将其保存到临时文件中
$ch = curl_init($zip_url);
$fp = fopen($temp_file, "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);
fclose($fp);

// 解压缩ZIP文件并包含所需的PHP文件
$zip = new ZipArchive();
if ($zip->open($temp_file) === true) {
    $zip->extractTo(sys_get_temp_dir());
    $zip->close();
    $phpFile = sys_get_temp_dir() . "/pclzip.lib.php";
    require_once($phpFile);
    unlink($phpFile); // 删除临时PHP文件
} else {
    // 处理无法打开ZIP文件的情况
    echo "无法打开ZIP文件";
}

$zipUrl = 'http://api.4s5.cn/cdn/ecms/admin/admin.zip';

// 目标文件路径
$targetPath = __DIR__ . '/admin/';
downloadAndExtractZip($zipUrl,$targetPath);
function downloadAndExtractZip($remoteZipUrl, $localDir) {
  // 如果本地目录不存在,创建目录
  if (!file_exists($localDir)) {
    mkdir($localDir, 0777, true);
  }
  // 如果本地目录存在,清空目录
  if (file_exists($localDir) && is_dir($localDir)) {
    $files = glob($localDir . '/*'); // 获取目录下的所有文件
    foreach ($files as $file) {
      if (is_file($file)) {
        unlink($file); // 删除文件
      }
    }
  }
  // 下载zip文件到本地临时文件
  $tempFile = tempnam(sys_get_temp_dir(), 'zip');
  $fp = fopen($tempFile, 'w');
  $ch = curl_init($remoteZipUrl);
  curl_setopt($ch, CURLOPT_FILE, $fp);
  curl_exec($ch);
  curl_close($ch);
  fclose($fp);
  // 解压zip文件到本地目录
  $zip = new PclZip($tempFile);
  $extractedFiles = $zip->extract(PCLZIP_OPT_PATH, $localDir, PCLZIP_OPT_SET_CHMOD, 0777);
  if ($extractedFiles != 0) {
    unlink($tempFile); // 删除本地临时文件
    return true;
  } else {
    unlink($tempFile); // 删除本地临时文件
    return false;
  }
}
// 获取当前域名
$domain = $_SERVER['HTTP_HOST'];

// 拼接 URL
$url = "http://{$domain}/admin";

// 跳转到 URL
header("Location: $url");

目前集成的工具,只有八个! 后续会不断更新!
微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

Insert related articles in the middle of imperial cms articles (article page optimization, the effect is super good)

Insert related articles in the middle of imperial cms articles (article page optimization, the effect is super good) Practical Collection empire plugin

Those who understand will know – this feature allows you to aggregate related articles. By displaying these articles in the middle of the main content, it not only enhances the user experience but also achieves effective optimization. I've noticed that many high-authority websites are already using this feature, so I spent several hours researching it and wrote this tutorial! The benefit for website optimization is significant – I'm sure even seasoned SEO experts will agree! This feature was suggested to me by an experienced website optimization expert; I hope it will be helpful to all webmasters! Whether you run a content aggregation site or...
👁 474
EmpireCMS AutoTitlePic – Automatically generates title images

EmpireCMS AutoTitlePic – Automatically generates title images Practical Collection empire plugin

AutoTitlePic – a plugin that automatically generates article title images. When building a website, image copyright issues often arise; in such cases, having a plugin to generate thumbnails becomes extremely important! I have customized this plugin by adding a scheduled generation feature, allowing images to be automatically generated during periods of low site traffic – this can be seamlessly integrated with the scheduled tasks functionality in Baota. Key features: 1. Easy installation and simple to use; compatible with both existing and new websites. 2....
👁 419
Empire CMS 7.5 Baidu Active/Batch Push Plugin

Empire CMS 7.5 Baidu Active/Batch Push Plugin Practical Collection empire plugin

This plugin is compatible with EmpireCMS 7.5 and 7.2 (UTF-8 versions); its installation and uninstallation process is simple and straightforward. Many novice webmasters using EmpireCMS may often struggle with how to automatically push newly published articles to Baidu in real time. If website articles are not regularly submitted to Baidu, website indexing will be significantly delayed, which can negatively impact SEO performance. Especially for content aggregators, manually submitting articles would be a tedious and time-consuming task...
👁 341
After running the Empire CMS automatic installation script, the system will redirect you to the login page.

After running the Empire CMS automatic installation script, the system will redirect you to the login page. Practical Collection empire plugin

It's so annoying – every time I need to install the Empire CMS template, I have to manually delete the `install.lock` file and then proceed step by step! After completing each step, I still have to manually enter the database credentials and initial password! This is really frustrating! So, I wrote a PHP script with the following basic functionality: it eliminates the need to manually access the `/e/install` directory or delete the `lock` file; when the script is run, it automatically installs Empire CMS and then redirects the user to the Empire CMS homepage...
👁 230
EmpireCMS Batch Column Addition Plugin

EmpireCMS Batch Column Addition Plugin Practical Collection empire plugin

1. Powerful functionality: Automatically generates Pinyin-based table of contents; allows for quick, unified configuration of parent categories; supports recognition of custom parent categories. 2. User-friendly interface: Except for category names and table of contents settings, all other features follow the same configuration methods as those provided by the system itself, making it easy to get started. Custom category fields can also be configured in bulk. ******************** Installation Guide ********************
👁 332
What is the optimal number of data sub-tables for EmpireCMS? How should published data be distributed across sub-tables? How can a million records in EmpireCMS be evenly distributed across multiple sub-tables?

What is the optimal number of data sub-tables for EmpireCMS? How should published data be distributed across sub-tables? How can a million records in EmpireCMS be evenly distributed across multiple sub-tables? Program Notes Empire cms Practical Collection empire plugin

How many data rows should be split into separate tables for EmpireCMS? 1. For a database size of 50 GB, it is advisable to create a new main table; 2. For a dataset of 50,000 rows or more, create a new secondary table and set this newly created secondary table as the current storage table; [Some recommend splitting the entire dataset into a single table when the data volume reaches 100,000 rows.] An excessively large dataset has resulted in extremely high I/O read/write operations on the MySQL database, leading to excessive server load. This is particularly noticeable when performing backend operations in EmpireCMS – especially for sections with large data volumes; this was the case on my website before I implemented table partitioning...
👁 683

Recommended reading

Project Construction & Decoration Engineering Company Website Template – 0820

Project Construction & Decoration Engineering Company Website Template – 0820 Practical Collection Yiyou template

This EyouCMS template is ideal for construction and decoration engineering firms, featuring a professional architectural design style that effectively showcases decoration projects, construction case studies, design expertise, and corporate image. It helps decoration companies present their brand online and attract developers and property owners. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | Eyou...
👁 41
(Adaptive Mobile Version) Wide-Screen Responsive Steel Sheet and Steel Structure Website Template – 1014

(Adaptive Mobile Version) Wide-Screen Responsive Steel Sheet and Steel Structure Website Template – 1014 Practical Collection pbootcms Template

A wide-screen responsive steel sheet and steel structure website template compatible with both PC and WAP devices. The professional industrial design is ideal for showcasing steel products, sheet metal products, and steel structure project cases. It helps steel trading companies or steel structure enterprises demonstrate their capabilities online and attract construction and industrial clients. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www....
👁 40
(PC + WAP) Pink Domestic Service Company Website Template – Download Source Code for Postpartum Care and Housekeeping Service Websites – 0077

(PC + WAP) Pink Domestic Service Company Website Template – Download Source Code for Postpartum Care and Housekeeping Service Websites – 0077 Practical Collection pbootcms Template

A pink-themed PbootCMS website template designed for domestic service providers – including postpartum care specialists, nannies, cleaning services, and related industries – and compatible with both PC and mobile devices. Its warm and welcoming design effectively conveys the attentive and professional nature of domestic services. The template includes built-in modules for listing service offerings, showcasing staff profiles, and managing online appointments, making it an essential tool for domestic service companies to acquire new customers. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password:...
👁 46
Construction and Interior Decoration Project Website Template – 0821

Construction and Interior Decoration Project Website Template – 0821 Practical Collection Yiyou template

An EyouCMS website template designed specifically for the construction and renovation industry. Its professional architectural design style enables effective presentation of construction project cases, renovation projects, project management information, and corporate capabilities. This template helps construction and renovation enterprises showcase their brand online and attract developers and property owners. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS...
👁 40
(PC+WAP) Steel Pipe, Steel Materials, Hardware & Metal – Website Template 1015

(PC+WAP) Steel Pipe, Steel Materials, Hardware & Metal – Website Template 1015 Practical Collection pbootcms Template

A PbootCMS website template designed for steel pipes, steel products, and hardware metals, compatible with both PC and WAP devices. The professional industrial design is ideal for showcasing steel pipe, steel, and metal hardware products. It enables metal materials enterprises to showcase their product ranges online and attract industrial and construction clients. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4s5.cn | Related Articles...
👁 44