Plugin Directory

Changeset 444650


Ignore:
Timestamp:
09/28/2011 08:41:42 AM (14 years ago)
Author:
dmitry78
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • xisearch-bar/trunk/xisearch.php

    r442481 r444650  
    44Plugin URI: http://www.xisearch.com
    55Description: 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.0
     6Version: 1.2
    77Author: XiSearch
    88*/
     
    1515function xisearch_setup() {
    1616    $xisearchScriptPath = get_option('XiSearchScriptPath');
    17     $xisearchEnabled = get_option('XiSearchEnabled');
    1817   
    19     if ($xisearchScriptPath != '' and $xisearchEnabled) {
     18    if ($xisearchScriptPath != '') {
    2019        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 );
    2123    }
    2224}
     
    2830function xisearch_configuration() {
    2931    $xisearchScriptPath = get_option('XiSearchScriptPath');
    30     $xisearchEnabled = get_option('XiSearchEnabled');
    3132
    3233    if ( isset($_POST['submit']) ) {
     
    3435        {
    3536            $xisearchScriptPath =  $_POST['xisearchbarpath'];
    36             if ($_POST['xisearch_enabled'] == 'on')
    37             {
    38                 $xisearchEnabled = 1;
    39             }
    40             else
    41             {
    42                 $xisearchEnabled = 0;
    43             }
     37           
    4438        }
    4539        else
    4640        {
    47             $xisearchScriptPath = '';
    48             $xisearchEnabled = 0;
     41            $xisearchScriptPath = "http://ms.xisearch.com/bars/default_loader.js";
    4942        }
    5043        update_option('XiSearchScriptPath', $xisearchScriptPath);
    51         update_option('XiSearchEnabled', $xisearchEnabled);
    5244        echo "<div id=\"updatemessage\" class=\"updated fade\"><p>XiSearch bar settings updated.</p></div>\n";
    5345        echo "<script type=\"text/javascript\">setTimeout(function(){jQuery('#updatemessage').hide('slow');}, 3000);</script>";
     
    6557                        <div class="inside">
    6658                            <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>
    7060                                <td valign="top"><input id="xisearchbarpath" name="xisearchbarpath" type="text" size="20" value="<?php echo $xisearchScriptPath; ?>"/></td></tr>
    7161                            </table>
Note: See TracChangeset for help on using the changeset viewer.