<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
function themeConfig($form) {
$logoUrl = new Typecho_Widget_Helper_Form_Element_Text('logoUrl', NULL, NULL, _t('站点LOGO地址'), _t('在这里填入一个图片URL地址, 以在网站标题前加上一个LOGO'));
$form->addInput($logoUrl);
$favicon = new Typecho_Widget_Helper_Form_Element_Text('favicon', NULL, NULL, _t('favicon地址'), _t('一般为http://www.yourblog.com/image.png,支持 https:// 或 //,留空则不设置favicon'));
$form->addInput($favicon);
$hdid = new Typecho_Widget_Helper_Form_Element_Text('hdid', NULL, NULL, _t('幻灯片文章ID'), _t(''));
$form->addInput($hdid);
$ina = new Typecho_Widget_Helper_Form_Element_Text('ina', NULL, NULL, _t('首页栏目左'), _t(''));
$form->addInput($ina);
$inb = new Typecho_Widget_Helper_Form_Element_Text('inb', NULL, NULL, _t('首页栏目中'), _t(''));
$form->addInput($inb);
$inc = new Typecho_Widget_Helper_Form_Element_Text('inc', NULL, NULL, _t('首页栏目右'), _t(''));
$form->addInput($inc);
$ind = new Typecho_Widget_Helper_Form_Element_Text('ind', NULL, NULL, _t('首页栏目下'), _t(''));
$form->addInput($ind);
$zztj = new Typecho_Widget_Helper_Form_Element_Text('zztj', NULL, NULL, _t('网站版权声明+备案号'), _t('在这里填入你的网站底部信息内容'));
$form->addInput($zztj);
$baiduappdi = new Typecho_Widget_Helper_Form_Element_Text('baiduappdi', NULL, NULL, _t('配置熊掌号 APPID'), _t('在这里填入你的个人配置熊掌号 APPID,不填写则为不开启,可以和自动推送有现成的插件:<b style="color: red;">BaiduSubmit</b> 配合推送,此处只是配置熊掌号设置,还需插件配合推送出去,才达到优化效果'));
$form->addInput($baiduappdi);
$cdnurla = new Typecho_Widget_Helper_Form_Element_Text('cdnurla', NULL, NULL, _t('镜像存储-镜像源'), _t('利用镜像存储做cdn缓存图片文件,格式:www.yourblog.com/ ,记得带上/,不带http或者https,和七牛之类云存储所填的保持一致'));
$form->addInput($cdnurla);
$cdnurlb = new Typecho_Widget_Helper_Form_Element_Text('cdnurlb', NULL, NULL, _t('镜像存储-子域名'), _t('利用镜像存储做cdn缓存图片文件,和第三方存储所填的域名保持一致即可,格式:xxx.yourblog.com/ '));
$form->addInput($cdnurlb);
$footernav = new Typecho_Widget_Helper_Form_Element_Textarea('footernav', NULL, NULL, _t('底部链接(友情链接)'), _t('一行一个链接,格式为:<a rel="nofollow" target="_blank" href="//mrju.cn">MrJu</a>'));
$form->addInput($footernav);
}
//热门访问量文章
function theMostViewed($limit = 4, $before = '<br/> - ( views: ', $after = ' times ) ')
{
$db = Typecho_Db::get();
$options = Typecho_Widget::widget('Widget_Options');
$limit = is_numeric($limit) ? $limit : 7;
$posts = $db->fetchAll($db->select()->from('table.contents')
->where('type = ? AND status = ? AND password IS NULL', 'post', 'publish')
->order('views', Typecho_Db::SORT_DESC)
->limit($limit)
);
if ($posts) {
foreach ($posts as $post) {
$result = Typecho_Widget::widget('Widget_Abstract_Contents')->push($post);
$post_views = number_format($result['views']);
$post_title = htmlspecialchars($result['title']);
$permalink = $result['permalink'];
$created = date('m-d', $result['created']);
$tdescs = $db->fetchAll($db->select()->from('table.fields')->where('name = ? AND cid = ?','tdesc',$result['cid']));
if(count($tdescs) !=0){
//var_dump($img);
$tdesc=$tdescs['0']['str_value'];
if($tdesc){}
else{
$post_text = preg_replace('/($s*$)|(^s*^)/m', '',strip_tags($result['text'])); //获取内容
$tdesc = mb_strlen($post_text, 'utf-8') > 25 ? mb_substr($post_text, 0, 25, 'utf-8').'....' : $post_text; //格式化内容
}
}
else{ $post_text = preg_replace('/($s*$)|(^s*^)/m', '',strip_tags($result['text'])); //获取内容
$tdesc = mb_strlen($post_text, 'utf-8') > 25 ? mb_substr($post_text, 0, 25, 'utf-8').'....' : $post_text; //格式化内容
}
// var_dump($img);
// if($img == ""){
// $img = "wu";
// }
echo " <article class='item'><p class='title ellipsis'><i class='iconfont icon-jian'></i><a href='$permalink' title='$post_title'>$post_title</a></p></article>";
}
} else {
echo "<li>N/A</li>\n";
}
}
/**
* 文章链接新窗口打开
*/
function parseContent($obj){
$obj = preg_replace("/<a href=\"([^\"]*)\">/i", "<a href=\"\\1\" target=\"_blank\" >", $obj);
return $obj;
}
//随机文章
function getRandomPosts($limit = 10){
$db = Typecho_Db::get();
$result = $db->fetchAll($db->select()->from('table.contents')
->where('status = ?','publish')
->where('type = ?', 'post')
->where('created <= unix_timestamp(now())', 'post')
->limit($limit)
->order('RAND()')
);
if($result){
$i=1;
foreach($result as $val){
if($i<=3){
$var = ' class="red"';
}else{
$var = '';
}
$val = Typecho_Widget::widget('Widget_Abstract_Contents')->push($val);
$post_title = htmlspecialchars($val['title']);
$permalink = $val['permalink'];
echo '<li><div class="widget-posts-text"><a class="widget-posts-title" href="'.$permalink.'" title="'.$post_title.'">'.$post_title.'</a><div class="widget-posts-meta"><i>'.$val['commentsNum'].'评论</i></div></div></li>';
$i++;
}
}
}
/** HTML压缩功能 */
function compressHtml($html_source) {
$chunks = preg_split('/(<!--<nocompress>-->.*?<!--<\/nocompress>-->|<nocompress>.*?<\/nocompress>|<pre.*?\/pre>|<textarea.*?\/textarea>|<script.*?\/script>)/msi', $html_source, -1, PREG_SPLIT_DELIM_CAPTURE);
$compress = '';
foreach ($chunks as $c) {
if (strtolower(substr($c, 0, 19)) == '<!--<nocompress>-->') {
$c = substr($c, 19, strlen($c) - 19 - 20);
$compress .= $c;
continue;
} else if (strtolower(substr($c, 0, 12)) == '<nocompress>') {
$c = substr($c, 12, strlen($c) - 12 - 13);
$compress .= $c;
continue;
} else if (strtolower(substr($c, 0, 4)) == '<pre' || strtolower(substr($c, 0, 9)) == '<textarea') {
$compress .= $c;
continue;
} else if (strtolower(substr($c, 0, 7)) == '<script' && strpos($c, '//') != false && (strpos($c, "\r") !== false || strpos($c, "\n") !== false)) {
$tmps = preg_split('/(\r|\n)/ms', $c, -1, PREG_SPLIT_NO_EMPTY);
$c = '';
foreach ($tmps as $tmp) {
if (strpos($tmp, '//') !== false) {
if (substr(trim($tmp), 0, 2) == '//') {
continue;
}
$chars = preg_split('//', $tmp, -1, PREG_SPLIT_NO_EMPTY);
$is_quot = $is_apos = false;
foreach ($chars as $key => $char) {
if ($char == '"' && $chars[$key - 1] != '\\' && !$is_apos) {
$is_quot = !$is_quot;
} else if ($char == '\'' && $chars[$key - 1] != '\\' && !$is_quot) {
$is_apos = !$is_apos;
} else if ($char == '/' && $chars[$key +
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
文章说说类博客网站源码,页面清新简洁。适合文章说说美文博客网站建站使用,响应式手机版本。 本来是dedecms的模板,也比较简单,适合用来搭建一个文学类的,纯文字的网站,简单的改成了typecho,方便做些收集类的纯文学站,很适合优化SEO 配置了熊掌号的接口(目前熊掌号下线,目前新站暂时没有用了,你可以修改链接变成快速收录提交) 对接了第三方CDN存储设置(自动回源上传图片) 压缩网页代码功能,发现压缩代码功能对优化还是挺有效果的
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![circ](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 16 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/2c8c20c5e95b46c58afd0a0d87fe23db_huayula.jpg!1)
酷爱码
- 粉丝: 7730
- 资源: 1451
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)