-
AuthorPosts
-
hcharly Friend
hcharly
- Join date:
- April 2008
- Posts:
- 107
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 11 times in 1 posts
February 13, 2011 at 10:30 am #160121Hello,
I noticed the following error developing at localhost. I checked at your demo site and the result is the same.
I’m using J.1.5.22 and JaBoard 1.5:Search Job form
Find keywords: test will find 3 jobs with any “Job must match” option.
Find keywords: secretary will find 2 jobs with any “Job must match” option.
As far it’s normal.Trying to search combining boths keyword -> test secretary | test, secretary will return 0 found whatever the “Job Must Match” option is.
May someone give it a look.
In advance thanks.
-CharlesNick R JA JobBoardNick R
- Join date:
- August 2009
- Posts:
- 284
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 12
- Thanked:
- 20 times in 1 posts
February 13, 2011 at 10:45 am #376465Hi There,
I tried it as well, demo and on my site – Error confirmed
I guess some of the dev’s will take a look at this.Cheers
NickVinh CV FriendVinh CV
- Join date:
- August 2009
- Posts:
- 574
- Downloads:
- 0
- Uploads:
- 2
- Thanked:
- 76 times in 72 posts
February 14, 2011 at 5:01 am #376557<em>@hcharly 221153 wrote:</em><blockquote>Hello,
I noticed the following error developing at localhost. I checked at your demo site and the result is the same.
I’m using J.1.5.22 and JaBoard 1.5:Search Job form
Find keywords: test will find 3 jobs with any “Job must match” option.
Find keywords: secretary will find 2 jobs with any “Job must match” option.
As far it’s normal.Trying to search combining boths keyword -> test secretary | test, secretary will return 0 found whatever the “Job Must Match” option is.
May someone give it a look.
In advance thanks.
-Charles</blockquote>Dear hcharly,
What’s the JaJobBoard version you are using?
With JAJobboard 1.5.0, to fix the problem, please extract and replace attach file to the file: SITE/componentscom_jajobboardhelperjafunctions.class.php
11210hcharly Friendhcharly
- Join date:
- April 2008
- Posts:
- 107
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 11 times in 1 posts
February 14, 2011 at 12:43 pm #376641OK Guys,
After some investigations in the code, I made the following changes that works for me.
This may be a good provisory fix for those who need it.
Here’s how I fixed it:You need to edit jafunctions.class.php (components / com_jajobboard / helper / jafunctions.class.php).
1-Find this function JB_Build_where
Near the end of this function find the code
[PHP]$subwhere [] .= ” (a.$field->field_name LIKE ” . $db->Quote ( ‘%’ . $db->getEscaped ( $search, true ) . ‘%’, false ) . “)”;[/PHP] and replace it by this one [PHP]$title_keyword = standardize_keyword($search);
foreach ($title_keyword as $search_keyword) {
$subwhere [] .= ” (a.$field->field_name LIKE ” . $db->Quote ( ‘%’ . $db->getEscaped ( $search_keyword, true ) . ‘%’, false ) . “)”;
}[/PHP]Doing so filtering with multiple keywords will work.
But there some other minor fixes such as – user may not select keyword option / user may search with quotes as within google / user may use comma separeted keywords.To better handle such cases, I brought a slight modification to the function standardize_keyword (in the same file near line 2354).
Here’s my code after edit. The code before changes are in Green for those who need to compare:
$keyword = trim ( $keyword );
/* Begin FIX : filter options
if (substr ( $keyword, 0, 1 ) == '"' && substr ( $keyword, count ( $keyword ) - 2, 1 ) == '"')
$keyword = str_ireplace ( '" ', '"+', $keyword );
*/
$check_keyword_option = JRequest::getVar ( 'keyword_option' );
if ($keyword) {
if ( (!is_null($check_keyword_option) && $check_keyword_option == '3') && (substr ( $keyword, 0, 1 ) != '"')) {
$keyword = '"' . $keyword . '"'; // phrase search as keyword_option is selected and is '3'
}}
if (substr ( $keyword, 0, 1 ) == '"' && substr ( $keyword, count ( $keyword ) - 2, 1 ) == '"') {
$keyword = str_ireplace ( '" ', '"+', $keyword );
} else {
$keyword = str_replace(',','+', $keyword); // this is to accept comma as a keyword seperator as used in other part of JA Board.
}
/* End FIX: filter options */$keyword = explode ( "+", $keyword );
// FIX: filter options. After a comma user may insert extra space(s). Let's clean those spaces from values.
foreach ($keyword as &$keyvalue) {
$keyvalue = trim($keyvalue);
}$temp_keyword = array ();
If you don’t need to compare, just copy the code above and replace the one below with it (7 first lines of the standardize_keyword’s function ):
$keyword = trim ( $keyword );
if (substr ( $keyword, 0, 1 ) == '"' && substr ( $keyword, count ( $keyword ) - 2, 1 ) == '"')
$keyword = str_ireplace ( '" ', '"+', $keyword );$keyword = explode ( "+", $keyword );
$temp_keyword = array ();
That’s all.
Hope this helps.
-Charlessharpdome Friendsharpdome
- Join date:
- December 2010
- Posts:
- 247
- Downloads:
- 6
- Uploads:
- 4
- Thanks:
- 62
- Thanked:
- 5 times in 1 posts
February 16, 2011 at 1:22 am #376871Does the file that Vinh posted earlier fix the problem?
Vinh CV FriendVinh CV
- Join date:
- August 2009
- Posts:
- 574
- Downloads:
- 0
- Uploads:
- 2
- Thanked:
- 76 times in 72 posts
February 16, 2011 at 3:45 am #376885Thanks hcharly for your post.
For more complext keywords( with character: +, ‘, ” ), you should using hcharly changes or Google search, it will be better.
hcharly Friendhcharly
- Join date:
- April 2008
- Posts:
- 107
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 11 times in 1 posts
February 16, 2011 at 6:42 am #376908<em>@sharpdome 221715 wrote:</em><blockquote>Does the file that Vinh posted earlier fix the problem?</blockquote>
When I posted “my provisory fix” there was no answer from Vinhcv.
I’ll test and implement his fix as the official one.Regards.
-Charleshcharly Friendhcharly
- Join date:
- April 2008
- Posts:
- 107
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 11 times in 1 posts
hcharly Friendhcharly
- Join date:
- April 2008
- Posts:
- 107
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 14
- Thanked:
- 11 times in 1 posts
-
AuthorPosts
This topic contains 10 replies, has 4 voices, and was last updated by Nick R 13 years, 9 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum