Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 19:40

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 1 post ] 
Author Message
PostPosted: 31 Mar 2012, 15:30 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
User Picker in Search

Request Topic: http://www.phpbb.com/community/viewtopi ... &t=2153327
Request by: Dark Star

With this Snippet you have a 'Find A Member' link, that allows you to select members (as in ACP > Manage Users) for search.php

Attachment:
user_picker_in_search_php.jpg
user_picker_in_search_php.jpg [ 84.88 KiB | Viewed 1897 times ]

Demo: search.php

Instruction

open

search.php

find

Code:
    'S_IN_SEARCH'            => true


after add

Code:
    // User Picker in Search / 4seven / 2012
    'U_FIND_USERNAME'        => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username&select_single=true'),
    // User Picker in Search / 4seven / 2012         


open

styles/prosilver/template/memberlist_search.html

Code:
function insert_single(user)
{
    opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user;
    self.close();


replace with

Code:
function insert_single(user)
{

    if (opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}){
    opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user;
    self.close();}
    
    if 
(opener.document.forms['{S_FORM_NAME}'].author){
    opener.document.forms['{S_FORM_NAME}'].author.value = user;
    self.close();}



open

styles/prosilver/template/search_body.html

find

Code:
<form method="get" action="{S_SEARCH_ACTION}"


replace with

Code:
<form id="select_user" method="get" action="{S_SEARCH_ACTION}"


find

Code:
        <dt><label for="author">{L_SEARCH_AUTHOR}:</label><br /><span>{L_SEARCH_AUTHOR_EXPLAIN}</span></dt


replace with

Code:
        <dt><label for="author">{L_SEARCH_AUTHOR}:</label><br /><span>{L_SEARCH_AUTHOR_EXPLAIN}</span>
        <br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dt


Clear all Board-, Template-, Style- and Browser-Caches

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.012s | 24 Queries | GZIP : Off ]