问题描述
- 上传文件时提示“文件超出大小”,修改后台设置无效。
解决步骤
- 检查zblog后台设置
- 全局设置:修改“允许上传文件的大小(单位MB)”。
- 修改php.ini
- 虚拟主机:联系主机提供商修改。
- 服务器:找到
php.ini
文件,修改upload_max_filesize
参数,保存并重启服务器。
分享服务器维护、抵抗入侵、防篡改、防御攻击、排查后门木马、清理挖矿病毒、网络安全、信息安全、内网安全、数据灾备、网站搬迁、程序升级、威胁情报、网站安全运维的日常知识
php.ini
文件,修改upload_max_filesize
参数,保存并重启服务器。/zb_users/plugin/RegPage/include.php
文件。$article->Template
改为自定义模板的名称,例如'login'
。当前位置:<a href="{$host}">网站首页</a>
{if $type=='category'}
{php}
$html='';
function navcate($id){
global $html;
$cate = new Category;
$cate->LoadInfoByID($id);
$html = ' > <a href="'.$cate->Url.'" title="查看'.$cate->Name.'中的全部文章">'.$cate->Name.'</a>'.$html;
if(($cate->ParentID)>0){
navcate($cate->ParentID);
}
}
navcate($category->ID);
global $html;
echo $html;
{/php}
{else}
> {$title}
{/if}
效果示例: 当前位置:网站首页 > 一级分类 > 二级分类 > 三级分类
http://localhost/install.php
,按照提示完成安装。默认设置:
自定义设置:
pre_get_posts
钩子来动态设置不同分类的每页文章数量。代码示例:
// 不同分类调用不同的分页显示数量
function tx_wp_filter_pre_get_posts($query) {
if ($query->is_main_query()) { // 判断是否为主查询
$num = '';
if (is_category()) { // 判断是否为分类
$cat_ID = get_queried_object_id(); // 获取分类ID
if (get_option('cat-pagenum-' . $cat_ID)) { // 判断分类自定义字段是否有值
$num = get_option('cat-pagenum-' . $cat_ID);
$query->set('posts_per_page', $num); // 给主循环数据里面的每页文章数量赋值
}
}
}
return $query;
}
add_action('pre_get_posts', 'tx_wp_filter_pre_get_posts'); // 挂上钩子
简化版代码:
// 不同分类调用不同的分页显示数量
function tx_wp_filter_pre_get_posts($query) {
if ($query->is_main_query()) { // 判断是否为主查询
$num = '';
if (is_category(array(1))) { // 数字1为指定分类ID
$num = 2; // 数字2为每页文章数量值,可以任意修改但必须是整数
$query->set('posts_per_page', $num); // 给主循环数据里面的每页文章数量赋值
}
}
return $query;
}
add_action('pre_get_posts', 'tx_wp_filter_pre_get_posts'); // 挂上钩子
Apache (.htaccess):
RewriteEngine On
ErrorDocument 404 /404.html
RewriteBase /
# 信息列表
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^listinfo-(.+?)-(.+?)\.html$ /e/action/ListInfo/index\.php\?classid=$1&page=$2
# 信息内容页
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^showinfo-(.+?)-(.+?)-(.+?)\.html$ /e/action/ShowInfo\.php\?classid=$1&id=$2&page=$3
# 标题分类列表页
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^infotype-(.+?)-(.+?)\.html$ /e/action/InfoType/index\.php\?ttid=$1&page=$2
# TAGS信息列表页
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^tags-(.+?)-(.+?)\.html$ /e/tags/index\.php\?tagname=$1&page=$2
# 评论列表页
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$ /e/pl/index\.php\?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6
IIS6 (httpd.ini):
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# 信息列表
RewriteRule ^(.*)listinfo-(.+?)-(.+?)\.html$ $1/e/action/ListInfo/index\.php\?classid=$2&page=$3
# 信息内容页
RewriteRule ^(.*)showinfo-(.+?)-(.+?)-(.+?)\.html$ $1/e/action/ShowInfo\.php\?classid=$2&id=$3&page=$4
# 标题分类列表页
RewriteRule ^(.*)infotype-(.+?)-(.+?)\.html$ $1/e/action/InfoType/index\.php\?ttid=$2&page=$3
# TAGS信息列表页
RewriteRule ^(.*)tags-(.+?)-(.+?)\.html$ $1/e/tags/index\.php\?tagname=$2&page=$3
# 评论列表页
RewriteRule ^(.*)comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$ $1/e/pl/index\.php\?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7
# 搜索伪静态
IIS7 (web.config):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- 帝国7.2默认规则 IIS7的rule name不能重复相同 -->
<rewrite>
<rules>
<rule name="listinfo">
<match url="^(.*/)*listinfo-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/action/ListInfo/index.php?classid={R:2}&page={R:3}" />
</rule>
<rule name="showinfo">
<match url="^(.*/)*showinfo-(.+?)-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/action/ShowInfo.php?classid={R:2}&id={R:3}&page={R:4}" />
</rule>
<rule name="infotype">
<match url="^(.*/)*infotype-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/action/InfoType/index.php?ttid={R:2}&page={R:3}" />
</rule>
<rule name="tags">
<match url="^(.*/)*tags-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/tags/index.php?tagname={R:2}&page={R:3}" />
</rule>
<rule name="comment">
<match url="^(.*/)*comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/pl/index.php?doaction={R:2}&classid={R:3}&id={R:4}&page={R:5}&myorder={R:6}&tempid={R:7}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Nginx:
rewrite ^([^\.]*)/listinfo-(.+?)-(.+?)\.html$ $1/e/action/ListInfo/index.php?classid=$2&page=$3 last;
rewrite ^([^\.]*)/showinfo-(.+?)-(.+?)-(.+?)\.html$ $1/e/action/ShowInfo.php?classid=$2&id=$3&page=$4 last;
rewrite ^([^\.]*)/infotype-(.+?)-(.+?)\.html$ $1/e/action/InfoType/index.php?ttid=$2&page=$3 last;
rewrite ^([^\.]*)/tags-(.+?)-(.+?)\.html$ $1/e/tags/index.php?tagname=$2&page=$3 last;
rewrite ^([^\.]*)/comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$ $1/e/pl/index.php?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7 last;
if (!-e $request_filename) {
return 404;
}
12小时内
<?=$empire->gettotal("select count(*) as total from [!db.pre!]ecms_表 where newstime > UNIX_TIMESTAMP() - 12*3600")?>
6小时内
<?=$empire->gettotal("select count(*) as total from [!db.pre!]ecms_表 where newstime > UNIX_TIMESTAMP() - 6*3600")?>
phpMyAdmin
等工具进入数据库,查看 dede_admin
表中的用户名。修改 customfields.func.php
文件
$fvalue = trim($ntag->GetInnerText());
$fvalue = ($ntag == "") ? trim($ntag) : trim($ntag->GetInnerText());
修改 img.lib.php
文件
$innerTmp = $arcTag->GetInnerText();
$innerTmp = ($arcTag == "") ? trim($arcTag) : trim($arcTag->GetInnerText());
.dede_pages {
text-align: right;
}
.dede_pages ul {
float: right;
padding: 12px 0px 12px 16px;
}
.dede_pages ul li {
float: left;
font-family: Tahoma;
line-height: 17px;
margin-right: 6px;
border: 1px solid #E9E9E9;
}
.dede_pages ul li a {
float: left;
padding: 2px 4px 2px;
color: #555;
display: block;
}
.dede_pages ul li a:hover {
color: #690;
text-decoration: none;
padding: 2px 4px 2px;
}
.dede_pages ul li.thisclass,
.dede_pages ul li.thisclass a,
.pagebox ul li.thisclass a:hover {
background-color: #F8F8F8;
padding: 2px 4px 2px;
font-weight: bold;
}
.dede_pages .pageinfo {
line-height: 21px;
padding: 12px 10px 12px 16px;
color: #999;
}
.dede_pages .pageinfo strong {
color: #555;
font-weight: normal;
margin: 0px 2px;
}