[solved]how to use the user-search-form

16 years 6 days ago #61641 by carsten888
[solved]how to use the user-search-form was created by carsten888
on page with the list of users is a small search-form with just one text-field for searching usernames. I want that form on the search-result-page of cb_advanced_search.

so this is the code for the form on the user-list page:
[code:1]<input type="text" name="search" class="inputbox" size="15" maxlength="100"<?php
if (isset($search)) echo " value=\"".htmlspecialchars($search)."\""; ?> />
<input type="image" src="<?php echo $adminimagesdir; ?>search.gif" alt="<?php echo _UE_SEARCH; ?>" align="top" style="border: 0px;" />[/code:1]

I didn't like the submit-image so I got rid of that and the output now is this working code:
[code:1]<form name="adminForm" method="post" action="http://localhost/mything/index.php?option=com_comprofiler&task=usersList&listid=2&Itemid=31&action=search" >
<input type="submit" class="button" value="zoeken" /></form>[/code:1]

so the above code works on the cb-userslist page. now I put this same code into the search-result-page of cb-advanced-search. I made sure the form is not within a form. when submitted I get a alert with an error:

Session expired and/or cookies are not enabled in your browser.

my cookies are enabled and search works from other page, so I guess it's the session going wrong.

How can I get this form working?

Post edited by: carsten888, at: 2008/04/27 17:42

Please Log in to join the conversation.

16 years 5 days ago #61686 by carsten888
solved! (well, sort of)

Instead of putting the cb-search form into the cb-advanced-search-page I put part of the cb-advanced-search-form into the cb-advanced-search-results page. No messing with sessions, and it works! now my cb-advanced-search result page looks exactly like the cb-result page.

file:
components/com_cb_search/cb_search.html.php
line:
423
[code:1] <a href="<?php echo ampReplace(sefRelToAbs("index.php?option=com_cb_search&amp;task=simple&amp;Itemid=$Itemid"«»)); ?>"><?php echo _CB_AS_TITLE; ?></a>[/code:1]

replace with:
[code:1]<form action="<?php echo $mosConfig_live_site; ?>/index.php?option=com_cb_search&amp;Itemid=44" method="post" id="adminForm" name="adminForm">
<input type="hidden" name="searchoperator0" id="searchoperator0AND" value="AND" checked="checked" />
gebruikersnaam: <input class="inputbox" mosReq=0 mosLabel="Gebruikersnaam" type="text" name="username" value="" />
<input type="hidden" name="id" value="0" />
<input type="hidden" name="gid" value="0" />
<input type="hidden" name="option" value="com_cb_search" />
<input type="hidden" name="task" value="simplesearch2" />

<input type="image" src="<?php echo $mosConfig_live_site; ?>/components/com_cb_search/images/search.gif" alt="Zoek" align="top" style="border: 0px;" /> &nbsp; <a href="index.php?option=com_cb_search&task=simple&Itemid=44">uitgebreid zoeken</a>
</form>[/code:1]

change Itemid to the menuitem id to make the button selected on the serach-results page.
gebruikersnaam = username (dutch)
uitgebreid zoeken = advanced search (dutch)

hope this helps someone.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.172 seconds

Facebook Twitter LinkedIn