本文整理汇总了PHP中RevSliderDB::escape方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderDB::escape方法的具体用法?PHP RevSliderDB::escape怎么用?PHP RevSliderDB::escape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderDB
的用法示例。
在下文中一共展示了RevSliderDB::escape方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isSlideByID
/**
* Check if Slide Exists with given ID
* @since: 5.0
*/
public static function isSlideByID($slideid)
{
$db = new RevSliderDB();
try {
if (strpos($slideid, 'static_') !== false) {
$sliderID = str_replace('static_', '', $slideid);
RevSliderFunctions::validateNumeric($sliderID, "Slider ID");
$sliderID = $db->escape($sliderID);
$record = $db->fetch(RevSliderGlobals::$table_static_slides, "slider_id={$sliderID}");
if (empty($record)) {
return false;
}
return true;
} else {
$slideid = $db->escape($slideid);
$record = $db->fetchSingle(RevSliderGlobals::$table_slides, "id={$slideid}");
if (empty($record)) {
return false;
}
return true;
}
} catch (Exception $e) {
return false;
}
}
示例2: updateAdvancedCssData
/**
* update captions advanced css
* @return: new captions html select
* @since: 5.0
*/
public function updateAdvancedCssData($data)
{
if (!isset($data['handle']) || !isset($data['styles']) || !isset($data['type'])) {
return false;
}
if ($data['type'] !== 'idle' && $data['type'] !== 'hover') {
return false;
}
$db = new RevSliderDB();
//get current styles
$styles = $db->fetchSingle(RevSliderGlobals::$table_css, '`handle` = "' . $db->escape($data['handle']) . '"');
if (!empty($styles)) {
if (!isset($styles['advanced'])) {
$styles['advanced'] = '';
}
$adv = json_decode(str_replace("'", '"', $styles['advanced']), true);
if (!isset($adv['idle'])) {
$adv['idle'] = array();
}
if (!isset($adv['hover'])) {
$adv['hover'] = array();
}
$adv[$data['type']] = $data['styles'];
$arrUpdate = array();
$arrUpdate['advanced'] = json_encode(str_replace("'", '"', $adv));
$result = $db->update(RevSliderGlobals::$table_css, $arrUpdate, array('handle' => $data['handle']));
//output captions array
$arrCaptions = RevSliderCssParser::get_captions_sorted();
return $arrCaptions;
} else {
return false;
}
}