1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-02 00:45:03 +02:00

PHP7 fix for message_handler. Plugin Builder now includes specific keyword drop-down menu for use on e107.org

This commit is contained in:
Cameron 2016-04-12 19:56:29 -07:00
parent 21017e78f1
commit 4a40104073
3 changed files with 48 additions and 5 deletions

View File

@ -2547,7 +2547,7 @@ class pluginBuilder
'author' => array('name','url'),
'summary' => array('summary'),
'description' => array('description'),
'keywords' => array('one','two'),
'keywords' => array('one','two','three'),
'category' => array('category'),
'copyright' => array('copyright'),
// 'adminLinks' => array('url','description','icon','iconSmall','primary'),
@ -2622,6 +2622,7 @@ class pluginBuilder
"category-category" => varset($p['category']),
"keywords-one" => varset($p['keywords']['word'][0]),
"keywords-two" => varset($p['keywords']['word'][1]),
"keywords-three" => varset($p['keywords']['word'][2]),
);
unset($p);
@ -2729,8 +2730,14 @@ class pluginBuilder
$pattern = "[A-Za-z \.0-9]*";
$xsize = 'block-level';
break;
case 'keywords-one':
$type = 'keywordDropDown';
$required = true;
$help = EPL_ADLAN_144;
break;
case 'keywords-three':
case 'keywords-two':
$help = EPL_ADLAN_144."<br />".EPL_ADLAN_143;
$required = true;
@ -2791,6 +2798,37 @@ class pluginBuilder
$text = $frm->select($name, $options, $default,'required=1&class=null', true);
break;
case 'keywordDropDown':
$options = array(
'generic',
'admin',
'messaging',
'enhancement',
'date',
'commerce',
'form',
'gaming',
'intranet',
'multimedia',
'information',
'mail',
'search',
'stats',
'files',
'security',
'generic',
'language'
);
sort($options);
$text = $frm->select($name, $options, $default,'required=1&class=null&useValues=1', true);
break;
default:
@ -2855,6 +2893,7 @@ $template = <<<TEMPLATE
<keywords>
<word>{KEYWORDS_ONE}</word>
<word>{KEYWORDS_TWO}</word>
<word>{KEYWORDS_THREE}</word>
</keywords>
<category>{CATEGORY_CATEGORY}</category>
<copyright>{COPYRIGHT_COPYRIGHT}</copyright>

View File

@ -2345,6 +2345,8 @@ class e_parse extends e_parser
$thurl = 'src='.urlencode($url).'&amp;';
// e107::getDebug()->log("Thumb: ".basename($url). print_a($options,true), E107_DBG_BASIC);
if(isset($options['crop']))
{
$this->thumbCrop = intval($options['crop']);
@ -2355,7 +2357,7 @@ class e_parse extends e_parser
$this->thumbEncode($options['x']);
}
if(vartrue($options['aw']) || vartrue($options['ah']) || $this->thumbCrop == 1)
if(vartrue($options['aw']) || vartrue($options['ah']) || ($this->thumbCrop == 1))
{
if($this->thumbCrop == 1 && !vartrue($options['aw']) && !vartrue($options['ah'])) // Allow templates to determine dimensions. See {SETIMAGE}
{

View File

@ -934,6 +934,8 @@ class eMessage
public function addAuto($update, $type = 'update', $success = false, $failed = false, $output = false)
{
$sql = e107::getDb();
if (($type == 'update' && $update) || ($type == 'insert' && $update !== false))
{
$this->add(($success ? $success : ($type == 'update' ? LAN_UPDATED : LAN_CREATED)), E_MESSAGE_SUCCESS);
@ -942,7 +944,7 @@ class eMessage
{
$this->add(($success ? $success : LAN_DELETED), E_MESSAGE_SUCCESS);
}
elseif (!mysql_errno())
elseif (!$sql->getLastErrorNumber())
{
if ($type == 'update')
{
@ -968,7 +970,7 @@ class eMessage
break;
}
$text = ($failed ? $failed : $msg." - ".LAN_TRY_AGAIN)."<br />".LAN_ERROR." ".mysql_errno().": ".mysql_error();
$text = ($failed ? $failed : $msg." - ".LAN_TRY_AGAIN)."<br />".LAN_ERROR." ".$sql->getLastErrorNumber().": ".$sql->getLastErrorText();
$this->add($text, E_MESSAGE_ERROR);
}