Exemple #1
0
function fwbslider_update()
{
    $fwbxml_url = 'http://www.sketchthemes.com/sketch-updates/plugin-updates/fwb-lite/org_fwbslider.xml';
    $fwbxml_txt = @simplexml_load_file($fwbxml_url);
    if ($fwbxml_txt) {
        $fwbxml_version = $fwbxml_txt->fwbslider[0]->version;
        $fwbxml_htmldata = $fwbxml_txt->fwbslider[0]->htmldata;
        $fwb_cur_version = fwbslider_get_version();
        ?>
<div id="fwb_updates"><?php 
        if ($fwbxml_htmldata) {
            echo $fwbxml_htmldata;
        }
        ?>
</div> <?php 
    }
}
function fwbslider_backend_menu()
{
    wp_nonce_field('update-options');
    $options = get_option('fwbslider_options');
    ?>
	<div class="wrap">
	<div id="icon-themes" class="icon32"></div>
	<h2><?php 
    _e('Full Width Background Slider ' . fwbslider_get_version() . ' Settings', 'fwbslider');
    ?>
</h2>
	</div>
	
	<div class="fwblite-wrapper">
	
		<!-- WP-Banner Starts Here -->
		<div id="wp_banner">
			<!-- Top Section Starts Here -->
			<div class="top_section">
				<!-- Begin MailChimp Signup Form -->
				<link type="text/css" rel="stylesheet" href="http://cdn-images.mailchimp.com/embedcode/classic-081711.css">
				<style type="text/css">
					#mc_embed_signup{ clear:left; font:14px Helvetica,Arial,sans-serif; }
					/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
					   We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
				</style>
				<div id="mc_embed_signup">
					<form novalidate="" target="_blank" class="validate" name="mc-embedded-subscribe-form" id="mc-embedded-subscribe-form" method="post" action="http://wpfruits.us6.list-manage.com/subscribe/post?u=166c9fed36fb93e9202b68dc3&amp;id=bea82345ae">
						<div class="mc-field-group">
							<input type="email" id="mce-EMAIL" class="required email" name="EMAIL" value="" placeholder="Our Newsletter Just Enter Your Email Here" />
							<input type="submit" class="button" id="mc-embedded-subscribe" name="subscribe" value="" onclick="return fwblite_wp_jsvalid();">
							<div style="clear:both;"></div>
						</div>
						<div class="clear" id="mce-responses">
							<div style="display:none" id="mce-error-response" class="response"></div>
							<div style="display:none" id="mce-success-response" class="response"></div>
						</div>	
						
					</form>
				</div>
				<script type="text/javascript">
					var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';
					try {
						var jqueryLoaded=jQuery;
						jqueryLoaded=true;
					} catch(err) {
						var jqueryLoaded=false;
					}
					var head= document.getElementsByTagName('head')[0];
					if (!jqueryLoaded) {
						var script = document.createElement('script');
						script.type = 'text/javascript';
						script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
						head.appendChild(script);
						if (script.readyState &amp;&amp; script.onload!==null){
							script.onreadystatechange= function () {
								  if (this.readyState == 'complete') mce_preload_check();
							}    
						}
					}
					var script = document.createElement('script');
					script.type = 'text/javascript';
					script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
					head.appendChild(script);
					var err_style = '';
					try{
						err_style = mc_custom_error_style;
					} catch(e){
						err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
					}
					var head= document.getElementsByTagName('head')[0];
					var style= document.createElement('style');
					style.type= 'text/css';
					if (style.styleSheet) {
						style.styleSheet.cssText = err_style;
					} else {
						style.appendChild(document.createTextNode(err_style));
					}
					head.appendChild(style);
					setTimeout('mce_preload_check();', 250);

					var mce_preload_checks = 0;
					function mce_preload_check(){
						if (mce_preload_checks&gt;40) return;
						mce_preload_checks++;
						try {
							var jqueryLoaded=jQuery;
						} catch(err) {
							setTimeout('mce_preload_check();', 250);
							return;
						}
						try {
							var validatorLoaded=jQuery("#fake-form").validate({});
						} catch(err) {
							setTimeout('mce_preload_check();', 250);
							return;
						}
						mce_init_form();
					}
					function mce_init_form()
					{
						jQuery(document).ready( function($) 
						{
						  var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){}  };
						  var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
						  $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
						  options = { url: 'http://wpfruits.us6.list-manage.com/subscribe/post-json?u=166c9fed36fb93e9202b68dc3&amp;id=bea82345ae&amp;c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
										beforeSubmit: function(){
											$('#mce_tmp_error_msg').remove();
											$('.datefield','#mc_embed_signup').each(
												function(){
													var txt = 'filled';
													var fields = new Array();
													var i = 0;
													$(':text', this).each(
														function(){
															fields[i] = this;
															i++;
														});
													$(':hidden', this).each(
														function(){
															var bday = false;
															if (fields.length == 2){
																bday = true;
																fields[2] = {'value':1970};//trick birthdays into having years
															}
															if ( fields[0].value=='MM' &amp;&amp; fields[1].value=='DD' &amp;&amp; (fields[2].value=='YYYY' || (bday &amp;&amp; fields[2].value==1970) ) ){
																this.value = '';
															} else if ( fields[0].value=='' &amp;&amp; fields[1].value=='' &amp;&amp; (fields[2].value=='' || (bday &amp;&amp; fields[2].value==1970) ) ){
																this.value = '';
															} else {
																if (/\[day\]/.test(fields[0].name)){
																	this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;									        
																} else {
																	this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
																}
															}
														});
												});
											return mce_validator.form();
										}, 
										success: mce_success_cb
									};
						  $('#mc-embedded-subscribe-form').ajaxForm(options);

						});
					}
					function mce_success_cb(resp){
						$('#mce-success-response').hide();
						$('#mce-error-response').hide();
						if (resp.result=="success"){
							$('#mce-'+resp.result+'-response').show();
							$('#mce-'+resp.result+'-response').html(resp.msg);
							$('#mc-embedded-subscribe-form').each(function(){
								this.reset();
							});
						} else {
							var index = -1;
							var msg;
							try {
								var parts = resp.msg.split(' - ',2);
								if (parts[1]==undefined){
									msg = resp.msg;
								} else {
									i = parseInt(parts[0]);
									if (i.toString() == parts[0]){
										index = parts[0];
										msg = parts[1];
									} else {
										index = -1;
										msg = resp.msg;
									}
								}
							} catch(e){
								index = -1;
								msg = resp.msg;
							}
							try{
								if (index== -1){
									$('#mce-'+resp.result+'-response').show();
									$('#mce-'+resp.result+'-response').html(msg);            
								} else {
									err_id = 'mce_tmp_error_msg';
									html = '&lt;div id="'+err_id+'" style="'+err_style+'"&gt; '+msg+'&lt;/div&gt;';
									
									var input_id = '#mc_embed_signup';
									var f = $(input_id);
									if (ftypes[index]=='address'){
										input_id = '#mce-'+fnames[index]+'-addr1';
										f = $(input_id).parent().parent().get(0);
									} else if (ftypes[index]=='date'){
										input_id = '#mce-'+fnames[index]+'-month';
										f = $(input_id).parent().parent().get(0);
									} else {
										input_id = '#mce-'+fnames[index];
										f = $().parent(input_id).get(0);
									}
									if (f){
										$(f).append(html);
										$(input_id).focus();
									} else {
										$('#mce-'+resp.result+'-response').show();
										$('#mce-'+resp.result+'-response').html(msg);
									}
								}
							} catch(e){
								$('#mce-'+resp.result+'-response').show();
								$('#mce-'+resp.result+'-response').html(msg);
							}
						}
					}

				</script>
				<!--End mc_embed_signup-->
			</div>
			<!-- Top Section Ends Here -->
			
			<!-- Bottom Section Starts Here -->
			<div class="bot_section">
				<a href="http://www.wpfruits.com/" class="wplogo" target="_blank" title="WFruits.com"></a>
				<a href="https://www.facebook.com/pages/WPFruitscom/443589065662507" class="fbicon" target="_blank" title="Facebook"></a>
				<a href="http://www.twitter.com/wpfruits" class="twicon" target="_blank" title="Twitter"></a>
				<div style="clear:both;"></div>
			</div>
			<!-- Bottom Section Ends Here -->
		</div>
		<!-- WP-Banner Ends Here -->
	
	</div>
	
	
	<div style="width:700px;">
		
		<div class="postbox fwbslide_wrap" id="fwbslider_post_metas" style="padding:20px;">
		
			<?php 
    echo fwbslider_update();
    ?>
			
			<span class="desc"><?php 
    _e('Enter Slides URL: ', 'fwbslider');
    _e('These Background Slides will work for all pages and posts until you have not checked option in post/page editor.', 'fwbslider');
    ?>
