mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 04:38:27 +01:00
PHP Notice and BC Fixes.
This commit is contained in:
parent
8023a87aa1
commit
716678a3b7
@ -34,6 +34,8 @@ class news_shortcodes extends e_shortcode
|
|||||||
protected $commentsEngine = 'e107';
|
protected $commentsEngine = 'e107';
|
||||||
|
|
||||||
private $imageItem;
|
private $imageItem;
|
||||||
|
|
||||||
|
public $param = array();
|
||||||
|
|
||||||
|
|
||||||
function __construct($eVars = null)
|
function __construct($eVars = null)
|
||||||
@ -80,7 +82,10 @@ class news_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
e107::getBB()->setClass("news"); // For automatic bbcode image resizing.
|
e107::getBB()->setClass("news"); // For automatic bbcode image resizing.
|
||||||
|
|
||||||
|
|
||||||
|
$news_body = '';
|
||||||
|
|
||||||
if($parm != 'extended')
|
if($parm != 'extended')
|
||||||
{
|
{
|
||||||
$news_body = $tp->toHTML($this->news_item['news_body'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
$news_body = $tp->toHTML($this->news_item['news_body'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
||||||
@ -90,7 +95,9 @@ class news_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
$news_body .= $tp->toHTML($this->news_item['news_extended'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
$news_body .= $tp->toHTML($this->news_item['news_extended'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
||||||
}
|
}
|
||||||
|
|
||||||
e107::getBB()->clearClass();
|
e107::getBB()->clearClass();
|
||||||
|
|
||||||
return $news_body;
|
return $news_body;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,7 +518,8 @@ class news_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$text = $tp->toHtml($this->news_item['news_body'],true);
|
$text = $tp->toHtml($this->news_item['news_body'],true);
|
||||||
$text = str_replace("<br />","\n",$text);
|
$breaks = array('<br />','<br>');
|
||||||
|
$text = str_replace($breaks,"\n",$text);
|
||||||
$text = strip_tags($text);
|
$text = strip_tags($text);
|
||||||
$tmp = preg_split('/(\.\s|!|\r|\n|\?)/i', trim($text));
|
$tmp = preg_split('/(\.\s|!|\r|\n|\?)/i', trim($text));
|
||||||
$tmp = array_filter($tmp);
|
$tmp = array_filter($tmp);
|
||||||
@ -597,18 +605,23 @@ class news_shortcodes extends e_shortcode
|
|||||||
$_src = $src = ($newsThumb[0] == '{' || $parms[1] == 'placeholder') ? e107::getParser()->replaceConstants($newsThumb, 'abs') : e_IMAGE_ABS."newspost_images/".$newsThumb;
|
$_src = $src = ($newsThumb[0] == '{' || $parms[1] == 'placeholder') ? e107::getParser()->replaceConstants($newsThumb, 'abs') : e_IMAGE_ABS."newspost_images/".$newsThumb;
|
||||||
|
|
||||||
|
|
||||||
if($parms[2] || $parms[1] == 'placeholder')
|
if(!empty($parms[2]) || $parms[1] == 'placeholder')
|
||||||
{
|
{
|
||||||
// $srcset = "srcset='".$tp->thumbSrcSet($src,'all')."' size='100vw' ";
|
// $srcset = "srcset='".$tp->thumbSrcSet($src,'all')."' size='100vw' ";
|
||||||
$src = e107::getParser()->thumbUrl($src, $parms[2]);
|
$attr = !empty($parms[2]) ? $parms[2] : null;
|
||||||
|
$src = e107::getParser()->thumbUrl($src, $attr);
|
||||||
$dimensions = e107::getParser()->thumbDimensions();
|
$dimensions = e107::getParser()->thumbDimensions();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(empty($parms[1]))
|
||||||
|
{
|
||||||
|
$parms = array(1 => null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch($parms[1])
|
switch($parms[1])
|
||||||
{
|
{
|
||||||
case 'src':
|
case 'src':
|
||||||
|
@ -19,6 +19,24 @@ if (!e107::isInstalled('download'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
e107::lan('download',false, true); // Loads e_PLUGIN.'download/languages/'.e_LANGUAGE.'/English_front.php'
|
e107::lan('download',false, true); // Loads e_PLUGIN.'download/languages/'.e_LANGUAGE.'/English_front.php'
|
||||||
|
|
||||||
|
$bcList = array(
|
||||||
|
'LAN_dl_19' => 'LAN_CATEGORY',
|
||||||
|
'LAN_dl_17' => 'LAN_FILES',
|
||||||
|
"LAN_dl_20" => "LAN_FILES",
|
||||||
|
"LAN_dl_21" => "LAN_SIZE",
|
||||||
|
"LAN_dl_22" => "LAN_DATE",
|
||||||
|
"LAN_dl_23" => "LAN_FILE",
|
||||||
|
"LAN_dl_24" => "LAN_AUTHOR",
|
||||||
|
"LAN_dl_25" => "LAN_ASCENDING",
|
||||||
|
"LAN_dl_26" => "LAN_DESCENDING",
|
||||||
|
"LAN_dl_27" => "LAN_GO",
|
||||||
|
"LAN_dl_28" => "LAN_NAME"
|
||||||
|
);
|
||||||
|
|
||||||
|
e107::getLanguage()->bcDefs($bcList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require_once(e_PLUGIN.'download/handlers/download_class.php');
|
require_once(e_PLUGIN.'download/handlers/download_class.php');
|
||||||
require_once(e_PLUGIN.'download/handlers/category_class.php');
|
require_once(e_PLUGIN.'download/handlers/category_class.php');
|
||||||
|
@ -23,9 +23,11 @@ if(isset($parms['caption'][e_LANGUAGE]))
|
|||||||
|
|
||||||
$limit = vartrue($parms['count'],5);
|
$limit = vartrue($parms['count'],5);
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$template = e107::getTemplate('news', 'news_menu', 'carousel');
|
$template = e107::getTemplate('news', 'news_menu', 'carousel', false, true);
|
||||||
|
|
||||||
$nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
|
$nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
|
||||||
|
|
||||||
|
e107::getDebug()->log("News Carousel Menu ".print_a($parms,true));
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT n.*, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon,
|
SELECT n.*, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon,
|
||||||
|
@ -39,7 +39,11 @@ if(!$OTHERNEWS2_STYLE)
|
|||||||
{
|
{
|
||||||
if(deftrue('BOOTSTRAP')) // v2.x
|
if(deftrue('BOOTSTRAP')) // v2.x
|
||||||
{
|
{
|
||||||
define("OTHERNEWS_COLS",false);
|
if(!defined("OTHERNEWS_COLS"))
|
||||||
|
{
|
||||||
|
define("OTHERNEWS_COLS",false);
|
||||||
|
}
|
||||||
|
|
||||||
$template = e107::getTemplate('news', 'news_menu', 'other2');
|
$template = e107::getTemplate('news', 'news_menu', 'other2');
|
||||||
$OTHERNEWS2_STYLE = $template['item'];
|
$OTHERNEWS2_STYLE = $template['item'];
|
||||||
|
|
||||||
|
@ -51,7 +51,10 @@ if(!$OTHERNEWS_STYLE)
|
|||||||
{
|
{
|
||||||
if(deftrue('BOOTSTRAP')) // v2.x
|
if(deftrue('BOOTSTRAP')) // v2.x
|
||||||
{
|
{
|
||||||
define("OTHERNEWS_COLS",false);
|
if(!defined("OTHERNEWS_COLS"))
|
||||||
|
{
|
||||||
|
define("OTHERNEWS_COLS",false);
|
||||||
|
}
|
||||||
$template = e107::getTemplate('news', 'news_menu', 'other');
|
$template = e107::getTemplate('news', 'news_menu', 'other');
|
||||||
|
|
||||||
$item_selector = '<div class="btn-group pull-right"><a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="prev">‹</a>
|
$item_selector = '<div class="btn-group pull-right"><a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="prev">‹</a>
|
||||||
|
@ -387,7 +387,7 @@ class newsfeedClass
|
|||||||
|
|
||||||
if($which == 'all')
|
if($which == 'all')
|
||||||
{
|
{
|
||||||
$ret['title'] = $NEWSFEED_MENU_CAPTION;
|
$ret['title'] = (!empty($NEWSFEED_MENU_CAPTION)) ? $NEWSFEED_MENU_CAPTION : '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user