当前位置:南蛮子懋和 > 技术 > Z-BlogPHP > 纯净主题的几个东西的备份

纯净主题的几个东西的备份

南蛮子懋和2025年03月28日Z-BlogPHP321
文章摘要
DaoGPT
此内容根据文章AI生成,并经过人工审核,仅用于文章内容的解释与总结
投诉

一,关于新增分页模板的include.php修改,纯净主题每加个自定义模板如haowu,则改之

function tpure_DefaultTemplate(&$template)
{
    global $zbp;
    if($template->GETTags('type') == 'index' && $template->GETTags('page') != '1'){
        switch($zbp->Config('tpure')->PostINDEXSTYLE){
            case "1":
                $template->SetTemplate('forum');
                break;
            case "2":
                $template->SetTemplate('album');
                break;
            case "3":
                $template->SetTemplate('sticker');
                break;
            case "4":
                $template->SetTemplate('hotspot');
                break;
            case "5":
                $template->SetTemplate('haowu');
                break;
            case "6":
                $template->SetTemplate('zuji');
                break;
            default:
                $template->SetTemplate('catalog');
        }
    }
    if(($template->GetTags('type') == 'category' && $template->GetTags('category')->Template != 'forum' && $template->GetTags('category')->Template != 'album' && $template->GetTags('category')->Template != 'sticker' && $template->GetTags('category')->Template != 'hotspot' && $template->GetTags('category')->Template != 'haowu' && $template->GetTags('category')->Template != 'zuji') ||
       ($template->GetTags('type') == 'tag' && $template->GetTags('tag')->Template != 'forum' && $template->GetTags('tag')->Template != 'album' && $template->GetTags('tag')->Template != 'sticker' && $template->GetTags('tag')->Template != 'hotspot' && $template->GetTags('tag')->Template != 'haowu' && $template->GetTags('tag')->Template != 'zuji') || $template->GetTags('type') == 'date'){
        $template->SetTemplate('catalog');
    }
    if($template->GetTags('type') == 'author' && $template->GetTags('author')->Template != 'catalog' && $template->GetTags('author')->Template != 'forum' && $template->GetTags('author')->Template != 'album' && $template->GetTags('author')->Template != 'sticker' && $template->GetTags('author')->Template != 'hotspot' && $template->GetTags('author')->Template != 'haowu' && $template->GetTags('author')->Template != 'zuji'){
        $template->SetTemplate('author');
    }
}

第二部分

function tpure_JudgeListTemplate($listtype)
{
    global $zbp;
    $listtype = $zbp->Config('tpure')->PostSEARCHSTYLE;
    switch($listtype)
    {
        case 1:
            $template = 'forum';
            break;
        case 2:
            $template = 'album';
            break;
        case 3:
            $template = 'sticker';
            break;
        case 4:
            $template = 'hotspot';
            break;
        case 5:
            $template = 'haowu';
            break;
        case 6:
            $template = 'zuji';
            break;    
        default:
            $template = '';
    }
    return $template;
}

二,由于纯净主题的IP归属地数据库不太理想,所以用的插件替代,如

<div class="cmtsname">{if $comment.Author.HomePage}<a href="{$comment.Author.HomePage}" rel="nofollow" target="_blank">{$comment.Author.StaticName}</a>{else}{$comment.Author.StaticName}{/if}{if $comment.Author.ID >= 59 && $comment.Author.ID <= 95}&nbsp;<i class="bi bi-robot"></i>&nbsp;{/if}{if $zbp->Config('tpure')->PostCMTIPON == '1'}<em>IP:{tpure_ipLocation($comment.IP)}</em>{/if}&nbsp;<em>{$comment.CommentUA['browser']['title']}</em>
            &nbsp;<em>{$comment.CommentUA['platform']['title']}</em></div>

三,评论处添加自定义提示,如commentpost.php,comment.php等

<textarea name="txaarticle" id="txaarticle" rows="3" tabindex="1" placeholder="请输入您的评论。点击“评论”按钮后,如果信息无误会自动刷新页面,即评论成功。因为缓存、CDN等因素,新评论将延时展示,并不能第一时间看到自己的评论。"></textarea>

四,纯净主题的文章页面在新版本的略缩图不可用,上传自定义略缩图无效,保存文章直接500;

五,纯净主题的文章页面的音乐播放与修改后的模板某些地方js冲突,只能优先使用拓源mp3插件;

六,纯净主题暂不支持PHP8.*,故每次更新需要覆盖plugin/phpmailer;

七,每次更新要注意footer.php内版权信息的更新。

其他需要注意的地方

右侧的作者统计,数字展示已经更改

https://www.dao.js.cn/new/2025020511594.shtml

暂时没有任何办法强制评论邮箱、网址、用户名均为必填,故如下

https://www.dao.js.cn/new/2024092011436.shtml

文章页面新增的AI摘要,每次升级需注意添加

https://www.dao.js.cn/new/2024121611540.shtml

文章页面新增的时间因子,每次升级需要注意添加

https://www.dao.js.cn/new/2024090311412.shtml

扫描二维码推送至手机访问。

版权声明:本文由 南蛮子懋和 发布,如需转载请遵循《声明》注明出处。

本文链接:https://www.dao.js.cn/new/2025032811694.shtml

分享给朋友:

“纯净主题的几个东西的备份” 的相关文章

Z-Blog时间因子,提交格式规范

Z-Blog时间因子,提交格式规范

时间因子作为百度和头条搜索的重要评估标准,决定了网页内容在搜索引擎中的表现。通过分析内容的发布时间、更新时间及用户互动时间,搜索引擎能够判断其价值与相关性。定期更新内容,保持页面的新鲜度,并积极引导用...

让Z-Blog评论必须填邮箱、网址等信息

让Z-Blog评论必须填邮箱、网址等信息

鸣谢@隔壁老李、@拓源网、@沉冰浮水、@豫唐网络四位大佬的思路及技术支撑,使得小道又学会了一个巧妙地姿势。缘起啊,说来话长。有位道友找小道换友链,结果在写评论的时候,居然邮箱、主页什么的全都没填,小道...

巧用Cloudflare功能实现Z-BlogPHP智能AI摘要

巧用Cloudflare功能实现Z-BlogPHP智能AI摘要

特别鸣谢@Mayx的鼎力支持,使小道实现了巧用Cloudflare功能实现Z-BlogPHP智能AI摘要的基本功能。思路https://mayx.eu.org/2024/07/03/ai-summar...

Z-BlogPHP调用文章总数、评论总数等常用标签

Z-BlogPHP调用文章总数、评论总数等常用标签

文章总数:{$zbp->cache->all_article_nums} 页面总数:{$zbp->cache->all_page_nums} 标签总数:{$...

升级拓源纯净主题tpure的注意事项

升级拓源纯净主题tpure的注意事项

由于站点已经是PHP高版本,每次升级主题的时候,需要重新下载纯净主题PHP7.4~PHP8邮件通知组件,不然的话整个网站评论会提示没有each函数。一定要长记性,长记性。目前主题的离线IP数据是没有I...

评论列表

绘初颜
绘初颜   UC Browser 15.0.6.3012  Apple iPhone
2025年03月28日

纯净主题的几个东西备份值得收藏,每一份都体现对生活的细致追求与精致备忘。

发表评论

南蛮子懋和

南蛮子懋和

◎欢迎参与讨论,请在这里发表您的看法和观点。

请如实填写常用的真实邮箱,方便后续的回复邮件通知。