zblog常用插件及操作步驟


zblog文件包下載

鏈接:https://pan.baidu.com/s/1ImzXTj5L4lZ0nRbg2WyLPA
提取碼:hkp5


 

zblog常用插件及操作步驟

 

獲取獨立頁面的標題:

 {$zbp->GetPostByID(6)->Title}

 

獲取描述

{$article.Metas.des}

 

分頁類

{elseif $type=='category'}
<title>{$category.Name}_{$name}{if $page>'1'}_第{$pagebar.PageNow}頁{/if}</title>
<meta name="Keywords" content="{$category.Metas.catekey}" />
<meta name="Description" content="{$category.Metas.catedes}" />
{else} 

 


 
        

 導航欄高亮

<script>
$(function(){
    var surl = location.href;
    var surl2 = $(".place a:eq(1)").attr("href");
    $("#nav ul li a").each(function() {
        if ($(this).attr("href")==surl || $(this).attr("href")==surl2) $(this).parent().addClass("on")
    });
});
</script>

 

#nav ul li.on a{color:red;}

 

 


Nginx環境下設置zblog偽靜態方法

Apache的環境非常簡單.可以點擊創建 .htaccess就可以了

Nginx環境下設置偽靜態,並沒有那個一鍵創建的按鈕.只看到了這樣的一個提示.

 

別的環境未測試.寶塔面板中 反正我是沒找到.

寶塔面板的修改方法:

寶塔的每個網站都有一個對應的 conf文件.直接修改那個文件即可

linux下目錄為:www\server\panel\vhost\nginx\你的域名.conf

window下目錄為:  寶塔安裝目錄\Nginx\conf\vhost\你的域名.conf

 

別的環境可以按照以上規律來找一下!

linux下實操圖解:

 


 

 

header.php

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">

{if $type=='article'}
<title>{$title}_{$article.Category.Name}_{$name}</title>
{if $article.Metas.ikey}
<meta name="Keywords" content="{$article.Metas.ikey}" />
{else}
<meta name="Keywords" content="{$article.Title}" />
{/if}
{if $article.Metas.des}
<meta name="Description" content="{$article.Metas.des}" />
{else}
{php}$zhaiyao = preg_replace('/[\r\n\s]+/', '', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),155)).'...');{/php}
<meta name="Description" content="{$zhaiyao}" />
{/if}
{elseif $type=='page'}
{if $article.Metas.ititle}
<title>{$article.Metas.ititle}_{$name}</title>
{else}
<title>{$title}_{$name}</title>
{/if}
{if $article.Metas.ikey}
<meta name="Keywords" content="{$article.Metas.ikey}" />
{else}
<meta name="Keywords" content="{$article.Title}" />
{/if}
{if $article.Metas.des}
<meta name="Description" content="{$article.Metas.des}" />
{else}
{php}$zhaipage = preg_replace('/[\r\n\s]+/', '', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),155)).'...');{/php}
<meta name="Description" content="{$zhaipage}" />
{/if}

{elseif $type=='index'}
<title>{$zbp->Config('asuiji')->titles}</title>
<meta name="Keywords" content="{$zbp->Config('asuiji')->keys}">
<meta name="description" content="{$zbp->Config('asuiji')->des}">

{elseif $type=='category'}
<title>{$category.Metas.catetitle}_{$name}</title>
<meta name="Keywords" content="{$category.Metas.catekey}" />
<meta name="Description" content="{$category.Metas.catedes}" />
{else}
<title>{$title}_{$name}</title>
<meta name="Keywords" content="{$title}" />
<meta name="Description" content=" " />
{/if}

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="{$host}zb_users/theme/{$theme}/js/jquery1.42.min.js"></script>
<script type="text/javascript" src="{$host}zb_users/theme/{$theme}/js/jquery.SuperSlide.2.1.3.js"></script>
<link rel="stylesheet" rev="stylesheet" href="{$host}zb_users/theme/{$theme}/style/in.css" type="text/css" media="all"/>
<link rel="stylesheet" rev="stylesheet" href="{$host}zb_users/theme/{$theme}/style/global.css" type="text/css" media="all"/>
<link rel="stylesheet" rev="stylesheet" href="{$host}zb_users/theme/{$theme}/style/page.css" type="text/css" media="all"/>
</head>

<body>

    

 

分頁

<div class="fenye">
  <ul class="xiayiye">
    {template:pagebar}
  </ul>
</div>
<style>
.fenye{padding-left:25px; margin-top:10px; margin-bottom:10px;height:40px;}
.fenye a{padding: 4px 12px;border: 1px solid #ccc;color: #000!important;font-size:16px;}
.fenye a:hover{background-color: #64970E;color: #fff;padding: 4px 12px;}
.fenye .now-page{background-color: #64970E;color: #fff;padding: 4px 12px;font-size: 16px;border:1px solid #64970E;}
.fenye ul{margin:0 auto;padding:0 20px;margin-left:400px;float:left;}

.page{width:1200px;min-height:600px;margin:0 auto;}
.page>p{height:32px;margin:1px 0;font-size:26px;text-align:center;width:1200px;}
.page>span{margin:10px 0;float:left;}
.page h1{height:32px;margin:1px 0;font-size:26px;text-align: center;}
.page .pagecon{min-height:500px;border-top:1px solid #f2f2f2;margin-top:40px;}

</style>

 

公司名字:{$zbp->Config('asuiji')->aname}
地址:{$zbp->Config('asuiji')->add} 聯系人:{$zbp->Config('asuiji')->aperson} 手機:{$zbp->Config('asuiji')->amoblie} 電話:{$zbp->Config('asuiji')->aphone} 郵編{$zbp->Config('asuiji')->atax} 郵箱{$zbp->Config('asuiji')->aemail} qq{$zbp->Config('asuiji')->aqq}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM