Skip to content

Commit

Permalink
v0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zixingyx committed Oct 15, 2021
1 parent 8d34c0a commit a8b7f23
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 60 deletions.
2 changes: 1 addition & 1 deletion css/baolog.css
Expand Up @@ -80,7 +80,7 @@ a:hover {

.thread-content img {
max-width: 90% !important;
height: 100% !important;
height: 90% !important;
}

.post-list .list-group-item {
Expand Down
Binary file modified favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions footer.php
Expand Up @@ -40,6 +40,7 @@
<script src="<?php bloginfo('template_url'); ?>/js/post-content.js"></script>
<script src="<?php bloginfo('template_url'); ?>/js/baolog-like.js"></script>
<script src="<?php bloginfo('template_url'); ?>/js/baolog-top.js"></script>

<script>
jsearch_form = $('#search_form');
jsearch_form.on('submit', function () {
Expand Down
2 changes: 1 addition & 1 deletion framework/classes/admin-options.class.php
Expand Up @@ -23,7 +23,7 @@ class CSF_Options extends CSF_Abstract {
public $args = array(

// framework title
'framework_title' => 'baolog 线报主题 <small>当前版本为v0.3.2</small>',
'framework_title' => 'baolog 线报主题 <small>当前版本为v0.3.3</small>',
'framework_class' => '',

// menu settings
Expand Down
75 changes: 53 additions & 22 deletions framework/codestar-framework.php
Expand Up @@ -48,7 +48,7 @@
array(
'type' => 'notice',
'style' => 'success',
'content' => '当前主题版本为V0.3.2,请关注作者https://github.com/paopao233查看更新内容',
'content' => '当前主题版本为V0.3.3,请关注作者https://github.com/paopao233查看更新内容。加入QQ群一起探讨:781506134',
),
array(
'id' => 'baolog-favicon',
Expand Down Expand Up @@ -96,7 +96,6 @@
'id' => 'baolog-posts-blank',
'type' => 'switcher',
'title' => '首页文章新标签打开方式',
'label' => '是否开启?',
'subtitle' => '默认是当前标签载入文章',
'text_off' => '点击开启此功能',
'text_on' => '点击关闭此功能',
Expand All @@ -117,24 +116,31 @@
'type' => 'switcher',
'title' => '关闭首页导航',
'desc' => '首页导航既是最新线报、24小时热门这个导航,做博客可关闭',
'label' => '是否开启此功能?',
'subtitle' => '默认是开启',
'text_off' => '开启此功能',
'text_on' => '关闭此功能',
'text_off' => '点击开启此功能',
'text_on' => '点击关闭此功能',
'text_width' => 140,
'default' => 'true',

), array(
'id' => 'baolog-footer-custom',
'type' => 'textarea',
'type' => 'code_editor',
'sanitize' => false,
'title' => '自定义footer',
'desc' => '例如:<p>This is inserted at the footer</p>',
'subtitle' => '显示在底部的链接,支持html代码,不支持JavaScript',
'desc' => '例如:&lt;p type="text/javascript"&gt;This is inserted at the footer&lt;/p&gt;',
'subtitle' => '显示在底部的链接,支持html代码,同样支持javascript',
'help' => '为空则不显示',


), array(
'id' => 'baolog-footer-analysis',
'type' => 'textarea',
'type' => 'code_editor',
'sanitize' => false,
'settings' => array(
'theme' => 'mbo',
'mode' => 'javascript',
),
'title' => '统计代码',
'desc' => '例如:<script>我是统计代码~</script>',
'desc' => '例如:&lt;script&gt;我是统计代码~&lt;/script&gt;',
'subtitle' => '自定义统计代码,可用百度统计,CNZZ...',
'help' => '为空则不显示',
),
Expand All @@ -147,13 +153,13 @@
'title' => '页面设置',
'icon' => 'fa fa-navicon',
'fields' => array(
// A textarea field
array(
'id' => 'baolog-page-support',
'type' => 'text',
'title' => '赞助网站页面地址',
'desc' => '评论里面显示。默认是:' . get_option('home') . '/mod-support.html',
'default' => get_option('home') . '/mod-support.html',
'type' => 'heading',
'content' => '有关页面的设置',
),
array(
'type' => 'subheading',
'content' => '页面配置,不是文章页面,单纯的页面的相关配置',
),
array(
'id' => 'baolog-page-login',
Expand All @@ -176,11 +182,18 @@
'title' => '文章设置',
'icon' => 'fa fa-clipboard',
'fields' => array(
array(
'type' => 'heading',
'content' => '有关文章页面的设置',
),
array(
'type' => 'subheading',
'content' => '文章页面配置',
),
array(
'id' => 'baolog-posts-update',
'type' => 'switcher',
'title' => '文章3天内未更新提示',
'label' => '是否开启?',
'subtitle' => '显示在文章页面',
'text_off' => '点击开启此功能',
'text_on' => '点击关闭此功能',
Expand All @@ -190,7 +203,6 @@
'type' => 'switcher',
'title' => '禁用文章自动保存功能',
'desc' => '编辑文章时,会自动保存草稿,如果嫌弃这个太累赘可以禁用!',
'label' => '是否禁用?',
'subtitle' => '默认是禁用',
'text_off' => '点击开启此功能',
'text_on' => '点击关闭此功能',
Expand All @@ -202,7 +214,6 @@
'type' => 'switcher',
'title' => '禁用文章保存修订版本功能',
'desc' => '当我们发布一个新文章时,以前的版本会保留着,如果觉得这个是累赘,可以禁用掉',
'label' => '是否禁用?',
'subtitle' => '默认是禁用',
'text_off' => '点击开启此功能',
'text_on' => '点击关闭此功能',
Expand Down Expand Up @@ -247,6 +258,16 @@
'type' => 'subheading',
'content' => '侧栏相关图片配置',
),
array(
'id' => 'baolog-sidebar-app-switcher',
'type' => 'switcher',
'title' => '侧栏的app悬浮',
'desc' => '关闭侧栏app悬浮以后,下面安卓app无论有没有图片都是不会显示的。',
'subtitle' => '默认是开启',
'text_off' => '点击开启此功能',
'text_on' => '点击关闭此功能',
'text_width' => 140,
),
array(
'id' => 'baolog-sidebar-app',
'type' => 'upload',
Expand All @@ -256,6 +277,16 @@
'help' => '显示在侧栏的安卓app二维码',
'subtitle' => '显示在侧栏的安卓app二维码',
),
array(
'id' => 'baolog-sidebar-qrcode-switcher',
'type' => 'switcher',
'title' => '侧栏的二维码悬浮',
'desc' => '关闭侧栏的二维码悬浮以后,下面二维码图片无论有没有图片都是不会显示的。',
'subtitle' => '默认是开启',
'text_off' => '点击开启此功能',
'text_on' => '点击关闭此功能',
'text_width' => 140,
),
array(
'id' => 'baolog-sidebar-wx',
'type' => 'upload',
Expand Down Expand Up @@ -299,8 +330,8 @@

//备份
CSF::createSection($prefix, array(
'title' => '备份',
'desc' => '这里是备份',
'title' => '备份配置',
'desc' => '这里是对主题配置的一个备份',
'icon' => 'fa fa-credit-card',
'fields' => array(
array(
Expand Down
24 changes: 21 additions & 3 deletions functions.php
Expand Up @@ -10,12 +10,14 @@
*/
?>
<?php
// Content
// 引入 Content
include(get_template_directory() . '/functions/shortcodes.php');

//引入主题选项
require_once dirname(__FILE__) . '/framework/codestar-framework.php';

//引入自定义functions文件

//获取后台主题选项参数
$options = get_option('baolog_framework');

Expand Down Expand Up @@ -951,12 +953,12 @@ function baolog_wp_footer_custom()

add_action('wp_footer', 'baolog_wp_footer_custom', 100);

//自定义统计代码 支持html 不支持javascript
//自定义统计代码
function baolog_wp_footer_analysis()
{
$options = get_option('baolog_framework');
$custom_footer = $options['baolog-footer-analysis'];
echo '<script>'.$custom_footer.'</script>';
echo $custom_footer;
}
add_action('wp_footer', 'baolog_wp_footer_analysis', 100);

Expand Down Expand Up @@ -1001,7 +1003,23 @@ function countdown_js()
add_action('wp_footer', 'countdown_js');
wp_register_script('countdown_js', get_template_directory_uri() . '/js/countdownjs.js', array(), '1.0', false);
wp_enqueue_script('countdown_js');

/**
*
* 侧栏相关配置
*/
//检查是否需要关闭侧栏的app悬浮
function baolog_check_sidebar_switcher($option){
$options = get_option('baolog_framework');
$isCLose = $options[$option];

if ($isCLose != 1){
echo "hide ";
}
echo $isCLose;
}
?>




76 changes: 60 additions & 16 deletions header.php
Expand Up @@ -30,21 +30,65 @@
echo " - ";
bloginfo('name');
} ?></title>
<meta name="description" content="<?php
<?php
global $set;
$options = get_option('baolog_framework');
echo $options['baolog-description'];
?>" />
<meta name="keywords" content="<?php
$options = get_option('baolog_framework');
echo $options['baolog-keywords'];
?>" />
<meta name="renderer" content="webkit" />
$keywords = $options['baolog-keywords'];
$description = $options['baolog-description'];
if (is_home()) {
if ($description == null) {
$description = get_bloginfo('description');
}
} else if (is_single() || is_page()) {
global $post;
global $baolog_post_meta;
$baolog_post_meta = json_decode(get_post_meta($post->ID, 'baolog_post_meta', true), true);
if (empty($baolog_post_meta['seo']['open'])) {
$baolog_post_meta['seo']['open'] = 0;
}
if (empty($baolog_post_meta['closesidebar'])) {
$baolog_post_meta['closesidebar'] = 0;
}
if (empty($baolog_post_meta['postrighttag']['open'])) {
$baolog_post_meta['postrighttag']['open'] = 0;
}
if (empty($baolog_post_meta['catalog'])) {
$baolog_post_meta['catalog'] = 0;
}

if ($baolog_post_meta['seo']['open'] == 1) {
$description = $baolog_post_meta['seo']['description'];
$keywords = $baolog_post_meta['seo']['keywords'];
} else {
$description = str_replace("\n", "", mb_strimwidth(strip_tags($post->post_content), 0, 200, "", 'utf-8'));
$tags = wp_get_post_tags($post->ID);
foreach ($tags as $tag) {
$keywords = $keywords . $tag->name . ", ";
}
$keywords = rtrim($keywords, ', ');
}
} elseif (is_tag()) {
// 标签的description可以到后台 - 文章 - 标签,修改标签的描述
$description = tag_description();
$keywords = single_tag_title('', false);
} elseif (is_category()) {
$description = category_description();
$keywords = single_tag_title('', false);
}
$description = trim(strip_tags($description));
$keywords = trim(strip_tags($keywords));

if (post_password_required() == false) {
?><meta name="keywords" content="<?php echo $keywords; ?>"/>
<meta name="description" content="<?php echo $description; ?>"/>
<?php
}
?><meta name="renderer" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"/>
<link rel="shortcut icon" href="
<?php
<link rel="shortcut icon" href="<?php
$options = get_option('baolog_framework');
echo $options['baolog-favicon'];
?>">
Expand All @@ -57,7 +101,11 @@
echo $options['baolog-favicon'];
?>">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen"/>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ghboke/corepresscdn@master/static/lib/fontawesome5pro/css/all.min.css?v=5.6">
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/bootstrap.css">
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/baolog.css">
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/huux-notice.css" name="huux_notice">
<?php wp_head(); ?>
<style>
table.nav_tag_list {
margin-bottom: 0.2rem;
Expand Down Expand Up @@ -90,10 +138,6 @@
text-decoration: none;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ghboke/corepresscdn@master/static/lib/fontawesome5pro/css/all.min.css?v=5.6">
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/bootstrap.css">
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/baolog.css">
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/huux-notice.css" name="huux_notice">
<style type="text/css" data-model="huux_hlight">
.huux_thread_hlight_style1 {
color: #D9534D;
Expand Down Expand Up @@ -136,7 +180,7 @@
width: 38px !important
}
</style>
<?php wp_head(); ?>

</head>

<!--刷新缓存-->
Expand Down
3 changes: 1 addition & 2 deletions page-support.php
Expand Up @@ -3,8 +3,7 @@
Template Name: 赞助我们
**/
get_header(); ?>

<body mpa-version="7.16.12" mpa-extension-id="aidjohbjielfdhcaookdaolppglahebo" data-new-gr-c-s-check-loaded="14.990.0"
<body mpa-version="7.16.12" mpa-extension-id="aidjohbjielfdhcaookdaolppglahebo" data-new-gr-c-s-check-loaded="14.990.0"
data-gr-ext-installed="">
<!--header-->
<main id="body">
Expand Down
2 changes: 1 addition & 1 deletion searchform.php
@@ -1,6 +1,6 @@
<form action="<?php echo home_url('/'); ?>" id="search_form" method="get">
<div class="input-group form-inline">
<input type="text" name="s" placeholder="搜索线报..."
<input type="text" name="s" placeholder="搜索一下..."
style="box-shadow: none;" class="form-control form-control-sm" value="<?php the_search_query(); ?>">
<div class="input-group-append">
<button class="btn btn-dark btn-sm" type="submit">搜索</button>
Expand Down
7 changes: 4 additions & 3 deletions sidebar.php
@@ -1,5 +1,6 @@
<ul class="baolog_side_nav">
<li>
<ul class="baolog_side_nav">

<li class="sidebar_app <?php baolog_check_sidebar_switcher("baolog-sidebar-app-switcher") ?>">
<i class="baolog_sn1 icon-android"></i>
<i class="baolog_sn_i"></i>
<div class="baolog_sn2">
Expand All @@ -15,7 +16,7 @@
</div>
</div>
</li>
<li>
<li class="sidebar_qrcode <?php baolog_check_sidebar_switcher("baolog-sidebar-qrcode-switcher") ?>">
<i class="baolog_sn1 icon-weixin"></i>
<i class="baolog_sn_i"></i>
<div class="baolog_sn2">
Expand Down

0 comments on commit a8b7f23

Please sign in to comment.