Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

WYSIWYG SPAW EDITOR Support Thread


osjunkie

Recommended Posts

WYSIWYG SPAW EDITOR

 

WYSIWYG SPAW EDITOR

Covers all Admin text fields

Edit_orders , newsletter_manager,Send_email,Banner_Manager

The editor have different layouts and 2 designs(classic and default).

A screenshot is added.

Have fun with it!!!

 

http://www.oscommerce.com/community/contributions,2963

 

I didn't release this, but I notice no one has posted it.

 

Enjoy.

Link to comment
Share on other sites

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

Someone figure out how to adjust the settings for editor dimensions?

 

Mine is too small.

 

Also need to know how to adjust the regular box that appears when the editor is off or in a Mozzilla browser. Mine is postage stamp size and unusable.

Link to comment
Share on other sites

SPAW Documentation

 

For full details refer to /spaw/docs/documentation.html provided within the the SPAW portion of the AWF distribution.

 

Essentially SPAW is controlled via these parameters. In AWF these are set by the file inc/wysiwyg.inc:

 

SPAW_Wysiwyg( $control_name='spaweditor', // control's name $value='', // initial value $lang='', // language $mode = '', // toolbar mode $theme='', // theme (skin) $width='100%', // width $height='300px', // height $css_stylesheet='', // css stylesheet file for content $dropdown_data='' // data for dropdowns (style, font, etc.) )

Parameters:

 

$control_name - the name of the control. This will be used for the id of the field holding the contents of the control and you will use it to obtain the contents when submitted to the server (i.e. $HTTP_POST_VARS['spaweditor']). The default value is "spaw_editor". Don't forget to set this parameter to different values if using more than one instance of the control on one page.

 

$value - initial content of the control. This is what you want to be in the editable area when control loads. Use something like stripslashes($HTTP_POST_VARS['spaweditor']) if you want control to display what was typed prior to submitting.

 

$lang - this denotes the language to be used in the control's interface. The default is the value of $spaw_default_lang variable set in config file which by default is equal to "en" (English). If you specify a value other than set in $spaw_default_lang variable, the control loads language data for default language as a "backup". This is done so in case the translation is a little outdated control is still usable (i.e. you will get messages in default language (most likely English) instead of missing translations from your selected language files. Available languages can be determined by taking a look at lib/lang/ subdirectory. Names of the subdirectories in there are the valid values for the $lang parameter.

 

$mode - toolbar mode (layout). Toolbar mode specifies the toolbar layout to be used for the instance. It defaults to the value of $spaw_default_toolbars config variable. You can also think of it as a way to limit (or extend) the features available to the user (this is why it was called mode). Valid values are the names of subdirectories in lib/toolbars/ directory.

 

$theme - the skin (look) of the control. This affects the images and rollover effects used for toolbar buttons and controls css styles. The default is the value of $spaw_default_theme config variable. Valid values are the names of subdirectories in lib/themes/ directory.

 

$width - control's width. The default is 100%.

 

$height - control's height. The default is 300 pixels.

 

$css_stylesheet - CSS stylesheet file to be used for control's content. The default is the value of $spaw_default_css_stylesheet config variable.

 

$dropdown_data - the array holding values to be used in a dropdown type toolbar controls like style, font, fontsize and paragraph. The structure is $dropdown_data['control_name']['value'] = 'Text'. The default data is taken from $spaw_default_dropdown_data config variable. You may use it as a starting point when customizing the dropdown data. You will most likely want to customize the data for the "style" dropdown cause it's the most instance specific of all dropdowns. Don't forget to provide the style with value "default". This one is used to remove the class attribute.

Examples for html_output.php to adjust size and features.

 

Replace snippet that begins $sw = new SPAW_Wysiwyg with one of the following examples with settings that match your requirements.

 

Example 1

This is the simpliest usage of the control with all the default parameters

 

$sw = new SPAW_Wysiwyg('spaw1',stripslashes($HTTP_POST_VARS['spaw1']));$sw->show();

Example #2

Now let's try something else... let's specify width and height of the control, Lithuanian language and different toolbar mode (sidetable in this example).

 

$sw = new SPAW_Wysiwyg('spaw2' /*name*/,stripslashes($HTTP_POST_VARS['spaw2']) /*value*/, 'lt' /*language*/, 'sidetable' /*toolbar mode*/, 'default' /*theme*/, '550px' /*width*/, '350px' /*height*/);$sw->show();

 

Example #3

In this example we pass an url (demo_red.css) of the stylesheet file to the consturctor/p>

 

$sw = new SPAW_Wysiwyg('spaw5' /*name*/,stripslashes($HTTP_POST_VARS['spaw5']) /*value*/, 'en' /*language*/, 'mini' /*toolbar mode*/, '' /*theme*/, '250px' /*width*/, '90px' /*height*/, 'demo_red.css' /*stylesheet file*/);$sw->show();

 

Example #4

There is a way to customize the content of the dropdowns like styles, fonts, etc. You can customize it for all instances of the control by modifying $spaw_dropdown_data array in config file or in the script. Or you can specify specific data for dropdowns for each of the separate instances. This example shows how...

 

// make a copy of $spaw_dropdown_data array$demo_array = $spaw_dropdown_data;// unset current stylesunset($demo_array['style']);// set new styles$demo_array['style']['default'] = 'Default';$demo_array['style']['crazystyle1'] = 'Crazy style no. 1';$demo_array['style']['crazystyle2'] = 'Crazy style no. 2';$demo_array['style']['crazystyle3'] = 'Crazy style no. 3';// pass $demo_array to the constructor$sw = new SPAW_Wysiwyg('spaw6' /*name*/,stripslashes($HTTP_POST_VARS['spaw6']) /*value*/, 'en' /*language*/, 'default' /*toolbar mode*/, '' /*theme*/, '550px' /*width*/, '90px' /*height*/, '' /*stylesheet file*/, $demo_array /*dropdown data*/);$sw->show();

Link to comment
Share on other sites

Working code for size adjustement

 

 

Open html_output.php

 

Replace

------------

$sw = new SPAW_Wysiwyg(tep_output_string($name), stripslashes($text), '', '', '', '', '');

$sw->show();

 

 

With

-----------

$sw = new SPAW_Wysiwyg(tep_output_string($name), stripslashes($text), '', 'sidetable', '', '500px', '600px');

$sw->show();

 

-------------------

 

Options: sidetable, mini, default, full, intlink

Size: width & length of what you specify.

Link to comment
Share on other sites

Looks great! Just a little problem on my end. I have osc installed in the root and not /catalog/... It shows up fine on the product description page. And it lets me add images etc... but, when I save, it is not inserted in the db. Therefore, it's not showing up on the catalog - product page. Where could the problem be located?

 

Thanks.

Link to comment
Share on other sites

Sorry, regarding my last posting. Had some nasty javascript running from htmlarea :blush:

 

Looks great! Just a little problem on my end. I have osc installed in the root and not /catalog/... It shows up fine on the product description page. And it lets me add images etc... but, when I save, it is not inserted in the db. Therefore, it's not showing up on the catalog - product page. Where could the problem be located?

 

Thanks.

Link to comment
Share on other sites

Sorry, regarding my last posting. Had some nasty javascript running from htmlarea :blush:

 

 

Make sure in your admin/includes/html_output.php under the( //output to a form radio field function) you have pasted this as per install instructions. Below is modified to all adjustment of box size that corrected the problem you are having for myself.

 

////

// Output a form textarea field

function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

 

$sw = new SPAW_Wysiwyg(tep_output_string($name), stripslashes($text), '', 'full', '', '600px', '500px');

$sw->show();

return $field;

}

 

This should fix your situation with data not being sent to the database.

 

IF you need to play around with settings, look in the catalog/includes/edit-wysiwyg.php.

 

 

Cheers

Link to comment
Share on other sites

I have been looking but cant find...

 

....what file could I edit to include the features to another area in admin.  I have an events manager installed and would like it to show up there as well...

 

Thanks!

 

 

Sorry bout that. It does show up. I had to refresh screen.....Using IE :(

Link to comment
Share on other sites

I am trying to get SPAW running.

 

I think my problem is with SPAW right now...

 

I put spaw in a alias directory on the server so it resides at:

http://www.domain.com:8082/spaw

 

When I go to:

http://www.domain.com:8082/spaw/scripts/demo.php

I get the following

Hi... this script shows various ways of using Solmetra SPAW web based WYSIWYG editor control.

Below you will see various modes of the control and parameters that caused it to look like this.

Note: in case you can't see the editors or get errors, it is most likely that you haven't configured the control properly. Check the documentation details.

Pay attention that you can use multiple instances of the control on the same page and with completely different settings... pretty cool;)

For more info on how to use the control check out the documentation or analyze this script (demo.php) and control's source. You can also try asking in SourceForge.net forums

 

So it is apparent that spaw is not working.

 

Here are the relevent server settings for spaw_control.config.php

// directory where spaw files are located
$spaw_dir = '/spaw/';

// base url for images
$spaw_base_url = 'http://www.domain.com:8082/';

 

 

Anyone have any ideas what I might be doing wrong?

Link to comment
Share on other sites

Well, I partially got SPAW working. It turns out that it seems it can not run from an alias folder for some reason. I moved it to the default /www/html/spaw and it worked great for the demo, but then it wouldn't work for my staging osc site. I assume this is because the staging osc site is in another alias. I suspect if I move spaw to the root of my staging site and then put a hard path to spaw in the config file, /staging/osCommerce/spaw, it would work, but then when I move it to production, I have to change the config file.

 

This is a pain in the ass. I don't kow if it is SPAW or the contrib that is difficult.

 

I have not entirely given up on SPAW, but I am going to test out HTMLArea v3 to see how that is...

Link to comment
Share on other sites

Category descriptions are not showing up on the site using SPAW editor. All the other functions except this one. I am not sure which file to edit to get this working and any help would be appreciated.

 

 

TIA\\ By the way, this contribution is VERY helpful...

Learning is not attained by chance, it must be sought for with ardor and attended to with diligence.

Link to comment
Share on other sites

  • 1 month later...

I've got a little problem happening on my manufacturers page.

 

I've installed this contribution to add more information about our manufacturers.

 

The contribution adds a text area to the normal information that comes up in the right hand information panel - along with the default name and image and url of manufacturers.

 

However, there seems to be a problem with the textarea now that I have installed SPAW. It's working just great on every other page except this!

 

I have an error occuring - I think it's javascript or similar.

 

Line: 36

Char: 5

Error: Object Required

Code: 0

 

In Firefox the text area just is not there, and in IE the SPAW editor is below the list of manufacturers - I assume this is because the text area in the side is only 30 x 10 while the SPAW editor is huge in comparison.

 

Could that be causing the error? Not having enough space for SPAW?

 

If that's the case, how could I make the text area be just a plain textbox, rather than a textarea with SPAW attached?

 

If you'd like me to send or post my .php file just let me know.

 

Any help would be wonderful!

 

Jane.

Link to comment
Share on other sites

  • 2 weeks later...

Have succesfully set-up SPAW and operates well for product and category descriptions and any other part assocted with updating the oscommerce site.

 

I am having problems with sending emails and newsletter as the emails are arriving but without HTML tags. I have configured Email options for HTML but the receiver format is not complete.

 

Outlook receives an email like:

 

<p>test email</p>

<p>test again</p>

 

that is all no html tags or the like. Any suggestion whether this is the server or SPAW integration with OsCommerce.

 

Cheers

 

Mal

Link to comment
Share on other sites

I was hoping that the last version was more complete and more stable than the contribution ,2963

 

Therefore I downloaded the latest version:

https://sourceforge.net/project/showfiles.p...lease_id=323081

 

(SPAW Editor PHP Edition Version 1.1 RC1)

 

But that one is a little different from contribution: ,2963

 

Also the instruction in this thread:

 

osjunkie Posted Feb 28 2005, 12:15 AM

 

is not working :(

 

I get an error because of this line:

$sw = new SPAW_Wysiwyg('spaw1',stripslashes($HTTP_POST_VARS['spaw1']));

"If you're working on something new, then you are necessarily an amateur."

Link to comment
Share on other sites

I was hoping that the last version was more complete and more stable than the contribution ,2963

 

Therefore I downloaded the latest version:

https://sourceforge.net/project/showfiles.p...lease_id=323081

 

(SPAW Editor PHP Edition Version 1.1 RC1)

 

But that one is a little different from contribution: ,2963

 

Also the instruction in this thread:

 

osjunkie  Posted Feb 28 2005, 12:15 AM

 

is not working :(

 

I get an error because of this line:

$sw = new SPAW_Wysiwyg('spaw1',stripslashes($HTTP_POST_VARS['spaw1']));

 

 

If you follow the documentation and install instructions it will work.

 

I had to put my SPAW directory outside of my catalog directory. The one on source forge won't work because it needs to be setup for Oscommerce.

 

Use the one on the contribution web site. There is a example file for integration. to to /spaw/scripts/demo.php and it shows you the different methods.

 

If you want to assign different editors to different text fields, you will have ot add extra functions to the html_output.php file.

 

Example: Shipping doesn't need the "FULL EDITOR" and would due with the MINI better.

 

So add in your html_output.php file the following

 

////
// Output a form textarea field
function tep_draw_textarea_field_mini($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$sw = new SPAW_Wysiwyg(tep_output_string($name), stripslashes($text), '', 'full', '', '400px', '200px');
$sw->show();
return $field;
}

 

Then in your orders.php file find tep_draw_textarea_field and change it to tep_draw_textarea_field_mini.

 

PRESTO...rocket science.

 

If you read more closely you will also learn how to take advantage of the OSC Style sheet and have all the styles in the drop down. I haven't done it yet but saw it there.

 

CHEERS from the JUNK!

Link to comment
Share on other sites

Thanks osjunkiie for your reply but I can't get it to show anything, either I see no trace of spaw at all or errors all over the place.

 

Probably I (*nix and PHP challenged) need more detailed osCommerce related examples and instructions.

 

Something like if your shop is as follows: http://yourshop.tld/catalog/

add the spaw directory here like so

and this file there like so

then do this to this file and do that to that file.

 

Very disappointed :(

 

Going to try HTMLarea the setup does not look so good but maybe it's sufficient.

"If you're working on something new, then you are necessarily an amateur."

Link to comment
Share on other sites

In HTMLArea i can not find how to show pure sourcecode, so that one goes also, because it retains code that becomes invisible like <p> </p>

which causes exessive whitespace.

 

Another one down the drain.

 

Leaves only Wysiwyg 1.7 to try.

"If you're working on something new, then you are necessarily an amateur."

Link to comment
Share on other sites

  • 2 weeks later...

CSS Hookup

 

Ok people, time for down and dirty with CSS and SPAW...took me 5 minutes and I figured it out. This is very useful and expands the functionality of using your CSS styles with the editor.

 

Step 1

admin/includes/functions/html_output.php

 

Find your declarations for your editors as mentioned in above posts. Add on a link to your css file. Here is an example.

 

////
// Output a form textarea field full editor
 function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
    if (tep_not_null($parameters)) $field .= ' ' . $parameters;

       $sw = new SPAW_Wysiwyg(tep_output_string($name), stripslashes($text), '', 'full', '', '600px', '500px','/home/ojunks/www/catalog/stylesheet.css');
       $sw->show();
   return $field;
 }

 

Step 2

Open catalog/includes/edit_wysiwyg.php

 

Add styles for the drop down. Here are mine, but yours may be different. Just go through your CSS for your site and add the appropriate ones.

// here we add some styles to styles dropdown
$spaw_dropdown_data['style']['default'] = 'No styles';
$spaw_dropdown_data['style']['main'] = 'Main Text';
$spaw_dropdown_data['style']['headdate'] = 'Tiny Date';
$spaw_dropdown_data['style']['boxText'] = 'Box Text';
$spaw_dropdown_data['style']['TEXTAREA'] = 'Text Area';
$spaw_dropdown_data['style']['msrp'] = 'MSRP Text';
$spaw_dropdown_data['style']['savings'] = 'Savings Text';
$spaw_dropdown_data['style']['price'] = 'Price Text';
$copy ="Wysiwyg Editor V1.04 modified SPAW for PHPNuke";
?>

 

Now you can set these styles to text you use in SPAW. You can even add extra CSS styles if you want for formatting emails, newletters..etc.

 

If you want to PayPal me something for this, PM me....

 

Thanks,

 

 

Brad

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys,

 

Had been using the old non Geko compatible SPAW for a while... so now trying 2 upgrade for Firefox ;)

 

Followed the install as carefully as possible but get this error whenever I try and visit /admin/

 

 

Fatal error: Cannot redeclare class spaw_util in /var/www/html/spaw/class/util.class.php on line 16

 

Line 16 is

 

16 {

17 // checks browser compatibility with the control

18 function checkBrowser()

19 {

 

Anyone got any ideas?!

 

Rich

Link to comment
Share on other sites

  • 2 weeks later...

I paste an HTML template (in HTML view) and switch to design view. When I go back to HTML view SPAW seperates all the code into new lines, when I sent this newsletter out it puts a <br> at end of everyline thus disrtorting the template.

 

Anyone know how to fix this?

 

Jacob

Link to comment
Share on other sites

  • 4 weeks later...

I installed Spaw, on Internet explorer (maxthon ...), it work fine but whan i use Firefox, I see the editor but it's impossible to write inside.

 

Do yu have a solution ?

 

normally spaw is compatible with Firefox when i see the site. on Mambo CMS, Spaw work fine with internet explorer and forefox.

 

Do you have a solution ?

Doy ou know if spaw work on maciinthosh ?

ps : local installation

Edited by Gyakutsuki


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...