</span>
			<form method="post" class="fwbslider_form">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
						<table class="fwb_proFeature" cellpadding="0" cellspacing="0">
							<tr style="line-height:22px;"><th colspan="2"><?php 
    _e('These Features comes with PRO Version. To activate, please purchase PRO version.', 'fwbslider');
    ?>
 <a href="http://www.wpfruits.com/full-width-background-slider/?fwb_ref=back" target="_blank"><?php 
    _e('Click Here to Purchase Plugin.', 'fwbslider');
    ?>
</a></th></tr>
						
							<tr>
								<th><?php 
    _e("Show Navigation:", 'fwbslider');
    ?>
</th>
								<td><select style="width:70px;"><option value="true">Yes</option><option value="false">No</option></select></td>
							</tr>
							
							<tr>
								<th><?php 
    _e("Show Bullets:", 'fwbslider');
    ?>
</th>
								<td><select style="width:70px;"><option value="true">Yes</option><option value="false">No</option></select></td>
							</tr>
							
							<tr>
								<th><?php 
    _e("Show Play/Pause Key:", 'fwbslider');
    ?>
</th>
								<td><select style="width:70px;"><option value="true">Yes</option><option value="false">No</option></select></td>
							</tr>
							
							<tr>
								<th><?php 
    _e("Show Thumbnails:", 'fwbslider');
    ?>
