Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: winrules on March 12, 2006, 05:45:54 PM

Title: Search Topic
Post by: winrules on March 12, 2006, 05:45:54 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=297)

This mod adds a "Search Topic" field in the display template, as seen in the picture below:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg82.imageshack.us%2Fimg82%2F2726%2Fsearchtopic6ea.png&hash=d59d4e97d30ad098ad8c7f1541ddebc76363c1e2)
Title: Re: Search Topic
Post by: Prasad007 on March 14, 2006, 07:29:55 AM
what does this mod do?
does it search for something inside the topic?
or search for some topic itself ?

no proper discription or explanation has been provided..
Title: Re: Search Topic
Post by: winrules on March 14, 2006, 08:13:13 AM
Quote from: Prasad007 on March 14, 2006, 07:29:55 AM
what does this mod do?
does it search for something inside the topic?
or search for some topic itself ?

no proper discription or explanation has been provided..


It adds a field in display.template.php. When you search it, it searchs all the posts in that particular topic.

Demo: http://www.squareeggs.ecwhost.com/smf/index.php?topic=2.0
Title: Re: Search Topic
Post by: Prasad007 on March 14, 2006, 08:14:25 AM
okay thanks! :)
Title: Re: Search Topic
Post by: kezayah on March 15, 2006, 03:22:01 AM
very good initiative !!!  :P
Title: Re: Search Topic
Post by: Skipdawg on March 19, 2006, 04:15:03 PM
kewl!
this should come in handy.  ;)
Title: Re: Search Topic
Post by: ivo2296 on March 25, 2006, 10:02:56 PM
I like it very much but when you have time can you do it for smf 1.0.5 or 1.0.6, cause those are the latest and final versions of SMF - RC2 is still beta.

Thank you!
Title: Re: Search Topic
Post by: ivo2296 on May 05, 2006, 12:18:21 AM
i have copied the code in cassic theme (Display.template.php) in smf 1.0.7 but it searches in hole forum.

Nice try :)

Title: Re: Search Topic
Post by: winrules on May 05, 2006, 03:37:22 PM
Quote from: ivo2296 on May 05, 2006, 12:18:21 AM
i have copied the code in cassic theme (Display.template.php) in smf 1.0.7 but it searches in hole forum.

Nice try :)


this mod doesn't work on 1.0.7.
Title: Re: Search Topic
Post by: ivo2296 on May 05, 2006, 10:39:07 PM
Quote from: winrules on May 05, 2006, 03:37:22 PM
Quote from: ivo2296 on May 05, 2006, 12:18:21 AM
i have copied the code in cassic theme (Display.template.php) in smf 1.0.7 but it searches in hole forum.

Nice try :)


this mod doesn't work on RC2.

I didn't say that i'm using RC2?!?
Title: Re: Search Topic
Post by: Teknomancer on May 06, 2006, 02:46:01 AM
this mod works great... I've customized it even.
Title: Re: Search Topic
Post by: winrules on May 06, 2006, 08:06:54 AM
Quote from: ivo2296 on May 05, 2006, 10:39:07 PM
Quote from: winrules on May 05, 2006, 03:37:22 PM
Quote from: ivo2296 on May 05, 2006, 12:18:21 AM
i have copied the code in cassic theme (Display.template.php) in smf 1.0.7 but it searches in hole forum.

Nice try :)


this mod doesn't work on RC2.

I didn't say that i'm using RC2?!?

*bangs head*
this mod doesn't work for 1.0.7, only 1.1RC2.
Title: Re: Search Topic
Post by: HaxXxoR on May 30, 2006, 06:20:16 PM
I modified it as well. Anyone help with the code? i got rid of the search box, cause it didnt work with my theme, and added some text that says "Search Topic". How do i make it to when they go to type something in it erases what i have there so they can type something in??
Title: Re: Search Topic
Post by: winrules on May 30, 2006, 08:35:28 PM
You would have to use javascript. You should probobally post in the scripting help board.
Title: Re: Search Topic
Post by: HaxXxoR on May 30, 2006, 09:18:37 PM
The only reason that i posted it here is that i went to Teknomancers site and he has it that way.

Teknomancer how did you get it to do that lol
Title: Re: Search Topic
Post by: Vinspire on May 31, 2006, 11:15:31 PM
How to get this mod to work on other themes ?
Title: Re: Search Topic
Post by: vnt87 on June 01, 2006, 07:07:23 AM
works great, thanks :D
Title: Re: Search Topic
Post by: winrules on June 01, 2006, 04:00:00 PM
Vinspire, look here: http://docs.simplemachines.org/index.php?topic=402
Title: Re: Search Topic
Post by: Vinspire on June 01, 2006, 10:12:37 PM
Quote from: winrules on June 01, 2006, 04:00:00 PM
Vinspire, look here: http://docs.simplemachines.org/index.php?topic=402

Thanks :)
Title: Re: Search Topic
Post by: vnt87 on June 01, 2006, 11:19:15 PM
Quote from: HaxXxoR on May 30, 2006, 06:20:16 PM
I modified it as well. Anyone help with the code? i got rid of the search box, cause it didnt work with my theme, and added some text that says "Search Topic". How do i make it to when they go to type something in it erases what i have there so they can type something in??

I'm wondering the same thing as well. Normally it can be done by inserting an 'onfocus' into the input textfield. I've checked Teknomancer's page and apparently that was what he did also. But I cant get the onfocus to work inside an echo function, I wonder what he did for it to work.
Title: Re: Search Topic
Post by: winrules on August 23, 2006, 06:05:13 PM
Version 1.01 has been released! This version adds support for 1.1 RC3.
Title: Re: Search Topic
Post by: randyripoff on September 05, 2006, 08:28:07 PM
Any reason why an Install link isn't showing in my package manager for this one?  Using 1.3.
Title: Re: Search Topic
Post by: winrules on September 05, 2006, 08:59:21 PM
Quote from: randyripoff on September 05, 2006, 08:28:07 PM
Any reason why an Install link isn't showing in my package manager for this one?  Using 1.3.
Do you mean 1.1 RC3?
Title: Re: Search Topic
Post by: randyripoff on September 05, 2006, 09:10:38 PM
D'oh!

I meant 1.08/1.1 RC3
Title: Re: Search Topic
Post by: winrules on September 06, 2006, 05:36:56 PM
Which one? 1.0.8 or 1.1 RC3?
Title: Re: Search Topic
Post by: randyripoff on September 06, 2006, 06:11:50 PM
Sorry, thought they were pretty much the same.  1.08.
Title: Re: Search Topic
Post by: winrules on September 06, 2006, 07:15:19 PM
I only works on 1.1 RC2/3.
Title: Re: Search Topic
Post by: randyripoff on September 06, 2006, 07:28:09 PM
Ah, okay. 

Are there plans to upgrade soon?
Title: Re: Search Topic
Post by: winrules on September 06, 2006, 07:53:43 PM
Quote from: randyripoff on September 06, 2006, 07:28:09 PM
Ah, okay. 

Are there plans to upgrade soon?
I won't be making it for 1.0.8. You can upgrade though.
Title: Re: Search Topic
Post by: ivo2296 on September 24, 2006, 10:24:54 PM
Any help with the classic theme of smf 1.1 RC3 please?
Title: Re: Search Topic
Post by: codenaught on September 24, 2006, 10:33:52 PM
Quote from: ivo2296 on September 24, 2006, 10:24:54 PM
Any help with the classic theme of smf 1.1 RC3 please?
Take a look at these:

http://www.simplemachines.org/community/index.php?topic=34526.0
http://docs.simplemachines.org/index.php?topic=402
Title: Re: Search Topic
Post by: ivo2296 on September 25, 2006, 12:01:52 AM
Quote from: akabugeyes on September 24, 2006, 10:33:52 PM
Quote from: ivo2296 on September 24, 2006, 10:24:54 PM
Any help with the classic theme of smf 1.1 RC3 please?
Take a look at these:

http://www.simplemachines.org/community/index.php?topic=34526.0
http://docs.simplemachines.org/index.php?topic=402


There nothing for smf 1.1 RC3 - RC3 code has many changes, but i'll give a try myself.

