1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Linkwords PHP 7.1 fix.

This commit is contained in:
Cameron
2016-12-21 12:10:21 -08:00
parent 9e99e12f8c
commit b82ac44d71
2 changed files with 21 additions and 7 deletions

View File

@@ -86,7 +86,7 @@
'linkword_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'linkword_word' => array ( 'title' => LWLAN_21, 'type' => 'tags', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'linkword_link' => array ( 'title' => LWLAN_6, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => 'size=xxlarge', 'class' => 'left', 'thclass' => 'left', ),
'linkword_active' => array ( 'title' => LAN_ACTIVE, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'left' => 'center', 'thclass' => 'left', ),
'linkword_active' => array ( 'title' => LAN_ACTIVE, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => array(), 'left' => 'center', 'thclass' => 'left', ),
'linkword_tooltip' => array ( 'title' => LWLAN_50, 'type' => 'textarea', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('size'=>'xxlarge'), 'class' => 'left', 'thclass' => 'left', ),
'linkword_limit' => array ( 'title' => "Max. links/tips", 'type' => 'number', 'data' => 'int', 'width' => '10%', 'help' => LWLAN_63, 'readParms' => '', 'writeParms' => array('default'=>3), 'class' => 'right', 'thclass' => 'right', ),
@@ -132,7 +132,7 @@
// ------- Customize Create --------
public function beforeCreate($new_data)
public function beforeCreate($new_data, $old_data)
{
return $new_data;
}

View File

@@ -139,7 +139,14 @@ class e_tohtml_linkwords
$lwlist = explode(',',$lw);
foreach ($lwlist as $lw)
{
$this->word_list[] = trim($lw);
$lw = trim($lw);
if(empty($lw))
{
continue;
}
$this->word_list[] = $lw;
$this->word_class[] = 'lw-'.$frm->name2id($lw);
$this->word_limit[] = vartrue($row['linkword_limit'],3);
@@ -152,6 +159,14 @@ class e_tohtml_linkwords
}
else
{
$lw = trim($lw);
if(empty($lw))
{
continue;
}
$this->word_list[] = $lw;
$this->word_class[] = 'lw-'.$frm->name2id($lw);
$this->word_limit[] = vartrue($row['linkword_limit'],3);
@@ -176,8 +191,6 @@ class e_tohtml_linkwords
}
}
}
@@ -245,9 +258,10 @@ class e_tohtml_linkwords
// Consider next line - stripos is PHP5, and mb_stripos is PHP >= 5.2 - so may well often require handling
// while (($first < $limit) && (stripos($text,$this->word_list[$first]) === FALSE)) { $first++; }; // *utf (stripos is PHP5 - compatibility handler implements)
$needle = $this->word_list[$first];
while (($first < $limit) && (strpos($tp->ustrtolower($text), $needle) === false))
while (($first < $limit) && (strpos($tp->ustrtolower($text),$this->word_list[$first]) === false))
{
$first++;
} // *utf