使用定时任务在Discuz X3.4中免插件自动生成sitemap.xml

为了更好的利于SEO,加快百度、360、谷歌、bing、搜狗等收录,我们需要网站生成sitemap.xml,有些搜索引擎只支持.xml,不支持.txt,所以我们必须在511遇见论坛下自动生成sitemap.xml,由于我们采用了伪静态,所以生成的链接必须和伪静态规则一致,在discuz后台插件搜索了几个,姑且不谈收费免费,发现很不稳定,且静态规则无法兼容,这里我们采用discuz的定时任务,自动生成sitemap.xml。 继续阅读

discuz修改标签的字数限制

每一个标签的长度总数是20个字符,也就是10个汉字,虽然说标签一般都是比较短的,但是这个有时是无法满足坛友们的需要的,关于discuz论坛标题字数的修改教程网上很多,但是标签字数修改的教程却是少之又少。
首先,需要将签总数字255字符修改大一些,这个是在表pre_forum_post中的tags字段里面,这里将255修改成了1000,大家可以根据自己的需要去改。

其次是修改tags的长度限制,是在表pre_common_tag的tagname里面,默认的是20这里修改成了200。

第三个是修改表pre_common_tagitem中的tagname字段,也是把20修改成200

最后需要修改source/class/class_tag.php

   if(preg_match('/^([\x7f-\xff_-]|\w|\s){3,20}$/', $tagname)) {				$status = $idtype != 'uid' ? 0 : 3;				$result = C::t('common_tag')->get_bytagname($tagname, $idtype);				if($result['tagid']) {					if($result['status'] == $status) {						$tagid = $result['tagid'];					}

{3,20}这个地方是限制每一个标签的长度的,默认的是3个字符到20个字符,我们这里把20改成200,这样的话,标签最高可以输入200个字符了

宝塔 Nginx 反代网站 出现502 Bad Gateway

宝塔 Nginx 反代网站 出现502 Bad Gateway ,错误信息显示 SSL_do_handshake() failed 的解决方法

你是否遇到过使用宝塔 Nginx 反代网站时出现 502 Bad Gateway , 明明正常反代都没问题 , 可是反代就 502 Bad Gateway , 查看错误日志显示 :

*6565 SSL_do_handshake() failed (SSL: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:SSL alert number 80) while SSL handshaking to upstream

初步研究问题发现是由于网站启用了 SNI , 宝塔Nginx反代默认没有加入 SNI proxy_ssl_server_name on; ,Nginx 无法成功 handshake 上游的 SSL , 导致 502 Bad Gateway.

继续阅读

wordpress代码添加下载按钮

在自定义主题-额外CSS处填入如下代码

.button {
    border-radius: 5px;
    color: #ffffff!important;
    display: inline-block;
    margin-right: 10px;
	  margin-bottom: 10px;
    padding: 7px 10px;
	background-color: #3bc492;
	text-decoration: none!important;
	text-indent: 0!important;
}
.button2 {
    border-radius: 5px;
    color: #ffffff!important;
    display: inline-block;
    margin-right: 10px;
	  margin-bottom: 10px;
    padding: 7px 10px;
	background-color: #CC00CC;
	text-decoration: none!important;
	text-indent: 0!important;
}

在编辑器中使用如下格式调用:

<p style="text-align: center;"><a class="button" href="https://google.com" target="_blank" rel="noopener">MediaFire</a></p>

<p style="text-align: center;"><a class="button2" href="https://www.baidu.com" target="_blank" rel="noopener">77File</a></p>

 

禁用核心WordPress更新

出于任何原因,如果您想禁用WordPress的自动核心更新,请在您的wp-config.php文件中添加以下代码行。

define( 'AUTOMATIC_UPDATER_DISABLED', true );

有时,您的站点上的所有自动更新都被禁用,尤其是当您在站点上手动安装WordPress时。在这种情况下,您可以通过在wp-config.php文件中添加以下代码来启用自动功能。

define( 'WP_AUTO_UPDATE_CORE', true );

您可以将值“true”更改为“minor”以仅接收次要更新(这是默认设置)。或者将值设为“false”以完全禁用您网站上的所有核心更新。

debian10 curl command not found

1、sudo apt update 或者 sudo apt upgrade

2、sudo apt install curl 或 sudo apt-get install curl

如果提示:要验证是否正确安装Curl,请在终端键入curl,然后按Enter。终端将会打印消息curl: try ‘curl –help’ or ‘curl –manual’ for more information,说明安装成功。

telegraph图床搭建

利用 CF Workers 反代官方 telegra.ph 实现无需 PHP 空间,单个首页文件 index.html 就能完成整个站点。

官方github地址:https://github.com/missuo/Telegraph-Image-Hosting

1、在cloudflare上部署worker,代码填写如下 继续阅读