11
BlueStocking
Re: WYSIWYG SmartSection hack or alternative?

@JAVesey,
RE: post number 7 this thread (Today 13:40)

Answer: Main page listings...
Main_Page

Some of the SPECIAL PAGES are:
AnnualReports | Blogs | Users | ThemeTemplates | ModuleDevelopment | LinkSisterSites | Hosting | Documentation | XoopsNewsTeam | CommunityCoordination | ModuleRepository

You are listed because the last I knew when this wiki was setup you were a community coordinator. SEE: Source

If that is no longer the case then you should remove your name from the listing, (keeping the listing as a user is stricly optional)


BlueStocking
hhttps://xoops.org/modules/repository .. It is time to get involved - XOOPS.ORG

12
Anonymous
Re: WYSIWYG SmartSection hack or alternative?
  • 2008/2/9 8:22

  • Anonymous

  • Posts: 0

  • Since:


Quote:
BlueStocking wrote:

Some of the SPECIAL PAGES are:
AnnualReports | Blogs | Users | ThemeTemplates | ModuleDevelopment | LinkSisterSites | Hosting | Documentation | XoopsNewsTeam | CommunityCoordination | ModuleRepository

You are listed because the last I knew when this wiki was setup you were a community coordinator.


BS,

The Community Coordination Team was disbanded due to inactivity; kc0maz was (and still is so far as I know) absent, as was I.

So far as I know, there's no new CCT so best that the link is removed altogether.

However, I remain a Moderator so perhaps listing me as such would be okay?

13
BlueStocking
Re: WYSIWYG SmartSection hack or alternative?

RE: by JAVesey on 2008/2/9 2:22:14 --
EDIT: Response Deleted by me, BS as being off subject.

___________
BACK ON SUBJECT:

JAVesey,
D.J. pm'ed me the people who do the system maintance are off for Chinese New Year vacation and will be back in a week when we can then have the ability to host your SmartSection zip file.

BlueStocking
hhttps://xoops.org/modules/repository .. It is time to get involved - XOOPS.ORG

14
Anonymous
Re: WYSIWYG SmartSection hack or alternative?
  • 2008/2/10 21:03

  • Anonymous

  • Posts: 0

  • Since:


Quote:
BlueStocking wrote:

D.J. pm'ed me the people who do the system maintance are off for Chinese New Year vacation and will be back in a week when we can then have the ability to host your SmartSection zip file.


Many thanks.......

Note:
The .zip files are for

1. Koivi wysiwyg editor (no changes at all to SmartSection - I wouldn't presume...... )
2. xcgallery 2.0.3 (with minor "Upload more files" keywords addition)

Also,
I might make "my" Cool2BeBlackHue theme available too, once I can sort out the licencing protocol.

15
armitage
Re: WYSIWYG SmartSection hack or alternative?
  • 2008/2/18 20:22

  • armitage

  • Just popping in

  • Posts: 31

  • Since: 2005/8/19


Hope you have time to answer a quick question about SmartSection and TinyMCE... I've hacked SmartSection successfully to use the tinymce included in the latest xoopseditor classes, but only the first form area renders the editor. The second renders only as a textarea.

Any ideas? I am eternally grateful.

16
McDonald
Re: WYSIWYG SmartSection hack or alternative?
  • 2008/2/18 22:12

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


What did you hack?

17
armitage
Re: WYSIWYG SmartSection hack or alternative?
  • 2008/2/18 22:34

  • armitage

  • Just popping in

  • Posts: 31

  • Since: 2005/8/19


Per your suggestion (see previous post with code example) I modified smartsection/include/functions.php as follows, pointing the 'tiny' case at /class/xoopseditor/tinymce/:

function smartsection_getEditor($caption, $name, $value, $dhtml = true)
{
$smartConfig =& smartsection_getModuleConfig();

global $xoops22;
if (!isset($xoops22)) {
$xoops22 = smartsection_isXoops22();
}

$editor_configs=array();
$editor_configs["name"] = $name;
$editor_configs["value"] = $value;
$editor_configs['caption'] = $caption;
$editor_configs["rows"] = 35;
$editor_configs["cols"] = 60;
$editor_configs["width"] = "100%";
$editor_configs["height"] = "400px";

switch ($smartConfig['use_wysiwyg']) {
case 'tiny' :
if (!$xoops22) {

// hack for tinymce goes here...

if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/tinymce/formtinymce.php")) {
include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/tinymce/formtinymce.php");
$editor = new XoopsFormTinymce(array('caption'=>$caption, 'name'=>$name, 'value'=>$value, 'width'=>'100%', 'height'=>'400px'));
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "tinyeditor", $editor_configs);
}
break;

// end tinymce hack

case 'inbetween' :
if (!$xoops22) {
if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php")) {
include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php");
$editor = new XoopsFormInbetweenTextArea(array('caption'=> $caption, 'name'=>$name, 'value'=>$value, 'width'=>'100%', 'height'=>'300px'),true);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "inbetween", $editor_configs);
}
break;

case 'fckeditor' :
if (!$xoops22) {
if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/FCKeditor/formfckeditor.php")) {
include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/FCKeditor/formfckeditor.php");
$editor = new XoopsFormFckeditor($editor_configs,true);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "fckeditor", $editor_configs);
}
break;

case 'koivi' :
if (!$xoops22) {
if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/koivi/formwysiwygtextarea.php")) {
include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/koivi/formwysiwygtextarea.php");
$editor = new XoopsFormWysiwygTextArea($caption, $name, $value, '100%', '400px');
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "koivi", $editor_configs);
}
break;

case "spaw":
if(!$xoops22) {
if (is_readable(XOOPS_ROOT_PATH . "/class/spaw/formspaw.php")) {
include_once(XOOPS_ROOT_PATH . "/class/spaw/formspaw.php");
$editor = new XoopsFormSpaw($caption, $name, $value);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}

} else {
$editor = new XoopsFormEditor($caption, "spaw", $editor_configs);
}
break;

case "htmlarea":
if(!$xoops22) {
if ( is_readable(XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php")) {
include_once(XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php");
$editor = new XoopsFormHtmlarea($caption, $name, $value);
} else {
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}
}
} else {
$editor = new XoopsFormEditor($caption, "htmlarea", $editor_configs);
}
break;

default :
if ($dhtml) {
$editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
} else {
$editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
}

break;
}

return $editor;
}

18
McDonald
Re: WYSIWYG SmartSection hack or alternative?
  • 2008/2/18 22:59

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Try the following.

In the file smartsection/xoops_version.php find the following:
$i++;
$modversion['config'][$i]['name'] = 'use_wysiwyg';
$modversion['config'][$i]['title'] = '_MI_SSECTION_WYSIWYG';
$modversion['config'][$i]['description'] = '_MI_SSECTION_WYSIWYGDSC';
$modversion['config'][$i]['formtype'] = 'select';
$modversion['config'][$i]['valuetype'] = 'text';
$modversion['config'][$i]['options'] = array('XoopsEditor'  => 'default',
                                           
'Koivi Editor'   => 'koivi',
                                           
'TinyEditor' => 'tiny',
                                           
'FCKEditor' => 'fckeditor',
                                           
'InBetween' => 'inbetween',
                                           
'HTMLArea' => 'htmlarea',
                                           
'Spaw Editor' => 'spaw');
$modversion['config'][$i]['default'] ='default';


