1
Burning
a "xoSearchForModule" plugin to display an advanced search form (Oledrion) ?
  • 2010/10/10 10:56

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi'

I'm still fighting against Xoops search forms

Now I would like to adapt a plugin coded by Dugris and called {xoSearchForModule}.

function smarty_function_xoSearchForModule$params, &$smarty ) {
    global 
$xoopsModule$xoopsConfig;
    if ( 
is_object($xoopsModule) && $xoopsModule->getVar('hassearch') == ) {
        include_once(
XOOPS_ROOT_PATH "/language/"$xoopsConfig['language'] . "/search.php");

        
$config_handler =& xoops_gethandler('config');
        
$xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);

        
$mid $xoopsModule->getVar('mid');
        
$modules[$mid] = $xoopsModule;
        
$queries = array();
        include_once 
XOOPS_ROOT_PATH "/include/searchform.php";

        
$new_search_form = new XoopsThemeForm(_SR_SEARCH"search"XOOPS_URL "/search.php"'get');

        foreach ( 
$search_form->getElements() as $key => $ele ) {
            if ( 
$ele->getCaption() != _SR_SEARCHIN ) {
                
$new_search_form->addElement$search_form->_elements[$key] );
            }
        }
       
$new_search_form->addElement(new XoopsFormHidden("mids[]"$mid ));
        
$new_search_form->display();
        
$GLOBALS['xoopsLogger']->addExtra("plugin smarty for xoops => xoSearchForModule""Loaded");
    }
}
?>


What it does ? With this plugin you can add Xoops search form where you want on your page, just adding this smarty {xoSearchForModule}

What I would like it do ? Instead of Xoops global search form, I would like to display into my theme the Oledrion search form.

Is it possible using this kind of smarty plugin ?

Thanks in advance
Still learning CSS and... english

2
mariane
Re: a "xoSearchForModule" plugin to display an advanced search form (Oledrion) ?
  • 2010/10/11 15:36

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


really no answer,but i think there is another method by adding a js file inside your module,then make a php block to call the search page of oledrion.
I tried it in yellowpages module, and it worked fine, I will try to find again the file and provide it to you
the road of success is always under construction

3
Burning
Re: a "xoSearchForModule" plugin to display an advanced search form (Oledrion) ?
  • 2010/10/11 18:03

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi' Mariane,

It sounds very interesting... I would never think about this kind of trick !

I would be very happy if you were able to catch your hack !
Still learning CSS and... english

4
mariane
Re: a "xoSearchForModule" plugin to display an advanced search form (Oledrion) ?
  • 2010/10/15 7:33

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


hello again,
I could find the code:
I used it with mxdirectory and it works perfect :
1- I called a jquery code :
<script type="text/javascript" src="{X_SITEURL}modules/mxdirectory/jquery-1.2.6.min.js"></script>

it's the same one in js xoops that we call in themes as :
<script type="text/javascript" src="<{$xoops_url}>/browse.php?Frameworks/jquery/jquery.js"> </script>

2- I create a block in xoops and I put this content :
<script>  
jQuery.noConflict();
jQuery(document).ready(function($) {  
    
jQuery.get("{X_SITEURL}modules/mxdirectory/search.php", function(data){  
        $(
'#quickcomment').append(data.substring(data.indexOf("<form name='submitform'"),data.indexOf("<!-- End Form Vaidation JavaScript //-->")));  
    });  
}); 
</
script>
the road of success is always under construction

Login

Username:
Password:

Lost Password? Register now!

Who's Online

69 user(s) are online (40 user(s) are browsing Support Forums)


Members: 0


Guests: 69


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits