1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Issue #4332 Carousel fixes. Newsfeed now uses json to store data.

This commit is contained in:
Cameron
2021-01-01 09:33:51 -08:00
parent e6ceafd496
commit 81634d5f5a
16 changed files with 46 additions and 37 deletions

View File

@@ -650,7 +650,7 @@ class e_form
$start =' $start ='
<!-- Carousel --> <!-- Carousel -->
<div id="'.$name.'" class="carousel slide" data-ride="carousel" '.$interval.' '.$wrap.' '.$pause.'>'; <div id="'.$name.'" class="carousel slide" data-ride="carousel" data-bs-ride="carousel" '.$interval.' '.$wrap.' '.$pause.'>';
if($indicate && (count($array) > 1)) if($indicate && (count($array) > 1))
{ {
@@ -663,7 +663,7 @@ class e_form
foreach($array as $key=>$tab) foreach($array as $key=>$tab)
{ {
$active = ($c == $act) ? ' class="active"' : ''; $active = ($c == $act) ? ' class="active"' : '';
$indicators .= '<li data-target="#'.$name.'" data-slide-to="'.$c.'" '.$active.'></li>'; $indicators .= '<li data-target="#'.$name.'" data-slide-to="'.$c.'" data-bs-target="#'.$name.'" data-bs-slide-to="'.$c.'" '.$active.'></li>';
$c++; $c++;
} }
@@ -700,10 +700,10 @@ class e_form
if($navigation && (count($array) > 1)) if($navigation && (count($array) > 1))
{ {
$controls = ' $controls = '
<a class="left carousel-control carousel-left" href="#'.$name.'" role="button" data-slide="prev"> <a class="left carousel-control carousel-left" href="#'.$name.'" role="button" data-slide="prev" data-bs-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span> <span class="glyphicon glyphicon-chevron-left"></span>
</a> </a>
<a class="right carousel-control carousel-right" href="#'.$name.'" role="button" data-slide="next"> <a class="right carousel-control carousel-right" href="#'.$name.'" role="button" data-slide="next" data-bs-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span> <span class="glyphicon glyphicon-chevron-right"></span>
</a>'; </a>';
} }

View File

@@ -563,7 +563,7 @@ class MagpieRSS {
if ( $php_errormsg ) { if ( $php_errormsg ) {
$errormsg .= " ({$php_errormsg})"; $errormsg .= " ({$php_errormsg})";
} }
if ( MAGPIE_DEBUG ) { if ( defined('MAGPIE_DEBUG') && MAGPIE_DEBUG) {
trigger_error( $errormsg, $lvl); trigger_error( $errormsg, $lvl);
} }
else { else {

View File

@@ -1788,7 +1788,7 @@ class themeHandler
foreach($slides as $key=>$v) foreach($slides as $key=>$v)
{ {
$id = $key + 1; $id = $key + 1;
$indicators .= '<li data-target="#myCarousel" data-slide-to="'.$id.'"></li>'; $indicators .= '<li data-target="#myCarousel" data-slide-to="'.$id.'" data-bs-slide-to="'.$id.'"></li>';
} }
$indicators .= '</ol>'; $indicators .= '</ol>';

View File

@@ -22,7 +22,7 @@ if(!isset($BANNER_LOGIN_TABLE))
<form method='post' action='".e_SELF."'>\n <form method='post' action='".e_SELF."'>\n
<table style='width:40%'> <table style='width:40%'>
<tr> <tr>
<td style='width:15%' class='defaulttext'>".BANNERLAN_16." </td> <td style='width:15%' class='defaulttext'>".LAN_USER." </td>
<td>{BANNER_LOGIN_TABLE_LOGIN}\n</td> <td>{BANNER_LOGIN_TABLE_LOGIN}\n</td>
</tr> </tr>
<tr> <tr>

View File

@@ -35,7 +35,7 @@ class banner_menu
$fields['banner_campaign'] = array('title'=> BNRLAN_39, 'type'=>'method'); $fields['banner_campaign'] = array('title'=> BNRLAN_39, 'type'=>'method');
$fields['banner_amount'] = array('title'=> BNRLAN_41, 'type'=>'text', 'writeParms'=>array('pattern'=>'[0-9]*')); $fields['banner_amount'] = array('title'=> BNRLAN_41, 'type'=>'text', 'writeParms'=>array('pattern'=>'[0-9]*'));
$fields['banner_width'] = array('title'=> LAN_WIDTH, 'type'=>'text', 'help'=>"In pixels", 'writeParms'=>array('pattern'=>'[0-9]*')); $fields['banner_width'] = array('title'=> LAN_WIDTH, 'type'=>'text', 'help'=>"In pixels", 'writeParms'=>array('pattern'=>'[0-9]*'));
$fields['banner_rendertype'] = array('title'=> BNRLAN_43, 'type'=>'dropdown', 'writeParms'=>array('optArray'=>$renderTypes)); $fields['banner_rendertype'] = array('title'=> BNRLAN_43, 'type'=>'dropdown', 'writeParms'=>array('optArray'=>$renderTypes, 'size'=>'xxlarge'));
return $fields; return $fields;
@@ -56,9 +56,14 @@ class banner_menu_form extends e_form
$text = ''; $text = '';
if(empty($curVal))
{
$curVal = array();
}
while ($row = $sql -> fetch()) while ($row = $sql -> fetch())
{ {
$checked = in_array($row['banner_campaign'],$curVal); $checked = in_array($row['banner_campaign'], $curVal);
$text .= $this->checkbox('banner_campaign[]',$row['banner_campaign'],$checked, array('label'=> $row['banner_campaign'],'class'=>'e-save')); // e-save class is required. $text .= $this->checkbox('banner_campaign[]',$row['banner_campaign'],$checked, array('label'=> $row['banner_campaign'],'class'=>'e-save')); // e-save class is required.
} }

View File

@@ -166,8 +166,8 @@ if(false === $cached)
if(deftrue('BOOTSTRAP')) // v2.x if(deftrue('BOOTSTRAP')) // v2.x
{ {
$month_selector = '<span class="btn-group pull-right float-right"><a class="btn btn-mini btn-default btn-secondary btn-sm btn-xs " href="#blogCalendar" data-slide="prev"></a> $month_selector = '<span class="btn-group pull-right float-right"><a class="btn btn-mini btn-default btn-secondary btn-sm btn-xs " href="#blogCalendar" data-slide="prev" data-bs-slide="prev"></a>
<a class="btn btn-mini btn-default btn-secondary btn-sm btn-xs" href="#blogCalendar" data-slide="next"></a></span>'; <a class="btn btn-mini btn-default btn-secondary btn-sm btn-xs" href="#blogCalendar" data-slide="next" data-bs-slide="next"></a></span>';
$caption = "<span class='inline-text'>".BLOGCAL_L1." ".$month_selector."</span>"; $caption = "<span class='inline-text'>".BLOGCAL_L1." ".$month_selector."</span>";

View File

@@ -12,7 +12,7 @@ $FEATUREBOX_CATEGORY_TEMPLATE = array();
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['list_start'] = ' $FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['list_start'] = '
<div id="carousel-example-generic" class="featurebox carousel slide" data-ride="carousel"> <div id="carousel-example-generic" class="featurebox carousel slide" data-ride="carousel" data-bs-ride="carousel">
{FEATUREBOX_NAVIGATION|bootstrap3_carousel=loop&uselimit=1} {FEATUREBOX_NAVIGATION|bootstrap3_carousel=loop&uselimit=1}
<!-- Wrapper for slides --> <!-- Wrapper for slides -->
<div class="carousel-inner"> <div class="carousel-inner">
@@ -23,10 +23,10 @@ $FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['list_end'] = '
</div> </div>
<!-- Controls --> <!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev" data-bs-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span> <span class="glyphicon glyphicon-chevron-left"></span>
</a> </a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"> <a class="right carousel-control" href="#carousel-example-generic" data-slide="next" data-bs-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span> <span class="glyphicon glyphicon-chevron-right"></span>
</a> </a>
@@ -69,8 +69,8 @@ $FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['list_end'] = '
</div> </div>
<!-- Carousel nav --> <!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a> <a class="carousel-control left" href="#myCarousel" data-slide="prev" data-bs-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a> <a class="carousel-control right" href="#myCarousel" data-slide="next" data-bs-slide="next">&rsaquo;</a>
</div><!-- end myCarousel --> </div><!-- end myCarousel -->
</div><!-- end span12 --> </div><!-- end span12 -->

View File

@@ -67,7 +67,7 @@ class plugin_hero_hero_shortcodes extends e_shortcode
{ {
$active = ($c == 0) ? 'active' : ''; $active = ($c == 0) ? 'active' : '';
$text .= '<li data-target="#'.$target.'" data-slide-to="'.$c.'" class="'.$active.'"></li>'; $text .= '<li data-target="#'.$target.'" data-slide-to="'.$c.'" data-bs-slide-to="'.$c.'" class="'.$active.'"></li>';
$text .= "\n"; $text .= "\n";
} }

View File

@@ -8,26 +8,23 @@ if (!defined('e107_INIT')) { exit; }
$HERO_TEMPLATE = array(); $HERO_TEMPLATE = array();
$HERO_TEMPLATE['default']['header'] = '<!-- Hero Menu: header -->{SETIMAGE: w=400&h=400} $HERO_TEMPLATE['default']['header'] = '<!-- Hero Menu: header -->{SETIMAGE: w=400&h=400}
<div id="carousel-hero" class="carousel carousel-fade slide" data-ride="carousel" data-interval="{HERO_SLIDE_INTERVAL}"> <div id="carousel-hero" class="carousel carousel-fade slide" data-bs-ride="carousel" data-ride="carousel" data-interval="{HERO_SLIDE_INTERVAL}" data-bs-interval="{HERO_SLIDE_INTERVAL}">
<div class="carousel-inner" role="listbox">'; <div class="carousel-inner" role="listbox">';
$HERO_TEMPLATE['default']['footer'] = '</div><div class="carousel-controls"> $HERO_TEMPLATE['default']['footer'] = '</div><div class="carousel-controls">
<!-- Controls --> <!-- Controls -->
<a class="left carousel-left carousel-control animated zoomIn animation-delay-30" href="#carousel-hero" role="button" data-slide="prev"> <a class="left carousel-left carousel-control animated zoomIn animation-delay-30" href="#carousel-hero" role="button" data-slide="prev" data-bs-slide="prev">
<i class="fa fa-chevron-left fa-fw"></i> <i class="fa fa-chevron-left fa-fw"></i>
<span class="sr-only">Previous</span> <span class="sr-only">Previous</span>
</a> </a>
<a class="right carousel-right carousel-control animated zoomIn animation-delay-30" href="#carousel-hero" role="button" data-slide="next"> <a class="right carousel-right carousel-control animated zoomIn animation-delay-30" href="#carousel-hero" role="button" data-slide="next" data-bs-slide="next">
<i class="fa fa-chevron-right fa-fw"></i> <i class="fa fa-chevron-right fa-fw"></i>
<span class="sr-only">Next</span> <span class="sr-only">Next</span>
</a> </a>
<!-- Indicators --> <!-- Indicators -->
{HERO_CAROUSEL_INDICATORS: target=carousel-hero&class=animated fadeInUpBig} {HERO_CAROUSEL_INDICATORS: target=carousel-hero&class=animated fadeInUpBig}
<!-- <ol class="carousel-indicators">
<li data-target="#carousel-hero" data-slide-to="0" class="animated fadeInUpBig animation-delay-27 active"></li>
<li data-target="#carousel-hero" data-slide-to="1" class="animated fadeInUpBig animation-delay-28"></li>
<li data-target="#carousel-hero" data-slide-to="2" class="animated fadeInUpBig animation-delay-29"></li>
</ol>--> </ol>-->
</div> </div>
</div>'; </div>';

View File

@@ -1,7 +1,11 @@
<?php <?php
if(!is_array($parm))
{
$parm = array();
}
$parm['type'] = !empty($parm['type']) ? $parm['type'] : 'main'; $parm['type'] = !empty($parm['type']) ? $parm['type'] : 'side';
$parm['layout'] = !empty($parm['layout']) ? $parm['layout'] : $parm['type']; $parm['layout'] = !empty($parm['layout']) ? $parm['layout'] : $parm['type'];
require_once(e_CORE."shortcodes/single/navigation.php"); require_once(e_CORE."shortcodes/single/navigation.php");

View File

@@ -57,8 +57,8 @@ if(!$OTHERNEWS_STYLE)
} }
$template = e107::getTemplate('news', 'news_menu', 'other', true, true); $template = e107::getTemplate('news', 'news_menu', 'other', true, true);
$item_selector = '<div class="btn-group pull-right float-right"><a class="btn btn-mini btn-xs btn-default btn-secondary" href="#otherNews" data-slide="prev"></a> $item_selector = '<div class="btn-group pull-right float-right"><a class="btn btn-mini btn-xs btn-default btn-secondary" href="#otherNews" data-slide="prev" data-bs-slide="prev"></a>
<a class="btn btn-mini btn-xs btn-default btn-secondary" href="#otherNews" data-slide="next"></a></div>'; <a class="btn btn-mini btn-xs btn-default btn-secondary" href="#otherNews" data-slide="next" data-bs-slide="next"></a></div>';
if(!empty($parms['caption'])) if(!empty($parms['caption']))
{ {

View File

@@ -52,10 +52,10 @@ $NEWS_MENU_TEMPLATE['latest']['item'] = '<li><a class="e-menu-link newsmo
// Other News Menu. // Other News Menu.
$NEWS_MENU_TEMPLATE['other']['caption'] = TD_MENU_L1; $NEWS_MENU_TEMPLATE['other']['caption'] = TD_MENU_L1;
$NEWS_MENU_TEMPLATE['other']['start'] = "<div id='otherNews' data-interval='false' class='carousel slide othernews-block'> $NEWS_MENU_TEMPLATE['other']['start'] = "<div id='otherNews' data-interval='false' data-bs-interval='false' class='carousel slide othernews-block'>
<div class='carousel-inner'> <div class='carousel-inner'>
{SETIMAGE: w=400&h=200&crop=1}"; // set the {NEWSIMAGE} dimensions. {SETIMAGE: w=400&h=200&crop=1}"; // set the {NEWSIMAGE} dimensions.
$NEWS_MENU_TEMPLATE['other']['item'] = '<div class="item {ACTIVE}"> $NEWS_MENU_TEMPLATE['other']['item'] = '<div class="carousel-item item {ACTIVE}">
{NEWSTHUMBNAIL=placeholder} {NEWSTHUMBNAIL=placeholder}
<h3>{NEWSTITLE}</h3> <h3>{NEWSTITLE}</h3>
<p>{NEWSSUMMARY}</p> <p>{NEWSSUMMARY}</p>
@@ -96,7 +96,7 @@ $NEWS_MENU_TEMPLATE['other2']['end'] = "</ul>";
/* Carousel Menu */ /* Carousel Menu */
$NEWS_MENU_TEMPLATE['carousel']['start'] = ' $NEWS_MENU_TEMPLATE['carousel']['start'] = '
<div id="news-carousel" class="carousel slide" data-ride="carousel"> <div id="news-carousel" class="carousel slide" data-ride="carousel" data-bs-ride="carousel">
<div class="row"> <div class="row">
<!-- Wrapper for slides --> <!-- Wrapper for slides -->
<div id="news-carousel-images" class="col-md-8"> <div id="news-carousel-images" class="col-md-8">
@@ -116,7 +116,7 @@ $NEWS_MENU_TEMPLATE['carousel']['end'] = '
$NEWS_MENU_TEMPLATE['carousel']['item'] = '<!-- Start Item --> $NEWS_MENU_TEMPLATE['carousel']['item'] = '<!-- Start Item -->
<div class="item {ACTIVE}">{SETIMAGE: w=800&h=370&crop=1} <div class="carousel-item item {ACTIVE}">{SETIMAGE: w=800&h=370&crop=1}
{NEWS_IMAGE: class=img-responsive img-fluid} {NEWS_IMAGE: class=img-responsive img-fluid}
<div class="carousel-caption"> <div class="carousel-caption">
<small>{NEWS_DATE=dd MM, yyyy}</small> <small>{NEWS_DATE=dd MM, yyyy}</small>
@@ -127,7 +127,7 @@ $NEWS_MENU_TEMPLATE['carousel']['item'] = '<!-- Start Item -->
$NEWS_MENU_TEMPLATE['carousel']['nav'] = '<li data-target="#news-carousel" data-slide-to="{COUNT}" class="{ACTIVE}"><a href="#">{NEWS_SUMMARY}</a></li>'; $NEWS_MENU_TEMPLATE['carousel']['nav'] = '<li data-target="#news-carousel" data-slide-to="{COUNT}" data-bs-slide-to="{COUNT}" class="{ACTIVE}"><a href="#">{NEWS_SUMMARY}</a></li>';

View File

@@ -216,7 +216,7 @@ class newsfeedClass
$temp['newsfeed_image_link'] = !empty($newsfeed_image) ? "<img src='".$newsfeed_image."' alt='' />" : ''; $temp['newsfeed_image_link'] = !empty($newsfeed_image) ? "<img src='".$newsfeed_image."' alt='' />" : '';
} }
$serializedArray = e107::serialize($temp, false); $serializedArray = e107::serialize($temp, 'json');
$now = time(); $now = time();
$this->newsList[$feedID]['newsfeed_data'] = $serializedArray; $this->newsList[$feedID]['newsfeed_data'] = $serializedArray;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e107Plugin name="Newsfeeds" lan="LAN_PLUGIN_NEWSFEEDS_NAME" version="2.0" date="2012-08-01" compatibility="2.0" installRequired="true"> <e107Plugin name="Newsfeeds" lan="LAN_PLUGIN_NEWSFEEDS_NAME" version="2.1" date="2021-01-01" compatibility="2.0" installRequired="true">
<author name="e107 Inc." url="http://e107.org" email="jalist@e107.org" /> <author name="e107 Inc." url="http://e107.org" email="noreply@e107.org" />
<description lan="LAN_PLUGIN_NEWSFEEDS_DESCRIPTION">This plugin will retrieve rss feeds from other websites and display them according to your preferences.</description> <description lan="LAN_PLUGIN_NEWSFEEDS_DESCRIPTION">This plugin will retrieve rss feeds from other websites and display them according to your preferences.</description>
<category>content</category> <category>content</category>
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright> <copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>

View File

@@ -7,7 +7,7 @@
<link url='admin_config.php' description='LAN_CONFIGURE' icon='images/pvt_message_32.png' iconSmall='images/pvt_message_16.png' primary='true' /> <link url='admin_config.php' description='LAN_CONFIGURE' icon='images/pvt_message_32.png' iconSmall='images/pvt_message_16.png' primary='true' />
</adminLinks> </adminLinks>
<pluginPrefs> <pluginPrefs>
<pref name="title">LAN_PM</pref> <pref name="title">LAN_PLUGIN_PM_NAME</pref>
<pref name="animate">1</pref> <pref name="animate">1</pref>
<pref name="dropdown">0</pref> <pref name="dropdown">0</pref>
<pref name="read_timeout">0</pref> <pref name="read_timeout">0</pref>

View File

@@ -21,6 +21,8 @@ if(!check_class($pm_prefs['pm_class']))
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
if (!e107::isInstalled('pm')) { return ''; } if (!e107::isInstalled('pm')) { return ''; }
/** /**
* Function to show a popup (if enabled) when new PMs arrive. * Function to show a popup (if enabled) when new PMs arrive.
* *
@@ -58,7 +60,7 @@ if(!function_exists('pm_show_popup'))
</html> "; </html> ";
$popuptext = str_replace("\n", '', $popuptext); $popuptext = str_replace("\n", '', $popuptext);
$popuptext = str_replace("\t", '', $popuptext); $popuptext = str_replace("\t", '', $popuptext);
$text .= " $text = "
<script type='text/javascript'> <script type='text/javascript'>
winl=(screen.width-200)/2; winl=(screen.width-200)/2;
wint = (screen.height-100)/2; wint = (screen.height-100)/2;
@@ -147,4 +149,5 @@ if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php
//$ns->tablerender(LAN_PM, $txt, 'pm'); //$ns->tablerender(LAN_PM, $txt, 'pm');
$caption = varset($pm_prefs['title'], LAN_PM); $caption = varset($pm_prefs['title'], LAN_PM);
$caption = defset($caption, $caption);
$ns->tablerender($caption, $txt, 'pm'); $ns->tablerender($caption, $txt, 'pm');