|
本帖最后由 gzwazz 于 2011-3-8 14:43 编辑
首先上图看看
方法如下
Upp.php 此文件放在libraries下
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Upp {
public $BasePath;
public $Width;
public $Height;
public $eName;
public $Value;
public $AutoSave;
function SinaEditor($eName){
$this->eName=$eName;
$this->BasePath='.';
$this->AutoSave=false;
$this->Height=460;
$this->Width=630;
return $this;
}
function create(){
$ur=base_url();
$ReadCookie=$this->AutoSave?1:0;
return <<<eot
<textarea name="{$this->eName}" id="{$this->eName}" style="display:none;">{$this->Value}</textarea>
<iframe src="{$ur}/editweb/Edit/editor.htm?id={$this->eName}&ReadCookie={$ReadCookie}" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" width="{$this->Width}" height="{$this->Height}"></iframe>
eot;
}
}
controllers控制器加载是这样的public function add(){
//加载ubb在线编缉器
$this->load->library('upp');
$editor=$this->upp->SinaEditor('content');
$editor->Value='';
$editor->BasePath='editweb';
$editor->Height=400;
$editor->Width=900;
$editor->AutoSave=false;
$data['ubb']=$editor->Create();
$this->load->view('admin/news_add', $data);
}
views写法这样的
<?php
extract($_POST);
extract($_GET);
unset($_POST,$_GET);
if(isset($act)){
$act=='subok' && die("提交的内容是:<br>".htmlspecialchars($gently_editor));
}
echo $ubb;
?>
最后上传新浪在线编缉器
editweb.rar
(158.49 KB, 下载次数: 597)
解压后放在和主放口文件index.php同级目录
此编缉器的上传功能被我限制了请自动修改editweb\Edit\editor\upload.php
完成
觉得可以请加分 |
评分
-
查看全部评分
|