首页
留言反馈
网站导航
推荐
毒鸡汤
Search
1
非插件为typecho 文章生成微海报分享
19,100 阅读
2
主题移动端,样式下添加二级分类
15,544 阅读
3
主题 添加author page
14,856 阅读
4
主题添加移动端下边栏
12,856 阅读
5
EMlog添加评论者邮箱等级
9,173 阅读
typecho
dynamic
SuiYu
Emlog
xiuno
登录
/
注册
Search
标签搜索
代码
xiuno
php
css
typecho
评论
模板
say
js
修改教程
标签
珍惜
努力
recommend
善良
样式
调用
微笑
颜色
插件
Vincent
累计撰写
151
篇文章
累计收到
184
条评论
首页
栏目
typecho
dynamic
SuiYu
Emlog
xiuno
页面
留言反馈
网站导航
推荐
毒鸡汤
搜索到
147
篇与
的结果
2021-07-05
右侧栏滚动到顶部自动固定教程代码
直接上代码:<script> window.onscroll = function () { var topScroll = document.documentElement.scrollTop;//滚动的距离,距离顶部的距离 var bignav = document.getElementsByClassName("aside")[0];//获取到导航栏id var left = document.getElementsByClassName("aside")[0].getBoundingClientRect().left; var width=document.getElementsByClassName("aside")[0].getBoundingClientRect().width; if (topScroll > 210 && Math.abs(topScroll-document.documentElement.scrollHeight)>600) { //当滚动距离大于250px时执行下面的东西 bignav.style.position = 'fixed'; bignav.style.top = '10px'; bignav.style.left = '' + left + 'px'; bignav.style.width = '' + width + 'px'; bignav.style.zIndex = '9999'; } else {//当滚动距离小于250的时候执行下面的内容,也就是让导航栏恢复原状 bignav.style.position = 'static'; } } </script>
2021年07月05日
1,048 阅读
0 评论
4 点赞
2021-07-05
xiuno插入图片轮番图
在首页代码处插入代码:<div id="demo" class="carousel slide mb-3" data-ride="carousel"> <!-- 指示符 --> <ul class="carousel-indicators"> <li data-target="#demo" data-slide-to="0" class="active"></li> <li data-target="#demo" data-slide-to="1" class=""></li> <li data-target="#demo" data-slide-to="2" class=""></li> </ul> <!-- 轮播图片 --> <div class="carousel-inner"> <div class="carousel-item active"> <a href="<a href="https://bbs.2025ly.cn" target="_blank"><img src="https://bbs.2025ly.cn/view/img/01.jpg"></a>" target="_blank"><span style="color:#0070c0">https://bbs.2025ly.cn" target="_blank"><img src="https://bbs.2025ly.cn/view/img/01.jpg"></a></span></a> </div> <div class="carousel-item"> <a href="<a href="https://bbs.2025ly.cn/forum-1.htm" target="_blank"><img src="https://bbs.2025ly.cn/view/img/02.jpg"></a>" target="_blank"><span style="color:#0070c0">https://bbs.2025ly.cn/forum-1.htm" target="_blank"><img src="https://bbs.2025ly.cn/view/img/02.jpg"></a></span></a> </div> <div class="carousel-item"> <a href="<a href="https://bbs.2025ly.cn/user-create.htm" target="_blank"><img src="https://bbs.2025ly.cn/view/img/03.jpg"></a>" target="_blank"><span style="color:#0070c0">https://bbs.2025ly.cn/user-create.htm" target="_blank"><img src="https://bbs.2025ly.cn/view/img/03.jpg"></a></span></a> </div> </div> <!-- 左右切换按钮 --> <a class="carousel-control-prev" href="#demo" data-slide="prev"> <span class="carousel-control-prev-icon"></span> </a> <a class="carousel-control-next" href="#demo" data-slide="next"> <span class="carousel-control-next-icon"></span> </a> </div>
2021年07月05日
939 阅读
0 评论
3 点赞
2021-07-04
xiunoBBS后台插件排序方法--启用的排前面
xiunoBBS后台插件默认是按照插件路径排序,也可以理解为按照插件作者(英文缩写)排序但是后台看起来就有点乱,找自己启用的插件要翻老半天先上排序后的效果,有没有变清爽:排序方法这个效果功能懒得开发成插件,而且几乎为必备修改,直接改源码将文件/model/plugin.func.php第53行的plugin_init()函数修改为以下代码,同时增加函数array_sort()即可,完整代码如下:// 在安装、卸载插件的时候,需要先初始化 function plugin_init() { global $plugin_srcfiles, $plugin_paths, $plugins, $official_plugins; $plugin_paths = glob(APP_PATH.'plugin/*', GLOB_ONLYDIR); if(is_array($plugin_paths)) { foreach($plugin_paths as $path) { $dir = file_name($path); $conffile = $path."/conf.json"; if(!is_file($conffile)) continue; $arr = xn_json_decode(file_get_contents($conffile)); if(empty($arr)) continue; $plugins[$dir] = $arr; // 额外的信息 $plugins[$dir]['hooks'] = array(); $hookpaths = glob(APP_PATH."plugin/$dir/hook/*.*"); // path if(is_array($hookpaths)) { foreach($hookpaths as $hookpath) { $hookname = file_name($hookpath); $plugins[$dir]['hooks'][$hookname] = $hookpath; } } // 本地 + 线上数据 $plugins[$dir] = plugin_read_by_dir($dir); } //插件排序,依赖于自定义函数array_sort() $plugins = array_sort($plugins,'installed','desc'); $plugins = array_sort($plugins,'enable','desc'); } } //二维数组排序 function array_sort($arr,$keys,$type='asc'){ $keysvalue = $new_array = array(); foreach ($arr as $k=>$v){ $keysvalue[$k] = $v[$keys]; } if($type == 'asc'){ asort($keysvalue); }else{ arsort($keysvalue); } reset($keysvalue); foreach ($keysvalue as $k=>$v){ $new_array[$k] = $arr[$k]; } return $new_array; }
2021年07月04日
880 阅读
0 评论
4 点赞
2021-07-03
Xiuno BBS 4.0 修改时间显示
##修罗开源轻论坛程序 - Xiuno BBS 4.0Xiuno BBS 4.0 是一款轻论坛产品,前端基于 BootStrap 4.0、JQuery 3,后端基于 PHP/7 MySQL XCache/Yac/Redis/Memcached...,自适应手机、平板、PC,有着非常方便的插件机制,不仅仅是一个轻论坛,还是一个良好的二次开发平台。这个程序默认是人类友好的时间显示的,例如:1天前 1月前有时候需要精确时间显示 2019-10-10 11:11:11但是又没有提供选项只能修改代码xiunophp/misc.func.php469行function humandate($timestamp, $lan = array()) {直接返回时间return date('Y-m-d H:i:s',$timestamp);exit;xiunophp.min.php 里面也有一个同样的函数 也要同样处理保存文件就可以了
2021年07月03日
916 阅读
0 评论
4 点赞
2021-07-03
Xiuno程序全部版块列表页面
首先添加路由,在插件hook目录新建文件index_route_case_start.php,内容为case 'bbs': include _include('plugin/xxx/view/htm/bbs.htm'); break;其中xxx修改为所在插件目录然后在/plugin/xxx/view/htm新建bbs.htm,内容为<?php include _include(APP_PATH . 'view/htm/header.inc.htm'); ?> <div class="row"><div class="col-lg-9 main"> <!--{hook bbs_start.htm}--> <ul class="list-unstyled mb-0"> <div class="row mx-0"><?php foreach ($forumlist_show as $_forum) { ?> <li class="col-sm-6 px-0 px-sm-2" fid="<?php echo $_forum['fid']; ?>" data-active="fid-<?php echo $_forum['fid']; ?>"> <div class="card mb-2"> <div class="card-body"> <div class="media"> <img class="logo-4 mr-2" src="<?php echo $_forum['icon_url']; ?>"> <div class="media-body"> <div class="d-flex justify-content-between"> <div><a href="<?php echo url("forum-$_forum[fid]"); ?>"><?php echo '' . $_forum['name'] . ''; ?></a></div> </div> <div class="text-small"> <?php echo "全部" . lang('threads') . ':'; ?><?php echo $_forum['threads']; ?> / <?php echo "今日" . lang('posts') . ':'; ?><?php echo $_forum['todayposts']; ?> </div> <div class="text-small break-all"> <?php echo xn_substr($_forum['brief'], 0, 18); ?> </div> </div> </div> </div> </div> </li> <?php } ?> </div> </ul> </div> <!--{hook bbs_end.htm}--> <!-- 此处省略了侧边栏代码,需要的话从别的页面复制过来--> </div> </div> <?php include _include(APP_PATH . 'view/htm/footer.inc.htm'); ?> <script> $('li[data-active="bbs"]').addClass('active'); </script> <!--{hook bbs_js.htm}-->
2021年07月03日
1,529 阅读
0 评论
5 点赞
2021-07-03
实现滚动标题效果
将下面代码加入xiuno的head文件内,就可以实现滚动效果了。代码:<script> //网站打开后延迟开启执行滚动效果 setTimeout(function(){ newtitle(); },2800); function newtitle() { //获取网站的标题 var text=document.title var timerID //标题超过长度后启用滚动 if(text.length>10){ //设置标题,从第二个字获取到末尾+标题的第一个字 document.title=text.substring(1,text.length)+text.substring(0,1); //获取标题长度 text=document.title.substring(0,text.length); //600毫秒后继续调用这个函数进行递归,实现滚动的效果 timerID = setTimeout("newtitle()", 600) } } </script>
2021年07月03日
905 阅读
0 评论
3 点赞
2021-07-03
首页主题列表头像美化,变方一点
找到文件主题目录下这个文件overwrite/view/htm/thread_list.inc.htm再最顶部添加下面一行[hide]<style> .avatar-3{ border-radius: 5px } </style>[/hide]
2021年07月03日
927 阅读
0 评论
4 点赞
2021-07-02
文字彩虹跑马灯效果特效代码
代码: <style> .masked{ text-align: center; background-image: -webkit-linear-gradient(left, #147B96, #E6D205 25%, #147B96 50%, #E6D205 75%, #147B96); -webkit-text-fill-color: transparent; -webkit-background-clip: text; -webkit-background-size: 200% 100%; -webkit-animation: masked-animation 4s infinite linear } @-webkit-keyframes masked-animation { 0%{ background-position: 0 0;} 100% { background-position: -100% 0; } </style><span class="masked">文字彩虹跑马灯效果特效代码</span>
2021年07月02日
1,015 阅读
0 评论
5 点赞
2021-07-01
成年人的崩溃,都是无声的
你是否有过这样的经历,开车到家以后不愿下车,喜欢一个人坐在车里听歌,放空自己,静静的发呆,好多话想说,好多话没说,好多话不能说,那些不能发在朋友圈,不能跟朋友,家人诉说的各种情绪,此刻在这个只属于自己的狭小空间里默不作声地暗自消化。 眼泪真的特别奇怪,疼的时候能忍住,累的时候也能忍住。可偏偏就是你受了委屈的时候,它怎么也忍不住,头一低,眼泪就倒了下来。成年人的世界,连哭都要躲起来,怕破坏气氛,怕别人尴尬,怕突如其来的安慰,怕被别人看穿自己的脆弱和无助。 成年人的身上背负着各种压力,无论工作上遇到了多大的委屈,还是在生活中遇见多大的挫折,总是咬牙坚持,不动声色迎难而上。每一天的状态大概就是,心里藏着疲惫和委屈,又在尽力讨好生活。一边崩溃堕落,跌向深渊;一边又拼命自愈,向往阳光…… 不让别人看到自己的负能量,这或许是成熟,但更是无可奈何的心酸。我们努力向上追逐,却还是没活成自己想要的样子。越长大越明白,真正喜欢想要的东西,没有一样可以轻易得到。世间所有不尽人意之事,全靠硬扛,接受分道扬镳,接受世事无常,接受孤独挫败,接受对未来的无力感,接受自己的不完美,接受痛苦心碎,熬过抽筋扒皮般的痛之后,这大概就叫成长。 听过最自律的一句话:那些我难以言表,不作声响,暗自发力的日子,其实并不是想要的生活,而是在通往我想要的生活路上。 终有一天你将举杯,敬一敬你的无所畏惧,你的一腔孤勇。你的秉直脾性,你的泪不自禁。 路还长,别丧,别哭,别灰心,别失落,我们都要加油!
2021年07月01日
883 阅读
0 评论
4 点赞
1
...
4
5
6
...
17