| :: |
| Author |
Message |
golgoth
Joined: 06 May 2008 Posts: 19
|
Posted: Sat Jun 14, 2008 6:33 pm Post subject: Advanced search bug (related to phpbb-seo) |
|
|
I just noticed that advanced search in my forum is not working properly: if i try to search inside a forum i get some random results picked from other sections.
After some tests, i saw that the code that causes the error is this replace in search.php:
| Code: | #
#-----[ FIND ]------------------------------------------
#
$u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
$u_search .= ($search_id) ? '&search_id=' . $search_id : '';
$u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
$u_search .= ($topic_id) ? '&t=' . $topic_id : '';
$u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author)) : '';
$u_search .= ($author_id) ? '&author_id=' . $author_id : '';
$u_search .= ($u_search_forum) ? '&fid%5B%5D=' . $u_search_forum : '';
$u_search .= (!$search_child) ? '&sc=0' : '';
$u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : '';
$u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : '';
#
#-----[ REPLACE, WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
//$u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
$u_search = $u_sort_param . $u_show_results;
$u_search .= ($search_id) ? '&search_id=' . $search_id : '';
$u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
$u_search .= ($topic_id) ? '&t=' . $topic_id : '';
$u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author)) : '';
$u_search .= ($author_id) ? '&author_id=' . $author_id : '';
$u_search .= ($u_search_forum) ? '&fid%5B%5D=' . $u_search_forum : '';
$u_search .= (!$search_child) ? '&sc=0' : '';
$u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : '';
$u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : '';
$u_search = trim($u_search, '&');
if ( $phpbb_seo->seo_opt['rewrite_usermsg'] && (!empty($author) || !empty($author_id)) ) {
$author_name = '';
if (!empty($author_id)) {
$sql = $sql = 'SELECT username
FROM ' . USERS_TABLE . "
WHERE user_id = $author_id
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) {
$author_name = $row['username'];
$phpbb_seo->set_user_url( $author_name, $author_id );
}
}
if (!empty($author) && (strpos($author, '*') === false) ) {
$sql = $sql = 'SELECT user_id
FROM ' . USERS_TABLE . "
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) {
$phpbb_seo->set_user_url( $author, $row['user_id'] );
}
}
$author = empty($author) ? $author_name : $author;
}
$u_search = append_sid( "{$phpbb_root_path}search.$phpEx" . (!empty($u_search) ? '?' . $u_search : '') );
// www.phpBB-SEO.com SEO TOOLKIT END |
Can you guys help me fixing it?
Thanks |
|
|
| Back to top |
|
 |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3482
|
|
| Back to top |
|
 |
golgoth
Joined: 06 May 2008 Posts: 19
|
Posted: Sun Jun 15, 2008 4:26 pm Post subject: Re: Advanced search bug (related to phpbb-seo) |
|
|
| I deactivated it, but i still get that error. Right now i restored the original code to get it work correctly. |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 809
|
Posted: Sun Jun 15, 2008 4:32 pm Post subject: Re: Advanced search bug (related to phpbb-seo) |
|
|
| Specifically what search options are you using (forum + keyword)? I just tried it on my forum and it works as expected. |
_________________ Dan Kehn |
|
| Back to top |
|
 |
golgoth
Joined: 06 May 2008 Posts: 19
|
Posted: Sun Jun 15, 2008 8:00 pm Post subject: Re: Advanced search bug (related to phpbb-seo) |
|
|
I used a common word, "patch", and searched in a specifical forum (which has 3 subforums).
Right now in my site the search engine is working correctly because those lines of code haven't been added, but if you wish i'll add them so that you can see the problem with your own eyes. |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3482
|
|
| Back to top |
|
 |
golgoth
Joined: 06 May 2008 Posts: 19
|
Posted: Sat Jun 21, 2008 10:48 pm Post subject: Re: Advanced search bug (related to phpbb-seo) |
|
|
Any news?
By the way, im going to totally reinstall my forum, along with phpbb-seo.
Do i have to make some changes in order to make search engine works correctly (domain and forum path won't change) or do i simply need to rename (in SEO ACP) forum categories with the same names i did before? |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3482
|
|
| Back to top |
|
 |
golgoth
Joined: 06 May 2008 Posts: 19
|
Posted: Sun Jun 22, 2008 11:13 am Post subject: Re: Advanced search bug (related to phpbb-seo) |
|
|
| Sure i will! I'll reinstall everything as soon as phpBB 3.0.2 will come out! |
|
|
| Back to top |
|
 |
golgoth
Joined: 06 May 2008 Posts: 19
|
Posted: Sun Jun 22, 2008 5:47 pm Post subject: Re: Advanced search bug (related to phpbb-seo) |
|
|
I forgot to ask: why do we have to wait a month or two to replace robots.txt?
I didn't understand the reason and i was curious  |
|
|
| Back to top |
|
 |
remixed
Joined: 09 May 2008 Posts: 19
|
Posted: Sat Jul 05, 2008 9:22 am Post subject: Re: Advanced search bug (related to phpbb-seo) |
|
|
because google has your bad (not seo friendly) urls indexed first. The next time google visit your website he wil look at your robots.txt. If all bad (not seo friendly) urls are blocked google will delete all those urls and not directly replace it by the good urls (take some time for google). Which means that nobody visit your site anymore  |
|
|
| Back to top |
|
 |
|
|