Author
Message
andrej Hangin' Around Joined: Sep 10, 2005 Posts: 48
Posted:
Sun Jan 22, 2006 4:43 am
Hello !
I have installed CNB Conteudo on my phpnuke 7.6 installation, (more precisely, raven 1.05.00 ).
The problem is with my fckeditor, the WYSIWYG editor..
It doesn't work.. I realised the reason probably lies within my php, i use php5 and the version of fckeditor only works with php 4.x.
So i have installed the newset fckeditor..
However now i need to change the integration lines somehow and have no clue hwo to do that.
Could you help me ?
Code: <?php
include_once "modules/Conteudo/FCKeditor/fckeditor.php";
function page() {
global $prefix, $db, $language, $multilingual, $bgcolor2, $module_name, $myid, $config, $fckedit;
include("header.php");
$mid = $_GET['mid'];
$cid = $_GET['cid'];
$avan = $_GET['avan'];
$title = base64_decode($_GET['title']);
$brother = $_GET['brother'];
if ($_GET['brother'] != '') {
list($mid, $cid) = $db -> sql_fetchrow($db -> sql_query("SELECT mid, cid FROM ".$prefix."_cnbc_pages WHERE pid = '$brother'"));
if ($config['allowfck'] == 1) $fckedit = 1;
}
list($is_wiki) = $db->sql_fetchrow($db->sql_query("SELECT wiki FROM ".$prefix."_cnbc_folder WHERE cid = '$cid'"));
if ( (!auto_file($myid, $mid, 'criate', 0)) AND ($mid > 0) ) die("<center><br><br>"._CNBC_DONTHAVEAUTO."<br><br></center>"); //ve se pode modificar o arquivo mae
if ( !auto_folder($myid, $cid, 'criate', 0)) die("<center><br><br>"._CNBC_DONTHAVEAUTO."<br><br></center>"); //ve se pode inserir um novo arquivo no diretorio
if ( (can_son($mid) == 0) AND ($mid != 0) ) die("<center><br><br>"._CNBC_DONTHAVEAUTO."<br><br></center>"); //ve se pode criar filhos
OpenTable();
echo "<center><b>"._ADDANEWPAGE."</b></center><br><br>";
echo "<form action=\"modules.php?name=$module_name&file=admin\" method=\"post\">";
echo "<input type=\"submit\" value=\""._SEND."\"><br><br>"
."<input type=\"hidden\" name=\"op\" value=\"page_save\">"
."<input type=\"hidden\" name=\"brother\" value=\"$brother\">"
."<input type=\"hidden\" name=\"avan\" value=\"$avan\">";
if ($avan == 1) {
if ($mid > 0) {
list($mainfile) = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_cnbc_pages WHERE pid='$mid'"));
echo "<b>"._MAINFILE.":</b> $mainfile<br>";
echo "<input type=\"hidden\" name=\"mid\" value=\"$mid\">";
} else {
echo "<b>"._MAINFILE.":</b> "._RAIZ."<br>";
echo "<input type=\"hidden\" name=\"mid\" value=\"0\">";
}
if ($cid>0) {
list($maincat) = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_cnbc_folder WHERE cid='$cid'"));
echo "<b>"._CATALOG.":</b> $maincat<br><br>";
echo "<input type=\"hidden\" name=\"cid\" value=\"$cid\">";
} else {
echo "<b>"._CATALOG.":</b> 0<br><br>";
echo "<input type=\"hidden\" name=\"cid\" value=\"0\">";
}
} else {
if ($mid > 0) echo "<input type=\"hidden\" name=\"mid\" value=\"$mid\">";
else echo "<input type=\"hidden\" name=\"mid\" value=\"0\">";
if ($cid > 0) echo "<input type=\"hidden\" name=\"cid\" value=\"$cid\">";
else echo "<input type=\"hidden\" name=\"cid\" value=\"0\">";
}
if ($is_wiki == 1 && $title != ''){
echo "<b>"._TITLE."*:</b><br>"
."<input type=\"checkbox\" name=\"atitle\" value=\"1\">"._SHOWTEXT."<br>"
."<input type=\"text\" name=\"title\" size=\"50\" value='$title' disabled><br><br>"
."<input type = \"hidden\" name = \"title\" value = '$title'>";
} else {
echo "<b>"._TITLE.":</b><br>"
."<input type=\"checkbox\" name=\"atitle\" value=\"1\">"._SHOWTEXT."<br>"
."<input type=\"text\" name=\"title\" size=\"50\"><br><br>";
}
if ($avan == 1) {
echo "<b>"._CSUBTITLE.":</b><br>"
."<input type=\"checkbox\" name=\"asubtitle\" value=\"1\">"._SHOWTEXT."<br>"
."<input type=\"text\" name=\"subtitle\" size=\"50\"><br><br>";
echo "<b>"._ACTIVATEPAGE."</b><br>"
."<input type=\"radio\" name=\"active\" value=\"1\" checked> "._YES."  <input type=\"radio\" name=\"active\" value=\"0\"> "._NO."<br><br>";
echo "<b>"._HEADERTEXT.":</b><br>"
."<input type=\"checkbox\" name=\"apage_header\" value=\"1\">"._SHOWTEXT."<br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('page_header');
//$oFCKeditor->Width = "100%"; $oFCKeditor->Height = "100";
//$oFCKeditor->ToolbarSet = "Basic";
//$oFCKeditor->Value = "$mypages[page_header]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->ToolbarSet = "Basic";
$oFCKeditor->CreateFCKeditor('page_header', '750', 100, 'page_header', '');
} else echo "<textarea name=\"page_header\" cols=\"100\" rows=\"4\"></textarea><br><br>";
}
echo "<b>"._PAGETEXT.":</b><br>"
."<input type=\"checkbox\" name=\"atext\" value=\"1\" checked>"._SHOWTEXT."<br>"
."<font class=\"tiny\">"._PAGEBREAK."</font><br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('text'); $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "500"; $oFCKeditor->ToolbarSet = "Default"; $oFCKeditor->Value = "$mypages[text]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->CreateFCKeditor('text', '750', 500, 'text', '');
} else echo "<textarea name=\"text\" cols=\"100\" rows=\"30\"></textarea><br><br>";
if ($avan == 1) {
echo "<b>"._FOOTERTEXT.":</b><br><input type=\"checkbox\" name=\"apage_footer\" value=\"1\">"._SHOWTEXT."<br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('page_footer'); $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "100"; $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = "$mypages[page_footer]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->ToolbarSet = "Basic";
$oFCKeditor->CreateFCKeditor('page_footer', '750', 100, 'page_footer', '');
} else echo "<textarea name=\"page_footer\" cols=\"100\" rows=\"4\"></textarea><br><br>";
echo "<b>"._SIGNATURE.":</b><br><input type=\"checkbox\" name=\"asignature\" value=\"1\">"._SHOWTEXT."<br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('signature'); $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "100"; $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = "$mypages[signature]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->ToolbarSet = "Basic";
$oFCKeditor->CreateFCKeditor('signature', '750', 100, 'signature', '');
} else echo "<textarea name=\"signature\" cols=\"100\" rows=\"4\"></textarea><br><br>";
// if ($multilingual == 1) {
echo "<br><b>"._LANGUAGE.": </b><br>"
."<select name=\"clanguage\">"
."<option value=\"\">"._CNBC_ALL."</option>";
$handle=opendir('language');
while ($file = readdir($handle)) {
if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
$langFound = $matches[1];
$languageslist .= "$langFound ";
}
}
closedir($handle);
$languageslist = explode(" ", $languageslist);
sort($languageslist);
for ($i=0; $i < sizeof($languageslist); $i++) {
if($languageslist[$i]!="") {
echo "<option value=\"$languageslist[$i]\" ";
if($languageslist[$i]==$language) echo "selected";
echo ">".ucfirst($languageslist[$i])."</option>\n";
}
}
echo "</select><br><br>";
// } else {
// echo "<input type=\"hidden\" name=\"clanguage\" value=\"$language\">";
// }
if ($config['allowtheme'] == 1) {
echo "<br><b>"._CNBC_DESIGN."</b><br>"
."<select name=\"theme\">";
echo "<option value='' selected>"._CNBC_DEFAULTTHEME."</option>\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file)) ) {
$themelist .= "$file ";
}
}
closedir($handle);
$themelist = explode(" ", $themelist);
sort($themelist);
for ($i=0; $i < sizeof($themelist); $i++) {
if($themelist[$i]!="") {
echo "<option value='$themelist[$i]'>$themelist[$i]</option>\n";
}
}
echo "</select><br><br>";
}
}
if ($avan == '1') echo "<br><br><a href=\"modules.php?name=$module_name&file=admin&op=page&mid=$mid&cid=$cid&fckedit=$fckedit\">"._CNBC_BASIC."</a> ... \n <br>"._CNBC_BASICTEXT."<br><br>";
else echo "<br><br><a href=\"modules.php?name=$module_name&file=admin&op=page&mid=$mid&cid=$cid&fckedit=$fckedit&avan=1\">"._CNBC_ADVANCED."</a> ... \n <br>"._CNBC_ADVANCEDTEXT."<br><br>";
echo "<input type=\"submit\" value=\""._SEND."\">"
."</form>";
CloseTable();
include("footer.php");
}
?>
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Sun Jan 22, 2006 5:27 pm
Once you instantiate the editor, you shoud only need to do something like:
Code: include_once(INCLUDE_PATH."includes/FCKeditor/fckeditor.php");
$oFCKeditor = new FCKeditor(page_header) ;
$oFCKeditor->ToolbarSet = "Default" ;
$oFCKeditor->Height = "750";
$oFCKeditor->InstanceName = "page_header" ;
$oFCKeditor->Value = "$page_header" ;
$oFCKeditor->Create() ;
instead of:
Code: $oFCKeditor->CreateFCKeditor('page_header', '750', 100, 'page_header', '');
I'm not sure what version of FCKeditor came with your CNB Contenudo, or what version you are using....
andrej Hangin' Around Joined: Sep 10, 2005 Posts: 48
Posted:
Mon Jan 23, 2006 11:46 am
Hm...
OK, now i have managed to integrate it inside Conteudo ( i believe ), but the thing is fckeditor gives me blank screen for an unknown reason..
See it here ..
It's fckeditor 2.2, btw !
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Mon Jan 23, 2006 8:53 pm
Strange...I haven't seen it give a blank screen, but I have only used inside Nuke modules, where I did see server errors when it wasn't configured properly. Perhaps that could be your issue?
andrej Hangin' Around Joined: Sep 10, 2005 Posts: 48
Posted:
Tue Jan 24, 2006 1:56 am
yes. I have found the probelm. For some reason not all fires of the fckedtior were not uploaded to the server and that's why i was getting blank screen..
Now everthing works !!!
Thanks for your help
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum