1
neilhedley
Inbetween - PHP error, and text is gone!
  • 2006/1/2 18:18

  • neilhedley

  • Just popping in

  • Posts: 6

  • Since: 2006/1/1 1


Using 2.2.3 of XOOPS, and the current version of the Inbetween editor, followed install instructions to make it work with AMS 2.41

Looks great, but when I posted my first article, the text of the article doesn't appear anywhere. So I started paying a little more attention. When I load the "Submit Article" form, I notice the following errors at the bottom of the screen:

Quote:
Warning [PHP]: Invalid argument supplied for foreach() in file class/xoopseditor/inbetween/forminbetweentextarea.php line 57
Warning [PHP]: Invalid argument supplied for foreach() in file class/xoopseditor/inbetween/forminbetweentextarea.php line 57


Here are lines 54 through 64:

function XoopsFormInbetweenTextArea($configs, $checkCompatible = false)
{
if(!empty($configs)) {
foreach($configs as $key => $val) {
if (method_exists($this, 'set'.Ucfirst($key))) {
$this->{'set'.Ucfirst($key)}($val);
}else{
$this->$key = $val;
}
}
}

Any suggestions would be MUCH appreciated.

2
frankblack
Re: Inbetween - PHP error, and text is gone!
  • 2006/1/2 21:15

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Arggh, I had to test this myself first, but this will work.

Change the xoops_version.php of ams from:

$modversion['config'][10]['options'] = array('_AMS_MI_EDITOR_DEFAULT' => 'default''_AMS_MI_EDITOR_KOIVI' => 'koivi');

to:
$modversion['config'][10]['options'] = array('_AMS_MI_EDITOR_DEFAULT' => 'default''_AMS_MI_EDITOR_KOIVI' => 'koivi''inbetween' => 'inbetween);


Add in include/storyform.inc.php right after:

if ($xoopsModuleConfig['editor'] == "koivi" && file_exists(XOOPS_ROOT_PATH."/class/wysiwyg/formwysiwygtextarea.php")) {
    include_once 
XOOPS_ROOT_PATH."/class/wysiwyg/formwysiwygtextarea.php";
    
$sform->addElement(new XoopsFormWysiwygTextArea(_AMS_NW_THESCOOP'hometext'$story->hometext("Edit"), '100%''200px'''), false);
    
$sform->addElement(new XoopsFormWysiwygTextArea(_AMS_AM_EXTEXT'bodytext'$story->bodytext("Edit"), '100%''200px'''), false);
}


elseif ($xoopsModuleConfig['editor'] == "inbetween" && file_exists(XOOPS_ROOT_PATH."/class/xoopseditor/inbetween/forminbetweentextarea.php")) {
    include_once 
XOOPS_ROOT_PATH."/class/xoopseditor/inbetween/forminbetweentextarea.php";
    
$sform->addElement(new XoopsFormInbetweenTextArea(array('caption'=>_AMS_NW_THESCOOP'name'=>'hometext''value'=>$story->hometext("Edit"), 'width'=>'600px''height'=>'400px'),true));
    
$sform->addElement(new XoopsFormInbetweenTextArea(array('caption'=>_AMS_AM_EXTEXT'name'=>'bodytext''value'=>$story->bodytext("Edit"), 'width'=>'600px''height'=>'400px'),false));
}


Change in submit.php:

case "preview":
    
$xt = new AmsTopic($xoopsDB->prefix("ams_topics"), $_POST['topic_id']);
    if (
$xoopsModuleConfig['editor'] != "koivi") {
        
$text explode("[extend]"$hometext);
        
$hometext $text[0];
        
$bodytext = isset($text[1]) ? $text[1] : "";
    }

to:
case "preview":
    
$xt = new AmsTopic($xoopsDB->prefix("ams_topics"), $_POST['topic_id']);
if ((
$xoopsModuleConfig['editor'] != "koivi") && ($xoopsModuleConfig['editor'] != "inbetween")) {
        
$text explode("[extend]"$hometext);
        
$hometext $text[0];
        
$bodytext = isset($text[1]) ? $text[1] : "";
    }


Change in submit.php:

case "post":
    if (
$xoopsModuleConfig['editor'] != "koivi") {
        
$text explode("[extend]"$_POST['hometext']);
        
$hometext $text[0];
        
$bodytext = isset($text[1]) ? $text[1] : "";
    }

to:
case "post":
    if ((
$xoopsModuleConfig['editor'] != "koivi") && ($xoopsModuleConfig['editor'] != "inbetween")) {
        
$text explode("[extend]"$_POST['hometext']);
        
$hometext $text[0];
        
$bodytext = isset($text[1]) ? $text[1] : "";
    }


Then update the module and you are done (hopefully).

Login

Who's Online

221 user(s) are online (111 user(s) are browsing Support Forums)


Members: 0


Guests: 221


more...

Donat-O-Meter

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

Latest GitHub Commits