本文整理匯總了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;
}
}