mirror of
https://github.com/e107inc/e107.git
synced 2025-08-30 01:30:32 +02:00
Bootstrap3 styling fixes and embedded featurebox layout added.
This commit is contained in:
@@ -28,9 +28,16 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
|
||||
* @param string $mod category template
|
||||
* @example {FEATUREBOX=cols=2|tabs}
|
||||
*/
|
||||
function sc_featurebox($parm, $mod = '')
|
||||
function sc_featurebox($parm=null, $mod = '')
|
||||
{
|
||||
|
||||
if($parm == null && $mod == '') // ie {FEATUREBOX}
|
||||
{
|
||||
$type = vartrue(e107::getPlugPref('featurebox','menu_category'),'bootstrap_carousel');
|
||||
$text = e107::getParser()->parseTemplate("{FEATUREBOX|".$type."}");
|
||||
return $text;
|
||||
}
|
||||
|
||||
// TODO cache
|
||||
if(!e107::isInstalled('featurebox')) //just in case
|
||||
{
|
||||
|
@@ -40,35 +40,36 @@ class featurebox_setup
|
||||
$count = 0;
|
||||
foreach($e107_featurebox_category as $insert)
|
||||
{
|
||||
$count = e107::getDb()->db_Insert('featurebox_category', $insert) ? $count + 1 : $count;
|
||||
$count = e107::getDb()->insert('featurebox_category', $insert) ? $count + 1 : $count;
|
||||
}
|
||||
|
||||
|
||||
$status = ($count == 3) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
|
||||
$mes->add(FBLAN_INSTALL_01, $status);
|
||||
|
||||
if($status)
|
||||
{
|
||||
$query = array();
|
||||
$query['fb_id'] = 0;
|
||||
$query['fb_category'] = $inserted;
|
||||
$query['fb_title'] = 'Default Title';
|
||||
$query['fb_text'] = 'Default Message';
|
||||
$query['fb_mode'] = 0;
|
||||
$query['fb_class'] = e_UC_PUBLIC;
|
||||
$query['fb_rendertype'] = 0;
|
||||
$query['fb_template'] = 'bootstrap_carousel';
|
||||
$query['fb_order'] = 0;
|
||||
$query['fb_image'] = '';
|
||||
$query['fb_imageurl'] = '';
|
||||
$e107_featurebox = array(
|
||||
array('fb_id'=>'4','fb_title'=>'Slide 1','fb_text'=>'Default Message - this is the default','fb_mode'=>'0','fb_class'=>'0','fb_rendertype'=>'0','fb_template'=>'bootstrap_carousel_default','fb_order'=>'3','fb_image'=>'','fb_imageurl'=>'','fb_category'=>'1'),
|
||||
array('fb_id'=>'6','fb_title'=>'Slide 2','fb_text'=>'Suspendisse ac dui purus. Cras eleifend, velit sed dapibus pharetra, elit dolor mattis tellus, ac luctus nisi massa at ligula. Ut sagittis, neque consequat elementum convallis, lorem nulla molestie arcu, eu rutrum velit quam at metus! Nullam eu eleifend magna. Praesent eget leo felis, vel euismod nibh. Morbi sem eros, pellentesque eu scelerisque id, pretium id enim. Mauris aliquet molestie dui vel ultricies. Etiam consequat quam sed tellus facilisis sollicitudin. Vivamus malesuada iaculis metus.
|
||||
','fb_mode'=>'0','fb_class'=>'0','fb_rendertype'=>'0','fb_template'=>'bootstrap_carousel_left','fb_order'=>'4','fb_image'=>'','fb_imageurl'=>'','fb_category'=>'1'),
|
||||
array('fb_id'=>'10','fb_title'=>'Slide 3','fb_text'=>'Suspendisse ac dui purus. Cras eleifend, velit sed dapibus pharetra, elit dolor mattis tellus, ac luctus nisi massa at ligula. Ut sagittis, neque consequat elementum convallis, lorem nulla molestie arcu, eu rutrum velit quam at metus! Nullam eu eleifend magna. Praesent eget leo felis, vel euismod nibh. Morbi sem eros, pellentesque eu scelerisque id, pretium id enim. Mauris aliquet molestie dui vel ultricies. Etiam consequat quam sed tellus facilisis sollicitudin. Vivamus malesuada iaculis metus.
|
||||
','fb_mode'=>'0','fb_class'=>'0','fb_rendertype'=>'0','fb_template'=>'bootstrap_carousel_right','fb_order'=>'4','fb_image'=>'','fb_imageurl'=>'','fb_category'=>'1')
|
||||
);
|
||||
|
||||
$status = e107::getDb('sql2')->db_Insert('featurebox', $query) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
foreach($e107_featurebox as $qry)
|
||||
{
|
||||
$status = e107::getDb('sql2')->insert('featurebox', $qry) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
}
|
||||
$mes->add(FBLAN_INSTALL_02, $status);
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = E_MESSAGE_ERROR;
|
||||
$mes->add(FBLAN_INSTALL_02, $status);
|
||||
}
|
||||
$mes->add(FBLAN_INSTALL_02, $status);
|
||||
|
||||
}
|
||||
/*
|
||||
function uninstall_options()
|
||||
|
@@ -120,27 +120,29 @@ class plugin_featurebox_item extends e_model
|
||||
*/
|
||||
public function sc_featurebox_image($parm = '')
|
||||
{
|
||||
if(!$this->get('fb_image'))
|
||||
if(!$this->get('fb_image') && $parm != 'placeholder')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
parse_str($parm, $parm);
|
||||
$tp = e107::getParser();
|
||||
|
||||
$imageSrc = ($parm != 'placeholder') ? $this->get('fb_image') : "";
|
||||
|
||||
if($tp->thumbWidth > 100 || $tp->thumbHeight > 100) //Guessing it's a featurebox image. Use {SETIMAGE} inside theme.php to configure.
|
||||
{
|
||||
$src = $tp->thumbUrl($this->get('fb_image')); //XXX TODO TBD Add a pref to use without resizing? Or, detect {SETIMAGE} in template to enable?
|
||||
$src = $tp->thumbUrl($imageSrc); //XXX TODO TBD Add a pref to use without resizing? Or, detect {SETIMAGE} in template to enable?
|
||||
}
|
||||
else
|
||||
{
|
||||
$src = $tp->replaceConstants($this->get('fb_image'), 'full');
|
||||
$src = $tp->replaceConstants($imageSrc, 'full');
|
||||
}
|
||||
|
||||
if(isset($parm['src']))
|
||||
{
|
||||
return $src;
|
||||
}
|
||||
$tag = '<img id="featurebox-image-'.$this->getId().'" src="'.$src.'" alt="'.$tp->toAttribute($this->get('fb_title')).'" class="featurebox" />';
|
||||
$tag = '<img id="featurebox-image-'.$this->getId().'" src="'.$src.'" alt="'.$tp->toAttribute($this->get('fb_title')).'" class="featurebox img-responsive" />';
|
||||
if(isset($parm['nourl']) || !$this->get('fb_imageurl'))
|
||||
{
|
||||
return $tag;
|
||||
|
@@ -11,12 +11,24 @@ global $sc_style;
|
||||
|
||||
// e107 v2.x Defaults.
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_default'] = '{SETIMAGE: w=1900&h=500&crop=1}
|
||||
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
<div class="container">
|
||||
<div class="carousel-caption">
|
||||
<h1>{FEATUREBOX_TITLE}</h1>
|
||||
<p>{FEATUREBOX_TEXT}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
|
||||
<!-- slide -->
|
||||
<!-- slide --> {SETIMAGE: w=600&h=500&crop=1}
|
||||
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
|
||||
<div class="media">
|
||||
<div class="media container">
|
||||
<div class="media-object featurebox-item-image pull-left ">
|
||||
{FEATUREBOX_IMAGE}
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
</div>
|
||||
<div class="media-body featurebox-item-text span4">
|
||||
<h1>
|
||||
@@ -31,27 +43,32 @@ $FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
|
||||
';
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_right'] = '
|
||||
{SETIMAGE: w=600&h=500&crop=1}
|
||||
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
|
||||
<div class="media">
|
||||
<div class="featurebox-item-text media-body animated fadeInUpBig">
|
||||
<div class="media container">
|
||||
<div class="featurebox-item-image media-object pull-right span6 animated fadeInDownBig">
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
</div>
|
||||
<div class="featurebox-item-text media-body animated fadeInUpBig">
|
||||
<h1>{FEATUREBOX_TITLE}</h1>
|
||||
{FEATUREBOX_TEXT}
|
||||
</div>
|
||||
<div class="featurebox-item-image media-object span6 animated fadeInDownBig">
|
||||
{FEATUREBOX_IMAGE}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_image'] = '
|
||||
<div class="item slide3 animated fadeInUpBig">
|
||||
{FEATUREBOX_IMAGE}
|
||||
</div>
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_image'] = '{SETIMAGE: w=1900&h=500&crop=1}
|
||||
|
||||
<div class="item">
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ----------------------------
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user