[2.0.19] Search Box

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
10
91%
Very Good
0
No votes
Good
0
No votes
Fair
0
No votes
Poor
1
9%
 
Total votes: 11

Shanana
Registered User
Posts: 368
Joined: Sat Aug 28, 2004 4:03 am
Location: USA [from London, England]

Post by Shanana »

So it's basically what vB has. Cool mod.
Jane Doe
Registered User
Posts: 145
Joined: Thu Aug 11, 2005 12:35 pm

Post by Jane Doe »

Blitze wrote: Greetings,

first of all, great mod. I installed it and I'm just loving it.

Except I'm having a little problem with posting_body.tpl. I have the fast polls mod installed and there seems to be conflicts between the two mods. The functions (function edit_options(caller) ....) of fast poll mod appears in input fields and it displays about 15 of such fields.

Does any body have this problem?
Any help will be appreciated

Thanks


Problem is this line in function edit_options(caller)

Code: Select all

var form = document.forms[0];
form[0] means the first form in the document but the first form is
now the search box.
So change [0] to [1] and it should work.
Blitze
Registered User
Posts: 410
Joined: Tue Nov 29, 2005 5:06 pm

Post by Blitze »

Thanks Jane Doe.

I made the change you suggested. [0] to [1] did not work. Since I have attachment mod installed I changed it to [2]. At this point it comes up fine but when I click on "Add Option" I get the function showing up in the input area again. If I change it to [3], it nullifies fast poll mod and the page refreshes to add an option.

Please help. :cry:
Jane Doe
Registered User
Posts: 145
Joined: Thu Aug 11, 2005 12:35 pm

Post by Jane Doe »

There is perhaps another way to solve this problem.
Since in some templates the number of your forms varies, you can also adress the form by name.

eg.

change

Code: Select all

var form = document.forms[0];
to

Code: Select all

var form = document.post;
The name of the form in the posting_body.tpl is "post"
Blitze
Registered User
Posts: 410
Joined: Tue Nov 29, 2005 5:06 pm

Post by Blitze »

:cry: I made the change to var form = document.post; but I'm still getting the same error. I'm not sure why. I added alert(form) to see what it's reading as the form name and it says [objectHTMLFormElement].

Thanks
Jane Doe
Registered User
Posts: 145
Joined: Thu Aug 11, 2005 12:35 pm

Post by Jane Doe »

The line in posting_body.tpl is something like this ?

Code: Select all

<form action="{S_POST_ACTION}" method="post" name="post" ...
and it is the only form in posting.tpl?
User avatar
webmacster87
Former Team Member
Posts: 3758
Joined: Fri Jun 11, 2004 2:30 am
Location: San Mateo, CA
Name: Douglas Bell
Contact:

Post by webmacster87 »

MOD Updated to version 1.0.1
See first post for Download Link
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Any Update code? Thanks!
User avatar
freddie
Registered User
Posts: 404
Joined: Sun Mar 31, 2002 1:40 pm
Location: Estes Park, USA
Contact:

Post by freddie »

great mod, works perfect !
tony44
Registered User
Posts: 232
Joined: Sun Apr 17, 2005 4:34 pm

Post by tony44 »

Found it. Nevermind 8)
tony44
Registered User
Posts: 232
Joined: Sun Apr 17, 2005 4:34 pm

Post by tony44 »

I am trying to apply this mod to my bbtech style so the code is different in the header. Does this look right? I tried the mod once and it did not work for me.

Code: Select all

<A HREF="{U_SEARCH}">
<IMG SRC="templates/BBTech/images/BBTech-hd_09.gif" WIDTH=59 HEIGHT=22 BORDER=0 ALT="{L_SEARCH}"></A>						<div id="searchbox" style="display:none;z-index: 100;">
						<form action="{S_SEARCH_ACTION}" method="POST">
						<table class="forumline" cellpadding="4" cellspacing="1" border="0">
						  <tr>
						    <th class="thHead" height="25"><a onclick="searchTooltip(); return false;" href="#" style="float:right;color: #FFF;font-size: 9px;font-family:Verdana, sans-serif; text-decoration: none;">(X)</a>{L_SEARCH_QUERY}</th>
						  </tr>
						  <tr>
						    <td class="row1" align="center">
						      <input type="text" style="width: 180px" class="post" name="search_keywords" size="30" /> <input class="liteoption" type="submit" value="{L_SEARCH}" />
						      <input type="hidden" name="search_terms" value="all" />
						      <input type="hidden" name="search_forum" value="-1" />
						      <input type="hidden" name="search_time" value="0" />
						      <input type="hidden" name="search_cat value="-1" />
						      <input type="hidden" name="sort_by value="0" />
						      <input type="hidden" name="sort_dir value="ASC" />
						      <input type="hidden" name="show_results value="posts" />
						      <input type="hidden" name="return_chars value="200" />
						      <input type="hidden" name="search_fields" value="all" />
						    </td>
						  </tr>
						  <tr>
						    <td class="catBottom" align="center">
							  <a href="{U_SEARCH}" class="nav">{L_ADVANCED_SEARCH}</a></TD>
<TD>
<A HREF="{U_ALBUM}">
<IMG SRC="templates/BBTech/images/BBTech-hd_album.gif" WIDTH=59 HEIGHT=22 BORDER=0 ALT="{L_ALBUM}"></A></TD>
<TD>
sellis999
Registered User
Posts: 5
Joined: Tue Dec 06, 2005 9:17 pm

great mod

Post by sellis999 »

tony44, it looks like you are missing the onclick="return searchTooltip();" attribute...

Alfatek, thanks for the great mod! I made one small improvement :-)


if you add the line:

document.forms[0].search_keywords.focus();


to the end of the else clause of the javascript method searchTooltip(), then the search box is automatically focused for typing, saving an unnecessary click.

Best,
Scott


E.g. here is my searchTooltip() method:

Code: Select all

function searchTooltip(){

  if (tooltipon){
    $('searchbox').style.display = 'none';

    tooltipon = false;
  }
  else{
    $('searchbox').style.display = 'block';
    $('searchbox').style.position = 'absolute';

    var obj = $('searchlink');
    var pos = Position.cumulativeOffset(obj);
    $('searchbox').style.left = pos[0] + 'px';
    $('searchbox').style.top = pos[1]+20 + 'px';

    tooltipon = true;

    // ****   CHANGE   ****
    // automatically set input focus on the textbox
    document.forms[0].search_keywords.focus();
    // ****  END CHANGE ****
  }

  return false;
}
Last edited by sellis999 on Sat Apr 01, 2006 5:52 am, edited 1 time in total.
sellis999
Registered User
Posts: 5
Joined: Tue Dec 06, 2005 9:17 pm

Re: great mod

Post by sellis999 »

[edit: double post]
tony44
Registered User
Posts: 232
Joined: Sun Apr 17, 2005 4:34 pm

Post by tony44 »

Sellis thanks for the advice, but it's still not working for me. I'm ok at copy and pasting, but that's about it. :P
Last edited by tony44 on Fri Apr 14, 2006 3:38 am, edited 1 time in total.
24fan24
Registered User
Posts: 42
Joined: Thu Mar 16, 2006 1:45 am

Post by 24fan24 »

Excellent mod. Thanks a lot!
Post Reply

Return to “[2.0.x] MOD Database Releases”