1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Fixed: When using TinyMce og:image tags were missing for images inserted into the news body. Banner plugin now has a tooltip/description field. Also supports longer URLs avoiding SQL errors. TinyMce upgraded to latest version. (v4.3.2)

This commit is contained in:
Cameron
2016-01-12 03:22:06 -08:00
parent b1c2e030d5
commit 5a6153db27
7 changed files with 49 additions and 21 deletions

View File

@@ -414,7 +414,29 @@ class e_bbcode
return;
}
if(substr(ltrim($text),0,6) == '[html]' && $type == 'img') // support for html img tags inside [html] bbcode.
{
$tmp = e107::getParser()->getTags($text,'img');
if(!empty($tmp['img']))
{
$mtch = array();
foreach($tmp['img'] as $k)
{
$mtch[1][] = str_replace('"','',trim($k['src']));
// echo $k['src']."<br />";
}
}
}
else // regular bbcode;
{
preg_match_all("/\[".$type."(?:[^\]]*)?]([^\[]*)(?:\[\/".$type."])/im",$text,$mtch);
}
$ret = array();
@@ -423,6 +445,7 @@ class e_bbcode
$tp = e107::getParser();
foreach($mtch[1] as $i)
{
if(substr($i,0,4)=='http')
{
$ret[] = $i;

View File

@@ -98,7 +98,8 @@ class banner_ui extends e_admin_ui
'banner_clientpassword' => array ( 'title' => BNRLAN_13, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => 'strength=1&password=1&required=0&generate=1&nomask=1', 'class' => 'center', 'thclass' => 'center', ),
'banner_image' => array ( 'title' => BNRLAN_14, 'type' => 'image', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => 'thumb=0x50', 'writeParms' => 'media=banner&w=600', 'class' => 'left', 'thclass' => 'left', ),
'banner_clickurl' => array ( 'title' => BNRLAN_15, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => 'size=xxlarge&required=1', 'class' => 'left', 'thclass' => 'left', ),
'banner_impurchased' => array ( 'title' => BNRLAN_16, 'type' => 'number', 'data' => 'int', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'banner_impurchased' => array ( 'title' => BNRLAN_16, 'type' => 'number', 'data' => 'int', 'width' => 'auto', 'inline' => true, 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', 'help'=>'0 = unlimited' ),
'banner_description' => array ( 'title' => BNRLAN_49, 'type' => 'textarea', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'banner_startdate' => array ( 'title' => BNRLAN_17, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'banner_enddate' => array ( 'title' => BNRLAN_18, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
@@ -107,7 +108,7 @@ class banner_ui extends e_admin_ui
'click_percentage' => array ( 'title' => BANNERLAN_25, 'type' => 'method', 'noedit'=>true, 'data' => false, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'banner_impressions' => array ( 'title' => 'Impressions', 'type' => 'method', 'noedit'=>true, 'data' => 'int', 'width' => '12%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'banner_impressions' => array ( 'title' => 'Impressions', 'type' => 'method', 'noedit'=>true, 'data' => 'int', 'width' => '12%', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'banner_ip' => array ( 'title' => LAN_IP, 'type' => 'hidden', 'noedit'=>true, 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
);

View File

@@ -140,7 +140,7 @@ if(!empty($menu_pref['banner_campaign']) && !empty($menu_pref['banner_amount']))
$query .= " AND banner_active IN (".USERCLASS_LIST.") ORDER BY RAND($seed) LIMIT ".intval($menu_pref['banner_amount']);
if($data = $sql->retrieve('banner', 'banner_id, banner_image, banner_clickurl,banner_campaign', $query,true))
if($data = $sql->retrieve('banner', 'banner_id, banner_image, banner_clickurl,banner_campaign, banner_description', $query,true))
{
foreach($data as $k=>$row)
{

View File

@@ -4,7 +4,7 @@ CREATE TABLE banner (
banner_clientlogin varchar(20) NOT NULL default '',
banner_clientpassword varchar(50) NOT NULL default '',
banner_image varchar(150) NOT NULL default '',
banner_clickurl varchar(150) NOT NULL default '',
banner_clickurl varchar(250) NOT NULL default '',
banner_impurchased int(10) unsigned NOT NULL default '0',
banner_startdate int(10) unsigned NOT NULL default '0',
banner_enddate int(10) unsigned NOT NULL default '0',
@@ -12,6 +12,7 @@ CREATE TABLE banner (
banner_clicks int(10) unsigned NOT NULL default '0',
banner_impressions int(10) unsigned NOT NULL default '0',
banner_ip text NOT NULL,
banner_description text NOT NULL,
banner_campaign varchar(150) NOT NULL default '',
PRIMARY KEY (banner_id)
) ENGINE=MyISAM;

View File

@@ -42,7 +42,7 @@ class banner_shortcodes extends e_shortcode
AND banner_active IN (".USERCLASS_LIST.")
ORDER BY RAND($seed) LIMIT 1";
if($sql->select('banner', 'banner_id, banner_image, banner_clickurl', $query))
if($sql->select('banner', 'banner_id, banner_image, banner_clickurl, banner_description', $query))
{
$row = $sql->fetch();
return $this->renderBanner($row);
@@ -97,7 +97,7 @@ class banner_shortcodes extends e_shortcode
break;
}
return "<a href='".e_HTTP.'banner.php?'.$row['banner_id']."' rel='external'>".$ban_ret.'</a>';
return "<a class='e-tip' href='".e_HTTP.'banner.php?'.$row['banner_id']."' rel='external' title=\"".$tp->toAttribute($row['banner_description'])."\">".$ban_ret.'</a>';
}

View File

@@ -63,4 +63,6 @@ define("BNRLAN_45", "One campaign rendered in a single menu"); // BANNER_MENU_L1
define("BNRLAN_46", "All selected campaigns rendered in one single menu"); // BANNER_MENU_L13
define("BNRLAN_47", "All selected campaigns rendered in separate menus"); // BANNER_MENU_L14
define("BNRLAN_48", "All selected campaigns (no box rendering)");
define("BNRLAN_49", "Description/Tooltip");
?>

View File

@@ -17,7 +17,8 @@ if((e107::wysiwyg() === true && check_class($pref['post_html'])) || strpos(e_SEL
{
if(e_PAGE != 'image.php')
{
e107::js('footer', "https://tinymce.cachefly.net/4.2/tinymce.min.js");
// e107::js('footer', "https://tinymce.cachefly.net/4.2/tinymce.min.js");
e107::js('footer', "//cdn.tinymce.com/4/tinymce.min.js");
e107::js('footer',e_PLUGIN.'tinymce4/wysiwyg.php','jquery',5);
// Add to e107_config.php to view hidden content when TinyMce not saving correctly
@@ -113,7 +114,7 @@ if((e107::wysiwyg() === true && check_class($pref['post_html'])) || strpos(e_SEL
var s = $('#bbcode_holder').val();
alert(s);
// alert(s);
var p = $.ajax({
type: 'POST',