Guest User

Untitled

a guest
Dec 13th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.42 KB | None | 0 0
  1. <?php
  2.  
  3. $general_default_settings = array(
  4.  
  5. // general page settings
  6.  
  7. 'status'=>'1',
  8. 'background'=>'',
  9. 'title'=>'',
  10. 'descrip'=>'',
  11. 'google_code'=>'',
  12. 'fb'=>'',
  13. 'twit'=>'',
  14. 'gp'=>''
  15.  
  16. );
  17.  
  18. ?>
  19. <div class="block ui-tabs-panel active" id="option-ui-id-1" >
  20. <?php $current_options = wp_parse_args( get_option( 'soon_page_settings', array() ), $general_default_settings );
  21.  
  22. if(isset($_POST['easy-coming-soon_lite_settings_save_1']))
  23. {
  24.  
  25. if ( empty($_POST) || !wp_verify_nonce($_POST['general_settings_page_save_nonce_field'],'general_settings_page_save_nonce_action' ) )
  26. {
  27. print __('Sorry, your nonce did not verify.','easy-coming-soon'); exit;
  28. }
  29.  
  30. $current_options['status'] = $_POST['status'];
  31. $current_options['background'] = $_POST['background'];
  32. $current_options['title'] = stripcslashes($_POST['title']);
  33. $current_options['descrip'] = stripcslashes($_POST['descrip']);
  34. $current_options['google_code'] = stripslashes($_POST['google_code']);
  35. $current_options['fb'] = $_POST['fb'];
  36. $current_options['twit'] = $_POST['twit'];
  37. $current_options['gp'] = $_POST['gp'];
  38.  
  39.  
  40. update_option('soon_page_settings',$current_options);
  41. }
  42.  
  43. if(isset($_POST['easy-coming-soon_lite_settings_reset_1']))
  44. {
  45. $current_options['status']='1';
  46. $current_options['background']='';
  47. $current_options['title']='';
  48. $current_options['descrip']='';
  49. $current_options['google_code']='';
  50. $current_options['fb']='';
  51. $current_options['twit']='';
  52. $current_options['gp']='';
  53.  
  54. update_option('soon_page_settings',$current_options);
  55. }
  56. ?>
  57. <form method="post" action="#section_general">
  58. <div id="heading">
  59. <table style="width:100%;"><tr>
  60. <td><h2><?php _e('Quick Start Settings','easy-coming-soon');?></h2></td>
  61. <td style="width:30%;">
  62. <div class="easy-coming-soon_lite_settings_loding" id="easy-coming-soon_loding_1_image"></div>
  63. <div class="easy-coming-soon_lite_settings_massage" id="easy-coming-soon_lite_settings_save_1_success" ><?php _e('Options data successfully Saved','easy-coming-soon');?></div>
  64. <div class="easy-coming-soon_lite_settings_massage" id="easy-coming-soon_lite_settings_save_1_reset" ><?php _e('Options data successfully reset','easy-coming-soon');?></div>
  65. </td>
  66. <td style="text-align:right;">
  67. <input class="button" type="submit" name="easy-coming-soon_lite_settings_reset_1" value="Restore Defaults" >&nbsp;
  68. <input class="button button-primary button-large" type="submit" name="easy-coming-soon_lite_settings_save_1" value="Save Options">
  69. </td>
  70. </tr>
  71. </table>
  72. </div>
  73.  
  74.  
  75. <div class="section">
  76. <div class="element">
  77. <h3><?php _e('Select status','easy-coming-soon') ?></h3>
  78. <input type="radio" name="status" value="0" id="status" <?php if($current_options['status']=='0') echo 'checked' ?>/>&nbsp;<?php _e('Disabled','easy-coming-soon') ?><br>
  79. <input type="radio" name="status" value="1" id="status" <?php if($current_options['status']=='1') echo 'checked' ?>/>&nbsp;<?php _e('Coming soon enabled','easy-coming-soon') ?>
  80. </div>
  81. </div>
  82.  
  83. <div class="section">
  84. <div class="element">
  85. <h3><?php _e('Enter background image','easy-coming-soon') ?></h3>
  86. <input type="text" value="<?php if(!empty($current_options['background'])){ echo $current_options['background']; } ?>" id="background" name="background" size="36">
  87. <input type="button" value="Upload Background Image" class="button-primary upload-primary" style="margin-left:10px;height:30px">
  88. </div>
  89. <br/>
  90. <?php if(!empty($current_options['background'])) { ?>
  91. <div><img style="display: inline; width:200px; border:1px solid #3894BD;" src="<?php echo $current_options['background']; ?>"></div>
  92. <?php } ?>
  93. </div>
  94.  
  95. <div class="section">
  96. <div class="element">
  97. <h3><?php _e('Enter the title','easy-coming-soon') ?></h3>
  98. <input type="text" id="title" name="title" value="<?php if(!empty($current_options['title'])){ echo $current_options['title']; } ?>"/>
  99. </div>
  100. </div>
  101.  
  102. <div class="section">
  103. <div class="element">
  104. <h3><?php _e('Enter description','easy-coming-soon') ?></h3>
  105. <textarea id="descrip" name="descrip" rows="5"><?php if(!empty($current_options['descrip'])){ echo $current_options['descrip']; } ?></textarea>
  106. </div>
  107. </div>
  108.  
  109. <div class="section">
  110. <div class="element">
  111. <h3><?php _e('Google Analytics Code','easy-coming-soon') ?></h3>
  112. <textarea id="google_code" name="google_code" rows="5"><?php if(!empty($current_options['google_code'])){ echo $current_options['google_code']; } ?></textarea>
  113. </div>
  114. </div>
  115.  
  116. <div class="section">
  117. <div class="element">
  118. <h3><?php _e('Enter facebook URL','easy-coming-soon') ?></h3>
  119. <input type="text" id="fb" name="fb" placeholder="Enter facebook url" value="<?php if(!empty($current_options['fb'])){ echo $current_options['fb']; } ?>"/>
  120. </div>
  121. </div>
  122.  
  123. <div class="section">
  124. <div class="element">
  125. <h3><?php _e('Enter twitter URL','easy-coming-soon') ?></h3>
  126. <input type="text" id="twit" name="twit" placeholder="Enter twitter url" value="<?php if(!empty($current_options['twit'])){ echo $current_options['twit']; } ?>"/>
  127. </div>
  128. </div>
  129.  
  130. <div class="section">
  131. <div class="element">
  132. <h3><?php _e('Enter google-plus URL','easy-coming-soon') ?></h3>
  133. <input type="text" id="gp" name="gp" placeholder="Enter google-plus url" value="<?php if(!empty($current_options['gp'])){ echo $current_options['gp']; } ?>"/>
  134. </div>
  135. </div>
  136.  
  137. <div id="button_section">
  138. <input class="button button-primary" type="submit" name="easy-coming-soon_lite_settings_save_1"value="Save Options">&nbsp;
  139. <input class="button" type="submit" name="easy-coming-soon_lite_settings_reset_1" value="Restore Defaults">
  140. </div>
  141.  
  142. <!-- Nonce Add - 27 August -->
  143.  
  144. <?php wp_nonce_field('general_settings_page_save_nonce_action','general_settings_page_save_nonce_field'); ?>
  145. </form>
  146. </div>
Add Comment
Please, Sign In to add comment