Forum Moderators: coopster
THere are millions to choose from has anyone got a good suggestion on a CMS program to use?
It doesn't have WYSIWYG, but it does use Textile - html shorthand - to make it easier to enter content.
Hope that helps,
Eron
[edited by: coopster at 4:28 pm (utc) on Feb. 12, 2005]
[edited by: ergophobe at 12:27 am (utc) on Feb. 14, 2005]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]
- HTMLArea can be set to treat hard returns as <p></p>. Though not flawless and though it needs some tweaking to work in Moz/FF, it does a pretty good job.
- it can be integrated with HTML Tidy to make a last ditch attempt to make valid code out of whatever HTML Area supplies. You could integrate spaw as well just by putting the Tidy extension on your server and sending whatever data you get from spaw to Tidy. In actual practice, now that I think of it, that's how I had to do it with HTMLArea as I couldn't get it's built-in Tidy functionality to work the way I wanted.
There are some other rich text areas out there that I've seen as well, but most don't seem quite ready for prime time. One other that's intriguing, though, is the bitflux editor, but that requires an xml-based site AFAIK
Ergophobe you are correct about "hard returns"
but I found Spaw quite easy to understand
and one may use use many instances on the same page
I do not use it as a tool for my dev (I hard code it all)
but it allows my users to a treat in self editing
the last thing I have added is a simple meant to deal with img size
other advantages it has a MS words "Cleaner"!
and I have been successful at copying and pasting from MS XL
Henry
but I found Spaw quite easy to understand
and one may use use many instances on the same page
Same with HTMLArea.
I do not use it as a tool for my dev (I hard code it all)
but it allows my users to a treat in self editing
Heh heh. I didn't figure anyone on the PHP Forum would be coding with a WYSIWYG editor. Still, if I go to the trouble of getting my generated code to validate, I like the fact that I can back up the code generated via Spaw or HTMLArea or whatever via Tidy. I should note, that I'm sort of just testing this stuff myself, but I have two sites that are crying for it.
the last thing I have added is a simple meant to deal with img size
How so? In other words, what aspect of image size?
other advantages it has a MS words "Cleaner"!
I think this is true with HTMLArea as well. I have chosen in my tests to use Tidy instead because I can fully customize what it does. Actually, I've been away from it for a while. I think you can customize more or less depending on which version of PHP because the Tidy module are different. I've got to get back to this!
"This would be a church site that allows non-technical people to add events and sermon content online."
for news,just use the default news module included in the core files.
for static content, like about us page etc, download and install the module "editto"...it uses the above mentioned spaw editor...
for uploading, download and install the module wfdownloads.
If you don't want to use any other part of this portal, just upload your html site into the same directory as the php xoops files...your site will load up first, but you can call on certain php files from the system when needed, in the background.
Spaw offers two img icons:
One is for uploading the other for img properties
If you click on the Spaw image property icon the img properties lets an user entering H and W
But it is useless for if you do not have an img prg or do not know how do deal with it you will only generate a distorted img.
So I added a little JS opening in a new small window
that does:
$new_height = ($_POST['new_width']/$_POST['existing_width']) * $_POST['existing_height'];
print "<TABLE bgcolor=\"#ffffcc\" border=\"3\"><TR> <TD><h3>New Height: ";
echo $new_height;
Pretty crude but it does the job since in that case there are only two img per page and W max is 150 pix.
it will be very easy with spaw to integrate a full blown syst to include thumbnailing etc...
I will do it soon
Hmmmm, I said it a while ago!
How integrating SPAW in your CMS
TOP OF YOUR "EDIT" SCRIPT
YOU NEED ADDING A SUBMIT SCRIP (NOT INCLUDED)
<?php
session_start();
//error_reporting (E_ALL);
include "include_fns.php";
$conn = db_connect();
$s = get_new_content_record($new_content);
?>
<?
if (!ereg('/$', $_SERVER['DOCUMENT_ROOT']))
$_root = $_SERVER['DOCUMENT_ROOT'].'/';
else
$_root = $_SERVER['DOCUMENT_ROOT'];
// define: a named constant that cannot be changed,
define('DR', $_root);
// unset: destroy specified var but also may keep its form and replace the var by another one
unset($_root);
// set $spaw_root variable to the physical path were control resides
// don't forget to modify other settings in config/spaw_control.config.php
// namely $spaw_dir and $spaw_base_url most likely require your modification
$spaw_root = DR.'spaw/';
// include the control file
include $spaw_root.'spaw_control.class.php';
// here we add some styles to styles dropdown
$spaw_dropdown_data['style']['default'] = 'No styles';
$spaw_dropdown_data['style']['style1'] = 'Style no. 1';
$spaw_dropdown_data['style']['style2'] = 'Style no. 2';
?>
<form name="spawdemo" method="post" ENCTYPE="multipart/form-data " action="submit_#*$!x.php">
<INPUT TYPE=HIDDEN NAME="new_content" VALUE="<?php print $new_content;?>">
<INPUT TYPE=HIDDEN NAME="destination" VALUE="<?php print $_SERVER['HTTP_REFERER'];?>">
<TABLE bgcolor=cccccc border=4>
<?
//#### Example: using it with a DB
<tr>
<td>PRODUCTS SPECIAL MONTH</td></td>
<td>
<tr>
<td>
<?
$my_content= new SPAW_Wysiwyg('my_content',isset($_POST['my_cpntent'])?stripslashes($_POST['my_content']): " $s[my_content]");
$my_content->show();
?>
</td>
</tr>
WHAT IS: include_fns: a bunch of ()
include_once("db_fns.php");
include_once("user_auth_fns.php");
include_once("select_fns.php");
######## db_fns:
function db_connect()
{
$result = @mysql_pconnect("XXXX", "XXXXX", "XXXXX");
if (!$result)
return false;
if (!@mysql_select_db("XXXXX"))
return false;
return $result;
}
function get_writer_record($username)
{
$conn = db_connect();
$sql = "select * from XXXXXX where username = '$username'";
$result = mysql_query($sql, $conn);
return(mysql_fetch_array($result));
}
$id=$_POST['id'];
$new_content=$id;
function get_new_content_record($new_content)
{
$conn = db_connect();
$sql = "select * from XXXXX where id = '$new_content'";
$result = mysql_query($sql, $conn);
return(mysql_fetch_array($result));
}
?>
#### user_auth = auth ()
<?
function login($username, $password)
// check username and password with db
// if yes, return true
// else return false
{
// connect to db
$conn = db_connect();
if (!$conn)
return 0;
$result = mysql_query("select * XXXXXXX
where username='$username'
and password = password('$password')");
if (!$result)
return 0;
if (mysql_num_rows($result)>0)
return 1;
else
return 0;
}
function check_auth_user()
// see if somebody is logged in and notify them if not
{
global $auth_user;
if (isset($_SESSION["username"]))
// if ( (session_is_registered("auth_user")) && (isset($auth_user)) )
return true;
else
return false;
}
?>
##### select_fns()
only needed for "select" choice
you will use your own.
regards
Henry