-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrevslider.php
executable file
·196 lines (154 loc) · 6.07 KB
/
revslider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php
/*
Plugin Name: Revolution Slider
Plugin URI: http://www.themepunch.com/revolution/
Description: Revolution Slider - Premium responsive slider
Author: ThemePunch
Version: 4.6.92
Author URI: http://themepunch.com
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
if(class_exists('RevSliderFront')) {
die('ERROR: It looks like you have more than one instance of Revolution Slider installed. Please remove additional instances for this plugin to work again.');
}
if(isset($_GET['revSliderAsTheme'])){
if($_GET['revSliderAsTheme'] == 'true'){
update_option('revSliderAsTheme', 'true');
}else{
update_option('revSliderAsTheme', 'false');
}
}
$revSliderVersion = "4.6.92";
$currentFile = __FILE__;
$currentFolder = dirname($currentFile);
$revSliderAsTheme = false;
$revslider_screens = array();
//set the RevSlider Plugin as a Theme. This hides the activation notice and the activation area in the Slider Overview
function set_revslider_as_theme(){
global $revSliderAsTheme;
if(defined('REV_SLIDER_AS_THEME')){
if(REV_SLIDER_AS_THEME == true)
$revSliderAsTheme = true;
}else{
if(get_option('revSliderAsTheme', 'true') == 'true')
$revSliderAsTheme = true;
}
}
//include frameword files
require_once $currentFolder . '/inc_php/framework/include_framework.php';
//include bases
require_once $folderIncludes . 'base.class.php';
require_once $folderIncludes . 'elements_base.class.php';
require_once $folderIncludes . 'base_admin.class.php';
require_once $folderIncludes . 'base_front.class.php';
//include product files
require_once $currentFolder . '/inc_php/revslider_settings_product.class.php';
require_once $currentFolder . '/inc_php/revslider_globals.class.php';
require_once $currentFolder . '/inc_php/revslider_operations.class.php';
require_once $currentFolder . '/inc_php/revslider_slider.class.php';
require_once $currentFolder . '/inc_php/revslider_output.class.php';
require_once $currentFolder . '/inc_php/revslider_slide.class.php';
require_once $currentFolder . '/inc_php/revslider_widget.class.php';
require_once $currentFolder . '/inc_php/revslider_params.class.php';
require_once $currentFolder . '/inc_php/revslider_tinybox.class.php';
require_once $currentFolder . '/inc_php/fonts.class.php'; //punchfonts
require_once $currentFolder . '/inc_php/extension.class.php';
try{
//register the revolution slider widget
UniteFunctionsWPRev::registerWidget("RevSlider_Widget");
//add shortcode
function rev_slider_shortcode($args){
extract(shortcode_atts(array('alias' => ''), $args, 'rev_slider'));
$sliderAlias = ($alias != '') ? $alias : UniteFunctionsRev::getVal($args,0);
ob_start();
$slider = RevSliderOutput::putSlider($sliderAlias);
$content = ob_get_contents();
ob_clean();
ob_end_clean();
// Do not output Slider if we are on mobile
$disable_on_mobile = $slider->getParam("disable_on_mobile","off");
if($disable_on_mobile == 'on'){
$mobile = (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') || wp_is_mobile()) ? true : false;
if($mobile)
return false;
}
$show_alternate = $slider->getParam("show_alternative_type","off");
if($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8'){
if(wp_is_mobile()){
$show_alternate_image = $slider->getParam("show_alternate_image","");
return '<img class="tp-slider-alternative-image" src="'.$show_alternate_image.'">';
}
}
//handle slider output types
if(!empty($slider)){
$outputType = $slider->getParam("output_type","");
switch($outputType){
case "compress":
$content = str_replace("\n", "", $content);
$content = str_replace("\r", "", $content);
return($content);
break;
case "echo":
echo $content; //bypass the filters
break;
default:
return($content);
break;
}
}else
return($content); //normal output
}
add_shortcode( 'rev_slider', 'rev_slider_shortcode' );
//add tiny box dropdown menu
$tinybox = new RevSlider_TinyBox();
/**
* Call Extensions
*/
$revext = new RevSliderExtension();
if(is_admin()){ //load admin part
require_once $currentFolder . '/inc_php/framework/update.class.php';
require_once $currentFolder . '/inc_php/framework/newsletter.class.php';
require_once $currentFolder."/revslider_admin.php";
$productAdmin = new RevSliderAdmin($currentFile);
}else{ //load front part
/**
*
* put rev slider on the page.
* the data can be slider ID or slider alias.
*/
function putRevSlider($data,$putIn = ""){
$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);
if($isPutIn == false && $includesGlobally == "off"){
$output = new RevSliderOutput();
$option1Name = "Include RevSlider libraries globally (all pages/posts)";
$option2Name = "Pages to include RevSlider libraries";
$output->putErrorMessage(__("If you want to use the PHP function \"putRevSlider\" in your code please make sure to check \" ",REVSLIDER_TEXTDOMAIN).$option1Name.__(" \" in the backend's \"General Settings\" (top right panel). <br> <br> Or add the current page to the \"",REVSLIDER_TEXTDOMAIN).$option2Name.__("\" option box."));
return(false);
}
RevSliderOutput::putSlider($data,$putIn);
}
/**
*
* put rev slider on the page.
* the data can be slider ID or slider alias.
*/
function checkRevSliderExists($alias){
$rev = new RevSlider();
return $rev->isAliasExists($alias);
}
require_once $currentFolder."/revslider_front.php";
$productFront = new RevSliderFront($currentFile);
}
}catch(Exception $e){
$message = $e->getMessage();
$trace = $e->getTraceAsString();
echo _e("Revolution Slider Error:",REVSLIDER_TEXTDOMAIN)."<b>".$message."</b>";
}
?>