PHP UEditor编辑器(支持传统蒙古文排版)

UEditor编辑器本身没有从上到下从左到右的排版方式,借鉴前辈的经验,对编辑器进行改造,改造后支持传统蒙古文自上而下从左向右的排版方式。本编辑器的原始代码来自github上的开源项目,原发布者在官方版本的基础上增加了OSS、QINIU、COS三种存储方式,本人在此基础上追加了传统蒙古文排版功能。(注:里面的蒙古文哈旺体来自蒙科立),下图为演示示例:蒙古文歌词《美丽的草原我的家》

下载源代码(代码为纯编辑器,不含上图中的文章导入及发布功能,不含数据库,需使用者自己开发)


PHP UEditor编辑器(支持传统蒙古文排版)

PHP FTP类

<?php


class App_Helper_FtpHelper
{
    var $connector;
    var $getback;

    //连接FTP
    function connect($ftp_server, $port, $timeout, $uname, $passwd)
    {
        $this->connector = @ftp_connect($ftp_server, $port, $timeout);
        $this->login_result = @ftp_login($this->connector, "$uname", "$passwd");
        if (!$this->connector) {
            echo "FTP connection has failed! \n";
            echo "Attempted to connect to $ftp_server for user $uname \n";
            die;
        } else if (!$this->login_result) {
            echo "Connected to $ftp_server, for user $uname \n";
        }
    }

    function lastmodtime($value)
    {
        $getback = ftp_mdtm($this->connector, $value);
        return $getback;
    }

    //更改当前目录
    function changedir($targetdir)
    {
        $getback = ftp_chdir($this->connector, $targetdir);
        return $getback;
    }

    //获取当前目录
    function getdir()
    {
        $getback = ftp_pwd($this->connector);
        return $getback;
    }

    //获取文件列表
    function get_file_list($directory)
    {
        $getback = ftp_rawlist($this->connector, $directory);
        return $getback;
    }

    //获取文件
    function get_file($file_to_get, $mode, $mode2)
    {
        $realfile = basename($file_to_get);
        $filename = $realfile;
        $checkdir = @$this->changedir($realfile);
        if ($checkdir == TRUE) {
            ftp_cdup($this->connector);
            echo "\n[DIR] $realfile";
        } else {
            echo "..... " . $realfile . "\n";
            $getback = ftp_get($this->connector, $filename, $realfile, $mode);
            if ($mode2) {
                $delstatus = ftp_delete($this->connector, $file_to_get);
                if ($delstatus == TRUE) {
                    echo "File $realfile on f deleted \n";
                }
            }
        }
        return $getback;
    }

    function put_file($remote,$local){
        ftp_put($this->connector,$remote,$local,FTP_BINARY,0);
        return 'https://sc-qdmgyg-com.oss-cn-beijing.aliyuncs.com'.'/sc/'.$remote;
    }

    function mode($pasvmode)
    {
        $result = ftp_pasv($this->connector, $pasvmode);
    }

    //退出
    function ftp_bye()
    {
        ftp_quit($this->connector);
//        return $getback;
    }
}

PHP FTP类