diff options
| author | 阔落 <45323514+BigCoke233@users.noreply.github.com> | 2019-03-24 18:02:09 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-24 18:02:09 +0800 |
| commit | 107e63005d013dd3caea541c921dcf8be415014e (patch) | |
| tree | 88b800d76e8724b8a9cdbb296d7492ae546f8750 | |
| parent | 86e235a247a0c34232f2cb60c111482a3e068aaf (diff) | |
Add files via upload
| -rw-r--r-- | file.php | 70 | ||||
| -rw-r--r-- | functions.php | 76 | ||||
| -rw-r--r-- | index.php | 58 | ||||
| -rw-r--r-- | links.php | 63 | ||||
| -rw-r--r-- | page.php | 52 | ||||
| -rw-r--r-- | post.php | 59 |
6 files changed, 378 insertions, 0 deletions
diff --git a/file.php b/file.php new file mode 100644 index 0000000..0bf18ee --- /dev/null +++ b/file.php @@ -0,0 +1,70 @@ +<?php
+/**
+ * 归档页面
+ *
+ * @package custom
+ */
+ ?>
+<?php $this->need('includes/head.php'); ?>
+<?php $this->need('includes/header.php'); ?>
+
+ <main class="container" id="pjax-container"><div class="row">
+
+ <!-- 主体 -->
+ <div class="col-md-8">
+ <!-- 面包屑 -->
+ <div class="item post-bread">
+ <i class="glyphicon glyphicon-folder-close"></i> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a> / <?php $this->title() ?>
+ </div>
+ <br />
+ <!-- 文章内容 -->
+
+ <article class="item">
+ <div class="post-banner">
+ <?php if($this->fields->banner && $this->fields->banner!='') :?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php else: ?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->default_banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php endif; ?>
+ <div class="post-header">
+ <h2><?php $this->title() ?></h4>
+ <span>
+ <i class="glyphicon glyphicon-time"></i> <?php $this->date('Y-m-d'); ?> /
+ <i class="glyphicon glyphicon-comment"></i> <?php $this->commentsNum('%d'); ?>
+ </span>
+ </div>
+ </div>
+
+ <div class="archive-list">
+ <ul class="post-ul">
+ <?php
+ $stat = Typecho_Widget::widget('Widget_Stat');
+ $this->widget('Widget_Contents_Post_Recent', 'pageSize='.$stat->publishedPostsNum)->to($archives);
+ $year=0; $mon=0; $i=0; $j=0;
+ while($archives->next()){
+ $year_tmp = date('Y',$archives->created);
+ $mon_tmp = date('m',$archives->created);
+ $y=$year; $m=$mon;
+ if ($year > $year_tmp || $mon > $mon_tmp) {
+ $output .= '</ul>';
+ }
+ $output .= '<li><span>'. $year_tmp .' - '. $mon_tmp .' | </span><a href="'.$archives->permalink .'">'. $archives->title .'</a><br /></li>';
+ }
+ $output .= '</ul>';
+ echo $output;
+ ?>
+ </ul>
+ </div>
+ </article>
+
+ </div>
+
+ <!-- 侧边栏 -->
+ <div class="col-md-4">
+ <?php $this->need('includes/sidebar.php'); ?>
+ </div>
+ <?php $this->need('includes/toolbar.php'); ?>
+ </div></main>
+
+
+<?php $this->need('includes/footer.php'); ?>
\ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..301b65a --- /dev/null +++ b/functions.php @@ -0,0 +1,76 @@ +<?php
+/*
+* 自定义字段
+* By BigCoke
+*/
+function themeFields($layout) {
+ $banner = new Typecho_Widget_Helper_Form_Element_Text('banner', NULL, NULL, _t('文章缩略图'), _t('填入一个图片url作为缩略图,显示在文章列表和文章页面顶部,不填写则没有缩略图'));
+ $layout->addItem($banner);
+
+ $type=new Typecho_Widget_Helper_Form_Element_Select('type',array('0'=>'一般文章','1'=>'说说'),'0','文章类型');
+ $layout->addItem($type);
+}
+
+/*
+* 主题设置
+* By BigCoke
+*/
+function themeConfig($form) {
+
+ echo "<link href=\"..\usr\\themes\Mark\assets\css\setting.css\" type=\"text/css\" rel=\"stylesheet\">";
+ echo "<div class=\"typecho-option\"><div class=\"img-lg\"></div><h2 class=\"title\">Mark 2.0.0</h2><span class=\"alert\">感谢您使用Mark主题,若有什么疑问可以查阅<a href=\"https://github.com/BigCoke233/mark/wiki\">主题wiki</a>,或者email我:bc@cokewithice.com<br /><b> 并请您不要删除主题版权信息,谢谢配合!</b></span></div>";
+
+ //基础设置
+ $IndexName = new Typecho_Widget_Helper_Form_Element_Text('IndexName', NULL, NULL, _t('站点名称'), _t('首页名称,会在一些地方调用。'));
+ $form->addInput($IndexName);
+
+ $IndexDecoration = new Typecho_Widget_Helper_Form_Element_Text('IndexDecoration', NULL, NULL, _t('站点介绍'), _t('用一句话来介绍你的网站'));
+ $form->addInput($IndexDecoration);
+
+ $IndexIcon = new Typecho_Widget_Helper_Form_Element_Text('IndexIcon', NULL, NULL, _t('LOGO图标'), _t('显示在导航栏的站点名之前,参考font-awesome或者bootstrap内置图标的class'));
+ $form->addInput($IndexIcon);
+
+ $news = new Typecho_Widget_Helper_Form_Element_Text('news', NULL, NULL, _t('首页公告'), _t('公告,显示在首页文章列表之前'));
+ $form->addInput($news);
+
+ $avatar = new Typecho_Widget_Helper_Form_Element_Text('avatar', NULL, NULL, _t('博主头像'), _t('填入一个图片url,作为博主头像显示在侧边栏(其他地方的图片自动调用gravatar)'));
+ $form->addInput($avatar);
+
+ $site_create_time = new Typecho_Widget_Helper_Form_Element_Text('site_create_time', NULL, NULL, _t('网站建立时间'), _t('格式为 2010-09-10 00:00:00 即 年-月-日 时:分:秒'));
+ $form->addInput($site_create_time);
+
+ $default_banner = new Typecho_Widget_Helper_Form_Element_Text('default_banner', NULL, NULL, _t('默认头图'), _t('并非文章列表的默认缩略图,而是显示在文章内页的头图。'));
+ $form->addInput($default_banner);
+
+ //侧边栏社交按钮配置
+ $github = new Typecho_Widget_Helper_Form_Element_Text('github', NULL, NULL, _t('github主页地址'), _t('输入你的github主页地址,显示在侧边栏,不填写则不显示'));
+ $form->addInput($github);
+
+ $QQ_num = new Typecho_Widget_Helper_Form_Element_Text('QQ_num', NULL, NULL, _t('QQ号'), _t('输入你的QQ号,在侧边栏点击后自动打开聊天窗口,不填写则不显示。'));
+ $form->addInput($QQ_num);
+
+ $QQ_group = new Typecho_Widget_Helper_Form_Element_Text('QQ_group', NULL, NULL, _t('QQ群'), _t('在qq群官网,找到加群组件,将里面超链接中的url复制过来,直接打开QQ群,显示在侧边栏,不填写则不显示。'));
+ $form->addInput($QQ_group);
+
+ $custom_social = new Typecho_Widget_Helper_Form_Element_Textarea('custom_social', NULL, NULL,_t('自定义社交按钮'), _t('和之前的github、qq、qq群按钮显示在一起,如有需要请根据主题wiki配置。'));
+ $form->addInput($custom_social);
+
+ //个性化设置
+ $bg_url = new Typecho_Widget_Helper_Form_Element_Text('bg_url', NULL, NULL, _t('背景图url'), _t('填入一个图片url作为背景图,填入背景图后自动设置透明度。'));
+ $form->addInput($bg_url);
+
+ $custom_nav = new Typecho_Widget_Helper_Form_Element_Textarea('custom_nav', NULL, NULL, _t('自定义导航'), _t('用li标签结合a标签书写,若不清楚可以查看主题wiki,设置之后会直接覆盖默认的导航。'));
+ $form->addInput($custom_nav);
+
+ $custom_sidebar = new Typecho_Widget_Helper_Form_Element_Textarea('custom_sidebar', NULL, NULL, _t('自定义侧边栏'), _t('显示在原有侧边栏之后,按照wiki书写。'));
+ $form->addInput($custom_sidebar);
+
+ //pjax
+ $pjax = new Typecho_Widget_Helper_Form_Element_Select('pjax',array('0'=>'不启用','1'=>'启用'),'0','启用 PJAX (BETA)','是否启用 PJAX。如果你发现站点有点不对劲,又不知道这个选项是啥意思,请关闭此项。');
+ $form->addInput($pjax);
+
+ $pjax_reload = new Typecho_Widget_Helper_Form_Element_Textarea('pjax_reload', NULL, NULL, _t('Pjax重载函数'), _t('填入Pjax重载函数,不懂或者没有打开pjax请留空。'));
+ $form->addInput($pjax_reload);
+}
+
+
diff --git a/index.php b/index.php new file mode 100644 index 0000000..5c7be02 --- /dev/null +++ b/index.php @@ -0,0 +1,58 @@ +<?php
+/**
+ * Mark-那永不消逝的痕迹
+ *
+ * @package Mark
+ * @author BigCoke
+ * @version 2.0.0
+ * @link http://cokewithice.com
+ */
+$this->need('includes/head.php');
+$this->need('includes/header.php');
+?>
+
+ <main class="container" id="pjax-container"><div class="row">
+
+ <!-- 主体 -->
+ <div class="col-md-8">
+ <?php if ($this->is('index')): ?>
+ <!-- 公告 -->
+ <div class="item news">
+ <i class="fa fa-volume-up"></i> <?php $this->options->news(); ?>
+ </div>
+ <br />
+ <?php endif; ?>
+ <!-- archive -->
+ <?php if ($this->is('archive')): ?>
+ <div class="item">
+ <?php $this->archiveTitle(array(
+ 'category'=>_t('分类 %s 下的文章'),
+ 'search'=>_t('包含关键字 %s 的文章'),
+ 'tag' =>_t('标签 %s 下的文章'),
+ 'author'=>_t('%s 的主页')
+ ), '', ''); ?>
+ <?php if ($this->have()): ?>
+ <?php else: ?>
+ <h2>居然没有找到相关内容Σ(⊙▽⊙"a</h2>
+ <?php endif; ?>
+ </div>
+ <br />
+ <?php endif; ?>
+ <!-- 文章列表 -->
+ <?php while($this->next()): ?>
+ <?php $this->need('includes/post-item.php'); ?>
+ <?php endwhile; ?>
+
+ <div class="pagenav"><?php $this->pageNav('<i class="glyphicon glyphicon-hand-left"></i>', '<i class="glyphicon glyphicon-hand-right"></i>',4, '...'); ?></div>
+ </div>
+
+ <!-- 侧边栏 -->
+ <div class="col-md-4">
+ <?php $this->need('includes/sidebar.php'); ?>
+ </div>
+
+ <?php $this->need('includes/toolbar.php'); ?>
+ </div></main>
+
+
+<?php $this->need('includes/footer.php'); ?>
\ No newline at end of file diff --git a/links.php b/links.php new file mode 100644 index 0000000..b0975cd --- /dev/null +++ b/links.php @@ -0,0 +1,63 @@ +<?php
+/**
+ * 友情链接
+ *
+ * @package custom
+ */
+$this->need('includes/head.php');
+$this->need('includes/header.php'); ?>
+
+ <main class="container" id="pjax-container"><div class="row">
+ <!-- 主体 -->
+ <div class="col-md-8">
+ <!-- 面包屑 -->
+ <div class="item post-bread">
+ <i class="glyphicon glyphicon-folder-close"></i> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a> / <?php $this->title() ?>
+ </div>
+ <br />
+
+ <article class="item">
+ <div class="post-banner">
+ <?php if($this->fields->banner && $this->fields->banner!='') :?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php else: ?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->default_banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php endif; ?>
+ <div class="post-header">
+ <h2><?php $this->title() ?></h4>
+ <span>
+ <i class="glyphicon glyphicon-time"></i> <?php $this->date('Y-m-d'); ?> /
+ <i class="glyphicon glyphicon-comment"></i> <?php $this->commentsNum('%d'); ?>
+ </span>
+ </div>
+ </div>
+
+ <div class="links-box">
+ <h2>友链墙</h2>
+ <div class="row">
+ <?php Links_Plugin::output("SHOW_MIX"); ?>
+ </div>
+ </div>
+
+ <hr />
+
+ <div class="post-content">
+ <?php
+ $content = preg_replace('/<img(.*?)src="(.*?)"(.*?)>/s','<a data-fancybox="gallery" href="${2}"><img${1}src="${2}"${3}></a>',$this->content);
+ echo $content
+ ?>
+ </div>
+ </article>
+
+ <?php $this->need('includes/comments.php'); ?>
+ </div>
+
+ <!-- 侧边栏 -->
+ <div class="col-md-4">
+ <?php $this->need('includes/sidebar.php'); ?>
+ </div>
+
+ <?php $this->need('includes/toolbar.php'); ?>
+ </div></main>
+
+<?php $this->need('includes/footer.php'); ?>
\ No newline at end of file diff --git a/page.php b/page.php new file mode 100644 index 0000000..3dcd3a9 --- /dev/null +++ b/page.php @@ -0,0 +1,52 @@ +<?php $this->need('includes/head.php'); ?>
+<?php $this->need('includes/header.php'); ?>
+
+ <main class="container" id="pjax-container"><div class="row">
+
+ <!-- 主体 -->
+ <div class="col-md-8">
+ <!-- 面包屑 -->
+ <div class="item post-bread">
+ <i class="glyphicon glyphicon-folder-close"></i> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a> / <?php $this->title() ?>
+ </div>
+ <br />
+ <!-- 文章内容 -->
+
+ <article class="item">
+ <div class="post-banner">
+ <?php if($this->fields->banner && $this->fields->banner!='') :?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php else: ?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->default_banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php endif; ?>
+ <div class="post-header">
+ <h2><?php $this->title() ?></h4>
+ <span>
+ <i class="glyphicon glyphicon-time"></i> <?php $this->date('Y-m-d'); ?> /
+ <i class="glyphicon glyphicon-comment"></i> <?php $this->commentsNum('%d'); ?>
+ </span>
+ </div>
+ </div>
+
+ <div class="post-content page-content">
+ <?php
+ $content = preg_replace('/<img(.*?)src="(.*?)"(.*?)>/s','<a data-fancybox="gallery" href="${2}"><img${1}src="${2}"${3}></a>',$this->content);
+ echo $content
+ ?>
+ </div>
+
+ </article>
+
+ <?php $this->need('includes/comments.php'); ?>
+ <br />
+ </div>
+
+ <!-- 侧边栏 -->
+ <div class="col-md-4">
+ <?php $this->need('includes/sidebar.php'); ?>
+ </div>
+ <?php $this->need('includes/toolbar.php'); ?>
+ </div></main>
+
+
+<?php $this->need('includes/footer.php'); ?>
\ No newline at end of file diff --git a/post.php b/post.php new file mode 100644 index 0000000..af88a3d --- /dev/null +++ b/post.php @@ -0,0 +1,59 @@ +<?php $this->need('includes/head.php'); ?>
+<?php $this->need('includes/header.php'); ?>
+
+ <main class="container" id="pjax-container"><div class="row">
+
+ <!-- 主体 -->
+ <div class="col-md-8">
+ <!-- 面包屑 -->
+ <div class="item post-bread">
+ <i class="glyphicon glyphicon-folder-close"></i> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a> / <?php $this->category('', true, '无分类'); ?> / <?php $this->title() ?>
+ </div>
+ <br />
+ <!-- 文章内容 -->
+
+ <article class="item">
+ <div class="post-banner">
+ <?php if($this->fields->banner && $this->fields->banner!='') :?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php else: ?>
+ <div class="media-banner" style="background-position:center center;background:url(<?php $this->fields->default_banner(); ?>);background-repeat:no-repeat;background-size:cover;"></div>
+ <?php endif; ?>
+ <div class="post-header">
+ <h2><?php $this->title() ?></h4>
+ <span>
+ <i class="glyphicon glyphicon-time"></i> <?php $this->date('Y-m-d'); ?> /
+ <i class="glyphicon glyphicon-bookmark"></i> <?php $this->category(',', true, '木有分类'); ?> /
+ <i class="glyphicon glyphicon-comment"></i> <?php $this->commentsNum('%d'); ?>
+ </span>
+ </div>
+ </div>
+
+ <div class="post-content">
+ <?php
+ $content = preg_replace('/<img(.*?)src="(.*?)"(.*?)>/s','<a data-fancybox="gallery" href="${2}"><img${1}src="${2}"${3}></a>',$this->content);
+ echo $content
+ ?>
+ </div>
+
+ <div class="post-footer">
+ <hr />
+ <div class="tags-list">
+ <?php $this->tags('', true, '没有标签哦~'); ?>
+ </div>
+ </div>
+ </article>
+
+ <?php $this->need('includes/comments.php'); ?>
+ <br />
+ </div>
+
+ <!-- 侧边栏 -->
+ <div class="col-md-4">
+ <?php $this->need('includes/sidebar.php'); ?>
+ </div>
+ <?php $this->need('includes/toolbar.php'); ?>
+ </div></main>
+
+
+<?php $this->need('includes/footer.php'); ?>
\ No newline at end of file |
