This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sec2time(timeInSeconds) { | |
var pad = function(num, size) { return ('000' + num).slice(size * -1); }, | |
time = parseFloat(timeInSeconds).toFixed(3), | |
hours = Math.floor(time / 60 / 60), | |
minutes = Math.floor(time / 60) % 60, | |
seconds = Math.floor(time - minutes * 60), | |
milliseconds = time.slice(-3); | |
return pad(hours, 2) + ':' + pad(minutes, 2) + ':' + pad(seconds, 2) + ',' + pad(milliseconds, 3); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$theme = 'THEME NAME'; | |
$GLOBALS['xoopsConfig']['theme_set'] = $theme; | |
$GLOBALS['xoopsConfig']['theme_set_allowed'][] = $theme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** layui-v2.4.5 MIT License By https://www.layui.com */ | |
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一頁",a.next="next"in a?a.next:"下一頁";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** layui-v2.4.5 MIT License By https://www.layui.com */ | |
;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["確定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("la |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xoops內過濾函數htmlSpecialChars效果與php函數htmlspecialchars差異:不會將 & 轉換為 & | |
使用phpword輸出內容時,必須將&符號進行轉換 | |
function htmlSpecialChars($text, $quote_style = ENT_QUOTES, $charset = null, $double_encode = true) | |
{ | |
if (version_compare(phpversion(), '5.2.3', '>=')) { | |
$text = htmlspecialchars($text, $quote_style, $charset ? $charset : (defined('_CHARSET') ? _CHARSET : 'UTF-8'), $double_encode); | |
} else { | |
$text = htmlspecialchars($text, $quote_style); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
modules/system/preloads/core.php | |
*/ | |
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js'); | |
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/bootstrap-notify.min.js'); | |
$GLOBALS['xoTheme']->addScript('', array('type' => 'text/javascript'), ' | |
$(document).ready(function(){ | |
$.notify({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//刪除確認的JS | |
if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/sweet_alert.php")) { | |
redirect_header("index.php", 3, _MD_NEED_TADTOOLS); | |
} | |
include_once XOOPS_ROOT_PATH . "/modules/tadtools/sweet_alert.php"; | |
$sweet_alert_obj = new sweet_alert(); | |
//產生token | |
$token = new XoopsSecurity(); | |
$render_token = $token->createToken(0, 'csrf_token'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//列出所有照片 | |
function list_photos($csn = "", $uid = "") | |
{ | |
global $xoopsModuleConfig, $xoopsTpl, $tadgallery, $xoopsDB; | |
if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/fancybox.php")) { | |
redirect_header("index.php", 3, _MA_NEED_TADTOOLS); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
//加入上傳檔案MIME types篩選 | |
//新增ext2mime函數,可將副檔名轉換為MIME types,提供給$file_handle->allowed使用 | |
//$allow = "doc;docx;pdf",利用分號;區分允許上傳的檔案類型 | |
$TadUpFiles->upload_file($upname,$width,$thumb_width,$files_sn,$desc,$safe_name=false,$hash=false,$return_col,$allow); | |
//上傳表單(enctype='multipart/form-data') | |
include_once XOOPS_ROOT_PATH."/modules/tadtools/TadUpFiles.php" ; | |
$TadUpFiles=new TadUpFiles("模組名稱",$subdir,$file="/file",$image="/image",$thumbs="/image/.thumbs"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="" enctype="multipart/form-data" method="post"> | |
<input id="file" name="file" type="file" /> | |
<input id="Submit" name="submit" type="submit" value="Submit" /> | |
</form> |
NewerOlder