Version: , by Tommy Boy
Developer Last Online: Oct 2014
Version: 2.2.x
Rating:
Released: 01-02-2002
Last Update: Never
Installs: 8
No support by the author.
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.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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.
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.
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:
Code:
$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.)
It actually turned out to be a typo on my behalf where:
PHP Code:
'FROM template AS t1'
wasnt on a new line but tacked on the end of :
PHP Code:
$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","")."