Hello,
This is my last shot, I've been resarching all over internet for days and found no answer to my problem.
I installed ckeditor on my website, and everything aparently works fine (the instace's been created on the website, and even return data from database using $initialValue), but I just can't see the toolbar in the textarea.
Tried everything, including creating the textarea in html and then using $CKeditor->replaceall().
I would be extremelly grateful if someone could help me on this.
This the code (it's part of a major php code, but I think it's enough for helping me):
And this is what I get when trying to add new content to my website:

And when I try to edit existing data:

Thank you all, and sorry for the long post.
This is my last shot, I've been resarching all over internet for days and found no answer to my problem.
I installed ckeditor on my website, and everything aparently works fine (the instace's been created on the website, and even return data from database using $initialValue), but I just can't see the toolbar in the textarea.
Tried everything, including creating the textarea in html and then using $CKeditor->replaceall().
I would be extremelly grateful if someone could help me on this.
This the code (it's part of a major php code, but I think it's enough for helping me):
<?
session_start();
$thm = $_SESSION['thm'];
include("../lib/libBanco.php");
require_once '/home/site/www.virtualife.com.br/www/htmlpurifier-3.3.0/library/HTMLPurifier.auto.php';
$objConexao = new ConexaoMysql;
$codigo_usuario = $_SESSION['codigo_usuario'];
$rsSelect = $objConexao->sql("select * from xprt_perms_users p, xprt_itens_blocos as i where i.cd_item = p.cd_item AND p.cd_usuario = '$codigo_usuario'");
$rsSelect_adm = $objConexao->sql("select * from xprt_perms_users p, xprt_itens_blocos as i where p.cd_usuario = '$codigo_usuario' AND p.cd_super = '1'");
$rsSelect_nick_adm = $objConexao->sql("select nick_id,nick from nick where nick_id = '$codigo_usuario'");
if (@mysql_num_rows($rsSelect_nick_adm) > 0) {
while($lista = mysql_fetch_assoc($rsSelect_nick_adm)) {
$nick_adm = $lista['nick'];
}
}
if (mysql_num_rows($rsSelect) || mysql_num_rows($rsSelect_adm)) {
if($_REQUEST['id'] && $_REQUEST['valor'] && $_REQUEST['type']) {
$id = $_REQUEST['id'];
$valor = $_REQUEST['valor'];
$type = $_REQUEST['type'];
$rsSelect_artigo = $objConexao->sql("select cd_conteudo,tx_titulo from xprt_conteudos where cd_conteudo = '$id'");
if (@mysql_num_rows($rsSelect_artigo) > 0) {
while($lista = mysql_fetch_assoc($rsSelect_artigo)) {
$artigo = $lista['tx_titulo'];
}
}
$data = date("Y-m-d");
$hora = date("H");
$min = date("i");
$seg = date("s");
$enviado = $data." ".$hora.":".$min.":".$seg;
if($type == "del") {
$objConexao->sql("insert into xprt_logs (date, nick, action) values ('".$enviado."', '".$nick_adm."', 'Deletou o artigo ".$artigo."')");
$objConexao->sql("delete from xprt_conteudos where cd_conteudo = '$id'");
}
if($type == "update") {
$rsSelect = $objConexao->sql("select * from xprt_conteudos where cd_conteudo = '$id'");
$lista_up = mysql_fetch_array($rsSelect);
$input_update = 1;
}
}
$content .= '<form name="blocos" id="blocos" method="post" action="admin/process.php" enctype="multipart/form-data">';
$titulo = "Adicionar Conteudo";
include("../thm/vlife_g3/header_center.php");
$content .= "<b>Sessão do Conteudo</b><br />";
$content .= "<select class=\"input\" name=\"sessao\"><option value=\"\">- Selecione a Sessão do Conteudo</option>";
if (mysql_num_rows($rsSelect_adm)) {
$rsSelect = $objConexao->sql("select * from xprt_blocos as b, xprt_itens_blocos as i where b.cd_bloco = i.cd_bloco AND i.cd_type = '0' order by b.cd_bloco");
} else {
$rsSelect = $objConexao->sql("select * from xprt_perms_users as p, xprt_blocos as b, xprt_itens_blocos as i where p.cd_usuario = '$codigo_usuario' AND p.cd_item = i.cd_item AND b.cd_bloco = i.cd_bloco AND i.cd_type = '0' order by b.cd_bloco");
}
while($lista = mysql_fetch_array($rsSelect)) {
$cd_b = $lista['cd_bloco'];
$cd_i = $lista['cd_item'];
$nm_b = $lista['nm_bloco'];
$nm_i = $lista['nm_item'];
if($nm_b != $nm_b_x) {
if($nm_b_x) { echo "</optgroup>"; }
$content .= " <optgroup label=\"\"></optgroup>";
$content .= " <optgroup label=\"[".$nm_b."]\">";
$nm_b_x = $nm_b;
}
$selected = "";
if($cd_b == $lista_up['cd_bloco'] && $cd_i == $lista_up['cd_item']) { $selected = "selected"; }
$content .= " <option value=\"".$cd_b."|".$cd_i."\" ".$selected.">".$nm_b." - ".$nm_i."</option>";
}
$content .= "</optgroup></select><br /><br />";
$content .= "<b>Titulo</b><br /><input class=\"input\" name=\"titulo\" onfocus=\"mudacor(this.name);\" onblur=\"voltacor(this.name);\" value=\"".$lista_up['tx_titulo']."\"><br /><br />";
$content .= "<b>Apresentação</b><br />";
echo $content;
include_once "../ckeditor/ckeditor.php";
// Create a class instance.
$CKEditor = new CKEditor();
// Path to the CKEditor directory.
$CKEditor->basePath = '../ckeditor/';
$initialValue = stripslashes($lista_up['tx_previa']);
// Create a textarea element and attach CKEditor to it.
$CKEditor->editor("apresenta", $initialValue);
$content .= "<br /><br />";
$content1 .= "<b>Conteudo Completo</b><br />";
echo $content1;
// Create a textarea element and attach CKEditor to it.
$initialValue = stripslashes($lista_up['tx_conteudo']);
$CKEditor->editor( "conteudo", $initialValue);
$content1 .= "<br /><br />";
if($input_update) { $content .= '<input type="hidden" name="update" value="1"/><input type="hidden" name="id" value="'.$lista_up['cd_conteudo'].'"/>'; }
$content2 .= '<br /><h6><input type="image" src="thm/vlife_g3/img/enviar.gif" name="botao"/></h6></form>';
$data = date("Y-m-d");
$hora = date("H");
$min = date("i");
$seg = date("s");
$enviado = $data." ".$hora.":".$min.":".$seg;
$rsSelect_nick_adm = $objConexao->sql("select nick_id,nick from nick where nick_id = '$codigo_usuario'");
if (@mysql_num_rows($rsSelect_nick_adm) > 0) {
while($lista = mysql_fetch_assoc($rsSelect_nick_adm)) {
$nick_adm = $lista['nick'];
}
}
include("../thm/vlife_g3/footer_center.php");
$content2 .= "<br />";
$titulo = "Listagem do Conteudo";
include("../thm/vlife_g3/header_center.php");
$rsSelect = $objConexao->sql("select * from xprt_conteudos as c, xprt_blocos as b, nick as u, xprt_itens_blocos as i where u.nick_id = c.cd_usuario AND c.cd_bloco = b.cd_bloco AND i.cd_bloco = b.cd_bloco AND i.cd_item = c.cd_item order by dt_registro desc");
if (mysql_num_rows($rsSelect) > 0) {
while ($lista = mysql_fetch_array($rsSelect)) {
$f_date = explode(" ", $lista['dt_registro']);
$date = explode("-", $f_date[0]);
$data = $date[2].".".$date[1].".".$date[0];
$hora = $f_date[1];
$bloco = $lista['nm_bloco'];
$item = $lista['nm_item'];
$codigo_item = $lista['cd_conteudo'];
$excluir = "<img src=\"thm/vlife_g3/img/excluir.png\" border=\"0\" alt=\"Excluir Item\" />";
$edit = "<img src=\"thm/vlife_g3/img/edit.gif\" border=\"0\" alt=\"Editar Item\" />";
$content2 .= "<a href=\"#\" onclick=\"atualizaBlocos('conteudos', '".$codigo_item."', '1', 'del');\">".$excluir."</a> ";
$content2 .= "<a href=\"#\" onclick=\"atualizaBlocos('conteudos', '".$codigo_item."', '1', 'update');\">".$edit."</a> ";
$content2 .= "[".$data." @ ".$hora."][".$bloco." - ".$item."] <b>".$lista['tx_titulo']."</b><br />";
//$content .= $lista['tx_titulo']." - ".$lista['tx_conteudo']." - ".$lista['dt_registro']." - ".$lista['nm_nome']."<br />";
}
}
include("../thm/vlife_g3/footer_center.php");
echo $content2;
} else {
$titulo = "Administração do Site";
include("../thm/vlife_g3/header_center.php");
include("../thm/vlife_g3/access_denied.php");
include("../thm/vlife_g3/footer_center.php");
}
?>
And this is what I get when trying to add new content to my website:

And when I try to edit existing data:

Thank you all, and sorry for the long post.
Re: Blank textarea when using ckeditor
When accessing the .php directly, ckeditor opens corectly, as in the following image:
I just don't know what am I doing wrong inthe php code.
Thank you.
Attachments:
Re: Blank textarea when using ckeditor
Re: Blank textarea when using ckeditor
Sure, there it is:
HTML is to big to quote here. I've posted in pastebin.
First is for the first screens (not working ckeditor):
http://pastebin.com/tPzLLtLB
Second one is for the second screen, accessed the php file directly.
http://pastebin.com/ZMyDvh99
Thank you.
Re: Blank textarea when using ckeditor
Re: Blank textarea when using ckeditor
I just don't know wich parameter I have to correct for this to work:
or
or maybe
Thank you.
Re: Blank textarea when using ckeditor
Let us know if you can fix it!
Re: Blank textarea when using ckeditor
Ok. I have successfully corrected the basepath of ckeditor.
But now I get the following error on Firebug: