Aug 27

Wondering how to check the content of an FCKEditor? You will love this simple code!!!

<?php
include("fckeditor/fckeditor.php") ;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>FCKeditor - Sample</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="robots" content="noindex, nofollow">
		<script>

function getRTEText(fckinst){
  var oEditorHTML = FCKeditorAPI.GetInstance(fckinst).GetHTML();
  alert(oEditorHTML);
}
</script>
	</head>
	<body>

		<form action="request.php" method="post">

<?php
	$oFCKeditor = new FCKeditor('content');
	$oFCKeditor->BasePath = "fckeditor/";
	$oFCKeditor->Value = $content['message'];
	oFCKeditor->Config['UserFilesPath'];
	$oFCKeditor->Height = "440";
	$oFCKeditor->Create();
?>

			<br>
			<input type="button" onclick="javaScript:getRTEText('content');" value="check">
			<input type="submit" value="Submit">
		</form>
	</body>
</html>
Tagged with:
Aug 14

Have you tried using FCKEditor to allow your user to upload files? Its one of the best WYSIWYG(What You See Is What You Get), but how about considering FCKEditor to create their own gallery? User will have their own directory. Ahem!!!!

In your FCKeditor directory find the config.php for php connector:
fckeditor/editor/filemanager/browser/default/connectors/php/config.php
Add this code in the topmost of the file:

<?
php session_start();

then search for this code:

$Config['UserFilesPath'] = '';

and replace it with

$Config['UserFilesPath'] = '/userfiles/'.$_SESSION['member_id'].'/';

Note that $_SESSION['member_id'] can be changed to whatever youd like to be the identifier of your users. Be sure to authenticate your user and set their ID’s in the session variable.

**Some developers do have hard time configuring the filebrowser, they can upload but cannot browse what are in the server. To fix this issue, open the frmresourcelist.html
fckeditor/editor/filemanager/browser/default/frmresourcelist.html

Search for:

oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
{
	// Build the link to view the folder.
	var sLink = '<a href="#" onclick="OpenFolder(\'' + ProtectPath( folderPath ) + '\');return false;">' ;

and replace it to:

oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
{
	// Build the link to view the folder.
	var sLink = '<a href="#" onclick="OpenFile(\'http://YOURDOMAIN' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;
Tagged with:
preload preload preload
Bless CV