Skip to content

Commit

Permalink
Merge pull request #41 from AH-dark/master
Browse files Browse the repository at this point in the history
Added an optional CDN service and optimized the code
  • Loading branch information
youranreus authored Nov 21, 2021
2 parents 7cb5cdd + 6a65919 commit f96da91
Show file tree
Hide file tree
Showing 43 changed files with 6,694 additions and 4,697 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.vscode/
.idea/
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@
- 各种小动画
- 长期维护



总之,欢迎下载体验~

| 主题文档 | 主题QQ群 | 反馈邮箱 |
| --------------------- | --------- | ----------------- |
| https://g.imouto.tech | 674232327 | [email protected] |

### License 许可证

Open sourced under GPL-3.0 License.

18 changes: 9 additions & 9 deletions archive.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('components/header.php');
?>

<div id="container">
<h3 class="archive-title"><?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ''); ?></h3>
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ''); ?></h3>
<?php if ($this->have()): ?>
<div id="articles">
<?php $this->need('components/article.php'); ?>
</div>
<div id="articles-switch" class="clear">
<?php $this->pageLink('更多 >','next'); ?>
<?php $this->pageLink('< 返回','prev'); ?>
<?php $this->pageLink('更多 >', 'next'); ?>
<?php $this->pageLink('< 返回', 'prev'); ?>
</div>
<?php else: ?>
<article class="post">
Expand Down
150 changes: 76 additions & 74 deletions archives.php
Original file line number Diff line number Diff line change
@@ -1,84 +1,86 @@
<?php
/**
* 归档页
*
* @package custom
*/
$this -> need('components/header.php');
* 归档页
*
* @package custom
*/
$this->need('components/header.php');
?>

<div class="PAP" id="archives">
<div id="page-banner" class="PAP-banner">
<div>
<h2 itemprop="name headline"><?php $this->title() ?></h2>
</div>
</div>
<div id="archives-content">
<div id="tag-cloud">
<?php $this->widget('Widget_Metas_Tag_Cloud', array('sort' => 'count', 'ignoreZeroCount' => true, 'desc' => true, 'limit' => 20))->to($tags); ?>
<?php if($tags->have()): ?>
<?php while ($tags->next()): ?>
<li><a href="<?php $tags->permalink(); ?>" rel="tag" class="size-<?php $tags->split(5, 10, 20, 30); ?>" title="<?php $tags->count(); ?> 个话题"><?php $tags->name(); ?></a></li>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div id="timeline">
<?php
$Month_E = array(1 => "Jan",
2 => "Feb",
3 => "Mar",
4 => "Apr",
5 => "May",
6 => "Jun",
7 => "Jul",
8 => "Aug",
9 => "Sep",
10 => "Oct",
11 => "Nov",
12 => "Dec");
$this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year = 0;
$mon = 0;
$i = 0;
$j = 0;
$all = array();
$output = '';
while ($archives->next()):
$year_tmp = date('Y', $archives->created);
$mon_tmp = date('n', $archives->created);
<div class="PAP" id="archives">
<div id="page-banner" class="PAP-banner">
<div>
<h2 itemprop="name headline"><?php $this->title() ?></h2>
</div>
</div>
<div id="archives-content">
<div id="tag-cloud">
<?php $this->widget('Widget_Metas_Tag_Cloud', array('sort' => 'count', 'ignoreZeroCount' => true, 'desc' => true, 'limit' => 20))->to($tags); ?>
<?php if ($tags->have()): ?>
<?php while ($tags->next()): ?>
<li>
<a href="<?php $tags->permalink(); ?>" rel="tag" class="size-<?php $tags->split(5, 10, 20, 30); ?>" title="<?php $tags->count(); ?> 个话题"><?php $tags->name(); ?></a>
</li>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div id="timeline">
<?php
$Month_E = array(1 => "Jan",
2 => "Feb",
3 => "Mar",
4 => "Apr",
5 => "May",
6 => "Jun",
7 => "Jul",
8 => "Aug",
9 => "Sep",
10 => "Oct",
11 => "Nov",
12 => "Dec");
$this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year = 0;
$mon = 0;
$i = 0;
$j = 0;
$all = array();
$output = '';
while ($archives->next()):
$year_tmp = date('Y', $archives->created);
$mon_tmp = date('n', $archives->created);

$y = $year;
$m = $mon;
if ($mon != $mon_tmp && $mon > 0) $output .= '</div></div>';
if ($year != $year_tmp) {
$year = $year_tmp;
$all[$year] = array();
}
$y = $year;
$m = $mon;
if ($mon != $mon_tmp && $mon > 0) $output .= '</div></div>';
if ($year != $year_tmp) {
$year = $year_tmp;
$all[$year] = array();
}

if ($mon != $mon_tmp) {
$mon = $mon_tmp;
array_push($all[$year], $mon);
$output .= "<div class='archive-title' id='arti-$year-$mon'><h3>$year-$Month_E[$mon]</h3><div class='archives archives-$mon' data-date='$year-$mon'>";
}
$output .= '<div class="brick"><a href="' . $archives->permalink . '" style="text-decoration:none;"><span class="time">' . date('m-d', $archives->created) . '</span style="color:#888;">' . $archives->title . '</a></div>';
endwhile;
$output .= '</div></div>';
echo $output;
if ($mon != $mon_tmp) {
$mon = $mon_tmp;
array_push($all[$year], $mon);
$output .= "<div class='archive-title' id='arti-$year-$mon'><h3>$year-$Month_E[$mon]</h3><div class='archives archives-$mon' data-date='$year-$mon'>";
}
$output .= '<div class="brick"><a href="' . $archives->permalink . '" style="text-decoration:none;"><span class="time">' . date('m-d', $archives->created) . '</span style="color:#888;">' . $archives->title . '</a></div>';
endwhile;
$output .= '</div></div>';
echo $output;

$html = "";
$year_now = date("Y");
foreach ($all as $key => $value) {
$html .= "<li class='year' id='year-$key'><a href='#' class='year-toogle' id='yeto-$key'>$key</a><ul class='monthall'>";
for ($i = 12; $i > 0; $i--) {
if ($key == $year_now && $i > $value[0]) continue;
$html .= in_array($i, $value) ? ("<li class='month monthed' id='mont-$key-$i'>$i</li>") : ("<li class='month'>$i</li>");
}
$html .= "</ul></li>";
}
?>
</div>
</div>
</div>
$html = "";
$year_now = date("Y");
foreach ($all as $key => $value) {
$html .= "<li class='year' id='year-$key'><a href='#' class='year-toogle' id='yeto-$key'>$key</a><ul class='monthall'>";
for ($i = 12; $i > 0; $i--) {
if ($key == $year_now && $i > $value[0]) continue;
$html .= in_array($i, $value) ? ("<li class='month monthed' id='mont-$key-$i'>$i</li>") : ("<li class='month'>$i</li>");
}
$html .= "</ul></li>";
}
?>
</div>
</div>
</div>


<?php $this->need('components/footer.php'); ?>
24 changes: 13 additions & 11 deletions components/404.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>

<div class="col-mb-12 col-tb-8 col-tb-offset-2">
<div class="col-mb-12 col-tb-8 col-tb-offset-2">

<div class="error-page">
<h2 class="post-title">404 - <?php _e('页面没找到'); ?></h2>
<p><?php _e('你想查看的页面已被转移或删除了, 要不要搜索看看: '); ?></p>
<form method="post">
<p><input type="text" name="s" class="text" autofocus /></p>
<p><button type="submit" class="submit"><?php _e('搜索'); ?></button></p>
</form>
</div>
<div class="error-page">
<h2 class="post-title">404 - <?php _e('页面没找到'); ?></h2>
<p><?php _e('你想查看的页面已被转移或删除了, 要不要搜索看看: '); ?></p>
<form method="post">
<p><input type="text" name="s" class="text" autofocus/></p>
<p>
<button type="submit" class="submit"><?php _e('搜索'); ?></button>
</p>
</form>
</div>

</div><!-- end #content-->
<?php $this->need('footer.php'); ?>
</div><!-- end #content-->
<?php $this->need('footer.php'); ?>
Loading

0 comments on commit f96da91

Please sign in to comment.