-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathpage-links.php
112 lines (108 loc) · 5.92 KB
/
page-links.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* 友情链接
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$GLOBALS['page'] = 'page-links';
// 语言初始化
languageInit($this->options->language);
$linkArr = array();
// 是否包含内页链接
if ($this->options->pageLinks) {
array_push($linkArr, array(
'title' => $GLOBALS['t']['linkPage']['linksOnDedicatedPageOnly'],
'links' => json_decode($this->options->pageLinks)
));
}
// 是否包含首页链接
if ($this->options->homeLinks) {
array_push($linkArr, array(
'title' => $GLOBALS['t']['linkPage']['linksOnHomepage'],
'links' => json_decode($this->options->homeLinks)
));
}
// 是否包含全站链接
if ($this->options->links) {
array_push($linkArr, array(
'title' => $GLOBALS['t']['linkPage']['linksOnAllPages'],
'links' => json_decode($this->options->links)
));
}
$this->need('components/header.php');
?>
<div class="container main" id="main">
<div class="row my-4">
<div class="col-xl-8 col-lg-8 post-page mb-5 mb-sm-5 mb-md-5 mb-lg-0 mb-xl-0">
<?php if ($this->options->breadcrumb == 'on'): ?>
<nav aria-label="<?php echo $GLOBALS['t']['breadcrumb']; ?>" class="breadcrumb-nav bg">
<ol class="breadcrumb m-0 pl-0 pr-0 pt-0 border-0">
<li class="breadcrumb-item">
<a href="<?php $this->options->siteUrl(); ?>"><?php echo $GLOBALS['t']['header']['home']; ?></a>
</li>
<li tabindex="0" class="breadcrumb-item active" aria-current="page"><?php $this->title(); ?></li>
</ol>
</nav>
<?php endif; ?>
<main class="page">
<article class="mb-4 border-bottom">
<header>
<h1 class="post-title m-0">
<a href="<?php $this->permalink(); ?>" rel="bookmark"><?php $this->title(); ?></a>
</h1>
</header>
<?php $headerImg = headerImageDisplay($this, $this->options->headerImage, $this->options->headerImageUrl); ?>
<?php if ($headerImg): ?>
<div class="header-img mb-3 mt-4">
<a <?php if ($this->options->headerImageStyle == 'rounded-corners') echo 'class="rounded"'; ?> href="<?php $this->permalink(); ?>" aria-hidden="true" aria-label="文章头图" style="background-image: url(<?php echo $headerImg; ?>);" tabindex="-1"></a>
</div>
<?php endif; ?>
<div class="post-info mt-2">
<span class="ml-1" title="<?php echo $GLOBALS['t']['post']['publicationDate']; ?>" data-toggle="tooltip" data-placement="top">
<i class="icon-calendar mr-1" aria-hidden="true"></i>
<time datetime="<?php $this->date('c'); ?>"><?php echo postDateFormat($this->created); ?></time>
</span>
<span class="ml-2" title="<?php echo $GLOBALS['t']['post']['author']; ?>" data-toggle="tooltip" data-placement="top">
<i class="icon-user mr-1" aria-hidden="true"></i>
<a href="<?php $this->author->permalink(); ?>" class="mr-2" title="<?php echo $GLOBALS['t']['post']['author']; ?>: <?php $this->author(); ?>">
<?php $this->author(); ?>
</a>
</span>
<span class="ml-2" title="<?php echo $GLOBALS['t']['post']['views']; ?>" data-toggle="tooltip" data-placement="top">
<i class="icon-eye mr-1" aria-hidden="true"></i>
<?php echo postViews($this); ?>
</span>
</div>
<div class="post-content mt-4">
<?php if (count($linkArr)): ?>
<?php foreach ($linkArr as $link): ?>
<h2><?php echo $link['title']; ?></h2>
<div class="row page-links mb-4 mt-3" aria-label="<?php echo $link['title']; ?>" role="group">
<?php foreach ($link['links'] as $val): ?>
<div class="col-xl-4 col-lg-4 col-md-4 col-sm-6 col-12 link mb-3">
<?php if (isset($val->logoUrl)): ?>
<img class="logo mr-2" src="<?php echo $val->logoUrl; ?>" alt="<?php echo $val->name; ?>">
<?php else: ?>
<div aria-label="<?php echo $val->name; ?>" role="img" class="logo-icon mr-2">
<i class="icon-link"></i>
</div>
<?php endif; ?>
<a href="<?php echo $val->url; ?>" title="<?php echo isset($val->title)?$val->title:$val->name; ?>" target="_blank" data-toggle="tooltip" data-placement="top">
<?php echo $val->name; ?>
</a>
</div>
<?php endforeach; ?>
</div>
<hr>
<?php endforeach; ?>
<?php endif; ?>
<?php $this->content(); ?>
</div>
</article>
<?php $this->need('components/comments.php'); ?>
</main>
</div>
<?php $this->need('components/sidebar.php'); ?>
</div>
</div>
<?php $this->need('components/footer.php'); ?>