and replace by this:
$i++;
$modversion['config'][$i]['name'] = 'use_wysiwyg';
$modversion['config'][$i]['title'] = '_MI_SSECTION_WYSIWYG';
$modversion['config'][$i]['description'] = '_MI_SSECTION_WYSIWYGDSC';
$modversion['config'][$i]['formtype'] = 'select';
$modversion['config'][$i]['valuetype'] = 'text';
$modversion['config'][$i]['options'] = array('XoopsEditor'  => 'default',
                                           
'Koivi Editor'   => 'koivi',
                                           
'TinyEditor' => 'tiny',
                                           
'FCKEditor' => 'fckeditor',
                                           
'InBetween' => 'inbetween',
                                           
'HTMLArea' => 'htmlarea',
                                           
'Spaw Editor' => 'spaw',
                                                 
'TinyMCE' => 'tinymce'  );
$modversion['config'][$i]['default'] ='default';


After saving and uploading, do an update of SmartSection from the Module Administration.
The above will add TinyMCE to the list from editors you can choose from in Preferences. Choose TinyMCE.

The hack to include/function.php should be
function smartsection_getEditor($caption$name$value$dhtml true)
{
    
$smartConfig =& smartsection_getModuleConfig();

    global 
$xoops22;
    if (!isset(
$xoops22)) {
        
$xoops22 smartsection_isXoops22();
    }

      
$editor_configs=array();
    
$editor_configs["name"] = $name;
    
$editor_configs["value"] = $value;
    
$editor_configs['caption'] = $caption;
    
$editor_configs["rows"] = 35;
    
$editor_configs["cols"] = 60;
    
$editor_configs["width"] = "100%";
    
$editor_configs["height"] = "400px";

    switch (
$smartConfig['use_wysiwyg']) {
        case 
'tinymce' :
        if (!
$xoops22) {

            if ( 
is_readable(XOOPS_ROOT_PATH "/class/xoopseditor/tinymce/formtinymce.php"))    {
                include_once(
XOOPS_ROOT_PATH "/class/xoopseditor/tinymce/formtinymce.php");
                
$editor = new XoopsFormTinymce(array('caption'=>$caption'name'=>$name'value'=>$value'width'=>'100%''height'=>'400px'));
            } else {
                if (
$dhtml) {
                    
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
                } else {
                    
$editor = new XoopsFormTextArea($caption$name$value760);
                }
            }
        } else {
            
$editor = new XoopsFormEditor($caption"tinymce"$editor_configs);
        }
        break;

        case 
'tiny' :
        if (!
$xoops22) {

            if ( 
is_readable(XOOPS_ROOT_PATH "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php"))    {
                include_once(
XOOPS_ROOT_PATH "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php");
                
$editor = new XoopsFormTinyeditorTextArea(array('caption'=>$caption'name'=>$name'value'=>$value'width'=>'100%''height'=>'400px'));
            } else {
                if (
$dhtml) {
                    
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
                } else {
                    
$editor = new XoopsFormTextArea($caption$name$value760);
                }
            }
        } else {
            
$editor = new XoopsFormEditor($caption"tinyeditor"$editor_configs);
        }
        break;

        case 
'inbetween' :
        if (!
$xoops22) {
            if ( 
is_readable(XOOPS_ROOT_PATH "/class/xoopseditor/inbetween/forminbetweentextarea.php"))    {
                include_once(
XOOPS_ROOT_PATH "/class/xoopseditor/inbetween/forminbetweentextarea.php");
                
$editor = new XoopsFormInbetweenTextArea(array('caption'=> $caption'name'=>$name'value'=>$value'width'=>'100%''height'=>'300px'),true);
            } else {
                if (
$dhtml) {
                    
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
                } else {
                    
$editor = new XoopsFormTextArea($caption$name$value760);
                }
            }
        } else {
            
$editor = new XoopsFormEditor($caption"inbetween"$editor_configs);
        }
        break;

        case 
'fckeditor' :
        if (!
$xoops22) {
            if ( 
is_readable(XOOPS_ROOT_PATH "/class/xoopseditor/fckeditor/formfckeditor.php"))    {
                include_once(
XOOPS_ROOT_PATH "/class/xoopseditor/fckeditor/formfckeditor.php");
                
$editor = new XoopsFormFckeditor($editor_configs,true);
            } else {
                if (
$dhtml) {
                    
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
                } else {
                    
$editor = new XoopsFormTextArea($caption$name$value760);
                }
            }
        } else {
            
$editor = new XoopsFormEditor($caption"fckeditor"$editor_configs);
        }
        break;

        case 
'koivi' :
        if (!
$xoops22) {
            if ( 
is_readable(XOOPS_ROOT_PATH "/class/wysiwyg/formwysiwygtextarea.php"))    {
                include_once(
XOOPS_ROOT_PATH "/class/wysiwyg/formwysiwygtextarea.php");
                
$editor = new XoopsFormWysiwygTextArea($caption$name$value'100%''400px');
            } else {
                if (
$dhtml) {
                    
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
                } else {
                    
$editor = new XoopsFormTextArea($caption$name$value760);
                }
            }
        } else {
            
$editor = new XoopsFormEditor($caption"koivi"$editor_configs);
        }
        break;

        case 
"spaw":
        if(!
$xoops22) {
            if (
is_readable(XOOPS_ROOT_PATH "/class/spaw/formspaw.php"))    {
                include_once(
XOOPS_ROOT_PATH "/class/spaw/formspaw.php");
                
$editor = new XoopsFormSpaw($caption$name$value);
            } else {
                if (
$dhtml) {
                    
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
                } else {
                    
$editor = new XoopsFormTextArea($caption$name$value760);
                }
            }

        } else {
            
$editor = new XoopsFormEditor($caption"spaw"$editor_configs);
        }
        break;

        case 
"htmlarea":
        if(!
$xoops22) {
            if ( 
is_readable(XOOPS_ROOT_PATH "/class/htmlarea/formhtmlarea.php"))    {
                include_once(
XOOPS_ROOT_PATH "/class/htmlarea/formhtmlarea.php");
                
$editor = new XoopsFormHtmlarea($caption$name$value);
            } else {
                if (
$dhtml) {
                    
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
                } else {
                    
$editor = new XoopsFormTextArea($caption$name$value760);
                }
            }
        } else {
            
$editor = new XoopsFormEditor($caption"htmlarea"$editor_configs);
        }
        break;

        default :
        if (
$dhtml) {
            
$editor = new XoopsFormDhtmlTextArea($caption$name$value2060);
        } else {
            
$editor = new XoopsFormTextArea($caption$name$value760);
        }

        break;
    }

    return 
$editor;
}


