Jump to content

A little help with a search script


skynet

Recommended Posts

Hi, first of i would like to thank you guys for making this forum this looks like a great resource ill be using a lot

 

I am building a website and i am using open source joomla since i need something done fast.  i am relatively new to this so my php/css skills .. well i lack them .. .I am using a search module for my site that searches the mosets tree (its an add on that generates listings). I think my problem is very simple i want the search bar to be wider (not length, but just bigger so the font looks bigger), i am kinda going for the www.live.com look. I know i can somehow place an image over it and then make the search field transparent.. and that would be fine (but i am open to suggestions). Can any of you guys point me to a tutorial that does something like that or help me out with code :) . Here is the code from the module.

 

thanks a million guys !!

<?php

/**
* Mambo Tree Search: Fixed Categories
*
* @package Mambo Tree 1.5
* @copyright (C) 2005 Mosets Consulting
* @url http://www.Mosets.com/
* @author Lee Cher Yeong <[email protected]>
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

# Include the config file
require( $mosConfig_absolute_path.'/administrator/components/com_mtree/config.mtree.php' );

# Include the language file. Default is English
if ($mt_language=='') $mt_language='english';
include_once('components/com_mtree/language/'.$mt_language.'.php');
if ( !isset($_MT_LANG) ) $_MT_LANG =& new mtLanguage();

# Get Itemid, determine if the mtree component is published
$database->setQuery("SELECT id FROM #__menu"
.	"\nWHERE link='index.php?option=com_mtree'"
.	"\nAND published='1'"
.	"\nLIMIT 1");
$Itemid = $database->loadResult();

$width 			= intval( $params->get( 'width', 16 ) );
$text 			= $params->get( 'text', _SEARCH_BOX );
$moduleclass_sfx 	= $params->get( 'moduleclass_sfx' );
$advsearch 			= intval( $params->get( 'advsearch', 1 ) );
$parent_cat	= intval( $params->get( 'parent_cat', 0 ) );
$search_button	= intval( $params->get( 'search_button', 1 ) );

global $database, $custom404, $mosConfig_sef, $cat_id;

# Get sub catgories for parent_cat
if ( $parent_cat >= 0 ) {
$database->setQuery( "SELECT cat_id, cat_name FROM #__mt_cats WHERE cat_approved='1' AND cat_published='1' AND cat_parent = '$parent_cat' ORDER BY cat_name ASC" );
$cats = $database->loadObjectList();
}

# Using Built in SEF feature in Mambo
if ( !isset($custom404) && $mosConfig_sef ) {
$onclickCmd = "document.location.href= '$mosConfig_live_site/component/option,com_mtree/task,search/Itemid,$Itemid/searchword,' + encodeURI(document.searchfrm2_mod.mt_search.value) + '/cat_id,' + encodeURI(document.searchfrm2_mod.cat_id.value) + '/'";
} else {

# Using SEF advance or no SEF at all
//$onclickCmd = "document.location.href='" . sefRelToAbs("index.php?option=com_mtree&task=search&Itemid=$Itemid&cat_id=' + encodeURI(document.searchfrm2_mod.cat_id.value) + '&searchword=' + encodeURI(document.searchfrm2_mod.mt_search.value)");
$onclickCmd = "document.location.href='" . "index.php?option=com_mtree&task=search&Itemid=$Itemid&cat_id=' + encodeURI(document.searchfrm2_mod.cat_id.value) + '&searchword=' + encodeURI(document.searchfrm2_mod.mt_search.value)";
}

?>
<form action="javascript: <?php echo $onclickCmd; ?>" method="POST" name="searchfrm2_mod">

<div align="left" class="search<?php echo $moduleclass_sfx; ?>">
<div align="center">
  <input type="text" id="mt_search" class="inputbox" size="<?php echo $width; ?>" value="<?php echo $text; ?>"  onblur="if(this.value=='') this.value='<?php echo $text; ?>';" onfocus="if(this.value=='<?php echo $text; ?>') this.value='';" onkeypress="if(event.keyCode == 13) <?php echo $onclickCmd; ?>" />
  <select name="cat_id">
        <option value="<?php echo $parent_cat ?>" selected><?php echo $_MT_LANG->ALL_CATEGORIES ?>
        <?php foreach( $cats AS $cat ) { ?>
        </option>
    <option value="<?php echo $cat->cat_id ?>"><?php echo $cat->cat_name ?>
        <?php } ?>
        </option>
      </select>
  <input name="submit" type="submit" class="button" value="<?php echo $_MT_LANG->SEARCH ?>" />
  <br />
  <?php if ( $search_button ) { ?>
  <?php } ?>
  
      <?php if ( $advsearch ) { ?><a href="<?php echo sefRelToAbs("index.php?option=com_mtree&task=advsearch&Itemid=$Itemid"); ?>"><?php echo $_MT_LANG->ADVANCED_SEARCH ?></a>
      <?php } ?>
    </div>
</div>
</form>

Link to comment
https://forums.phpfreaks.com/topic/42897-a-little-help-with-a-search-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.