1 (edited by cuteseal 2004-08-24 08:00)

Topic: Quick Search

Hi all,

Just thought I'd contribute a little mod which takes like 5 seconds to do, but is pretty useful.

To add a quick search to your forum header, modify your main.tpl file under include/template/
(see it in action here)

Change:

        <td class="puncon1">
            <pun_navlinks><br><br>
            <pun_status>
        </td>

To:

        <td class="puncon1">
            <pun_navlinks><br><br>
            <table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td width="50%" valign="bottom">
            <pun_status>
            </td><td width="50%" align="right" valign="bottom">
            <form method="get" action="search.php" id="search">Search forums:
            <input type="hidden" name="action" value="search">
            <input type="text" name="keywords" size="30" maxlength="100"><input type="submit" name="search" value="Go" accesskey="s">    
            </form>    
            </td></tr></table>
        </td>

You can also add <input type="hidden" name="show_as" value="topics"> if you want to display the results as topics instead of posts.

Enjoy! big_smile

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

Re: Quick Search

Nice :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Quick Search

indeed ... I'll add this one to my board smile

Re: Quick Search

Thanks smile

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

5

Re: Quick Search

Add it too !!! smile

Beurk TABLES ... smile

but ... great however smile

Re: Quick Search

You can always use divs... whatever takes your fancy I guess big_smile

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

Re: Quick Search

There is a bug between this mod and the punpost preview mod.

When I installed this mod, my forum's user would to preview their post, their message was posted. When I remove it, I can preview.

Re: Quick Search

Oh really?  All it's doing is just inserting a HTML form.. nothing funky.

Maybe check the code that you're replacing, and make sure you're not removing any punpreview code.

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

Re: Quick Search

In the post preview mod we cannot change the main.tpl just the "post.php" files.

I don't see what the interaction between this two files.

Re: Quick Search

probably a post preview issue, that it takes the first <form> avaible... and that's then the quicksearch

add a name to the quicksearch perhaps?

Re: Quick Search

cuteseal wrote:

To add a quick search to your forum header, modify your main.tpl file under include/template/

Thats exactly what I was looking for and I added the suggested changes to main.tpl. The search seems to work fine, except for one little thing:

- BBCode is not parsed correctly and shows up in the posts.

So instead of seeing a bold word I see the BBCode around it. Which looks funny.

Anybody any idea if that's a big thing to solve or just a little one?

To see what I mean, go to http://groningen-info.de/forum and type the word lasergames in the search box at the top right (or something else).

12 (edited by trel1023 2005-02-04 19:12)

Re: Quick Search

confirmed - and not just on your site, pmmueller

any 1.2.x punbb install - if you do a search (from the search page), and select to view posts, you will get the result you're talking about.

all the bbcode will be visible in the forum.

definitely needs to be run through the parser magic.

Re: Quick Search

If you're talking about PunBB not parsing BBCode when viewing search results as posts, it's like that by design. Parsing that BBCode would require the full post to be displayed and we don't want that.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Quick Search

we can't truncate a few characters  - figure out if there are any dangling open bbcode tags, close them at the end of our truncating, and then parse it and display it?

it seems like there's a way to make the output of a search-by-post result a little more appealing to look at if it has bbcode in it.

perhaps stripping it out altogether?  seems a little extreme.


this is the first time i've seen this - so these are first reactions.   apply salt as necessary.

Re: Quick Search

We can, but it's a lot of work. Also, a quote box won't make sense if it is cut off in the middle of the quote. I guess we could strip out quotes and code all together, but I'm not sure I like that. Then the search results won't show what is actually in the post.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Quick Search

right.

but neither does showing the post without the 'markup' it was designed to be viewed with.

so, yeah, one or the other.


for Email_Digests, i truncated and stripped.  because they're meant to be pointers back to the 'proper' forum.
i feel the same is probably true for these results on the search page.