How to install SPAW editor

Frequently Asked Questions (read only)

How to install SPAW editor

Postby ksen » Wed Jul 19, 2006 5:04 pm

Oks here goes….!!!



1. Download the latest stable version of SPAW Editor – PHP version from

http://www.solmetra.com/en/disp.php/en_products/en_spaw/en_spaw_download



2. Unzip the file into a folder. I actually unzipped the content into /cutenews/plugins/spaw folder.



3. Follow the instructions in the /docs/documentation.html file and install and configure the editor.

Note – Don’t forget to rename the file spaw_control.default.config.php in config sub-directory to spaw_control.config.php when installing control for the first time. (this instruction is clearly given in the documentation, jus thot I will emphasize cos I missed it the first time :D ).

For anyone who wants to see what my config file looks like, I have included it in the zip file.

Also make sure to specify the image folders properly following the help file.



4. Ok now the installation and config of the spaw editor is done. If u have done it properly the demo page spaw/scripts/demo.php should work fine. Check it out.



5. Ok now comes the part where we integrate the spaw editor with cute news. Only two files need to be modified. The addnews.mdu and the editnews.mdu



6. Open up both files and add the following snippet to the top of both pages.



Code: Select all
<?php

// ================================================

// SPAW PHP WYSIWYG editor control

// ================================================

// Control usage demonstration file

// ================================================

// Developed: Alan Mendelevich, alan@solmetra.lt

// Copyright: Solmetra (c)2003 All rights reserved.

// ------------------------------------------------

//                                www.solmetra.com

// ================================================

// $Revision: 1.6 $, $Date: 2004/12/30 09:38:27 $

// ================================================



// this part determines the physical root of your website

// it's up to you how to do this

if (!ereg('/$', $HTTP_SERVER_VARS['DOCUMENT_ROOT']))

  $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'].'/';

else

  $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];



define('DR', $_root);

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.'news/plugins/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';



?>




7. Now in the addnews.mdu file find the following.



Code: Select all
<!-- êîðîòêàÿ -->

<fieldset id="short"><legend><?=$echo['short']; ?></legend>



<?=insertTag('short'); ?>

<?=insertSmilies('short', 23); ?>



<textarea name="short_story" tabindex="4"></textarea>   

</fieldset>



<!-- ïîëíàÿ -->

<fieldset id="full"><legend><?=$echo['full']; ?></legend>



<?

   echo run_filters('new-advanced-options', 'full');

?>



<?=insertTag('full'); ?>

<?=insertSmilies('full', 23); ?>



<textarea name="full_story" tabindex="5"></textarea>

</fieldset>






8. And Change it to the following.



Code: Select all
<!-- êîðîòêàÿ -->

<fieldset id="short"><legend><?=$echo['short']; ?></legend>



<!-- <?=insertTag('short'); ?> -->

<!-- <?=insertSmilies('short', 23); ?> -->





<?php

$sw = new SPAW_Wysiwyg('short_story' /*name*/,stripslashes($HTTP_POST_VARS['short_story']) /*value*/,

                       'en' /*language*/, 'default' /*toolbar mode*/, '' /*theme*/,

                       '500px' /*width*/, '250px' /*height*/, '' /*stylesheet file*/,

                       '' /*dropdown data*/);



$sw->show();

?>





<?php /*?><textarea name="short_story" tabindex="4"></textarea><?php */?>

</fieldset>



<!-- ïîëíàÿ -->

<fieldset id="full"><legend><?=$echo['full']; ?></legend>



<?

   echo run_filters('new-advanced-options', 'full');

?>



<!--<?=insertTag('full'); ?> -->

<!-- <?=insertSmilies('full', 23); ?> -->



<?php

$sw = new SPAW_Wysiwyg('full_story' /*name*/,stripslashes($HTTP_POST_VARS['full_story']) /*value*/,

                       'en' /*language*/, 'default' /*toolbar mode*/, '' /*theme*/,

                       '500px' /*width*/, '350px' /*height*/, '' /*stylesheet file*/,

                       '' /*dropdown data*/);

$sw->show();

?>





<?php /*?><textarea name="full_story" tabindex="5"></textarea><?php */?>

</fieldset>




9. Save the file

10. Switch to editnews.mdu and find the following code snippet.



Code: Select all
<!-- êîðîòêàÿ -->

<fieldset id="short"><legend><?=$echo['short']; ?></legend>



<?

   echo run_filters('edit-advanced-options', 'short');

?>



<?=insertTag('short'); ?>

<?=insertSmilies('short', 23); ?>





<textarea name="short_story" tabindex="4"><?=htmlspecialchars(replace_news('admin', $story['short'])); ?></textarea>



</fieldset>



<!-- ïîëíàÿ -->

<fieldset id="full"><legend><?=$echo['full']; ?></legend>



<?

   echo run_filters('edit-advanced-options', 'full');

?>



<?=insertTag('full'); ?>

<?=insertSmilies('full', 23); ?>



<textarea name="full_story" tabindex="5"><?=htmlspecialchars(replace_news('admin', $story['full'])); ?></textarea>

</fieldset>




11. And replace it with the following



Code: Select all
<!-- êîðîòêàÿ -->

<fieldset id="short"><legend><?=$echo['short']; ?></legend>



<?

   echo run_filters('edit-advanced-options', 'short');

?>



<!-- <?=insertTag('short'); ?> -->

<!-- <?=insertSmilies('short', 23); ?> -->





<?php

$temp_short = replace_news('admin', $story['short']);

$sw = new SPAW_Wysiwyg('short_story' /*name*/,isset($temp_short)?stripslashes($temp_short):'$temp_short' /*value*/,

                       'en' /*language*/, 'default' /*toolbar mode*/, '' /*theme*/,

                       '500px' /*width*/, '250px' /*height*/, '' /*stylesheet file*/,

                       '' /*dropdown data*/);



$sw->show();

?>



<?php /*?><textarea name="short_story" tabindex="4"><?=htmlspecialchars(replace_news('admin', $story['short'])); ?></textarea><?php */?>



</fieldset>



<!-- ïîëíàÿ -->

<fieldset id="full"><legend><?=$echo['full']; ?></legend>



<?

   echo run_filters('edit-advanced-options', 'full');

?>



<!-- <?=insertTag('full'); ?> -->

<!-- <?=insertSmilies('full', 23); ?> -->



<?php

$temp_long = replace_news('admin', $story['full']);

$sw = new SPAW_Wysiwyg('full_story' /*name*/,isset($temp_long)?stripslashes($temp_long):'$temp_long' /*value*/,

                       'en' /*language*/, 'default' /*toolbar mode*/, '' /*theme*/,

                       '200px' /*width*/, '250px' /*height*/, '' /*stylesheet file*/,

                       '' /*dropdown data*/);



$sw->show();

?>



<?php /*?><textarea name="full_story" tabindex="5"><?=htmlspecialchars(replace_news('admin', $story['full'])); ?></textarea><?php */?>

</fieldset>




12. Save both files and upload everything. I think this was all required if I’m not mistaken. If there’s any errors pls post I’d be glad to help. For reference for anybody I have attached the spaw config file, addnews and edit news files.
User avatar
ksen
 
Posts: 142
Joined: Sun Jun 04, 2006 7:11 am

Postby ksen » Wed Jul 19, 2006 5:23 pm

Here is the zip file.
You do not have the required permissions to view the files attached to this post.
User avatar
ksen
 
Posts: 142
Joined: Sun Jun 04, 2006 7:11 am


Return to FAQ



Who is online

Users browsing this forum: No registered users and 0 guests

cron