首页
留言反馈
网站导航
推荐
毒鸡汤
Search
1
非插件为typecho 文章生成微海报分享
18,938 阅读
2
主题移动端,样式下添加二级分类
15,460 阅读
3
主题 添加author page
14,770 阅读
4
主题添加移动端下边栏
12,779 阅读
5
EMlog添加评论者邮箱等级
9,122 阅读
typecho
dynamic
SuiYu
Emlog
xiuno
登录
/
注册
Search
标签搜索
代码
xiuno
php
css
typecho
评论
模板
say
js
修改教程
标签
珍惜
努力
recommend
善良
样式
调用
微笑
颜色
插件
Vincent
累计撰写
151
篇文章
累计收到
184
条评论
首页
栏目
typecho
dynamic
SuiYu
Emlog
xiuno
页面
留言反馈
网站导航
推荐
毒鸡汤
搜索到
17
篇与
的结果
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日
802 阅读
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日
891 阅读
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,479 阅读
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日
891 阅读
0 评论
3 点赞
2021-07-03
首页主题列表头像美化,变方一点
找到文件主题目录下这个文件overwrite/view/htm/thread_list.inc.htm再最顶部添加下面一行[hide]<style> .avatar-3{ border-radius: 5px } </style>[/hide]
2021年07月03日
892 阅读
0 评论
4 点赞
2021-07-01
弹窗广告代码分享
HTML代码:<!-- 弹窗 --> <div class="modal fade" id="modal_20200114" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">公告</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> 内容 </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal" id="modal_20200114_lock">我知道了,不要再弹出</button> </div> </div> </div> </div>JS代码:(放到底部)<script> !function (){ var a = $('#modal_20200114'); var b = $('#modal_20200114_lock'); var k = $.cookie('modal_20200114_lock'); if(!k){ a.modal('show'); b.on('click', function() { $.cookie('modal_20200114_lock', '1'); }); } }(); </script>
2021年07月01日
969 阅读
0 评论
3 点赞
2021-07-01
为xiuno增加附件下载位置详细信息
要实现附件信息功能,要增加下面三个hook文件。1. attach_output_before.php attach_downloads($aid);2. model_attach_start.php // downloads + 1function attach_downloads($aid, $n = 1) { global $conf; $sqladd = strpos($conf['db']['type'], 'mysql') === FALSE ? '' : ' LOW_PRIORITY'; $r = db_exec("UPDATE$sqladd `bbs_attach` SET downloads=downloads+$n WHERE aid='$aid'"); return $r; }3. model_post_file_list_html_delete_before.php$s .= '<br><div style="color:#999;"> 上传时间:'.date('Y-m-d', $attach['create_date'])."\r\n"; $s .= ' | 下载次数:'.intval($attach['downloads'])."\r\n"; $s .= '次 | 文件大小:'.humansize($attach['filesize'])."\r\n"; $s .= '</div>'."\r\n";
2021年07月01日
784 阅读
0 评论
3 点赞
2021-06-30
xiuno伪静态配置
apache1.在网站根目录创建文件 .htaccess,内容如下:<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*?)([^/]*)$ $1index.php?$2[QSA,PT,L] </IfModule>2. 修改conf/conf.php,将url_rewrite_on 改成13. 清理缓存nginx1. 在配置文件的server节点下新增如下内容:location ~* \.(htm)$ { rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last; }2. 修改conf/conf.php,将url_rewrite_on 改成13. 清理缓存
2021年06月30日
884 阅读
0 评论
3 点赞
1
2