首页
微语
统计
友链
留言
memos
圈子
图床
推荐
相册
网站监控
VPS监控
Search
1
为Typecho添加webp解析
34,232 阅读
2
实现typecho微信时光机功能的图文教程
18,582 阅读
3
emlog数据成功迁移到typecho
17,356 阅读
4
typecho 时光机单页 typecho-whisper
10,667 阅读
5
湖南移动5G特惠流量月包5元5GB/10元10GB
9,593 阅读
手机达人
免费资源
电脑网络
娱乐休闲
网站建设
威言威语
Typecho
Emlog
WordPress
服务器
主题
插件
排行榜    
登录
/
注册
Search
标签搜索
wordpress
发布
插件
免费
教程
typecho
EMlog
PHP
代码
CSS
华为
图片
代码修改
安装
评论
手机
诺基亚
微信
文章
智能
Chen'mo
累计撰写
1,259
篇文章
累计收到
357
条评论
首页
栏目
手机达人
免费资源
电脑网络
娱乐休闲
网站建设
威言威语
Typecho
Emlog
WordPress
服务器
主题
插件
页面
微语
统计
友链
留言
memos
推荐
相册
网站监控
VPS监控
搜索到
1259
篇与
的结果
2023-06-10
Typecho视频主题ZeVideo开源、助力Typecho多方面发展
ZeVideo一款开源的Typecho视频主题,相对于前段时间放出来的免费版重构了很多东西,也增加了一些功能。功能介绍全站pjax无刷新加载支持根据系统进入深色模式,或手动切换支持记录播放历史功能首页布局支持自定义主题设置支持修改logo,添加统计代码,这是广告位广告等生态方面支持 https://github.com/jrotty/CatClaw 采集插件可对接大部分资源站 json接口支持多条件检索(需要购买这个插件 https://blog.zezeshe.com/archives/gjsoso-typecho.html 【历史原因这个插件一直为付费插件,所以不能免费】)开源地址https://github.com/jrotty/Zevideogithub.com对typecho改动1,让文章根据最后编辑时间排序在 Typecho 的 var/Widget路径下编辑 Archive.php文件,在 764行左右找到如下代码 $select->order('table.contents.created', Db::SORT_DESC) ->page($this->currentPage, $this->parameter->pageSize);将其改为 $select->order('table.contents.modified', Db::SORT_DESC) ->page($this->currentPage, $this->parameter->pageSize);2,修改数据库结构因为是用自定义字段存每集动漫的视频地址的,然而像是柯南这种上千集的,字段数据库表格存不下,所以我将数据库fields表str_value的类型由text改为了mediumtext。截图展示备份下载:[attach]1428[/attach]
2023年06月10日
4,465 阅读
0 评论
1 点赞
2023-06-07
Typecho 1.2.1 更新了
此版本主要是一个安全更新,建议所有用户升级。XSS 漏洞主要是 #1535, #1539, #1545, #1560 这几个 ISSUE 提到的错误。由于参数和对提交数据的过滤不严,造成了站点会被攻击者利用的漏洞。此次修复后你可以安全地打开已经被攻击者污染的评论数据,当然我们建议你删除它们。对 MySQL 的 SSL 支持在某些运行环境中你可能需要通过 SSL 来连接 MySQL 数据库,目前我们已经加上了这一支持。更多的小更新对 PHP 8.1 的更多支持其它 Bug 修复感谢各位贡献者的无私工作。具体更新请见:https://github.com/typecho/typecho/releases/tag/v1.2.0正式版下载:https://github.com/typecho/typecho/releases/latest/download/typecho.zip[attach]1426[/attach]
2023年06月07日
3,980 阅读
0 评论
0 点赞
worker反代Loc,解决不能发帖和投票的 问题
又来一个版本。直接在CF的worker里添加代码。添加路由的时候,记得网址后面有/*又弄了一个演示:https://loc.513513.xyz2023-5-25 16:491.修复头像2.修复交易帖显示缺失直接上代码:/** * write by 西柚论坛 https://www.xiubbs.com */ addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)); }); // 准备反代的目的域名 let target_url = "https://hostloc.com"; // 要替换内容的正则表达式 let target_url_reg = /(?<=\/\/).*?hostloc\.com/g; async function handleRequest(request) { let url = new URL(request.url); url.hostname = new URL(target_url).hostname; // 复制请求对象并更新它的属性 let headers = new Headers(request.headers); headers.set("Referer", target_url); headers.set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"); //处理头像的302跳转,处理编辑帖子之后的报错 let redirect = "manual"; if(url.href.indexOf("/uc_server/") > -1){ redirect = "follow"; } const param = { method: request.method, headers: headers, body: request.body, redirect: redirect } let response = await fetch(url, param); // 检查响应头中的内容类型 const contentType = response.headers.get('content-type'); if (contentType && contentType.includes('text')) { // 如果是文本类型,替换响应主体中的URL let responseBody = await response.text(); responseBody = await handleResBody(request,responseBody); // 复制响应对象并更新它的属性 let headers = await handleResHeader(response); return new Response(responseBody, { status: response.status, statusText: response.statusText, headers: headers }); } else { // 如果不是文本类型,直接返回响应对象 return response; } } async function handleResBody(request, responseBody){ responseBody = responseBody.replace(target_url_reg, new URL(request.url).hostname); responseBody = responseBody.replace("<head>", '<head>\n<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">'); responseBody = responseBody.replace("</head>", '<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/gh/lifespy/css-and-js-hub@0.1/css/responsive.css">\n</head>'); responseBody = responseBody.replace("</body>", '<script src="//cdn.jsdelivr.net/gh/lifespy/css-and-js-hub@0.1/js/polish.js" type="text/javascript"></script>\n</body>'); return responseBody; } async function handleResHeader(resp){ let headers = new Headers(resp.headers); headers.set('Access-Control-Allow-Origin', '*'); headers.set('Access-Control-Allow-Methods', 'GET'); headers.set('Access-Control-Allow-Headers', 'Content-Type'); return headers; }还有一个个nginx版本server { listen 80; listen [::]:80; server_name loc.xiu.ee; #SSL Configuration listen 443 ssl; listen [::]:443 ssl; ssl_certificate /ssl/loc.xiu.ee.crt; ssl_certificate_key /ssl/loc.xiu.ee.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; if ($scheme = http) { return 301 https://$server_name$request_uri; } # proxy to another site location ~/ { proxy_pass https://hostloc.com; proxy_set_header Host hostloc.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header referer https://hostloc.com/$request_uri; proxy_set_header Accept-Encoding ""; proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0"; sub_filter_types *; sub_filter '<base href="https://hostloc.com/">' '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/gh/lifespy/css-and-js-hub/css/responsive.css" />'; sub_filter 'hostloc.com' 'loc.xiu.ee'; sub_filter '</body>' '<script src="//cdn.jsdelivr.net/gh/lifespy/css-and-js-hub/js/polish.js"></script></body>'; sub_filter_once off; set $static_fileEJLfi5A0 0; if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" ) { set $static_fileEJLfi5A0 1; expires 12h; } if ( $static_fileEJLfi5A0 = 0 ) { add_header Cache-Control no-cache; } } }
2023年05月26日
4,360 阅读
0 评论
0 点赞
用CFworkers部署的所以不用担心泄露账号密码问题
用CFworkers部署的所以不用担心泄露账号密码问题所有功能正常源码:https://bijici.com/6wmzHviewhttps://hostloc.us/备份:addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)); }); const TARGET_URL = "https://hostloc.com"; const TARGET_URL_REGEXP = /hostloc\.com/g; const TARGET_HOSTNAME = new URL(TARGET_URL).hostname; const handleRequest = async request => { const url = new URL(request.url); url.hostname = TARGET_HOSTNAME; let headers = new Headers(request.headers); headers.set("Referer", TARGET_URL); headers.set("User-Agent", request.headers.get("user-agent")); const param = { method: request.method, headers: headers, body: request.body, redirect: "manual" } const response = await fetch(url, param); return handleResponse(request, response); } const handleResponse = async (request, response) => { const contentType = response.headers.get('content-type'); let headers = new Headers(response.headers); headers.set('Access-Control-Allow-Origin', '*'); headers.set('Access-Control-Allow-Methods', 'GET'); headers.set('Access-Control-Allow-Headers', 'Content-Type'); let location = response.headers.get('location'); if (location) { location = location.replace(TARGET_URL_REGEXP, new URL(request.url).hostname); headers.set('location', location); } const data = (contentType && contentType.includes('text')) ? await response.text() : await response.blob(); const modifiedData = (typeof data === 'string') ? data.replace(TARGET_URL_REGEXP, new URL(request.url).hostname) : data; return new Response(modifiedData, { status: response.status, statusText: response.statusText, headers: headers }); }PS:我自己也弄了一个反代:https://mjj.513513.xyz
2023年05月25日
4,065 阅读
0 评论
0 点赞
HTML5实现微信聊天气泡效果
HTML5实现微信聊天气泡效果图: 话不多说直接放代码:<div class="container-manc"> <!-- Notice/Center --> <div class="chat-notice"> <span>漫川邀请“汤圆”进入群聊</span> </div> <!-- Left --> <div class="chat-sender"> <div><img src="http://q.qlogo.cn/headimg_dl?dst_uin=82632418&spec=640&img_type=jpg"></div> <div>汤圆</div> <div> <div class="chat-left_triangle"></div> <span>哇!博主的站点真的好好看,请问如何给博主进行留言呢?</span> </div> </div> <!-- Right --> <div class="chat-receiver"> <div><img src="http://q.qlogo.cn/headimg_dl?dst_uin=28422961&spec=640&img_type=jpg"></div> <div>漫川</div> <div> <div class="chat-right_triangle"></div> <span>您可以在下面与博主进行留言,看到会回复您的喔!</span> </div> <!-- Right --> <div class="chat-receiver"> <div><img src="http://q.qlogo.cn/headimg_dl?dst_uin=28422961&spec=640&img_type=jpg"></div> <div>漫川</div> <div> <div class="chat-right_triangle"></div> <span>您的每句话都会记录在漫川站点的数据库里,直到风消失的那天.</span> </div> </div>CSS代码:/*微信聊天气泡*/ .chat-sender{ clear:both; font-size: 80%; } .chat-sender div:nth-of-type(1){ float: left; } .chat-sender div:nth-of-type(2){ margin: 0 50px 2px 50px; padding: 0px; color: #848484; font-size: 70%; text-align: left; } .chat-sender div:nth-of-type(3){ background-color: #efefef; /*float: left;*/ margin: 0 50px 10px 50px; padding: 10px 10px 10px 10px; border-radius:7px; text-indent: -12px; } .chat-receiver{ clear:both; font-size: 80%; } .chat-receiver div:nth-of-type(1){ float: right; } .chat-receiver div:nth-of-type(2){ margin: 0px 50px 2px 50px; padding: 0px; color: #848484; font-size: 70%; text-align: right; } .chat-receiver div:nth-of-type(3){ /*float:right;*/ background-color: #b2e281; margin: 0px 50px 10px 50px; padding: 10px 10px 10px 10px; border-radius:7px; } .chat-receiver div:first-child img, .chat-sender div:first-child img{ width: 40px; height: 40px; border-radius: 10%; } .chat-left_triangle{ height: 0px; width: 0px; border-width: 6px; border-style: solid; border-color: transparent white transparent transparent; position: relative; left: -22px; top: 3px; } .chat-right_triangle{ height: 0px; width: 0px; border-width: 6px; border-style: solid; border-color: transparent transparent transparent #b2e281; position: relative; right:-22px; top:3px; } .chat-notice{ clear: both; font-size: 70%; color: white; text-align: center; margin-top: 15px; margin-bottom: 15px; } .chat-notice span{ background-color: #cecece; line-height: 25px; border-radius: 5px; padding: 5px 10px; }
2023年05月21日
3,955 阅读
0 评论
0 点赞
2023-05-06
typecho评论推送插件Comment2Fanwan
Comment2FanwanTypecho 新评论饭碗警告通知注册送20元余额,发现里面的Telegram是免费的。说明因为微信服务号模板消息将在 2021.04.30 改版,届时 Server酱 将无法正常使用,依赖于它的 Comment2Wechat 也将无法正常使用,故开发此插件使用方法点此下载后解压,将解压后的目录名改为 Comment2Fanwan,然后上传到你的 Typecho 的 /usr/plugins,并在 Typecho 后台开启插件到饭碗警告里创建规则,并将触发方式设置成 Webhook,接着创建五个变量名 和 键为后面所列的模板变量:title、author、comment、created_at、url, 可参考以下截图: 最后在通知正文添加{{ author }} 于 {{ created_at }} 在您的文章<a href="{{ url }}">《{{ title }}》</a>发表了评论: {{ comment }}当然,你也可以按照你的喜好修改文案,本插件会向饭碗推送 title、author、comment、created_at、url 这几个模板变量,在正文中用诸如 {{ author}} 的写法即可,它会动态替换将你创建的规则的 Webhook 地址填到插件设置里,保存即可。本站备份下载:[attach]1421[/attach]
2023年05月06日
6,851 阅读
3 评论
1 点赞
2023-05-02
Typecho 附件下载增强插件
从 Attachment 插件增强而来。修改附件短码[attach]id[/attach] 从 Attachment 改名 点击附件按钮自动填写[attach]id[/attach] 增加原文件名下载(隐藏真实路径) 增加内置统计功能(带开关) 支持 CDN 路径替换Accessories 更新到 1.0.8支持更多编辑器(Ueditor,Vditor)支持图片短代码,换域名也不怕图片链接不对啦(图片链接也支持cdn)下载地址:[attach]1419[/attach]
2023年05月02日
5,698 阅读
0 评论
0 点赞
2023-04-27
Typecho影视主题Zevideo免费开放了
因为自己重构了下,使用pjax代替mobileboneJs,所以重构前的版本就放出来在互联网上留个记号????这是我搞得第四款Typecho影视主题了,之前有影视1,2,3号,其中2号是付费的,3号是2号停止维护后补偿2号用户的,因为Typecho搞影视并没有什么优势,生态不行,seo也不行,生态方面我弄了CatClaw采集插件(https://github.com/jrotty/CatClaw)以及检索插件,但依旧没啥意义,这次弄得影视模板其实算是Moeos主题的副产物,主要就是给闲置域名弄点内容玩玩!改动因为是用自定义字段存每集动漫的视频地址的,然而像是柯南这种上千集的,字段数据库表格存不下,所以我将数据库fields表str_value的类型由text改为了mediumtext。还有就是因为视频站点更新视频后,被更新的视频要排在前面,所以需要把typecho根据文章创建时间排序改为根据文章修改时间进行排序。检索功能需要这个插件:https://blog.zezeshe.com/archives/gjsoso-typecho.html (插件是付费的,以前给影视1~3号主题用来着,所以不能免费开放)不需要这个功能可以在pages文件夹下search.php中删除<?php $this->need('gjsearch.php'); ?>。本站备份下载:[attach]1417[/attach]
2023年04月27日
5,262 阅读
3 评论
1 点赞
2023-04-23
typecho热力图插件
标题所示插件的具体效果应该通过首页可以看到了,用法很简单。如果是不想修改直接拿来用的话,直接解压缩,然后放到usr/plugins/的CalendarGraph目录下直接使用的话:在需要显示的位置:<?php \Typecho\Plugin::factory('index.php')->renderGraph() ;?> <?php \Typecho\Plugin::factory('index.php')->renderCalendar() ;?> 但在实际应用中,我的这个插件样式肯定不可能和你们现有的模版皮肤相配套,所以其实你们可以参考我的这两个函数的写法,直接在模板里面写上<style> #tooltip {zindex: 999;display: none;position: fixed;left: 0;top: 0;height: 25px;background-color: rgba(0, 0, 0, .8);color: #fff;padding: 4px 10px;border-radius: 3px;font-size: 12px} #tooltip:after {display: block;position: absolute;content: '';bottom: -6px;left: 50%;margin-left: -6px;width: 0; height: 0; border-left: 6px solid transparent;border-right: 6px solid transparent;border-top: 6px solid rgba(0, 0, 0, .8);} svg {width: 100%}</style> <div id='svg' ></div><div id='tooltip'></div> <?php $item = json_encode(\TypechoPlugin\CalendarGraph::getGraphData()); echo "<script>const graphOption = {tooptipId: '#tooltip',graphId : '#svg' ,tooltipFormat: '{1}篇内容于{0}发表',graphData:{$item}, option: {}};</script>"; ?> <script src='<?php echo Options::alloc()->rootUrl;?>.'/usr/plugins/CalendarGraph/bundle.js' defer></script>就是这样简单,下载地址为: CalendarGraph.zip 效果图:本站备份下载:[attach]1415[/attach]
2023年04月23日
5,807 阅读
4 评论
0 点赞
2023-04-22
Typecho 主题侧边栏日历插件 Calendar
插件简介:该插件可以实现在typecho主题侧边栏显示一个日历的功能。插件预览:插件使用:1、将整个Calender文件夹先上传至/usr/plugins目录下2、进入后台管理面板,启动本插件3、修改当前使用主题的sidebar.php,在自己需要的位置加上<?php if (class_exists("Calendar_Plugin")): ?> <div class="list-group"> <a class="list-group-item active"><i class="fa fa-calendar fa-fw"></i> <?php _e('日历');?></a> <?php Calendar_Plugin::render();?> </div> <?php endif;?>插件下载:https://github.com/istobran/typecho-calender-plugin本站备份下载:[attach]1413[/attach]
2023年04月22日
6,301 阅读
1 评论
0 点赞
2023-04-15
BearSimple - 一款简洁的Typecho主题
BearSimple主题是什么BearSimple是一款简洁但又不是完全简洁的Typecho主题,为什么说不是完全简洁呢,因为这款主题除了前台简洁外其他地方一点也不简洁,就如同..打个比方就是外看陋室,内看别墅。诶对,就是这个意思。说明本主题开源免费长期更新,有时候一天一更,有时候两三个月一更,视情况而定QQ交流群:561848356适合使用的博客类型简约类博客,喜欢简约的博客站长应该也会喜欢本主题项目地址:https://github.com/whitebearcode/typecho-bearsimple文档地址:https://bearnotion.flowus.cn/share/59d9bea7-d0d3-447b-a090-57f8876e393c效果图:主题功能支持Pjax加载Diy模式评论过滤,支持限制一些评论内容评论表情,支持QQ等个性表情支持短代码,支持回复可见、字体颜色、已完成/未完成列表[todolist]等编辑器支持一键插入全部附件HTML压缩灯箱功能,可以将文章内的图片聚集到灯箱查看图片水印,支持文字水印和图片水印功能幻灯片功能弹窗功能打赏功能缓存功能多种导航菜单样式多种翻页样式极具多样化的行为验证功能,可设置评论验证码以及CC简易防护文章微海报功能实验室功能哀悼模式支持语言切换,拥有简繁体切换以及全球几十种语言切换防复制功能返回顶部Sitemap网站地图友链功能文章置顶多种头像调用方式(Gravatar多种镜像源可供切换、自定义头像、支持QQ头像)支持代码高亮,拥有多种样式可供选择多种文章展现样式可供选择支持文章时效性提示支持文章版权功能,多种文章共享协议可供选择文章支持显示文章热度支持多种自定义页面,追番、读书应有尽有~~.......等几十种功能
2023年04月15日
5,975 阅读
0 评论
1 点赞
适用于Typecho的那年今日代码
开头可以在Typecho博客上展示当前文章日期在过去几年的今天所发的其他文章之前在一些博客上看到这个那年今日,感觉还不错,就借鉴了一下,并进行优化处理,且兼容了sqlite。代码将以下代码放入functions.phpfunction historyToday($created) { $date = date('m/d', $created); $date_m = date('m月', $created); $date_d = date('d日', $created); $time = time(); $db = Typecho_Db::get(); $prefix = $db->getPrefix(); $limit = 5;//显示多少篇文章 $adapter = $db->getAdapterName(); if ("Pdo_SQLite" === $adapter || "SQLite" === $adapter) { $sql = "SELECT * FROM `{$prefix}contents` WHERE strftime('%m-%d',datetime(datetime(created, 'unixepoch'))) = '{$date}' and created <= {$time} and created != {$created} and type = 'post' and status = 'publish' and (password is NULL or password = '') LIMIT ".$limit; } if ("Pdo_Mysql" === $adapter || "Mysql" === $adapter || "Mysqli" === $adapter) { $sql = "SELECT * FROM `{$prefix}contents` WHERE DATE_FORMAT(FROM_UNIXTIME(created), '%m/%d') = '{$date}' and created <= {$time} and created != {$created} and type = 'post' and status = 'publish' and (password is NULL or password = '') LIMIT ".$limit; } $result = $db->query($sql); $historyTodaylist = []; if ($result instanceof Traversable) { foreach ($result as $item) { $item = Typecho_Widget::widget('Widget_Abstract_Contents')->push($item); $title = htmlspecialchars($item['title']); $permalink = $item['permalink']; $date = date('Y年m月d日',$created); $historydate = date('Y年m月d日',$item['created']); $historyTodaylist[] = array( "title" => $title, "permalink" => $permalink, "date" => $historydate ); } } if (count($historyTodaylist) > 0){ echo "<div class='bs-today'> <fieldset> <legend><h5>那年今日</h5></legend> <div class='today-date'><div class='today-m'>{$date_m}</div><div class='today-d'>{$date_d}</div></div><ul> "; foreach ($historyTodaylist as $item){ echo "<li><span>{$item['date']}</span><a href='{$item['permalink']}' title='{$item['title']}' target='_blank'>{$item['title']}</a></li>"; } echo "</ul></fieldset></div>"; } }在文章页面合适的地方插入如下代码:<?php historyToday($this->created)?>这样就大功告成了!总结仅展示PHP部分,至于样式则可以自己写,这里就不过多讲述!
2023年04月14日
4,761 阅读
0 评论
0 点赞
让访客可以在 Typecho 评论贴图(Typecho 评论插图功能实现)
在 Typecho 评论的内容中,如果用 <img src="图片地址" />的语法,将被 Typecho 自带的过滤器删除,所以评论后看不到贴图。接触贴图限制我们需要手动打开限制,这个一般推荐在themeInit函数里强制设置,这样对用户来说就无需额外操作。修改functions.phpfunction themeInit($archive) { $options = Helper::options(); //允许图片标签 $options->commentsHTMLTagAllowed .= '<img class="" src="" data-src="" alt="" style=""/>'; }这样我们就可以在评论区通过 <img src="图片地址" />的语法来贴图了。支持使用短代码格式贴图使用短代码的格式贴图 [img src="图片地址"]好处是有别的html过滤器也不怕图片被过滤掉了。处理评论内用需要用到钩子,往functions.php加入以下代码。Typecho_Plugin::factory('Widget_Abstract_Comments')->contentEx = ['CommensHelper', 'parse']; class CommensHelper { public static function parse(string $content, $archive, ?string $lastResult) :string { if ($lastResult) $content = $lastResult; // 判断是不是在文章页 $isSingle = Typecho_Widget::widget('Widget_Archive')->is('single'); if ($isSingle) { $content = preg_replace_callback('/\[img=?\]*(.*?)(\[\/img)?\]/ism', function ($matches) { return sprintf('', Typecho_Common::safeUrl($matches[1])); }, $content); } else { $content = preg_replace('/\[img=?\]*(.*?)(\[\/img)?\]/ism', _t("[图片]"), $content); } return $content; } }评论框增加一个按钮用于插入图片修改comments.php,在合适位置加入以下代码:<a id="insert-image" href="javascript:void(0)" data-textarea="textarea[name='text']" data-prompt-text="请输入图片链接">插入图片</a> <script> let el = document.getElementById('insert-image'); el.addEventListener('click', (event) => comment_image.apply(el, [event, document.querySelector(el.dataset.textarea)]), false); function comment_image(event, textarea) { var URL = prompt(this.getAttribute("data-prompt-text") || ""); if (URL) { replaceSelectedText(textarea, '[img]' + URL + '[/img]'); } return false; } function getInputSelection(el) { var start = 0, end = 0, normalizedValue, range, textInputRange, len, endRange; if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") { start = el.selectionStart; end = el.selectionEnd; } else { range = document.selection.createRange(); if (range && range.parentElement() == el) { len = el.value.length; normalizedValue = el.value.replace(/\r\n/g, "\n"); // Create a working TextRange that lives only in the input textInputRange = el.createTextRange(); textInputRange.moveToBookmark(range.getBookmark()); // Check if the start and end of the selection are at the very end // of the input, since moveStart/moveEnd doesn't return what we want // in those cases endRange = el.createTextRange(); endRange.collapse(false); if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) { start = end = len; } else { start = -textInputRange.moveStart("character", -len); start += normalizedValue.slice(0, start).split("\n").length - 1; if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) { end = len; } else { end = -textInputRange.moveEnd("character", -len); end += normalizedValue.slice(0, end).split("\n").length - 1; } } } } return { start: start, end: end }; } function replaceSelectedText(el, text) { var sel = getInputSelection(el), val = el.value; el.value = val.slice(0, sel.start) + text + val.slice(sel.end); } </script>JS代码积分下载:
2023年04月08日
6,129 阅读
2 评论
0 点赞
2023-04-07
子比go外链修改
效果图子比go外链修改食用教程在子比目录下找文件,go.php 文件再把我下面这个代码粘贴进去然后保存即可<?php if ( strlen($_SERVER['REQUEST_URI']) > 384 || strpos($_SERVER['REQUEST_URI'], "eval(") || strpos($_SERVER['REQUEST_URI'], "base64") ) { @header("HTTP/1.1 414 Request-URI Too Long"); @header("Status: 414 Request-URI Too Long"); @header("Connection: Close"); @exit; } //通过QUERY_STRING取得完整的传入数据,然后取得url=之后的所有值,兼容性更好 @session_start(); $t_url = !empty($_SESSION['GOLINK']) ? $_SESSION['GOLINK'] : preg_replace('/^url=(.*)$/i', 'k_e_k_c_c_n', $_SERVER["QUERY_STRING"]); //数据处理 if (!empty($t_url)) { //判断取值是否加密 if ($t_url == base64_encode(base64_decode($t_url))) { $t_url = base64_decode($t_url); } //防止xss $t_url = htmlspecialchars($t_url); //对取值进行网址校验和判断 preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i', $t_url, $matches); $wiiui_title = get_bloginfo('name'); $title = $wiiui_title . ' - 安全中心'; if ($matches) { $url = $t_url; // $title = '页面加载中,请稍候...'; } else { preg_match('/\./i', $t_url, $matche); if ($matche) { $url = 'http://' . $t_url; // $title = '页面加载中,请稍候...'; } else { $url = 'http://' . $_SERVER['HTTP_HOST']; $title = '参数错误,正在返回首页...'; } } } else { $title = '参数缺失,正在返回首页...'; $url = 'http://' . $_SERVER['HTTP_HOST']; } $url = str_replace('&', '&', $url); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="robots" content="noindex, nofollow" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <?php echo "<link rel='apple-touch-icon-precomposed icon' href='" . _pz('iconpng') . "' type='image/x-icon'/>"; ?> <noscript> <meta http-equiv="refresh" content="1;url='<?php echo $url; ?>';"> </noscript> <script> function link_jump() { //禁止其他网站使用我们的跳转页面 var MyHOST = new RegExp("<?php echo $_SERVER['HTTP_HOST']; ?>"); if (!MyHOST.test(document.referrer)) { location.href = "//" + MyHOST; } location.href = "<?php echo $url; ?>"; } //延时10S跳转,可自行修改延时时间 setTimeout(link_jump, 10000); //延时50S关闭跳转页面,用于文件下载后不会关闭跳转页的问题 setTimeout(function() { window.opener = null; window.close(); } , 50000); </script> <link rel="stylesheet" id="_fontawesome-css" href="//cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" media="all"> <title> <?php echo $title; ?> </title> <style> body,html { padding:0; margin:0 } body { background:#f5f6f7; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif } a { cursor:default; text-decoration:none; word-wrap:break-word; word-break:break-all } .wiiuii-go-main { display:flex; width:100%; height:100%; justify-content:center; align-items:center } .wiiuii-go-container { position: relative; max-width:28em; height:auto; display:inline-block; background:#fff; margin:10px; padding:1.5em; border-radius:5px; box-shadow:0 0 10px rgba(116,116,116,.1) } .wiiuii-go-content a { color:#036af4 } .wiiuii-go-content a:hover { color:#e91e63 } .wiiuii-go-logo { text-align:center; width:auto; height:65px; margin-bottom:10px } .wiiuii-go-logo img { max-width:100%; height:100% } .wiiuii-go-msg { cursor:default; text-align:center; padding:10px 5px; font-weight:700; color:rgba(255, 0, 0, 0.85); background:rgba(255, 0, 0, 0.1); border-radius:5px } .wiiuii-go-button-item { text-align:right } .wiiuii-go-button { display:inline-block; border-radius:99px; padding:10px 15px; background:rgba(116,116,116,.1); transition:all .5s } .wiiuii-go-button a { font-weight:700; font-size:14px; color:#333 } .wiiuii-go-button:hover { color:#000; background:rgba(116,116,116,.2) } .wiiuii-goid-item { position:absolute; top:10px; left:10px; border-radius:4px; overflow:hidden; background:#ffd07c } .wiiuii-goid-title { padding:0 4px; background:#ffa400 } .wiiuii-goid-text { padding-right:5px } .wiiuii-go-container hr { border: 0; height: 0.05em; background: #eee; } </style> </head> <body> <div class="wiiuii-go-main"> <div class="wiiuii-go-container"> <div class="wiiuii-goid-item"> <b class="wiiuii-goid-title">GID</b> <span class="wiiuii-goid-text">LINK<?php echo hexdec($url); ?></span> </div> <div class="wiiuii-go-logo"> <?php echo zib_get_adaptive_theme_img(_pz('logo_src'), _pz('logo_src_dark')); ?> </div> <div class="wiiuii-go-content"> <div class="wiiuii-go-msg"> <span><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> 您即将离开<?php echo $wiiui_title; ?>,请注意您的账号和财产安全。</span> </div> <p>访问链接:<a onclick="location.replace('<?php echo $url; ?>')" title="<?php echo $url; ?>"><?php echo $url; ?></a></p> </div> <hr> <div class="wiiuii-go-button-item"> <div class="wiiuii-go-button"> <a onclick="location.replace('//<?php echo $_SERVER['HTTP_HOST']; ?>')">返回首页</a> </div> <div class="wiiuii-go-button"> <a onclick="location.replace('<?php echo $url; ?>')">继续访问</a> </div> </div> </div> </div> </body> </html>
2023年04月07日
4,638 阅读
0 评论
0 点赞
2023-04-02
Joe主题导航栏标签添加角标
前言Joe主题是一款非常优秀的主题。使用了一段时间,真是太爱了。我在浏览别人的网站的时候发现有的标签有一个小的角标,用来标注重点。自已也想弄一个,一顿折腾,终于搞出来了,特此记录。效果图制作方法登录后台-->设置外观-->全局设置-->自定义CSS.ff-red { display: inline-block; transform: translateY(-12px); font-size: .75rem; letter-spacing: 0.05em; background: linear-gradient(to top, #efd3b0 0%, #eb4444 100%); color: #ffffff; border-radius: 1rem; padding: .15rem .275rem; line-height: 1; font-weight: bold; }编辑header.php/* 路径: usr/themes/Joe/public/header.php 找到导航栏位置,修改代码 */ <?php foreach (array_slice($pages->stack, 0, $this->options->JNavMaxNum) as $item) : ?> <a class="item <?php echo $this->is('page', $item['slug']) ? 'active' : '' ?>" href="<?php echo $item['permalink'] ?>" title="<?php echo $item['title'] ?>"><?php echo $item['title'] ?> <?php if ($item['title'] == '服务') : ?> <span class="ff-red">付费</span> <?php endif; ?> </a> <?php endforeach; ?>
2023年04月02日
5,128 阅读
0 评论
1 点赞
2023-04-01
Joe主题文章添加文章目录树
前言去年写过一篇 Joe主题开启文章目录结构 ,最近感觉有点难看,而且默认是隐藏的,每次都得用鼠标点一下。网上找了其他的目录树方案教程,都很老了。设置了都没有效果。参考着别人的网站,折腾了一下午终于弄好了,特此记录下来。效果修改post.php加载js和css<!--加在头部--> <link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/jfloor.min.css'); ?>"> <!-- body标签 最下面 --> <?php if ($this->options->jfloor === 'on') : ?> <!-- 目录树 --> <script src="<?php $this->options->themeUrl('assets/js/jfloor.min.js'); ?>"></script> <?php endif; ?>加载功能代码,大概41行 <div class="joe_container j-post"> <section class="j-adaption" style="height: auto !important;"> <?php if ($this->options->jfloor === 'on') : ?> <?php GetCatalog(); ?> <?php endif; ?> ... </div>functions.php后台功能开关 //开启文章目录树显示 $jfloor = new Typecho_Widget_Helper_Form_Element_Select( 'jfloor', array( 'off' => '关闭(默认)', 'on' => '开启', ), 'off', '是否启用文章目录树显示', '介绍:开启之后 在文章最左侧显示目录树(手机端不显示)' ); $jfloor->setAttribute('class', 'joe_content joe_post'); $form->addInput($jfloor->multiMode());core/function.php目录树函数,放在文件最后/*生成文章目录树*/ function CreateCatalog($obj) { global $catalog; global $catalog_count; $catalog = array(); $catalog_count = 0; $obj = preg_replace_callback('/<h([1-6])(.*?)>(.*?)<\/h\1>/i', function ($obj) { global $catalog; global $catalog_count; $catalog_count++; $catalog[] = array('text' => trim(strip_tags($obj[3])), 'depth' => $obj[1], 'count' => $catalog_count); return '<h' . $obj[1] . $obj[2] . ' id="cl-' . $catalog_count . '"><span>' . $obj[3] . '</span></h' . $obj[1] . '>'; }, $obj); return $obj; } /*获取文章目录树*/ function GetCatalog() { global $catalog; $index = ''; if ($catalog) { $index = '<ul>'; $prev_depth = ''; $to_depth = 0; foreach ($catalog as $catalog_item) { $catalog_depth = $catalog_item['depth']; if ($prev_depth) { if ($catalog_depth == $prev_depth) { $index .= '</li>'; } elseif ($catalog_depth > $prev_depth) { $to_depth++; $index .= '<ul>'; } else { $to_depth2 = ($to_depth > ($prev_depth - $catalog_depth)) ? ($prev_depth - $catalog_depth) : $to_depth; if ($to_depth2) { for ($i = 0; $i < $to_depth2; $i++) { $index .= '</li></ul>'; $to_depth--; } } $index .= '</li>'; } } $index .= '<li><a href="#cl-' . $catalog_item['count'] . '" data-href="#cl-' . $catalog_item['count'] . '">' . $catalog_item['text'] . '</a>'; $prev_depth = $catalog_item['depth']; } for ($i = 0; $i <= $to_depth; $i++) { $index .= '</li></ul>'; } $index = '<div class="j-floor s-j-floor"><div class="contain" id="jFloor" style="top: 126px;"><div class="title">文章目录</div>' . $index . '<svg class="toc-marker" xmlns="http://www.w3.org/2000/svg"><path stroke="var(--theme)" stroke-width="3" fill="transparent" stroke-dasharray="0, 0, 0, 1000" stroke-linecap="round" stroke-linejoin="round" transform="translate(-0.5, -0.5)" /></svg></div></div>'; } echo $index; }core/core.php文章页面相应位置(初始化函数themeInit)加载,大约第83行 /* 文章目录树 */ if ($self->is('single')) { $self->content = CreateCatalog($self->content); }需要的资源文件jfloor.min.css //样式jfloor.min.js //功能实现下载{cloud title="JOE文章目录树" type="bd" url="https://pan.baidu.com/s/1o83oneH3WumzrmtUVdQM7w" password="w4ut"/}本站备份下载[attach]1405[/attach]
2023年04月01日
6,180 阅读
2 评论
0 点赞
2023-03-31
UserLog一款Typecho用户登陆日志插件
这个是一年前发布的《Typecho用户登陆日志插件》的重构版,完全重写,旧版本用的是存储数据库的方式,今天规则之树大佬说我的表名和他的东西冲突了,用户只能二选一了,所以就有了重构的念头,这个重构版功能上可能没有旧版本多,但这个全新重构版则是采用json文件的方式来存储用户登录日志,安全无公害。UserLogUserLog是一款Typecho的用户登陆日志插件,支持记录常规登录与通过插件接口登录(一般为社交登录)的用户信息,且支持按月归档。效果图插件下载UserLog1.0.7https://qqdie.lanzoue.com/iiQ5C0omrqbg插件更新保留插件目录下history文件夹(里面就是存的登录日志的json文件),替换其余文件即可完成升级。更新记录2023年2月26日发布1.0.7版本新插入的数据改为插入的数据最前面,月份显示文字调整。2023年2月23日发布1.0.5版本支持只显示今天/昨天的登录记录,css调整优化移动端体验效果2023年2月20日发布1.0.1版本合计界面下支持统计当前年份下登录的用户人数,同时支持显示平均每人登录的次数。2023年2月19日发布1.0.0版本支持记录常规登录与通过插件接口登录的用户信息,且支持按月归档,支持显示最近5年的记录本站备份下载[attach]1402[/attach]
2023年03月31日
6,057 阅读
0 评论
0 点赞
2023-03-30
Simple microblogging [增强版]-WordPress说说插件
一个给wordpress添加说说的插件插件效果:实例演示:https://h4ck.org.cn/talk/插件下载地址:https://github.com/obaby/Simple-microblogging-wordpress-plugin本站备份下载:[attach]1401[/attach]
2023年03月30日
5,571 阅读
0 评论
0 点赞
2023-03-29
Typecho_Theme_JJ 《高仿掘金》
Typecho 主题-《高仿掘金》这是一个程序员风格的主题,是为了更好的文章阅读和分享知识!FAQ 文档《主题使用指南》更新日志2023-03-18webpack5 + typescript 重构主题支持 Typecho 1.2模块化结构兼容到 320px 分辨率修复 1.0 版本备案信息无法展示 bug新增表情文章与独立页支持切换主题支持更多的代码类型高亮文章内容支持 iframe 了优化了灯箱逻辑更加准确的分类菜单高亮更好的定位跳转更新了 UI有彩蛋哦还有很多变化需细细品味2021-8-15利用 webpack 重构项目,js 和 css 得以更加优秀的按需引入功能全部重构,部分功能逻辑完善:登录弹窗、无限加载等等和老朋友成功研究出掘金灯箱逻辑算法,目前基本做到了 1:1 完美复原响应式最低分辨率在 420px,320px 依旧可以访问还有啥,想不起来了,版本号也懒得更新了,就这样吧,懒癌主题预览有志之士如果你也想完善这个主题,可以提交你的代码,在我博客留言探讨也行 木灵鱼儿底层基建本主题基于 《webpack-multiple-entry》项目实现,它是一个用于 Typecho 主题开发的底层工具,用于实现现代化前端打包构建。主题下载https://github.com/mulingyuer/Typecho_Theme_JJ/releases/download/v2.1.1/Typecho_Theme_JJ.zip
2023年03月29日
6,495 阅读
1 评论
0 点赞
2023-03-14
Jasmine - 简约、美观的博客主题
Jasmine,一款 Typecho 主题。专为博客类网站开发,响应式设计,在移动端也有不错体验。主要使用白、灰、黑三种配色,整体简洁、精致、美观。欢迎进群交流主题、Typecho 等相关问题。QQ 群:539165194主题预览本站主题仓库如果觉得主题还不错,请帮忙点个 start ????。Github | Gitee 预览图主题亮点响应式设计针对 SEO 优化支持切换夜间模式支持置顶文章显示支持评论 QQ 头像显示支持代码高亮支持随机文章跳转支持文章缩略图设置支持外观设置备份主题更新检测……快速开始环境PHP 7+ (建议)MySQL(建议)Typecho 1.1+(建议)安装下载主题压缩包 jasmine.zip解压下载文件,并将文件夹重命名为 jasmine上传至 usr/themes/目录下启用此主题本站备份下载[attach]1396[/attach]
2023年03月14日
7,455 阅读
2 评论
2 点赞
1
2
...
63