中药方大全小图标
您当前的位置:首页 > 其他 > 网站日记

帝国cms二开助手更新记录

提示: 阅读权限:公开  来源:原创  作者:中药方大全

2021年4月3日 
  文件  jiuhecai.php 替换 
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>

<script src="//cdn.staticfile.org/ace/1.2.6/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="//cdn.staticfile.org/ace/1.2.6/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>

2022年3月8日

//增加了.md文件的浏览功能。重点修改代码备忘:
<?php
$file=$_GET['fn'];
$kzm= substr($file, strrpos($file, '.')+1);
 if(strtolower($kzm)!='md'){
    exit();
}
 define('EmpireCMSAdmin', '1');
 define('InEmpireCMS', '1');
 require($_SERVER['DOCUMENT_ROOT']."/e/class/connect.php");
 require($_SERVER['DOCUMENT_ROOT']."/e/class/db_sql.php");
 require('jhcfun.php');
 require($_SERVER['DOCUMENT_ROOT']."/e/class/functions.php");
 // require('../../data/dbcache/class.php'); 

 $link = db_connect();
 $empire = new mysqlquery();
 //$editor = 1;//验证用户
 $lur = is_login();
 $logininid = $lur['userid'];
 $loginin = $lur['username'];

$file=trim($file,'/');
$file=ECMS_PATH.$file;
if(!file_exists($file)){
    db_close();
    $empire=null;
    exit();
}
$md=file_get_contents($file);
require_once "Parsedown.php";
$Parsedown = new Parsedown();

$html= $Parsedown->text($md);
?>
<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<title>ACE代码编辑器</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
</head>
<body>
    <?=$html?>
</body></html>

对应的js调整

//浏览操作
    function preview(obj, path) {
		if ( !obj || !path ) { return false; }
		var fileExtension = path.split('.').pop().toLowerCase();
		if(fileExtension=='md'){
		    path='e/extend/erkaihelper/viewmd.php{$whehref}&fn='+path;
		}
		
		path=window.location.host+'/'+path;
		path=path.replace('//','/');
		path=window.location.protocol+"//"+path;
		window.open(path, '_blank');
    }


tags:
返回顶部
推荐资讯
视频:田纪钧讲关节不痛的秘密、膝关节拉筋法
视频:田纪钧讲关节不
白露到了,你还好吗?
白露到了,你还好吗?
尿疗与断食
尿疗与断食
给风疹反复发作女孩的药方(组图)
给风疹反复发作女孩的
相关文章
    无相关信息
栏目更新
栏目热门
  1. 帝国cms全站搜索的分页格式如何修改-流程
  2. libreoffice7的命令大全
  3. 帝国cms插件之标题生成标题图片
  4. 帝国cms插件安装模板
  5. useragent两千条,爬虫专用
  6. 帝国cms插件如何兼容gbk和utf8
  7. 帝国cms插件之迅搜
  8. 帝国cms用户上传文件名的命名规则及修改方
  9. 帝国cms7.2函数大全
  10. 帝国cms代码片段备忘录