Instead of TinyMCE from the xoopseditor package you could also use TinyEditor. This is TinyMCE adapted for XOOPS and has the XOOPS ImageManager also. TinyEditor can be easily configured from the Preferences and toolbars can be setup per user group.
You can download TinyEditor complete with plugins here: http://members.lycos.nl/mcdonaldsstore/ (download link #13)
Don't forget to read the manual because this tells you how to install TinyEditor and more.

19
bjuti
Re: WYSIWYG SmartSection hack or alternative?
  • 2009/2/14 17:21

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Hehe, after one year of inactivity I'm gonna write osmething on this topic :)

So, the problem is.

I'm using XOOPS 2.3.1 and smartcestion 2.14. I've hacked smartsection like McDonald said and when I choose tinymce editor work but I have problem of not showing lang titles on tabs and etc.. I've just have variables such as [definition_xxx] etc.

So I have edit xoopsconfig.php and put in there to use TinyMCE as def. editor. Now the problem is, when I want to put the enable comments on my site, all users get Tiny MCE, and i don't wanna let them to use it because of safety.

Is there any solution or another hack for smartsection to use XOOPS 2.3 bundeled editors?

Tnx

20
bjuti
Re: WYSIWYG SmartSection hack or alternative?
  • 2009/2/17 0:31

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Anyone?

Login

Who's Online

218 user(s) are online (80 user(s) are browsing Support Forums)


Members: 0


Guests: 218


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits