本文整理汇总了PHP中UniteFunctionsWPRev类的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsWPRev类的具体用法?PHP UniteFunctionsWPRev怎么用?PHP UniteFunctionsWPRev使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UniteFunctionsWPRev类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: yit_revslider_slider
function yit_revslider_slider()
{
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");
$isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) {
return;
}
wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION);
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $custom_css);
$setBase = (is_ssl()) ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
wp_enqueue_script("jquery", $url_jquery);
// put javascript to footer
add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
开发者ID:simonsays88,项目名称:costa,代码行数:28,代码来源:config.php
示例2: rev_uploader
private function rev_uploader()
{
$key = Tools::getValue('security_key');
if (empty($key) || Tools::encrypt(GlobalsRevSlider::MODULE_NAME) != $key) {
echo json_encode(array('error_on' => 1, 'error_details' => 'Security Error'));
die;
}
$targetFolder = ABSPATH . '/uploads/';
$randnum = rand(00, 9999999);
$sds_time = time();
$NewFileName = $randnum . '-' . $sds_time;
//$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
//$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetPath = $targetFolder;
//$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type
$fileTypes = array('jpg', 'jpeg', 'gif', 'png');
// File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'], $fileTypes)) {
// $worked = UniteFunctionsWPRev::import_media_img($tempFile, $targetPath, $randnum.$_FILES['Filedata']['name']);
$worked = UniteFunctionsWPRev::import_media_img($tempFile, $targetPath, $NewFileName . '.' . $fileParts['extension']);
if (!empty($worked)) {
echo '1';
}
} else {
echo '0';
}
}
}
开发者ID:evgrishin,项目名称:se1614,代码行数:32,代码来源:revolutionslider_ajax.php
示例3: onAddScripts
/**
*
* a must function. you can not use it, but the function must stay there!.
*
*/
public static function onAddScripts()
{
global $wp_version;
$style_pre = '';
$style_post = '';
if ($wp_version < 3.7) {
$style_pre = '<style type="text/css">';
$style_post = '</style>';
}
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
$includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
$strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
/*
*/
/*
$styles = $db->fetch(GlobalsRevSlider::$table_css);
$styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
$styles = UniteCssParserRev::compress_css($styles);
wp_add_inline_style( 'rs-plugin-settings', $style_pre.$styles.$style_post );
// KRISZTIAN MODIFICATION FOR INNERLAYERS
$stylesinnerlayers = str_replace('.tp-caption', '',$styles);´
wp_add_inline_style( 'rs-plugin-settings', $style_pre.$stylesinnerlayers.$style_post );
// END MODIFICATION
*/
$setBase = is_ssl() ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
self::addScriptAbsoluteUrl($url_jquery, "jquery");
if ($includesFooter == "off") {
$waitfor = array('jquery');
$enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
if ($enable_logs == 'on') {
self::addScriptWaitFor("jquery.themepunch.enablelog", "rs-plugin/js", 'enable-logs');
$waitfor[] = 'enable-logs';
}
self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
} else {
//put javascript to footer
UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
}
}
开发者ID:epiii,项目名称:aros,代码行数:63,代码来源:revslider_front.php
示例4: drawImageInput
/**
*
* draw imaeg input:
* @param $setting
*/
protected function drawImageInput($setting)
{
$class = UniteFunctionsRev::getVal($setting, "class");
if (!empty($class)) {
$class = "class='{$class}'";
}
$settingsID = $setting["id"];
$buttonID = $settingsID . "_button";
$buttonRemoveID = $settingsID . "_button_remove";
$spanPreviewID = $buttonID . "_preview";
$img = "";
$value = UniteFunctionsRev::getVal($setting, "value");
if (!empty($value)) {
$urlImage = $value;
$imagePath = UniteFunctionsWPRev::getImageRealPathFromUrl($urlImage);
$img = '<div style="width:100px;height:70px;background:url(' . $urlImage . '); background-position:center center; background-size:cover;"></div>';
}
?>
<span id='<?php
echo $spanPreviewID;
?>
' class='setting-image-preview'><?php
echo $img;
?>
</span>
<input type="hidden" id="<?php
echo $setting["id"];
?>
" name="<?php
echo $setting["name"];
?>
" value="<?php
echo $setting["value"];
?>
" />
<input type="button" id="<?php
echo $buttonID;
?>
" style="width: 110px !important; float: left;" class='button-image-select button-primary revblue<?php
echo $class;
?>
' value="<?php
_e('Choose Image', REVSLIDER_TEXTDOMAIN);
?>
"></input>
<input type="button" class="button-image-remove button-primary revred" style="width: 110px !important;" id="<?php
echo $buttonRemoveID;
?>
" value="<?php
_e('Remove', REVSLIDER_TEXTDOMAIN);
?>
" />
<div class="clear"></div>
<?php
}
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:63,代码来源:settings_product.class.php
示例5: drawImageInput
/**
*
* draw imaeg input:
* @param $setting
*/
protected function drawImageInput($setting)
{
$class = UniteFunctionsRev::getVal($setting, "class");
if (!empty($class)) {
$class = "class='{$class}'";
}
$settingsID = $setting["id"];
$buttonID = $settingsID . "_button";
$spanPreviewID = $buttonID . "_preview";
$img = "";
$value = UniteFunctionsRev::getVal($setting, "value");
if (!empty($value)) {
$urlImage = $value;
$imagePath = UniteFunctionsWPRev::getImageRealPathFromUrl($urlImage);
if (file_exists($realPath)) {
$filepath = UniteFunctionsWPRev::getImagePathFromURL($urlImage);
$urlImage = UniteBaseClassRev::getImageUrl($filepath, 100, 70, true);
}
$img = "<img width='100' height='70' src='{$urlImage}'></img>";
}
?>
<span id='<?php
echo $spanPreviewID;
?>
' class='setting-image-preview'><?php
echo $img;
?>
</span>
<input type="hidden" id="<?php
echo $setting["id"];
?>
" name="<?php
echo $setting["name"];
?>
" value="<?php
echo $setting["value"];
?>
" />
<input type="button" id="<?php
echo $buttonID;
?>
" class='button-image-select <?php
echo $class;
?>
' value="Choose Image"></input>
<?php
}
开发者ID:venkimithu,项目名称:npmgroups,代码行数:55,代码来源:settings_product.class.php
示例6: onAddScripts
public static function onAddScripts()
{
global $wp_version;
$style_pre = '';
$style_post = '';
if ($wp_version < 3.7) {
$style_pre = '<style type="text/css">';
$style_post = '</style>';
}
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
$includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
$strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
$setBase = get_http();
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
self::addScriptAbsoluteUrl($url_jquery, "jquery");
if ($includesFooter == "off") {
$waitfor = array('jquery');
$enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
if ($enable_logs == 'on') {
self::addScriptWaitFor("jquery.themepunch.enablelog", "rs-plugin/js", 'enable-logs');
$waitfor[] = 'enable-logs';
}
self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
} else {
UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
}
}
开发者ID:rinodung,项目名称:opencart-15x-flat-admin,代码行数:42,代码来源:revslider_front.php
示例7: onAddScripts
/**
*
* a must function. you can not use it, but the function must stay there!.
*
*/
public static function onAddScripts()
{
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
$includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
$strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
//check if dynamic-captions.css exists. If not, include captions.php
if (file_exists(self::$path_plugin . "rs-plugin/css/dynamic-captions.css") == false) {
self::addDynamicStyle("captions", "rs-plugin-captions", "rs-plugin/css");
} else {
$db = new UniteDBRev();
$styles = $db->fetch(GlobalsRevSlider::$table_css);
$styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
wp_add_inline_style('rs-plugin-settings', $styles);
//self::addStyle("dynamic-captions","rs-captions","rs-plugin/css");
}
$custom_css = RevOperations::getStaticCss();
wp_add_inline_style('rs-plugin-settings', $custom_css);
//self::addStyle("static-captions","rs-plugin-static","rs-plugin/css");
$setBase = is_ssl() ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
self::addScriptAbsoluteUrl($url_jquery, "jquery");
if ($includesFooter == "off") {
self::addScriptWaitFor("jquery.themepunch.plugins.min", "rs-plugin/js", 'themepunchtools', 'jquery');
self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'jquery');
} else {
//put javascript to footer
UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
}
}
开发者ID:donpapa26,项目名称:bakancslistad,代码行数:47,代码来源:revslider_front.php
示例8: yit_revslider_slider
function yit_revslider_slider()
{
if ( ! class_exists('RevOperations') ) {
return;
}
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");
$isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ( YIT_Layout()->slider_name===false
|| (YIT_Layout()->slider_name != 'none' && YIT_Slider::get_slider( YIT_Layout()->slider_name )->config->layout != 'revolution-slider')
|| $includesGlobally == "on"
|| $isWidgetActive
|| $hasShortcode ) {
return;
}
if ( defined( 'RS_PLUGIN_URL' ) ) {
wp_enqueue_style( 'rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION );
}
else {
wp_enqueue_style( "rs-plugin-settings", UniteBaseClassRev::$url_plugin . "rs-plugin/css/settings.css", array(), GlobalsRevSlider::SLIDER_REVISION );
}
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $custom_css);
$setBase = (is_ssl()) ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
wp_enqueue_script("jquery", $url_jquery);
// put javascript to footer
add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
开发者ID:jabue,项目名称:wordpress,代码行数:41,代码来源:config.php
示例9: onAddScripts
public static function onAddScripts()
{
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
$includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
$strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
//self::addStyle("settings","rs-settings","rs-plugin/css");
//check if dynamic-captions.css exists. If not, include captions.php
//if(file_exists(self::$path_plugin."rs-plugin/css/dynamic-captions.css") == false){
//self::addDynamicStyle("captions","rs-plugin-captions","rs-plugin/css");
// $captionsAction = Context::getContext()->link->getAdminLink('Revolutionslider_ajax').'&revControllerAction=captions';
//
// wp_enqueue_style ('captions', $captionsAction);
// }
//else
//self::addStyle("dynamic-captions","rs-captions","rs-plugin/css");
//self::addStyle("static-captions","rs-plugin-static","rs-plugin/css");
// $setBase = (is_ssl()) ? "https://" : "http://";
// $url_jquery = $setBase."ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
// self::addScriptAbsoluteUrl($url_jquery, "jquery");
// if($includesFooter == "off"){
// self::addScript("jquery.themepunch.tools.min","rs-plugin/js",'themepunchtools');
// self::addScript("jquery.themepunch.revolution.min","rs-plugin/js");
//self::addScriptWaitFor("jquery.themepunch.tools.min","rs-plugin/js",'themepunchtools', array('jquery'));
//self::addScriptWaitFor("jquery.themepunch.revolution.min","rs-plugin/js", null, array('jquery'));
// }else{
//put javascript to footer
// UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
// }
}
开发者ID:evgrishin,项目名称:se1614,代码行数:41,代码来源:revslider_front.php
示例10: onAddScripts
/**
*
* a must function. you can not use it, but the function must stay there!.
*
*/
public static function onAddScripts()
{
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
$strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
self::addStyle("settings", "rs-settings", "rs-plugin/css");
self::addStyle("captions", "rs-captions", "rs-plugin/css");
$url_jquery = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
self::addScriptAbsoluteUrl($url_jquery, "jquery");
self::addScript("jquery.themepunch.revolution.min", "rs-plugin/js");
}
开发者ID:kivivuori,项目名称:jotain,代码行数:27,代码来源:revslider_front.php
示例11: onAddScripts
/**
*
* a must function. you can not use it, but the function must stay there!.
*
*/
public static function onAddScripts()
{
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
$includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
$strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $custom_css);
$setBase = is_ssl() ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
self::addScriptAbsoluteUrl($url_jquery, "jquery");
if ($includesFooter == "off") {
$use_hammer = UniteFunctionsRev::getVal($arrValues, "use_hammer_js", 'on');
$waitfor = array('jquery');
if ($use_hammer == 'off') {
self::addScriptWaitFor("jquery.themepunch.disablehammer", "rs-plugin/js", 'disable-hammer');
$waitfor[] = 'disable-hammer';
}
self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
} else {
//put javascript to footer
UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
}
}
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:43,代码来源:revslider_front.php
示例12: createTable
/**
*
* craete tables
*/
public static function createTable($tableName)
{
//if table exists - don't create it.
$tableRealName = self::$table_prefix . $tableName;
if (UniteFunctionsWPRev::isDBTableExists($tableRealName)) {
return false;
}
switch ($tableName) {
case GlobalsRevSlider::TABLE_SLIDERS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\n\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t title tinytext NOT NULL,\r\n\t\t\t\t\t\t\t alias tinytext,\r\n\t\t\t\t\t\t\t params text NOT NULL,\r\n\t\t\t\t\t\t\t PRIMARY KEY (id)\r\n\t\t\t\t\t\t\t);";
break;
case GlobalsRevSlider::TABLE_SLIDES_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t slider_id int(9) NOT NULL,\r\n\t\t\t\t\t\t\t\t slide_order int not NULL,\t\t \r\n\t\t\t\t\t\t\t\t params text NOT NULL,\r\n\t\t\t\t\t\t\t\t layers text NOT NULL,\r\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\r\n\t\t\t\t\t\t\t\t);";
break;
default:
UniteFunctionsRev::throwError("table: {$tableName} not found");
break;
}
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta($sql);
}
开发者ID:nimishavyas,项目名称:proiti,代码行数:25,代码来源:revslider_admin.php
示例13: createTable
/**
*
* craete tables
*/
public static function createTable($tableName)
{
global $wpdb;
$parseCssToDb = false;
$checkForTablesOneTime = get_option('revslider_checktables', '0');
if ($checkForTablesOneTime == '0') {
update_option('revslider_checktables', '1');
if (UniteFunctionsWPRev::isDBTableExists(self::$table_prefix . GlobalsRevSlider::TABLE_CSS_NAME)) {
//check if database is empty
$result = $wpdb->get_row("SELECT COUNT( DISTINCT id ) AS NumberOfEntrys FROM " . self::$table_prefix . GlobalsRevSlider::TABLE_CSS_NAME);
if ($result->NumberOfEntrys == 0) {
$parseCssToDb = true;
}
}
}
if ($parseCssToDb) {
$revOperations = new RevOperations();
$revOperations->importCaptionsCssContentArray();
$revOperations->moveOldCaptionsCss();
//$revOperations->updateDynamicCaptions(true);
}
//if table exists - don't create it.
$tableRealName = self::$table_prefix . $tableName;
if (UniteFunctionsWPRev::isDBTableExists($tableRealName)) {
return false;
}
$charset_collate = '';
if (method_exists($wpdb, "get_charset_collate")) {
$charset_collate = $wpdb->get_charset_collate();
} else {
if (!empty($wpdb->charset)) {
$charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
}
if (!empty($wpdb->collate)) {
$charset_collate .= " COLLATE {$wpdb->collate}";
}
}
switch ($tableName) {
case GlobalsRevSlider::TABLE_SLIDERS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t title tinytext NOT NULL,\n\t\t\t\t\t\t\t alias tinytext,\n\t\t\t\t\t\t\t params text NOT NULL,\n\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_SLIDES_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t slider_id int(9) NOT NULL,\n\t\t\t\t\t\t\t\t slide_order int not NULL,\t\n\t\t\t\t\t\t\t\t params text NOT NULL,\n\t\t\t\t\t\t\t\t layers text NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_STATIC_SLIDES_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t slider_id int(9) NOT NULL,\n\t\t\t\t\t\t\t\t params text NOT NULL,\n\t\t\t\t\t\t\t\t layers text NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_SETTINGS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t general TEXT NOT NULL,\n\t\t\t\t\t\t\t\t params TEXT NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_CSS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t handle TEXT NOT NULL,\n\t\t\t\t\t\t\t\t settings TEXT,\n\t\t\t\t\t\t\t\t hover TEXT,\n\t\t\t\t\t\t\t\t params TEXT NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
$parseCssToDb = true;
break;
case GlobalsRevSlider::TABLE_LAYER_ANIMS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t handle TEXT NOT NULL,\n\t\t\t\t\t\t\t\t params TEXT NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
default:
UniteFunctionsRev::throwError("table: {$tableName} not found");
break;
}
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta($sql);
if ($parseCssToDb) {
$revOperations = new RevOperations();
$revOperations->importCaptionsCssContentArray();
$revOperations->moveOldCaptionsCss();
//$revOperations->updateDynamicCaptions(true);
}
}
开发者ID:Alderx,项目名称:publioriente,代码行数:74,代码来源:revslider_admin.php
示例14: putSliderBase
public function putSliderBase($sliderID)
{
try {
self::$sliderSerial++;
$this->slider = new RevSlider();
$this->slider->initByMixed($sliderID);
//modify settings for admin preview mode
if ($this->previewMode == true) {
$this->modifyPreviewModeSettings();
}
//set slider language
$isWpmlExists = UniteWpmlRev::isWpmlExists();
$useWpml = $this->slider->getParam("use_wpml", "off");
if ($isWpmlExists && $useWpml == "on") {
if ($this->previewMode == false) {
$this->sliderLang = UniteFunctionsWPRev::getCurrentLangCode();
}
}
//edit html before slider
$htmlBeforeSlider = "";
if ($this->slider->getParam("load_googlefont", "false") == "true") {
$googleFont = $this->slider->getParam("google_font");
$htmlBeforeSlider = "<link rel='stylesheet' id='rev-google-font' href='http://fonts.googleapis.com/css?family={$googleFont}' type='text/css' media='all' />";
}
//pub js to body handle
if ($this->slider->getParam("js_to_body", "false") == "true") {
$urlIncludeJS = UniteBaseClassRev::$url_plugin . "rs-plugin/js/jquery.themepunch.revolution.min.js";
$htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJS}'></script>";
}
//the initial id can be alias
$sliderID = $this->slider->getID();
$bannerWidth = $this->slider->getParam("width", null, RevSlider::VALIDATE_NUMERIC, "Slider Width");
$bannerHeight = $this->slider->getParam("height", null, RevSlider::VALIDATE_NUMERIC, "Slider Height");
$sliderType = $this->slider->getParam("slider_type");
//set wrapper height
$wrapperHeigh = 0;
$wrapperHeigh += $this->slider->getParam("height");
//add thumb height
if ($this->slider->getParam("navigaion_type") == "thumb") {
$wrapperHeigh += $this->slider->getParam("thumb_height");
}
$this->sliderHtmlID = "rev_slider_" . $sliderID . "_" . self::$sliderSerial;
$this->sliderHtmlID_wrapper = $this->sliderHtmlID . "_wrapper";
$containerStyle = "";
$sliderPosition = $this->slider->getParam("position", "center");
//set position:
if ($sliderType != "fullscreen") {
switch ($sliderPosition) {
case "center":
default:
$containerStyle .= "margin:0px auto;";
break;
case "left":
$containerStyle .= "float:left;";
break;
case "right":
$containerStyle .= "float:right;";
break;
}
}
//add background color
$backgrondColor = trim($this->slider->getParam("background_color"));
if (!empty($backgrondColor)) {
$containerStyle .= "background-color:{$backgrondColor};";
}
//set padding
$containerStyle .= "padding:" . $this->slider->getParam("padding", "0") . "px;";
//set margin:
if ($sliderType != "fullscreen") {
if ($sliderPosition != "center") {
$containerStyle .= "margin-left:" . $this->slider->getParam("margin_left", "0") . "px;";
$containerStyle .= "margin-right:" . $this->slider->getParam("margin_right", "0") . "px;";
}
$containerStyle .= "margin-top:" . $this->slider->getParam("margin_top", "0") . "px;";
$containerStyle .= "margin-bottom:" . $this->slider->getParam("margin_bottom", "0") . "px;";
}
//set height and width:
$bannerStyle = "display:none;";
//add background image (to banner style)
$showBackgroundImage = $this->slider->getParam("show_background_image", "false");
if ($showBackgroundImage == "true") {
$backgroundImage = $this->slider->getParam("background_image");
if (!empty($backgroundImage)) {
$bannerStyle .= "background-image:url({$backgroundImage});background-repeat:no-repeat;";
}
}
//set wrapper and slider class:
$sliderWrapperClass = "rev_slider_wrapper";
$sliderClass = "rev_slider";
$putResponsiveStyles = false;
switch ($sliderType) {
default:
case "fixed":
$bannerStyle .= "height:{$bannerHeight}px;width:{$bannerWidth}px;";
$containerStyle .= "height:{$bannerHeight}px;width:{$bannerWidth}px;";
break;
case "responsitive":
$putResponsiveStyles = true;
break;
case "fullwidth":
//.........这里部分代码省略.........
开发者ID:scoutrul,项目名称:sys,代码行数:101,代码来源:revslider_output.class.php
示例15: putSliderBase
/**
*
* put html slider on the html page.
* @param $data - mixed, can be ID ot Alias.
*/
public function putSliderBase($sliderID)
{
try {
self::$sliderSerial++;
$this->slider = new RevSlider();
$this->slider->initByMixed($sliderID);
// Do not output Slider if we are on mobile
$disable_on_mobile = $this->slider->getParam("disable_on_mobile", "off");
$isMobile = strstr($_SERVER['HTTP_USER_AGENT'], 'Android') || strstr($_SERVER['HTTP_USER_AGENT'], 'webOS') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad') ? true : false;
if ($disable_on_mobile == 'on' && $isMobile) {
return false;
}
$show_alternate = $this->slider->getParam("show_alternative_type", "off");
if ($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8') {
if ($isMobile) {
$show_alternate_image = $this->slider->getParam("show_alternate_image", "");
echo '<img class="tp-slider-alternative-image" src="' . $show_alternate_image . '">';
return false;
}
}
$doWrapFromTemplate = false;
if ($this->slider->isSlidesFromPosts() && $this->slider->getParam("slider_template_id", false) !== false) {
//need to use general settings from the Template Slider
$this->slider->initByMixed($this->slider->getParam("slider_template_id", false));
$doWrapFromTemplate = $sliderID;
}
//modify settings for admin preview mode
if ($this->previewMode == true) {
$this->modifyPreviewModeSettings();
}
//set slider language
$isWpmlExists = UniteWpmlRev::isWpmlExists();
$useWpml = $this->slider->getParam("use_wpml", "off");
if ($isWpmlExists && $useWpml == "on") {
if ($this->previewMode == false) {
$this->sliderLang = UniteFunctionsWPRev::getCurrentLangCode();
}
}
//edit html before slider
$htmlBeforeSlider = "";
if ($this->slider->getParam("load_googlefont", "false") == "true") {
$googleFont = $this->slider->getParam("google_font");
if (is_array($googleFont)) {
foreach ($googleFont as $key => $font) {
$htmlBeforeSlider .= RevOperations::getCleanFontImport($font);
}
} else {
$htmlBeforeSlider .= RevOperations::getCleanFontImport($googleFont);
}
}
//pub js to body handle
if ($this->jsToBody == true) {
//$operations = new RevOperations();
//$arrValues = $operations->getGeneralSettingsValues();
$urlIncludeJSTools = GlobalsRevSlider::$url_item_plugin . "js/jquery.themepunch.tools.min.js?rev=" . GlobalsRevSlider::SLIDER_REVISION;
$htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJSTools}'></script>\n";
//$enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs",'off');
$enable_logs = "off";
if ($enable_logs == 'on') {
$urlIncludeJS = UniteBaseClassRev::$url_plugin . "rs-plugin/js/jquery.themepunch.enablelog.js?rev=" . GlobalsRevSlider::SLIDER_REVISION;
$htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJS}'></script>";
}
$useHammer = 'on';
if ($useHammer == 'off') {
$urlIncludeJS = GlobalsRevSlider::$url_item_plugin . "js/jquery.themepunch.disablehammer.js?rev=" . GlobalsRevSlider::SLIDER_REVISION;
$htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJS}'></script>\n";
}
$urlIncludeJS = GlobalsRevSlider::$url_item_plugin . "js/jquery.themepunch.revolution.min.js?rev=" . GlobalsRevSlider::SLIDER_REVISION;
$htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJS}'></script>\n";
}
//the initial id can be alias
$sliderID = $this->slider->getID();
$bannerWidth = $this->slider->getParam("width", null, RevSlider::VALIDATE_NUMERIC, "Slider Width");
$bannerHeight = $this->slider->getParam("height", null, RevSlider::VALIDATE_NUMERIC, "Slider Height");
$sliderType = $this->slider->getParam("slider_type");
//set wrapper height
$wrapperHeigh = 0;
$wrapperHeigh += $this->slider->getParam("height");
//add thumb height
if ($this->slider->getParam("navigaion_type") == "thumb") {
$wrapperHeigh += $this->slider->getParam("thumb_height");
}
$this->sliderHtmlID = "rev_slider_" . $sliderID . "_" . self::$sliderSerial;
$this->sliderHtmlID_wrapper = $this->sliderHtmlID . "_wrapper";
$containerStyle = "";
$sliderPosition = $this->slider->getParam("position", "center");
//set position:
if ($sliderType != "fullscreen") {
switch ($sliderPosition) {
case "center":
default:
$containerStyle .= "margin:0px auto;";
break;
case "left":
$containerStyle .= "float:left;";
//.........这里部分代码省略.........
开发者ID:jhener79,项目名称:vlakc,代码行数:101,代码来源:revslider_output.class.php
示例16: getPostTypesWithCatsForClient
/**
*
* get post types with categories for client side.
*/
public static function getPostTypesWithCatsForClient()
{
$arrPostTypes = UniteFunctionsWPRev::getPostTypesWithCats();
$globalCounter = 0;
$arrOutput = array();
foreach ($arrPostTypes as $postType => $arrTaxWithCats) {
|
请发表评论