Thanks for the links!
Title: Re: Search Topic
Post by: kriskd on December 16, 2006, 08:55:03 PM
Will this work on 1.1 Final as is or will I need to wait for an update?
Title: Re: Search Topic
Post by: Greek on December 17, 2006, 04:56:47 AM
It doesn't work on 1.1 Final
Title: Re: Search Topic
Post by: codenaught on December 17, 2006, 11:12:14 AM
It will work in 1.1. You just need to add ;version_emulate=1.1-RC3 to the end of the package manager url.
Title: Re: Search Topic
Post by: Greek on December 17, 2006, 04:10:22 PM
Thanks. I did  it, but I get again error for compatibility. Perhaps I did something wrong.
Title: Re: Search Topic
Post by: RoarinRow on December 19, 2006, 02:32:13 PM
Very cool, just added this to my 1.1.1. forum and made the changes manually to my display.template.php file  :)
Title: Re: Search Topic
Post by: Greek on December 20, 2006, 04:04:12 AM
Ι did it too, but i have a small display problem.
Can anyone tell me how to correct this?
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg337.imageshack.us%2Fimg337%2F1362%2Fsearchtopicps9.th.png&hash=5fc190a1101e73cabc47005c3a80f8b7fdd705f0) (http://img337.imageshack.us/my.php?image=searchtopicps9.png)
I want the search button to appears on the left of search field, in the same line.

This is the code and in bold, the small changes that I have made:
Quote<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
   <id>winrules:SearchTopic</id>
   <version>1.01</version>
   <file name="$themedir/Display.template.php">
      <operation>
         <search position="replace"><![CDATA[
            <td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
                  ', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
            </td>
]]></search>
         <add><![CDATA[
            <td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
                  ', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
            </td>
            <td>
               <form action="', $scripturl, '?action=search2;topic=', $context['current_topic'], '" method="post" style="margin: 0;">
                  <input type="text" name="search" value="" style="width: 120px;" />&nbsp;
                  <input type="submit" name="submit" value="Αναζήτηση στο θέμα(Search Topic in greek language)" style="width: 25ex;" />
               </form>
            </td>
]]></add>
      </operation>
   </file>
</modification>

Thanks  :)
Title: Re: Search Topic
Post by: FoneBone on January 04, 2007, 06:05:22 PM
Here is a little modification for the german language:

<!--Search topic-->
<td>
<form action="', $scripturl, '?action=search2;topic=', $context['current_topic'], '" method="post" style="margin: 0;">
<input type="text" name="search" style="width: 190px;" value="Thema durchsuchen" onFocus="if (this.value==\'Thema durchsuchen\') this.value = \'\';" onBlur="if (this.value==\'\') this.value=\'Thema durchsuchen\';"/>&nbsp;
<input type="submit" name="submit" value="Los" style="width: 6ex;" />
</form>
</td>
<!-- Search topic end -->

But you all feel free to change every "Thema durchsuchen" to e.g. "Topic Search"
and
the "Los"-Button to e.g. "Go" or something else.

Regards
FoneBone
Title: Re: Search Topic
Post by: ThK on January 30, 2007, 05:26:49 PM
Hi,

I modified the hack, so it uses a variable for "Search Topic", so it can be translated w/o hard coding stuff. German and English included, I chose "Thema durchsuchen" btw. *gg*
Title: Re: Search Topic
Post by: URPG on February 13, 2007, 05:46:36 AM
Does it have to be changed to work with 1.1.2.?
Title: Re: Search Topic
Post by: winrules on February 13, 2007, 05:20:34 PM
Quote from: URPG on February 13, 2007, 05:46:36 AM
Does it have to be changed to work with 1.1.2.?
No.
Title: Re: Search Topic
Post by: NativePages on February 18, 2007, 11:32:13 AM
Quote from: winrules on February 13, 2007, 05:20:34 PM
Quote from: URPG on February 13, 2007, 05:46:36 AM
Does it have to be changed to work with 1.1.2.?
No.

Question: I'm running 1.1.2, had to do a super clean out and reinstall all mods, but got everything working. Search Topic is the last mod I added after the cleanout. It installed, appears to be working, BUT ... on the package manager, it did NOT give me the uninstall option. Is this an upgrade issue, a package manager issue, or something that I can fix by adding a line or 12 of coding somewhere. If I can fix it, where and what do I add?

Thanks in advance! I had so much trouble with the uninstall options disappearing after the upgrade from 1.0.X to 1.1.1 to 1.1.2 I just don't want to risk installing anything else if even one mod isn't 100%.
Title: Re: Search Topic
Post by: Farmacija on February 21, 2007, 11:06:47 AM
i install it on 1.1.2 and its work without any problem! very usefull mod !!!!
Title: Re: Search Topic
Post by: Gourgi on March 18, 2007, 08:57:05 PM
winrules this mod is great but i think you should add uninstall info too ..  
Title: Re: Search Topic
Post by: Farmacija on March 19, 2007, 04:33:50 AM
this mod sholud be implement into official smf forum special for topics that have 80+ pages...
Title: Re: Search Topic
Post by: Matthew Schenker on March 23, 2007, 09:13:32 AM
This topic is interesting to me, as I am looking for ways to improve searching in my forum.  Recently, I have learned that the SMF search functions don't work as well as I had hoped. Perhaps this modification could help?

I'm running 1.1.2.

Thanks!
Title: Re: Search Topic
Post by: AllMassive on April 15, 2007, 06:30:56 PM
This Mod doesn't look like the one on the screenshot.
The search Button is not to the right of the searchfield - perhaps someone knows how to fix this ?
I'm running my Forum with Several Languages, but now the Search-Button is hardcoded to the "Display.template.php" - perhaps you could add multilang-support ?

Otherwise it seems to run fine  :D
Title: Re: Search Topic
Post by: shadow82x on April 26, 2007, 03:21:31 PM
Its pointless to run on 1.1.2 because with the quick search you can do it anyway.. o
Title: Re: Search Topic
Post by: maxgentino on May 16, 2007, 12:09:48 AM
How can i uninstall this mod?
Thanks
Title: Re: Search Topic
Post by: chep on May 21, 2007, 09:42:18 PM
Quote from: Gourgi on March 18, 2007, 08:57:05 PM
winrules this mod is great but i think you should add uninstall info too .. 

True.
Title: Re: Search Topic
Post by: TrueSatan on May 21, 2007, 10:15:47 PM
The uninstall issue is a  very minor fix...unpack the archive...open package-info.xml and change line 16 to:

<uninstall for="1.1 - 1.1.99">

Archive the folder again and it's done.

It doesn't get much easier...
Title: Re: Search Topic
Post by: chep on May 21, 2007, 10:34:53 PM
Well done. Thanks
Title: Re: Search Topic
Post by: TrueSatan on May 22, 2007, 04:14:43 AM
My pleasure...below is an amended version as per my last posting...those who already have the mod installed and wish to uninstall it should first upload this version to their Packages directory replacing the existing file then uninstall via the package manager in the usual way.

If the uninstall is shown as a fail in the package manager testing then that merely means that another mod or mods have altered the files it seeks to address and you will have to use the information in the following link to uninstall manually by reversing the process there described.

http://docs.simplemachines.org/index.php?topic=402 (http://docs.simplemachines.org/index.php?topic=402)
Title: Re: Search Topic
Post by: kamili34 on July 03, 2007, 04:44:26 PM
Great it works on 1.1.3  :P
Title: Re: Search Topic
Post by: TrueSatan on July 03, 2007, 08:34:25 PM
Quote from: kamili34 on July 03, 2007, 04:44:26 PM
Great it works on 1.1.3  :P

Yes but read http://www.simplemachines.org/community/index.php?topic=75893.msg1070229#msg1070229 (http://www.simplemachines.org/community/index.php?topic=75893.msg1070229#msg1070229)
Title: Re: Search Topic
Post by: kamili34 on July 03, 2007, 09:24:33 PM
But when I install this mod I add

<install for="1.1.3,1.1 - 1.1.99"> and
<uninstall for="1.1.3,1.1 - 1.1.99">

:)
Title: Re: Search Topic
Post by: TrueSatan on July 04, 2007, 04:18:08 AM
It's not generally a good idea to do that as newer versions of SMF that don't exist at this time may not work with this mod and adding versioning, as you have suggested, makes an assumption that they will work with it.
Title: Re: Search Topic
Post by: kamili34 on July 04, 2007, 04:46:12 AM
as you have suggested, makes an assumption that they will work with it.

I don't know what you think about  :)
Title: Re: Search Topic
Post by: TrueSatan on July 04, 2007, 05:00:39 AM
I don't understand your question; please restate it.
Title: Re: Search Topic
Post by: Matthew Schenker on July 05, 2007, 12:12:27 PM
This is something my members have wanted for a long time!

I'm running 1.1.3. The "Search" option from the main menu is great. But the Search function with the little magnifying glass confuses people.  It searches in the current topic, but it's not clear that this is what it does and some members assume it's searching the whole board.

With this modification, they will know they are searching that topic.

If I install this modification, how would I uninstall the magnifying glass search feature currently on my board?

Thanks for doing the work on this!
Title: Re: Search Topic
Post by: Sulgicur on August 27, 2007, 08:04:27 PM
Is this going to be updated for 1.1.3?
Title: Re: Search Topic
Post by: Matthew Schenker on August 28, 2007, 08:50:15 AM
I'm also hoping that the search feature is changed a bit.  The function works great in my forum, bringing up results quickly.  But the distinction between searching the whole forum or searching specific boards needs to be better.

Looking forward to using 2.0!
Title: Re: Search Topic
Post by: Farmacija on August 28, 2007, 11:11:31 PM
is there a way to change font color or size that members can easily notice that button??
Title: Re: Search Topic
Post by: TrueSatan on August 29, 2007, 04:29:32 AM
Look at the modification.xml file in the package...in it see the style settings...fiddle with them if you so wish
Title: Re: Search Topic
Post by: Farmacija on August 29, 2007, 05:23:14 PM
this part sholud correct with whatever yo want i put the bold red font color
<input type="submit" name="submit" value="Search Topic" style="width: 18ex; color: red; font-weight: bold; " />
Title: Re: Search Topic
Post by: noelchiew on November 25, 2007, 06:09:14 PM
How do I make the search field and button to be on the same line. This is how it looks like in my forum after installing.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg156.imageshack.us%2Fimg156%2F9933%2Fsearchtopicij8.jpg&hash=9b2a6cba9eb809e6b3bae09283b22356d66cd28e)
Title: Re: Search Topic
Post by: TrueSatan on November 25, 2007, 06:45:17 PM
For each theme find in Display.template.php:


<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
</td>
<td>
<form action="', $scripturl, '?action=search2;topic=', $context['current_topic'], '" method="post" style="margin: 0;">
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="Search Topic" style="width: 18ex;" />
</form>
</td>


Replace with:


<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
<form action="', $scripturl, '?action=search2;topic=', $context['current_topic'], '" method="post" style="margin: 0;">
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="Search Topic" style="width: 18ex;" />
</form>
</td>


If a theme doesn't have a Display.template.php file of its own it should automatically use the one from the SMF default theme but sometimes this doesn't work...in such cases copy the SMF Default theme Display.template.php file to the theme(s) that don't have the file of the same name.
Title: Re: Search Topic
Post by: 58tbird on March 25, 2008, 11:45:41 AM
Will this work with 1.1.4?
Title: Re: Search Topic
Post by: winrules on March 25, 2008, 04:37:04 PM
Can't tell you for sure but probably.
Title: Re: Search Topic
Post by: 58tbird on March 29, 2008, 04:53:14 PM
Thank you winrules!  I installed it and appears to be working just fine  ;)
Title: Re: Search Topic
Post by: Force73 on June 06, 2008, 03:05:24 PM
Works nice with SMF 1.1.5 -  I've changed the layout to fit in my Theme:

http://www.highfield-forum.de/board/index.php?topic=52.0

On every page of the topic there is the "Diesen Beitrag durchsuchen"-Line, right above. It's nice! Thank you.
Title: Re: Search Topic
Post by: GMCbris on July 08, 2008, 02:43:15 AM
Quote from: Force73 on June 06, 2008, 03:05:24 PM
Works nice with SMF 1.1.5 -  I've changed the layout to fit in my Theme:

http://www.highfield-forum.de/board/index.php?topic=52.0

On every page of the topic there is the "Diesen Beitrag durchsuchen"-Line, right above. It's nice! Thank you.

As with a lot of Mods - I cant get them to work as the "Find this" code is generally not in my theme

Can you share with me your code - so that I can see if I can make it work in my theme

Thanks

GMC
Title: Re: Search Topic
Post by: Kimmie on July 25, 2008, 01:10:40 AM
Works great on 1.1.5 :)
Title: Re: Search Topic
Post by: Phat^Trance on March 26, 2009, 08:06:31 AM
works fine on 1.1.7 BUT the search box looks very ugly! can this be fixed?

heres an screenshot: http://i42.tinypic.com/2obps.jpg

is it possible to have the search button to the right of the search box instead of under it?