本文整理汇总了PHP中RevSlider::initByDBData方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider::initByDBData方法的具体用法?PHP RevSlider::initByDBData怎么用?PHP RevSlider::initByDBData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlider
的用法示例。
在下文中一共展示了RevSlider::initByDBData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArrSliders
/**
*
* get sliders array - function don't belong to the object!
*/
public function getArrSliders($templates = false)
{
$where = "";
$response = $this->db->fetch(GlobalsRevSlider::$table_sliders, $where, "id");
$arrSliders = array();
foreach ($response as $arrData) {
$slider = new RevSlider();
$slider->initByDBData($arrData);
if ($templates) {
if ($slider->getParam("template", "false") == "false") {
continue;
}
} else {
if ($slider->getParam("template", "false") == "true") {
continue;
}
}
$arrSliders[] = $slider;
}
return $arrSliders;
}
示例2: foreach
$tmpl->write_template_markup($template);
}
}*/
if (!empty($tp_template_slider)) {
foreach ($tp_template_slider as $m_slider) {
if ($m_slider['cat'] != 'Premium') {
continue;
}
if (!empty($m_slider['filter']) && is_array($m_slider['filter'])) {
foreach ($m_slider['filter'] as $f => $v) {
$m_slider['filter'][$f] = 'temp_' . $v;
}
}
if (!isset($m_slider['installed']) && !isset($m_slider['is_new'])) {
$c_slider = new RevSlider();
$c_slider->initByDBData($m_slider);
$c_slides = $tmpl->getThemePunchTemplateSlides(array($m_slider));
$c_title = $c_slider->getTitle();
$width = $c_slider->getParam("width", 1240);
$height = $c_slider->getParam("height", 868);
if (!empty($c_slides)) {
?>
<div class="template_group_wrappers <?php
if (isset($m_slider['filter'])) {
echo implode(' ', $m_slider['filter']);
}
?>
">
<?php
echo '<div class="template_slider_title">';
if (isset($m_slider['preview']) && $m_slider['preview'] !== '') {
示例3: getArrSliders
/**
* get sliders array - function don't belong to the object!
*/
public function getArrSliders($orders = false, $templates = 'neither')
{
$order_fav = false;
if ($orders !== false && key($orders) != 'favorite') {
$order_direction = reset($orders);
$do_order = key($orders);
} else {
$do_order = 'id';
$order_direction = 'ASC';
if (is_array($orders) && key($orders) == 'favorite') {
$order_direction = reset($orders);
$order_fav = true;
}
}
$where = "`type` != 'template'";
$response = $this->db->fetch(RevSliderGlobals::$table_sliders, $where, $do_order, '', $order_direction);
$arrSliders = array();
foreach ($response as $arrData) {
$slider = new RevSlider();
$slider->initByDBData($arrData);
/*
This part needs to stay for backwards compatibility. It is used in the update process from v4x to v5x
*/
if ($templates === true) {
if ($slider->getParam("template", "false") == "false") {
continue;
}
} elseif ($templates === false) {
if ($slider->getParam("template", "false") == "true") {
continue;
}
}
$arrSliders[] = $slider;
}
if ($order_fav === true) {
$temp = array();
$temp_not = array();
foreach ($arrSliders as $key => $slider) {
if ($slider->isFavorite()) {
$temp_not[] = $slider;
} else {
$temp[] = $slider;
}
}
$arrSliders = array();
$arrSliders = $order_direction == 'ASC' ? array_merge($temp, $temp_not) : array_merge($temp_not, $temp);
}
return $arrSliders;
}
示例4: getArrSliders
/**
*
* get sliders array - function don't belong to the object!
*/
public function getArrSliders($templates = false, $orders = false)
{
$where = "";
if ($orders !== false) {
$order_direction = reset($orders);
$do_order = key($orders);
} else {
$do_order = 'id';
$order_direction = 'ASC';
}
$where = "";
$response = $this->db->fetch(GlobalsRevSlider::$table_sliders, $where, $do_order, '', $order_direction);
$arrSliders = array();
foreach ($response as $arrData) {
$slider = new RevSlider();
$slider->initByDBData($arrData);
if ($templates) {
if ($slider->getParam("template", "false") == "false") {
continue;
}
} else {
if ($slider->getParam("template", "false") == "true") {
continue;
}
}
$arrSliders[] = $slider;
}
return $arrSliders;
}
示例5: getArrSliders
/**
*
* get sliders array - function don't belong to the object!
*/
public function getArrSliders()
{
$where = "";
$response = $this->db->fetch(GlobalsRevSlider::$table_sliders, $where, "id");
$arrSliders = array();
foreach ($response as $arrData) {
$slider = new RevSlider();
$slider->initByDBData($arrData);
$arrSliders[] = $slider;
}
return $arrSliders;
}