Changeset 444650
- Timestamp:
- 09/28/2011 08:41:42 AM (14 years ago)
- File:
-
- 1 edited
-
xisearch-bar/trunk/xisearch.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xisearch-bar/trunk/xisearch.php
r442481 r444650 4 4 Plugin URI: http://www.xisearch.com 5 5 Description: XiSearch smart search plugin. Add different searches: search on site and in the Web, search images and video, Wiki and text translator 6 Version: 1. 06 Version: 1.2 7 7 Author: XiSearch 8 8 */ … … 15 15 function xisearch_setup() { 16 16 $xisearchScriptPath = get_option('XiSearchScriptPath'); 17 $xisearchEnabled = get_option('XiSearchEnabled');18 17 19 if ($xisearchScriptPath != '' and $xisearchEnabled) {18 if ($xisearchScriptPath != '') { 20 19 wp_enqueue_script('XiSearchBar', $xisearchScriptPath, false, false, true ); 20 } 21 else{ 22 wp_enqueue_script('XiSearchBar', "http://ms.xisearch.com/bars/default_loader.js", false, false, true ); 21 23 } 22 24 } … … 28 30 function xisearch_configuration() { 29 31 $xisearchScriptPath = get_option('XiSearchScriptPath'); 30 $xisearchEnabled = get_option('XiSearchEnabled');31 32 32 33 if ( isset($_POST['submit']) ) { … … 34 35 { 35 36 $xisearchScriptPath = $_POST['xisearchbarpath']; 36 if ($_POST['xisearch_enabled'] == 'on') 37 { 38 $xisearchEnabled = 1; 39 } 40 else 41 { 42 $xisearchEnabled = 0; 43 } 37 44 38 } 45 39 else 46 40 { 47 $xisearchScriptPath = ''; 48 $xisearchEnabled = 0; 41 $xisearchScriptPath = "http://ms.xisearch.com/bars/default_loader.js"; 49 42 } 50 43 update_option('XiSearchScriptPath', $xisearchScriptPath); 51 update_option('XiSearchEnabled', $xisearchEnabled);52 44 echo "<div id=\"updatemessage\" class=\"updated fade\"><p>XiSearch bar settings updated.</p></div>\n"; 53 45 echo "<script type=\"text/javascript\">setTimeout(function(){jQuery('#updatemessage').hide('slow');}, 3000);</script>"; … … 65 57 <div class="inside"> 66 58 <table class="form-table"> 67 <tr><th valign="top" scrope="row">XiSearch bar on/off:</th> 68 <td valign="top"><input type="checkbox" id="xisearch_enabled" name="xisearch_enabled" <?php echo ($xisearchEnabled ? 'checked="checked"' : ''); ?> /> <label for="xisearch_enabled">Enable or disable the XiSearch bar</label><br/></td></tr> 69 <tr><th valign="top" scrope="row"><label for="xisearchbarpath">XiSearch code:</label></th> 59 <tr><th valign="top" scrope="row"><label for="xisearchbarpath">XiSearch script for Wordpress:</label></th> 70 60 <td valign="top"><input id="xisearchbarpath" name="xisearchbarpath" type="text" size="20" value="<?php echo $xisearchScriptPath; ?>"/></td></tr> 71 61 </table>
Note: See TracChangeset
for help on using the changeset viewer.