标签 Typecho 下的文章 - 易航博客
首页
统计
友链
4K壁纸
留言板
关于
推荐
百度一下: 易航博客
搜 索
1
Joe主题再续前缘版 - 本站同款
5,735 阅读
2
易航网址引导系统
3,071 阅读
3
Js自动播放HTML音乐(不受浏览器限制,无需先与浏览器交互,无需对浏览器进行修改)
1,982 阅读
4
六个好看实用的HTML登录界面源码
1,769 阅读
5
V免签全开源免签约码支付系统(支持:支付宝 微信 QQ)
716 阅读
源码大全
PHP源码
HTML模板
Java源码
小程序源码
热门程序
Typecho
ThinkPHP
Joe主题
技术教程
HTML教程
PHP教程
CSS教程
JS教程
MySQL教程
SEO教程
正则表达式教程
网络技术
话题讨论
PHP话题
书虫小说
剑来
雪中悍刀行
值得一看
媒体新闻
人生语录
热门事件
活动线报
经验分享
关于我们
站点公告
其他文章
登录
/
注册
搜 索
标签搜索
网站源码
PHP
PHP教程
PHP源码
PHP函数方法
JavaScript
HTML模板
HTML
Joe主题
网站模板
Typecho
ThinkPHP
PHP网络请求
支付系统
通信协议
码支付
API接口
Typecho插件
PHP发送数据
网络攻击
易航
累计撰写
90
篇文章
累计收到
920
条评论
首页
栏目
源码大全
PHP源码
HTML模板
Java源码
小程序源码
热门程序
Typecho
ThinkPHP
Joe主题
技术教程
HTML教程
PHP教程
CSS教程
JS教程
MySQL教程
SEO教程
正则表达式教程
网络技术
话题讨论
PHP话题
书虫小说
剑来
雪中悍刀行
值得一看
媒体新闻
人生语录
热门事件
活动线报
经验分享
关于我们
站点公告
其他文章
页面
统计
友链
4K壁纸
留言板
关于
推荐
百度一下: 易航博客
用户登录
登录
注册
找到
5
篇与
Typecho
相关的结果
2022-12-12
Typecho一键调整网站为冬天情景插件
效果图获取插件隐藏内容,请前往内页查看详情安装教程将下载下来的插件压缩包上传至 Typecho站点根目录/usr/plugins 目录解压即可
2022年12月12日
621 阅读
88 评论
3 点赞
2022-08-13
Typecho高性能优化之缓存插件 YH Cache
使用场景虽然HP typecho非常高效,但是为了提高Web站点的并发性,静态缓存页面是必要的。这个缓存插件的目的只是缓存首页,以减少对数据库的压力。提醒:更高效和灵活的缓存方法应该使用nginx而不是插件。如果你有nginx基础,你可以参考这里的配置插件配置首先:启用这个插件。然后,配置插件第一:配置文件缓存路径,您可以指定相对位置或绝对位置。第二:配置缓存时间,单位为秒,请根据自己的需要进行配置。应当指出的是因为插件使用了简单的文件缓存机制,所以请确保缓存路径所在的分区有足够的空间和足够的inode节点。后台文章更新后,缓存不会自动更新(实现起来很麻烦,所以这个版本暂时没有实现这个功能)。这一点特别重要,所以请合理配置缓存过期时间。下载地址
2022年08月13日
316 阅读
1 评论
4 点赞
2022-07-18
Typecho 1.2.0 提示版本更新Bug解决方法
Typecho以一向高雅的动作宣布了自己的回归: “这不是玩笑,我们回来了”Typecho 1.2.0 我也按照更新的方法将我的typecho更新到了1.2.0版,但是在后台却还是看到提示升级,当前版本1.2.0,最新版本1.2.0的字样。可以确定这是typecho的一个Bug,官方也给出了修复的办法,在代码的判断中修改一处就可以解决了。if ( isset($json['release']) && preg_match("/^[0-9\.]+$/", $json['release']) && version_compare($json['release'], $version, '>=') && version_compare($json['release'], $version, '>') )在 var/Widget/Ajax.php 这个文件中,将 >= 改为 > 即可。
2022年07月18日
295 阅读
1 评论
6 点赞
2022-07-12
Typecho开发主题常用函数及调用方法
1、站点名称<?php $this->options->title() ?>2、站点网址<?php $this->options ->siteUrl(); ?>3、完整路径标题如分享几个 Typecho 中常用的调用函数<?php $this->archiveTitle(' » ', < span class="string">'', ' | '); ?><?php $this ->options->title(); ?>4、站点说明<?php $this->options->description() ?>5、模板文件夹地址<?php $this->options->themeUrl(); ?>6、导入模板文件夹内的 php 文件<?php $this->need('.php'); ?>7、文章或者页面的作者<?php $this->author(); ?>8、作者头像< ?php $this->author->gravatar('40') ?> //此处输出的完整的img标签,40是头像的宽和高9、该文作者全部文章列表链接<?php $this->author->permalink (); ?>10、该文作者个人主页链接<?php $this->author->url(); ?>11 、该文作者的邮箱地址<?php $this->author->mail(); ?>12、上一篇与下一篇调用代码<?php $this->thePrev(); ?> <?php $this->theNext(); ?>13、判断是否为首页,输出相关内容<?php if ($this->is('index')): ?> //首页输出内容 <?php else: ?> //不是首页输出内容 <?php endif; ?>14、文章或页面,评论数目<?php $this->commentsNum('No Comments', '1 Comment' , '%d Comments'); ?>15、截取部份文章(首页每篇文章显示摘要),350 是字数<?php $this->excerpt(350, '...'); ?>16、调用自定义字段<?php $this->fields->fieldName ?>17、RSS 地址<?php $this->options->feedUrl(); ?>18、获取最新 post<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=8&type=category')->parse('<li><a href=""></a></li>'); ?>19、纯文字分类名称,不带链接<?php $this->category(',', false); ?>20、获取当前文章所属分类(包含链接)<?php if ($this->is('post')): ?> <span><?php $this->category(' '); ?></span> <?php endif; ?>21、获取文章分类列表<ul> <?php $this->widget('Widget_Metas_Category_List') ->parse('<li><a href=""></a> ()</li>'); ?> </ul>22、获取某分类 post<ul> <?php $this->widget('Widget_Archive@indexyc', 'pageSize=8&type=category', 'mid=1') ->parse('<li><a href="" title=""></a></li>'); ?> </ul>23、获取最新评论列表<ul> <?php $this->widget('Widget_Comments_Recent')->to($comments); ?> <?php while($comments->next()): ?> <li><a href="<?php $comments->permalink(); ?>"><?php $comments->author(false); ?></a>: <?php $comments->excerpt(50, '...'); ?></li> <?php endwhile; ?> </ul>24、首页获取 最新文章 代码限制条数<?php while ($this->next()): ?> <?php if ($this->sequence <= 3): ?> html <?php endif; ?> <?php endwhile; ?>25、获取最新评论列表第二个版本,只显示访客评论不显示博主也就是作者或者说自己发的评论<?php $this->widget('Widget_Comments_Recent','ignoreAuthor=true')->to($comments); ?> <?php while($comments->next()): ?> <li><a href="<?php $comments->permalink(); ?>"><?php $comments->author(false); ?></a>: <?php $comments->excerpt(50, '...'); ?></li> <?php endwhile; ?>26、获取文章时间归档<ul> <?php $this->widget('Widget_Contents_Post_Date', 'type=month&format=F Y') ->parse('<li><a href=""></a></li>'); ?> </ul>27、获取标签集合,也就是标签云<?php $this->widget('Widget_Metas_Tag_Cloud', 'ignoreZeroCount=1&limit=28')->to($tags); ?> <?php while($tags->next()): ?> <a href="<?php $tags->permalink(); ?>" class="size-<?php $tags->split(5, 10, 20, 30); ?>"><?php $tags->name(); ?></a> <?php endwhile; ?>28、调用该文相关文章列表<?php $this->related(5)->to($relatedPosts); ?> <?php if ($relatedPosts->have()): ?> //这句也可以写成 if (count($relatedPosts->stack)) <ul><?php while ($relatedPosts->next()): ?> <li><a href="<?php $relatedPosts->permalink(); ?>" title="<?php $relatedPosts->title(); ?>"><?php $relatedPosts->title(); ?></a></li> <?php endwhile; ?></ul> <?php else : ?> <li>无相关文章</li> <?php endif; ?>29、隐藏 head 区域的程序版本和模版名称<?php $this->header("generator=&template="); ?>30、获取读者墙<?php $period = time() - 999592000; // 時段: 30 天, 單位: 秒 $counts = Typecho_Db::get()->fetchAll(Typecho_Db::get() ->select('COUNT(author) AS cnt','author', 'url', 'mail') ->from('table.comments') ->where('created > ?', $period ) ->where('status = ?', 'approved') ->where('type = ?', 'comment') ->where('authorId = ?', '0') ->group('author') ->order('cnt', Typecho_Db::SORT_DESC) ->limit(25) ); $mostactive = ''; $avatar_path = 'http://www.gravatar.com/avatar/'; foreach ($counts as $count) { $avatar = $avatar_path . md5(strtolower($count['mail'])) . '.jpg'; $c_url = $count['url']; if ( !$c_url ) $c_url = Helper::options()->siteUrl; $mostactive .= "<a href='" . $c_url . "' title='" . $count['author'] . " (参与" . $count['cnt'] . "次互动)' target='_blank'><img src='" . $avatar . "' alt='" . $count['author'] . "的头像' class='avatar' width='32' height='32' /></a>\n"; } echo $mostactive; ?>31、登陆与未登录用户展示不同内容<?php if($this->user->hasLogin()): ?> // 登陆可见 <?php else: ?> // 未登录和登陆均可见 <?php endif; ?>32、导航页面列表调用隐藏特定的页面 这个演示隐藏了 album 和 search 两个页面<ul> <li<?php if($this->is('index')): ?> class="current"<?php endif; ?>><a href="<?php $this->options->siteUrl(); ?>">主页</a></li> <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?> <?php while($pages->next()): ?> <?php if (($pages->slug != 'album') && ($pages->slug != 'search')): ?> <li<?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?>><a href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a></li> <?php endif; ?> <?php endwhile; ?> </ul> //参数说明:9.0 版 typecho 支出在后台管理页面编辑时选择隐藏页面。33、Typecho 归档页面 (牧风提供)<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives); $year=0; $mon=0; $i=0; $j=0; $output = '<div id="archives">'; while($archives->next()): $year_tmp = date('Y',$archives->created); $mon_tmp = date('m',$archives->created); $y=$year; $m=$mon; if ($mon != $mon_tmp && $mon > 0) $output .= '</ul></li>'; if ($year != $year_tmp && $year > 0) $output .= '</ul>'; if ($year != $year_tmp) { $year = $year_tmp; $output .= '<h3 class="al_year">'. $year .' 年</h3><ul class="al_mon_list">'; //输出年份 } if ($mon != $mon_tmp) { $mon = $mon_tmp; $output .= '<li><span class="al_mon">'. $mon .' 月</span><ul class="al_post_list">'; //输出月份 } $output .= '<li>'.date('d日: ',$archives->created).'<a href="'.$archives->permalink .'">'. $archives->title .'</a> <em>('. $archives->commentsNum.')</em></li>'; //输出文章日期和标题 endwhile; $output .= '</ul></li></ul></div>'; echo $output; ?>34、获取当前文章页缩略图<?php $this->attachments(1)->attachment->url(); ?> //进行熊掌号改造的朋友请务必注意,这里所谓缩略图指的是当前文章页第一个附件地址,请确保第一个附件类型为图片。35、根据页面类型显示内容//判断是文章页则显示内容 <?php if ($this->is('post')): ?> 想要显示的内容1 <?php endif; ?> //判断是页面则显示内容 <?php if ($this->is('page', 'about')): ?> 想要显示的内容2 <?php endif; ?>
2022年07月12日
129 阅读
0 评论
2 点赞
2022-07-05
Typecho自动生成站点地图插件最新版(支持 V1.1 和 V1.2)
前言关于 sitemap 的作用,做过网站 SEO 的站长应该都挺熟悉的吧。Sitemap,又叫站点地图。站点地图相当于一个网站目录,它可以更直观地向用户展示网站的结构和网站中文章的内容,方便用户浏览和使用。另外,方便百度蜘蛛抓取网站页面,通过站点地图获取站点内的信息,可以增加站点内的文章收藏。Typecho主题为了简化代码,多数没有自带sitemap,这对想爬取我们网站的蜘蛛很不友好,在花费些时间整理出来后,免费开源给大家使用,功能全且小巧,最最重要的是不占用大内存,自动识别并收录整合到自己网站的新页面。功能介绍生成 sitemap 包含 首页、独立页面、分类、标签、文章 推送百度搜索资源平台,目前仅支持普通收录推送API说明参数名参数值接口功能sitemapupdate更新sitemappushmain推送核心文章pushall推送全部文章pushnew推送最新文章tokenAPI token插件中的API token插件截图更新说明版本历史1.1.0 更新推送规则1.2.0 修复缓存机制,以前是存数据库会导致内容超出长度,现在改为存储缓存文件1.2.1 修复读取分类的错误1.3.0 新增api刷新sitemap功能新增api推送文章功能发布文章自动推送当前文章发布文章更新sitemap新增推送日志和Sitemap更新日志存入插件目录下修复文章不满20篇的推送异常报错修复手动推送后显示链接乱的问题1.3.1 修复后台入口非 域名/admin/ 情况下推送功能无法使用1.3.2 修复 PHP8 运行环境下的的报错作者删库跑路 现插件源码已被销毁(文章标题是骗你们进来的 想不到吧😜)PS:开个玩笑哈哈,作者没有删库跑路下载插件作者博客地址:https://www.zhaoyingtian.com/archives/93.htmlGithub开源地址:https://github.com/ethanzhao2001/Sitemap-For-Typecho
2022年07月05日
249 阅读
2 评论
5 点赞