Skip to content

Commit

Permalink
✨ 提取友情链接为单独模块及页面底部设置
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Dec 24, 2021
1 parent 60d18d2 commit 50d64df
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 83 deletions.
4 changes: 2 additions & 2 deletions 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

?>

<div id="content" class="mt20 container">
<div id="content" class="mt20 container min-height-container">

<?php echo pk_breadcrumbs() ?>

Expand All @@ -30,4 +30,4 @@



<?php get_footer() ?>
<?php get_footer() ?>
14 changes: 7 additions & 7 deletions assets/dist/libs.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/dist/puock.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/dist/style.min.css

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions assets/js/puock.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Puock {
if (el == null) {
el = $(".comment-captcha");
}
el.attr("src", el.attr("data-path") + '&t='+(new Date()).getTime())
el.attr("src", el.attr("data-path") + '&t=' + (new Date()).getTime())
}

eventOpenSearchBox() {
Expand Down Expand Up @@ -195,6 +195,7 @@ class Puock {
navbar: false,
filter(image) {
if (!$(image).hasClass("dont-view")) {
console.log(image)
return image.complete;
}
return false;
Expand Down Expand Up @@ -405,7 +406,7 @@ class Puock {
this.infoToastShow('评论信息不能为空');
return false;
}
if(this.data.params.vd_comment){
if (this.data.params.vd_comment) {
if ($.trim($("#comment-vd").val()) === '') {
this.infoToastShow('验证码不能为空');
return false;
Expand Down
45 changes: 43 additions & 2 deletions assets/style/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ pre {
padding-top: 20px;
}

.fs12 {
font-size: 12px;
}

.navbar, #header {
padding: 0;
position: fixed;
Expand Down Expand Up @@ -301,6 +305,10 @@ pre {
}
}

.min-height-container{
min-height: 70vh;
}

.modal-content {
border: none;
border-radius: 5px;
Expand Down Expand Up @@ -1697,9 +1705,31 @@ a:hover {
//首页友情链接
.index-links {
a {
margin: 3px 3px;
margin: 3px;
padding: 0.5rem 0.7rem;
}

.index-links-box {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-items: flex-start;
&:nth-of-type(2)::after {
content: '';
flex: auto;
}
}

.links-item {
background-color: @colorModeLightBg;
color: @colorModeLightFont;
transition: all .2s;
margin-bottom: 8px;
&:hover {
background-color: @colorPrimary;
color: @colorLight;
}
}
}


Expand Down Expand Up @@ -1755,6 +1785,13 @@ a:hover {
}
}

.index-links .links-item {
&:hover {
background-color: @colorPrimary;
color: @colorLight
}
}

.colorMode {
color: @colorYellow !important;
}
Expand All @@ -1766,7 +1803,11 @@ a:hover {
}

#post-comments .post-comment .content-text, .entry-content code,
#page-read-progress, .timeline-content, .timeline:before, .timeline-location {
#page-read-progress,
.timeline-content,
.timeline:before,
.timeline-location,
.index-links .links-item {
background-color: @inputBg;
}

Expand Down
59 changes: 25 additions & 34 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,34 @@
<footer id="footer">
<div class="container">
<div class="row row-cols-md-1">
<div class="col-md-6">
<div><span class="t-md pb-2 d-inline-block border-bottom border-primary"><i
class="czs-about-l"></i> <?php _e('关于我们', PUOCK) ?></span></div>
<p class="mt20 t-md"><?php echo pk_get_option('footer_about_me', '') ?></p>
</div>
<div class="col-md-6">
<div><span class="t-md pb-2 d-inline-block border-bottom border-primary"><i
class="czs-link-l"></i> <?php _e('友情链接', PUOCK) ?></span></div>
<div class="more-link mt20 t-md">
<?php
$link_cid = pk_get_option('index_link_id', '');
if (!empty($link_cid)) {
preg_match_all('/<a .*?>.*?<\/a>/', wp_list_bookmarks(array(
'category' => $link_cid,
'category_before' => '',
'title_li' => '',
'echo' => 0
)), $links);
foreach ($links[0] as $link) {
echo $link;
}
}
$link_page_id = pk_get_option('link_page', '');
if (!empty($link_page_id)) {
echo '<a target="_blank" href="' . get_page_link($link_page_id) . '">' . __('更多链接', PUOCK) . '</a>';
}
?>
<?php if (!empty(pk_get_option('footer_about_me_title', ''))): ?>
<div class="col-md-6">
<div><span class="t-md pb-2 d-inline-block border-bottom border-primary"><i
class="czs-about-l"></i> <?php echo pk_get_option('footer_about_me_title', '') ?></span>
</div>
<p class="mt20 t-md"><?php echo pk_get_option('footer_about_me', '') ?></p>
</div>
</div>
<?php endif; ?>
<?php if (!empty(pk_get_option('footer_copyright_title', ''))): ?>
<div class="col-md-6">
<div><span class="t-md pb-2 d-inline-block border-bottom border-primary"><i
class="czs-network-l"></i> <?php echo pk_get_option('footer_copyright_title', '') ?></span>
</div>
<p class="mt20 t-md"><?php echo pk_get_option('footer_copyright', '') ?></p>
</div>
<?php endif; ?>
</div>
<div class="mt20 text-center t-md">
<div class="info">
<?php echo pk_get_option('footer_info') ?>
<p>Theme by <a target="_blank" href="/~https://github.com/Licoy/wordpress-theme-puock">Puock</a></p>
</div>
</div>
<div class="mt20 text-center t-md">
<div class="info">
<?php echo pk_get_option('footer_info') ?>
<?php /* 请遵守开源协议,保留主题底部(此处)的署名,以支持本主题更好的发展,谢谢合作 */ ?>
<p class="fs12 mt10"><i class="czs-wordpress"></i>&nbsp;Theme by <a target="_blank" title="Puock"
href="/~https://github.com/Licoy/wordpress-theme-puock">Puock</a>
</p>
</div>
</div>
</div>
</footer>
</div>
<script data-no-instant
Expand All @@ -71,4 +62,4 @@ class="czs-link-l"></i> <?php _e('友情链接', PUOCK) ?></span></div>
<?php wp_footer(); ?>
<?php get_template_part('templates/async', 'views') ?>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion inc/go.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

?>

<div id="content" class="mt20 container">
<div id="content" class="mt20 container min-height-container">

<?php echo pk_breadcrumbs() ?>

Expand Down
49 changes: 37 additions & 12 deletions inc/setting/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function optionsframework_options()

// 全局设置
$options[] = array(
'name' => optionsframework_icon($base,'setting') . '全局设置',
'name' => optionsframework_icon($base, 'setting') . '全局设置',
'type' => 'heading'
);
$options[] = array(
Expand Down Expand Up @@ -219,7 +219,7 @@ function optionsframework_options()

// 基本设置
$options[] = array(
'name' => optionsframework_icon($base,'setting-config') . '基本设置',
'name' => optionsframework_icon($base, 'setting-config') . '基本设置',
'type' => 'heading'
);

Expand Down Expand Up @@ -398,7 +398,7 @@ function optionsframework_options()

// 第三方登录
$options[] = array(
'name' => optionsframework_icon($base,'tencent-qq') . '第三方登录',
'name' => optionsframework_icon($base, 'tencent-qq') . '第三方登录',
'type' => 'heading'
);

Expand Down Expand Up @@ -426,7 +426,7 @@ function optionsframework_options()

// CMS布局设置
$options[] = array(
'name' => optionsframework_icon($base,'page') . 'CMS布局设置',
'name' => optionsframework_icon($base, 'page') . 'CMS布局设置',
'type' => 'heading'
);

Expand Down Expand Up @@ -480,7 +480,7 @@ function optionsframework_options()

// 企业布局设置
$options[] = array(
'name' => optionsframework_icon($base,'city') . '企业布局设置',
'name' => optionsframework_icon($base, 'city') . '企业布局设置',
'type' => 'heading'
);

Expand Down Expand Up @@ -655,7 +655,7 @@ function optionsframework_options()

// 防刷验证
$options[] = array(
'name' => optionsframework_icon($base,'protect') . '防刷验证',
'name' => optionsframework_icon($base, 'protect') . '防刷验证',
'type' => 'heading'
);

Expand All @@ -669,7 +669,7 @@ function optionsframework_options()

// 广告
$options[] = array(
'name' => optionsframework_icon($base,'ad') . '广告',
'name' => optionsframework_icon($base, 'ad') . '广告',
'type' => 'heading'
);

Expand Down Expand Up @@ -757,7 +757,7 @@ function optionsframework_options()

// 邮件设置
$options[] = array(
'name' => optionsframework_icon($base,'mail') . 'SMTP邮件',
'name' => optionsframework_icon($base, 'mail') . 'SMTP邮件',
'type' => 'heading'
);

Expand Down Expand Up @@ -821,7 +821,7 @@ function optionsframework_options()

// SEO设置
$options[] = array(
'name' => optionsframework_icon($base,'seo') . 'SEO设置',
'name' => optionsframework_icon($base, 'seo') . 'SEO设置',
'type' => 'heading'
);

Expand Down Expand Up @@ -925,6 +925,15 @@ function optionsframework_options()
'settings' => $editorSettings
);

$options[] = array(
'name' => '底部关于我们说明标题',
'desc' => '若为空则不显示此栏目',
'id' => 'footer_about_me_title',
'std' => '关于我们',
'class' => 'mini',
'type' => 'text'
);

$options[] = array(
'name' => '底部关于我们说明',
'id' => 'footer_about_me',
Expand All @@ -933,6 +942,23 @@ function optionsframework_options()
'std' => '底部关于我们说明'
);

$options[] = array(
'name' => '底部版权说明标题',
'desc' => '若为空则不显示此栏目',
'id' => 'footer_copyright_title',
'std' => '版权说明',
'class' => 'mini',
'type' => 'text'
);

$options[] = array(
'name' => '底部版权说明',
'id' => 'footer_copyright',
'settings' => $editorSettings,
'type' => 'editor',
'std' => '底部版权说明'
);

$options[] = array(
'name' => '下载说明/申明',
'id' => 'down_tips',
Expand All @@ -943,7 +969,7 @@ function optionsframework_options()

// 资源或更新
$options[] = array(
'name' => optionsframework_icon($base,'link-cloud-sucess') . '资源或更新',
'name' => optionsframework_icon($base, 'link-cloud-sucess') . '资源或更新',
'type' => 'heading'
);
$options[] = array(
Expand Down Expand Up @@ -981,8 +1007,7 @@ function optionsframework_options()
}



function optionsframework_icon($base, $icon, $nbsp = true)
{
return "<img class='pk-setting-icon' src='${base}/${icon}.svg' alt='${icon}' />";
}
}
4 changes: 2 additions & 2 deletions search.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php get_header() ?>

<div id="content" class="mt15 container">
<div id="content" class="mt15 container min-height-container">
<?php get_template_part('ad/global','top') ?>
<?php echo pk_breadcrumbs() ?>

Expand Down Expand Up @@ -29,4 +29,4 @@



<?php get_footer() ?>
<?php get_footer() ?>
4 changes: 2 additions & 2 deletions tag.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php get_header() ?>

<div id="content" class="container mt15">
<div id="content" class="container mt15 ">
<?php get_template_part('ad/global','top') ?>
<?php echo pk_breadcrumbs() ?>

Expand All @@ -18,4 +18,4 @@



<?php get_footer() ?>
<?php get_footer() ?>
Loading

0 comments on commit 50d64df

Please sign in to comment.