1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-17 20:01:47 +02:00

Corrected incorrect MySQL row count when using PDO mode. Simple bootstrap 'carousel' mode added to welcome message preferences. For advanced options use the featurebox plugin.

This commit is contained in:
Cameron
2015-07-25 18:14:44 -07:00
parent f6f5b6b4c8
commit a917375e7c
3 changed files with 35 additions and 8 deletions

View File

@@ -62,12 +62,14 @@ function wmessage_shortcode($parm='')
SELECT * FROM #generic
WHERE gen_type ='wmessage' AND gen_intdata IN (".USERCLASS_LIST.')';
$wmessage = array();
$wmessageCaption = array();
$wmcaption = '';
if($sql->gen($qry))
{
while ($row = $sql->fetch())
{
$wmessage[] = $tp->toHTML($row['gen_chardata'], TRUE, 'BODY, defs', 'admin');
$wmessageCaption[] = $tp->toHTML($row['gen_ip'], TRUE, 'TITLE');
if(!$wmcaption)
{
$wmcaption = $tp->toHTML($row['gen_ip'], TRUE, 'TITLE');
@@ -75,10 +77,21 @@ function wmessage_shortcode($parm='')
}
}
if (isset($wmessage) && $wmessage)
{
ob_start();
if (vartrue($pref['wm_enclose']))
if(intval($pref['wm_enclose']) === 2) // carousel
{
$carousel= array();
foreach($wmessage as $k=>$v)
{
$carousel['slide-'.$k] = array('caption'=>$wmessageCaption[$k], 'text'=>$ns->tablerender($wmessageCaption[$k],$v, 'wm',true));
}
echo e107::getForm()->carousel('wmessage-carousel',$carousel);
}
elseif(intval($pref['wm_enclose']) === 1)
{
$ns->tablerender($wmcaption, implode("<br />",$wmessage), 'wm');
}