</th>
								<td><select style="width:70px;"><option value="true">Yes</option><option value="false">No</option></select></td>
							</tr>
							
							<tr>
								<th><?php 
    _e("Show ProgressBar:", 'fwbslider');
    ?>
</th>
								<td><select style="width:70px;"><option value="true">Yes</option><option value="false">No</option></select></td>
							</tr>
							
							<tr><th><label for="alloverlay"><?php 
    _e('Display Overlay:', 'fwbslider');
    ?>
</label></th><td>&nbsp;<label for="alloverlay"><input id="alloverlay" type="checkbox"  value="true" />&nbsp;<?php 
    _e('Check it, if you want overlay effect.', 'fwbslider');
    ?>
</label></td></tr>		
							<tr><th><label><?php 
    _e('Set Overlay Effect:', 'fwbslider');
    ?>
</label></th>
								<td class="clearfix">
									<label class="fwb_rdlb" for="fwe1" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/01.png');"><input type="radio" id="fwe1" ></label>
									<label class="fwb_rdlb" for="fwe2" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/02.png');"><input type="radio" id="fwe2" ></label>
									<label class="fwb_rdlb" for="fwe3" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/03.png');"><input type="radio" id="fwe3" ></label>
									<label class="fwb_rdlb" for="fwe4" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/04.png');"><input type="radio" id="fwe4" ></label>
									<label class="fwb_rdlb" for="fwe5" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/05.png');"><input type="radio" id="fwe5" ></label>
									<label class="fwb_rdlb" for="fwe6" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/06.png');"><input type="radio" id="fwe6" ></label>
									<label class="fwb_rdlb" for="fwe7" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/07.png');"><input type="radio" id="fwe7" ></label>
									<label class="fwb_rdlb" for="fwe8" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/08.png');"><input type="radio" id="fwe8" ></label>
									<label class="fwb_rdlb" for="fwe9" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/09.png');"><input type="radio" id="fwe9" ></label>
									<label class="fwb_rdlb" for="fwe10" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/10.png');"><input type="radio" id="fwe10" ></label>
									<label class="fwb_rdlb" for="fwe11" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/11.png');"><input type="radio" id="fwe11" ></label>
									<label class="fwb_rdlb" for="fwe12" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/12.png');"><input type="radio" id="fwe12" ></label>
									<label class="fwb_rdlb" for="fwe13" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/13.png');"><input type="radio" id="fwe13" ></label>
									<label class="fwb_rdlb" for="fwe14" style="background:#e7e7e7 url('<?php 
    echo FWBLITE_URL;
    ?>
/images/overlay/14.png');"><input type="radio" id="fwe14" ></label>
								</td>
							</tr>
						</table>
						</td>
					</tr>
					
					<tr><td colspan="2"><div><input type="checkbox" id="fwbBgChkbox" value="1"  <?php 
    if ($options['fwbBgChkbox']) {
        ?>
 checked <?php 
    }
    ?>
 name="fwbslider_options[fwbBgChkbox]" />&nbsp;<label style="color:#D30E0E;" for="fwbBgChkbox"><b><?php 
    _e('Check it, if you want to use <i>"Background Color instead of slider images."</i>', 'fwbslider');
    ?>
</b></label></div></td></tr>
		
					<tr>
						<th><?php 
    _e("Background Color", 'fwbslider');
    ?>
</th>
						<td>
							<div class="fwb_colwrap">
								<input type="text" id="fwb_bgcolor" class="fwb_color_inp" value="<?php 
    if ($options['fwbBgcolor']) {
        echo $options['fwbBgcolor'];
    } else {
        echo "#F7D2D2";
    }
    ?>
" name="fwbslider_options[fwbBgcolor]" />
								<div class="fwb_colsel fwb_bgcolor"></div>
							</div>
						</td>
					</tr>
					
					<tr><th><label><?php 
    _e('Slide Duration', 'fwbslider');
    ?>
</label> </th><td><input style="width:50px;" name="fwbslider_options[fwbsduration]" type="text" value="<?php 
    if ($options['fwbsduration']) {
        echo $options['fwbsduration'];
    }
    ?>
