How to set Profile search to search_result_mode=ext by default?

When you do a members search, the url displays as:

http://www.mydomain.com/search.php?search_mode=simple&NickName=theirusername&ID=&submit=Search

 

What I want is to show member's details by default, the url displays as:

http://www.mydomain.com/search.php?search_result_mode=ext&search_mode=simple&NickName=theirusername&submit=Search

 

I found the bit of code to edit is in inc/classes/BxDolProfileFields.php:

                'name'  => 'search_mode',
When I change it to 'name'  => 'search_result_mode=ext&search_mode', it is stripping the & and = characters. It displays the url as:

http://www.mydomain.com/search.php?search_result_mode%3Dext%26search_mode=simple&NickName=theirusername&ID=&submit=Search

If I go to the address bar and replace the %3D with =, and the %26 to & and hit enter, it takes me to the profiles with the detailed results, just as I want. Does anyone know what I can do to make this stop replacing the characters? I've read up this page:

http://www.w3schools.com/tags/ref_urlencode.asp

I've even tried 'name'  => 'search_result_mode%3Dext%26search_mode', but it doesn't work. Why is it stripping and not displaying correctly?

Quote · 15 Sep 2012

It is not intended to be edited in that manner. The function that array is passed to is not expecting to see two parameters in that name array entry.

Do this instead.

Undo your changes and edit this file instead.

In the root of your dolphin site in the file search.php at about line 31 look for this.

bx_import('BxTemplProfileView');

Add this directly under it.

if(!isset($_GET['search_mode'])) {
    header('Location: search.php?search_result_mode=ext&search_mode=sim');
}


Then go down to about line 90 and look for this.

        $sLinks = BxDolPageView::getBlockCaptionMenu(mktime(), array(
            'simple' => array('href' => $sUrl . '?search_mode=sim', 'title' => _t('_search_tab_simple'), 'onclick' => '', 'active' => $bSimAct),
            'advanced' => array('href' => $sUrl . '?search_mode=adv', 'title' => _t('_search_tab_Adv'), 'onclick' => '', 'active' => $bAdvAct),
            'quick' => array('href' => $sUrl . '?search_mode=quick', 'title' => _t('_search_tab_quick'), 'onclick' => '', 'active' => $bQuiAct),
        ));


Change it to this.

        $sLinks = BxDolPageView::getBlockCaptionMenu(mktime(), array(
            'simple' => array('href' => $sUrl . '?search_result_mode=ext&search_mode=sim', 'title' => _t('_search_tab_simple'), 'onclick' => '', 'active' => $bSimAct),
            'advanced' => array('href' => $sUrl . '?search_result_mode=ext&search_mode=adv', 'title' => _t('_search_tab_Adv'), 'onclick' => '', 'active' => $bAdvAct),
            'quick' => array('href' => $sUrl . '?search_result_mode=ext&search_mode=quick', 'title' => _t('_search_tab_quick'), 'onclick' => '', 'active' => $bQuiAct),
        ));

https://www.deanbassett.com
Quote · 15 Sep 2012

When I go to search.php, it redirects to http://www.mydomain.com/search.php?search_result_mode=ext&search_mode=sim, so that part is good. But when you use the search form to search for, let's say User name, it goes to this url:

http://www.mydomain.com/search.php?search_mode=simple&NickName=SEARCHEDNAME&submit=Search

 

It's stripping the search_result_mode=ext out of the URL. What could fix that?

 

Also, I only use Simple search, and I was able to remove the quick and advance links from the search box in search.php by removing these lines:

            'advanced' => array('href' => $sUrl . '?search_result_mode=ext&search_mode=adv', 'title' => _t('_search_tab_Adv'), 'onclick' => '', 'active' => $bAdvAct),
            'quick' => array('href' => $sUrl . '?search_result_mode=ext&search_mode=quick', 'title' => _t('_search_tab_quick'), 'onclick' => '', 'active' => $bQuiAct),

 

Where can I remove the "Simple" and "Details" links on the result box? I don't see it in search.php. Sometimes this software is a Pain in the @ss because you have to edit several files to accomplish one little goal.

Quote · 15 Sep 2012

I was wrong in my last post, it's Detailed search I use.

In regards to the Simple and Details links, just like I figured, it was in a totally different file, /base/scripts/BxBaseProfileView.php.

 

If I remove

                    case 'ext':
                        $modeTitle = _t('_Extended');
                    break;

 

It removes the Details link. But if I remove

                    case 'sim':
                        $modeTitle = _t('_Simple');
                    break;

It removes the link, but leaves the little grey bubble, I've included an image.

 

searchbox.jpg · 18.6K · 204 views
Quote · 15 Sep 2012

Guess thats's not going to work.

I'll have to do some more digging. Back to the drawing board of that one.

https://www.deanbassett.com
Quote · 15 Sep 2012

Well, you got it right up to the point of using the search. I'll owe you a case of beer for all your help Tongue Out

Quote · 15 Sep 2012

If only the boonex developers would participate in these forums more often.

I am sure there is a very simple way to change the mode. They wrote it, so they probably know exactly where it is.

Instead of doing hacks like this.

https://www.deanbassett.com
Quote · 16 Sep 2012

That's what gets me most, most of the things we hack, are things that should be included right outta the box. It sux when you have to go through file after file just to change one thing.

Quote · 16 Sep 2012

Does anyone from Boonex read these forums? I know this is an easy fix, but I can't find where to fix the search feature, the rest works.

Quote · 18 Sep 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.