PDA

View Full Version : Search Templates by Title


Tommy Boy
01-02-2002, 10:00 PM
This will enhance the template search option in the admin control panel, with the ability to search for templates by title as well. This is great for people who modify their templates a lot, like most of us here, who install many hacks. Instead of browsing manually to the template, which is many times a child template (requires another click, to open its parent), you can just type the template name, and get to it immediately from the search results page.

I believe I also fixed a vBulletin bug with this hack. It appears that searches performed on custom templates would not return anything, even when they really should. If I'm completely wrong here, please tell me so and I'll shut up. :D

Mystics
01-03-2002, 03:48 PM
Thx!!! Great Addon for the Template-Search-Function, I missed that very often :)

And you were right with the Bug, searches performed on custom templates would not return anything!
(Before your hack)

Greetz,
Mystics

Lesane
01-03-2002, 04:14 PM
Great, thanks. And yes, searches on custom templates didnt worked before your hack. Now it does! Cool :cool:

FWC
01-03-2002, 09:52 PM
Well done, Tommy! :)

-.valkyre
01-04-2002, 12:08 AM
Very cool Tommy! Your quickly becoming one of the most "useful" hackers :)

Tommy Boy
01-04-2002, 12:44 AM
Originally posted by -.valkyre
Very cool Tommy! Your quickly becoming one of the most "useful" hackers :)
YAY!! :D

Hooper
01-04-2002, 12:57 AM
The search vbulletin templates as you see it was asked about by me and soon included thereafter. The search not including custom templates wasn't a bug, just wasn't included when they added it. I asked for that at a later point at vBulletin. I think you'll see this in a future release. Not that I mind seeing it now.

Tommy Boy
01-04-2002, 01:10 AM
Originally posted by Hooper
The search vbulletin templates as you see it was asked about by me and soon included thereafter. The search not including custom templates wasn't a bug, just wasn't included when they added it. I asked for that at a later point at vBulletin. I think you'll see this in a future release. Not that I mind seeing it now. I think it was a bug, since all I had to do is change "t2" to "t1" in the SQL query, which indicates that the option was already there... :o

Hooper
01-04-2002, 01:13 AM
That's just plain impossible. vBulletin has never had bugs. Just designed behaviors.

Tommy Boy
01-04-2002, 01:14 AM
Just like Microsoft, eh? :D

Hooper
01-04-2002, 01:17 AM
Absolutely.

-.valkyre
01-04-2002, 01:29 AM
Damn designed behaviors :D

bbaddons
01-04-2002, 07:07 AM
Thanks, this hack saves me some time in having to click the links, instead I just search for em.

Great hack, very useful to those that do a lot of hacking and those that just make small template mods :) :)

Great Job (this should be in the next vB release ;))

Stretchr
01-16-2002, 04:59 PM
Nah, with MS, it's a feature---And you'd have to pay extra for it!
:D
Great hack. Thank you!
Originally posted by Hooper
That's just plain impossible. vBulletin has never had bugs. Just designed behaviors.

djr
01-27-2002, 04:33 PM
TommyBoy,

Can you enhance it a bit more where you have two input boxes: one where you can search only for occurences of the string inside a template and one inputbox for template titles only.

pls see attached picture

- djr

Princeton
01-28-2002, 10:58 PM
worked the first time around ... thank you

great addition

kippesp
02-02-2002, 08:42 AM
Can you enhance it a bit more where you have two input boxes: one where you can search only for occurences of the string inside a template and one inputbox for template titles only.Done.

SemperFidelis
01-03-2003, 01:22 AM
kippesp - great addition to an already great hack.
:)

Any ideas on how to fix this :
(on vb 2.2.9)

kippesp
01-03-2003, 03:43 AM
This file hasn't changed since 2.2.6. But what you're seeing looks very familure to what I saw with the template backup system.
And I think version 2.2.6 fixes what you're seeing in template.php. You'll need to incorporate my changes into 2.2.6's changes (see below).

Can you compare your code against 2.2.9 again--especially the query at line 471.

This is what those lines should look like: $templates=$DB_site->query("SELECT t1.title AS title,t2.templateid, NOT ISNULL(t2.templateid) AS found" . iif(isset($searchstring), ",INSTR(t1.".$searchtype.",'".addslashes($searchstring)."') AS globalcontain,INSTR(t2.".$searchtype.",'".addslashes($searchstring)."') AS localcontain","")."
FROM template AS t1
LEFT JOIN template AS t2 ON (t1.title=t2.title AND t2.templatesetid=$templateset[templatesetid])
WHERE t1.templatesetid=-1 AND t1.title<>'options'
ORDER BY t1.title");Let me know if this works. I can also post the full set
of changes against 2.2.9 (mine and TommyBoy's) for this hack since it's been so long.

Be sure you to use the code in this post. I had to edit this post.

(Not that it matters, but the file really did change in 2.2.8--fixed a bug that TommyBoy found 10 months ago and has long been in my code.)

SemperFidelis
01-05-2003, 01:35 PM
Cheers for the assitance there kippesp

It actually turned out to be a typo on my behalf where:

'FROM template AS t1'

wasnt on a new line but tacked on the end of :

$templates=$DB_site->query("SELECT t1.title AS title,t2.templateid, NOT ISNULL(t2.templateid) AS found" . iif(isset($searchstring), ",INSTR(t1.".$searchtype.",'".addslashes($searchstring)."') AS globalcontain,INSTR(t2.".$searchtype.",'".addslashes($searchstring)."') AS localcontain","")."


So thanks again, its all working fine now.