2 of 3
2
Using simple or advanced search… will it work for this?
Posted: 11 March 2008 10:01 AM   [ Ignore ]   [ # 19 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

Only other thing now that would make it 100% is if someone just selects say defence, i want it to show all the entries without having to write a keyword.

Is that possible Robin? or is that the one thing that is a bit hard!

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
Posted: 11 March 2008 10:01 AM   [ Ignore ]   [ # 20 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Hi Brian,

It still isn’t working on the - http://www.panache.scandinaviandesignsprojects.com/search page. Don’t know if you are changing that now though?

It comes up with the javascript that you have on that button so I think that is what is throwing it out as the standard EE form handles the submit without any Javascript as far as I know.

Hope that helps?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 10:03 AM   [ Ignore ]   [ # 21 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006
flashwiz - 11 March 2008 10:01 AM

Only other thing now that would make it 100% is if someone just selects say defence, i want it to show all the entries without having to write a keyword.

Is that possible Robin? or is that the one thing that is a bit hard!

You could always provide some links on the page to take them to a template which shows the entries based on category?
To do it with just the drop-down is going to take some modifying of code I guess or completely hand-coding a search form as you would need to say “if there is no keyword then just show the category results”. Links would be easier. Is that any good?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 10:10 AM   [ Ignore ]   [ # 22 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

Hi Mark,

If you go to the home page, and just use the form to the left now, is that not working for you?

http://www.panache.scandinaviandesignsprojects.com/

The links would work, but they would look a little crude dont you think?

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
Posted: 11 March 2008 10:12 AM   [ Ignore ]   [ # 23 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

Just out of curiosity, when you enter a keyword to search is it searching within every custom field that i make searchable?

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
Posted: 11 March 2008 10:20 AM   [ Ignore ]   [ # 24 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006
flashwiz - 11 March 2008 10:10 AM

Hi Mark,

If you go to the home page, and just use the form to the left now, is that not working for you?

http://www.panache.scandinaviandesignsprojects.com/

The links would work, but they would look a little crude dont you think?

Yes that page is working fine, the other one wasn’t though. I guess you aren’t going to be using the other page though now?
As to the links yes they can look a little crude on their own but with some styling wink

flashwiz - 11 March 2008 10:12 AM

Just out of curiosity, when you enter a keyword to search is it searching within every custom field that i make searchable?

Actually I don’t think it is in your case as you don’t have the search_in value set anywhere in the form. I could be wrong though.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 10:21 AM   [ Ignore ]   [ # 25 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Going home now so will pick up any answers to this thread in a little while.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 10:26 AM   [ Ignore ]   [ # 26 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Yea- a separate list of category links or a hack around

// We only require a keyword if the member name field is blank
        
        
if ( ! isset($_GET['mbr']) OR ! is_numeric($_GET['mbr']))
        
{        
            
if ( ! isset($_POST['member_name']) OR $_POST['member_name'] == '')
            
{        
                
if ( ! isset($_POST['keywords']) OR $_POST['keywords'] == "")
                
{            
                    
return $OUT->show_user_error('general', array($LANG->line('search_no_keywords')));
                
}
            }
        }


That’s needed if no keywords.  Or you might could have js put in a * for the keywords if it’s empty- then make sure min_length is set to 1.  Think that’s what I did.

And as to where is seaches- it’s determined by search_in- if set to everywhere, it hits the title and all searchable fields.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 11 March 2008 11:20 AM   [ Ignore ]   [ # 27 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Great reply Robin! wink

The setting search to 1 character and using Javascript to fill in a * incase they haven’t set anything is a great idea!

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 11:21 AM   [ Ignore ]   [ # 28 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

Hi Robin, silly question, but where does that code go in order to hack it?

grin

Or where and how do i put the other bit so that i can set the keyword to min length 1 and get javascript to add in the *. Sorry my coding only goes sooooooo far wink

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
Posted: 11 March 2008 12:10 PM   [ Ignore ]   [ # 29 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Hi Brian,

I think the code that Robin has shown there is the code that currently resides in admin->modules->search->mod.search.php at around line 140. I think that you would need to do a modification to it to enable you to get what you need.

At least I’m pretty sure that’s what it is.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 12:31 PM   [ Ignore ]   [ # 30 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Hi Brian,

As to the javascript side of things my Javascript is not very good so I had to go away and code this and test it out but this kind of thing should work for you hopefully.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<
title>Set Fields</title>
</
head>
<
body>
<
div id="wrapper">

<
form name="myForm" method="post" action="submit.php">
<
input type="text" name="keyword" onblur="setKeyword();" onfocus="wipeState();" value="*"><br />
</
form>


function
wipeState(){
document
.forms.myForm.keyword.value = "";
}

function setKeyword(){
if (document.forms.myForm.keyword.value == ""){
document
.forms.myForm.keyword.value = "*";
}
}


</div>
</
body>
</
html>

That should set the field value to * if the user clicks into the field but doesn’t enter anything.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 01:16 PM   [ Ignore ]   [ # 31 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

The code for the mod.search.php file looks the same as the code i already have in that file at that line number.

Will try you Javascript too, many thanks Mark, above and beyond with help, much appreciated.

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
Posted: 11 March 2008 01:20 PM   [ Ignore ]   [ # 32 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

What happens if the user doesnt click into the field? ie someone just comes along and thinks i want to see all the jobs in the defence sector…

then they are presented with no jobs basically…

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
Posted: 11 March 2008 01:23 PM   [ Ignore ]   [ # 33 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

If they don’t click into the field then it already has the field value=”*” value set to a * so will just work. You will of course need to set the minimum search length to 1 as Robin said but the code above should cover all the bases. Perhaps just copy-paste the whole of the code I have given into a new blank template and see what it does. Should be fairly easy to take apart to get what you need from it then.

Hope that helps?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 March 2008 01:27 PM   [ Ignore ]   [ # 34 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

I might be stupid here, but wont that make the search look for * in the jobs… as in not find anything containing * and therefore give no results?

Or am i been stupid here..

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
Posted: 11 March 2008 01:32 PM   [ Ignore ]   [ # 35 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Hi Brian,

As far as I know (could be wrong though - Robin?) the * symbol is used as a wild-card search so it should bring back all results no matter what.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 12 March 2008 05:25 AM   [ Ignore ]   [ # 36 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  112
Joined  02-20-2007

Well this is all working nicely now… apart from one thing… do you have to turn on pagination somewhere within search results? Never had a problem before, but for some reason or other it doesnt work when i do a search now.

thanks
B.

 Signature 

Better to regret something you did rather than something you didnt

Profile
 
 
   
2 of 3
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65087 Total Logged-in Users: 35
Total Topics: 82226 Total Anonymous Users: 22
Total Replies: 441924 Total Guests: 217
Total Posts: 524150    
Members ( View Memberlist )