This plug-in is just an auxiliary plug-in. It doesn’t matter the imperial version, either 7.5 or 7.2. Duplicate tags will not be inserted successfully.
php code:
<?php
require('../e/class/connect.php');
require('../e/class/db_sql.php');
$link=db_connect();
$empire=new mysqlquery();
/****参数配置开始****/
//把所有tag放到一个文本里面,一个tag为一行
//然后把文本上传与本php文件相同的路径,最后运行插件即可
$filename = "tag.txt";
/****参数配置结束****/
$data = file_get_contents($filename);
$arrs = explode(PHP_EOL,$data);
foreach($arrs as $k => $value){
$sql = "INSERT INTO `{$dbtbpre}enewstags` (`tagid`, `tagname`, `num`, `isgood`, `cid`, `tagtitle`, `tagkey`, `tagdes`, `fclast`) VALUES (NULL, '$value', '0', '0', '0', '', '', '', '0')";
$r = $empire->query1($sql);
$false = "<p>名称为<a style='color:red;'>$value</a>的tag在数据库已经存在</p>";
$true = "<p>成功插入名称为<a style='color:green;'>$value</a>的tag</p>";
$msg = $r==1?$true:$false;
echo $msg;
}
db_close();
$empire=null;
?>Imperial cms7.5 batch adding TAG plug-in usage tutorial
1. Create an English directory in the root directory of the website. For security reasons, type in English as you like, for example: B5Bt8aXH6L5j3dd8xm66
2. After the directory is created, upload the addTitle.php file (or create a new php file, and then put the above code into the php file. The php file name can be arbitrary, for example: addTitle.php)
3. Put your tag into a text file. The file is preferably a txt text. The tag code format inside is one per line. Example of file name: tag.txt
第一个tag
第二个tag
第三个tag
第四个tag4. Open addTitle.php and change the tag file name in the parameter configuration to your own tag file name.
5. Run the plug-in. According to the above text name example, my plug-in operation is: domain name/B5Bt8aXH6L5j3dd8xm66/addTitle.php
Notes on using the TAG plugin in batches in Empire cms7.5
A file must be created to store the addTitle.php file
Plug-in download address: https://wwa.lanzoui.com/iSNvgu2l62b
For customized plug-ins, please contact qq: 1810216796
Please indicate the source when reprinting: https://www.4s5.cn/archives/61.html