"  /> <small>(<b><?php 
    _e('in Seconds', 'fwbslider');
    ?>
</b>)</small></td></tr>				
					<tr><th><label><?php 
    _e('Transition Speed', 'fwbslider');
    ?>
</label> </th><td><input style="width:50px;" name="fwbslider_options[fwbstspeed]" type="text" value="<?php 
    if ($options['fwbstspeed']) {
        echo $options['fwbstspeed'];
    }
    ?>
"  /> <small>(<b><?php 
    _e('in Seconds', 'fwbslider');
    ?>
</b>)</small></td></tr>
					<tr><th><label><?php 
    _e('FWB Slide1 URL', 'fwbslider');
    ?>
</label></th><td><input type="text" class="fwb_uploadimg" name="fwbslider_options[fwbslide1]" value="<?php 
    echo $options['fwbslide1'];
    ?>
" /><input class="fwb_uploadbtn button" type="button" value="Browse.." /></td></tr>
					<tr><th><label><?php 
    _e('FWB Slide2 URL', 'fwbslider');
    ?>
</label></th><td><input type="text" class="fwb_uploadimg" name="fwbslider_options[fwbslide2]" value="<?php 
    echo $options['fwbslide2'];
    ?>
" /><input class="fwb_uploadbtn button" type="button" value="Browse.." /></td></tr>
					<tr><th><label><?php 
    _e('FWB Slide3 URL', 'fwbslider');
    ?>
</label></th><td><input type="text" class="fwb_uploadimg" name="fwbslider_options[fwbslide3]" value="<?php 
    echo $options['fwbslide3'];
    ?>
" /><input class="fwb_uploadbtn button" type="button" value="Browse.." /></td></tr>
					<tr><th><label><?php 
    _e('FWB Slide4 URL', 'fwbslider');
    ?>
</label></th><td><input type="text" class="fwb_uploadimg" name="fwbslider_options[fwbslide4]" value="<?php 
    echo $options['fwbslide4'];
    ?>
" /><input class="fwb_uploadbtn button" type="button" value="Browse.." /></td></tr>
					<tr><th><label><?php 
    _e('FWB Slide5 URL', 'fwbslider');
    ?>
</label></th><td><input type="text" class="fwb_uploadimg" name="fwbslider_options[fwbslide5]" value="<?php 
    echo $options['fwbslide5'];
    ?>
" /><input class="fwb_uploadbtn button" type="button" value="Browse.." /></td></tr>
					<tr><th><label><?php 
    _e('FWB Slide6 URL', 'fwbslider');
    ?>
</label></th><td><input type="text" class="fwb_uploadimg" name="fwbslider_options[fwbslide6]" value="<?php 
    echo $options['fwbslide6'];
    ?>
" /><input class="fwb_uploadbtn button" type="button" value="Browse.." /></td></tr>
					
					<tr>
						<td colspan="2">
						<table class="fwb_proFeature" cellpadding="0" cellspacing="0">
							<tr style="line-height:22px;"><th colspan="2"><?php 
    _e('These Features comes with PRO Version. To activate, please purchase PRO version.', 'fwbslider');
    ?>
 <a href="http://www.wpfruits.com/full-width-background-slider/?fwb_ref=back" target="_blank"><?php 
    _e('Click Here to Purchase Plugin.', 'fwbslider');
    ?>
</a></th></tr>
							<tr><th><label><?php 
    _e('FWB Slide7 URL:', 'fwbslider');
    ?>
</label></th><td><input type="text" /><input type="button" class="button" value="Browse.." /></td></tr>
							<tr><th><label><?php 
    _e('FWB Slide8 URL:', 'fwbslider');
    ?>
</label></th><td><input type="text" /><input type="button" class="button" value="Browse.." /></td></tr>
							<tr><th><label><?php 
    _e('FWB Slide9 URL:', 'fwbslider');
    ?>
</label></th><td><input type="text" /><input type="button" class="button" value="Browse.." /></td></tr>
							<tr><th><label><?php 
    _e('FWB Slide10 URL:', 'fwbslider');
    ?>
</label></th><td><input type="text" /><input type="button" class="button" value="Browse.." /></td></tr>
						</table>                                                                                                             
					</tr>
				
				</table>	
				 
				<p class="button-controls">
					<input type="submit" value="<?php 
    _e('Save Settings');
    ?>
" class="button-primary" id="fwbslider_update" name="fwbslider_update">	
				</p>
			</form>
		</div>
		
		<iframe frameborder="1" class="fwblite_iframe" src="http://www.sketchthemes.com/sketch-updates/plugin-updates/fwb-lite/fwb-lite.php" width="200px" height="500px" scrolling="no" ></iframe> 		
		
	</div>
<?php 
}