CodeIgniter & Spaw Editor

I have released an updated version at http://sheldon.lendrum.co.nz/codeigniter-spaw-editor-tabs_411/10/. This new version allows CodeIgniter and SPAW TABS !

Recently I have been working on a large project for a National Sporting team, It has been a process and it is almost finished.
As part of this system, we have developed an extended custom content management system.

Finding a WYSIWYG Editor for these types of sites is a tricky thing. Your editor of choice needs to be complex enough to let the user Manage their site, but not too hard that they can’t and don’t manage it, yet not give them so many options that your beautiful design gets listed on some of the ‘worst’ design sites due to ‘Crazy Customisation’, bright, huge highlighted words, 5mb images on every page and so on… like a ‘Client goes Crazy’ Video.

WordPress uses TinyMCE editor from MoxieCode, which is what we first implemented, but the design agency requested that they can add inline images in to the content. ( Bad thoughts crept in to my mind of a horror site coming out ) but I decided this would be a nesscarry change.

I went back to an old faithful that Ryan & I have used for years on other CMS’s.
The issue with this is it uses it’s own class, and interferes with CodeIgniter, the PHP FRamework that we are developing this site in.

After some googling, I found a solution on the CodeIgniter Wiki. After installing it, I first found I needed some small customizations, and that it wasn’t a new version, and didn’t have Safari support, which both us developers, and the advertising agency use. So I went to work on repackaging SPAW 2.0.8.1 for CodeIgniter with a few extra plugins.

Download it for free and let me know how it works :)
check the new version with TABS
Spaw 2.0.8.1 for CodeIgniter (557)

This entry was posted in Code, design, Technology, work and tagged , , , , , , , , , , , , . Bookmark the permalink.

17 Responses to CodeIgniter & Spaw Editor

  1. Pingback: Sheldon Lendrum » Blog Archive » CSS Fix for SPAW Editor & Safari

  2. Mark says:

    Hi. Thanks for the spaw CI plugin. Just a few questions .. I presume that I put all of the files contained in the .zip into into my library directory? Can you give an example usage of the $config array?

    Thanks. I’m a newbie to CI.

    Mark.

  3. Debty says:

    Ahaan… I will follow.

  4. Pingback: Sheldon Lendrum» CodeIgniter & SPAW Editor Tabs

  5. Kodai says:

    how to use .htaccess for spaw where my dir structure like this
    -codeigniter
    -sample.app
    —-libraries
    ————-spaw2
    -www
    —-index.php
    and my app folder: sample.app

    Thanks

  6. Sheldon says:

    Hi Kodai,

    Is SPAW outside of your web directory ? if this is the case, then SPAW will not work.
    It has to be accessible by the browser.

  7. Kodai says:

    Is there any posibilities ? move the spaw2 folder to www dir ?

  8. Sheldon says:

    Hi,

    SPAW has to be in a directory accessible by the Web.
    So I think you will have to move the application dir in to the ‘www’ dir.

    If this is a security issue, you can use both .htaccess and PHP to make it secure.

    My .htaccess files are like this.

    # enable apache's modrewrite
    Options +FollowSymLinks
    RewriteEngine on
     
    #force www. on to address
    #RewriteCond %{HTTP_HOST} !^www\.
    #RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    
    # paths to exclude from the rule - images/styles/index.php itself
    RewriteCond $1 !^(index\.php|css|images|)
     
    # make everything else point to my CI index.php
    RewriteRule ^(.*)$ /index.php/$1

    and in every PHP file, I add thise right at the top

    < ?php
     
    	if(!defined('BASEPATH')) exit('No direct script access allowed');
     
    	class Site extends Controller {
     
    		function Site() {
    			parent::Controller();
    		}
     
    		function index() { // rest of file ......

    Try that and let me know.

  9. yohan says:

    Hi there,
    I’m trying to use SPAW+CI and put everything as you have said (or typed) but it’s not working.

    it always saying
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    but the spaw frame is loading (no images). how can i make it happen? thanks

  10. Hi Yohan,

    What server OS are you running, IIS or Apache ?
    Can you give me an example of your set up ?
    Are you using .htaccess files ?

    Are you able to post these answers in the forum.

  11. yohan says:

    Hi Sheldon,

    I’m running apache server (using wamp)

    This is my setup

    function Welcome() {
    parent::Controller();
    $this->load->model("school_model");
    $this->data["dataSideBar"]["stateList"] = $this->school_model->getStateList();
    $this->data["dataSideBar"]["townList"] = $this->school_model->getTownList();

    $config = array('name' => 'SpawTest',
    'content' => 'This should be in textarea.',
    'caption' => 'test');
    $this->load->library('spaw', $config);
    }

    I’m not using .htaccess file. I copied spaw.php & .htaccess file outside spaw2 folder, is it correct?

    thanks for replying

    PS : where should I put this in the forum?

  12. yohan says:

    Hi Sheldon,

    Thanks for your reply,
    I thought I have posted a reply, but it seems it’s not posted.

    I’m using Apache server bundled with wamp5

    My setup will be
    1. copy all spaw.zip content to library folder and put spaw.php outside spaw2 folder
    2.
    $config = array('name' => 'SpawTest',
    'content' => 'This should be in textarea.',
    'caption' => 'test');
    $this->load->library('spaw', $config);

    above code is in my controller

    spaw->show();?>
    above code is in my view

    3. I’m using any .htaccess file *currently*

    Can you find out what has gone wrong?

    thanks in advance,

    Yohan

  13. Yohan says:

    Hi Sheldon,
    Using PHP 5.2.x this SPAW editor works well, but after I upgrade my PHP to 5.3.x version, it just won’t run.
    because of some deprecated functions such as ereg & eregi function.
    Is there any available SPAW plugins for CI that works with PHP 5.3.x

    thanks in advance

    Yohan W.

  14. cihip says:

    CodeIgniter & Spaw Editor post for thanx.

  15. Mike says:

    Hi Sheldon

    i am running xampp in my windows 7 with PHP Version 5.3.1
    with a path of localhost/site_name
    and i get the following…

    Access forbidden!

    You don’t have permission to access the requested object. It is either read-protected or not readable by the server.

    If you think this is a server error, please contact the webmaster.
    Error 403

    Any ideas?
    Thanks

  16. Mike says:

    Oh and using CI2

    thanks in advance.

  17. Hi Mike,

    Try checking hte permissions on your spaw dir, else move it to the root dir of your site, and alter the include() path’s in the spaw CI library.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">