PDA

View Full Version : Mozilla/Firefox users: Search when editing templates


sv1cec
06-27-2005, 10:00 PM
I am not sure if this is a real hack, so moderators, please feel free to remove it, if you do not consider it worthy.

I am an avid Mozilla user, having IE only for testing my forums, so I never use IE in the admincp. However, I was given access to a site, in which, for some reason, I had to use IE to access its admincp. I noticed that while editing a template, there was a "Search" box at the bottom of the form. That same box, didn't show up when using Firefox!

So I started asking around and I was told that this works only in IE. Then, when vB 3.5 came out, I noticed that the search function, was present in Firefox as well. Puzzled, I posted a question in vB.com, and the answer I got said to upload the clientscript/vbulletin_templatemgr.js, to get the same functionality.

Well, I did but nothing changed. So then I compared the file includes/adminfunctions_template.php and noticed some small differences. I incorporated them in vb 3.0.7 adminfunctions_template.php and voila, I got the search working fine.

If you are not in a hurry to update to vb 3.5 and if you want that functionality, edit your includes/adminfunctions_template.php and find:


function print_template_javascript()
{
global $stylevar, $vbphrase, $vboptions;

print_phrase_ref_popup_javascript();

echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>';

print_label_row(iif(is_browser('ie'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie'), '
<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($GLOBALS['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />


replace that with:


function print_template_javascript()
{
global $stylevar, $vbphrase, $vboptions;

print_phrase_ref_popup_javascript();

echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>';

print_label_row(iif(is_browser('ie') OR is_browser('mozilla', '20040707'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '
<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($GLOBALS['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />


With only this change, the search is working OK for me, but if you have problems, try uploading the clientscript/vbulletin_templatemgr.js from vb 3.5. It was not needed in my case, and it does not seem to have any differences that can affect the search, but I am not an expert in js.

Rgds

Snake
06-28-2005, 12:51 PM
Uhh I know I'm not a blind person but I coudn't search for the adminfunctions_template.php file. o.O

FightRice.com
06-28-2005, 12:53 PM
did you look inside your /includes folder?

TCattitude
06-28-2005, 12:57 PM
includes\adminfunctions_template.php

Nice mini mod ;)

Snake
06-28-2005, 01:19 PM
Sorry guys my bad.

Injektilo
06-28-2005, 01:28 PM
this is by far the BEST hack ever!!! :) i hated using explorer for editing templates

sv1cec
06-28-2005, 01:35 PM
I hate using IE for anything!

Snake
06-28-2005, 01:51 PM
I hate using IE for anything!
Good point. I'm a fan of Firefox after all. :nervous:

waza
06-28-2005, 02:11 PM
thx, really nice! *clicked install*
You know, i have installed over 50 hacks with template modification just by reading the whole template, I never use IE so i didn't know this function was in.

this will make installing hacks A LOT easier

jugo
06-28-2005, 02:22 PM
WOW...and here i thought that it was something I did that made it disappear.

Thank ...

/me installs.

Freezerator
06-28-2005, 03:48 PM
HoTM :p

Nice hack, really handy.

TheComputerGuy
06-28-2005, 03:59 PM
sweet deal

DS MrSinister
06-28-2005, 08:49 PM
Thank You Thank You u made my life soooooooooo much better.. WHat a great hack.


:)

Clicks Install

Littlebit
06-28-2005, 10:52 PM
Thanks a bunch!

iceman-x
06-28-2005, 10:55 PM
thanks you, wery nice, i have ben missing it for some time. :)

Adrian Schneider
06-28-2005, 10:56 PM
Great minds think alike ;)
https://vborg.vbsupport.ru/showthread.php?t=81936

Thanks:D

Picside
06-29-2005, 01:40 AM
awesome! i always thought that was weird not to be able to search with the VB editor. thanks!

Adrian Schneider
06-29-2005, 03:49 AM
But it's not a template mod. ;)

yoyoyoyo
06-29-2005, 04:28 AM
But it's not a template mod. ;)I was actually replying to the wrong thread .. oops. Thanks for this one, too

mkdevo
06-29-2005, 11:30 AM
wow.. as a firefox user, i never even knew this existed! :) thanks!

Princeton
06-29-2005, 03:31 PM
great little mod

Aeolian_X
06-29-2005, 06:03 PM
great little mod
I wish I would have seen this mod a while back. I could ahve used it. I installed it anyway, because it's definately useful. Thank you.

Snake
07-05-2005, 08:44 AM
sv1cec in the screenshot, which chat system are you currently running?

sv1cec
07-05-2005, 09:40 AM
vBChat, heavily customized!

Snake
07-05-2005, 09:59 AM
Oh I thought you were using a JAVA chat hack. vBChat is bad, I don't like it that much.

sv1cec
07-05-2005, 11:10 AM
Each one is entitled to his opinion. I find it the best chat hack for vB, since it integrates completely with vB and allows you to customize it, to suite your site needs. I tried a couple of others, but either they had no connection to vB or (even worst) didn't allow you to customize even the way the screen looks.

I find vBChat the best for my needs, that does not necessarily make it suitable for yours.

Rgds

Snake
07-05-2005, 11:18 AM
Each one is entitled to his opinion. I find it the best chat hack for vB, since it integrates completely with vB and allows you to customize it, to suite your site needs. I tried a couple of others, but either they had no connection to vB or (even worst) didn't allow you to customize even the way the screen looks.

lol There is no way you could intergrate it with vB because it is using JAVA! You cannot perform that since vBulletin is coded in PHP/MYSQL. ;)

MorrisMcD
07-10-2005, 12:51 AM
lol There is no way you could intergrate it with vB because it is using JAVA! You cannot perform that since vBulletin is coded in PHP/MYSQL. ;)
Very nice! Thanks.. However, I seem to be having less luck than the rest of you.. I see the search box.. But no find button... :confused:

sv1cec
07-10-2005, 04:43 AM
Maybe you accidentally deleted the next line in that file? Here is what that part of the file should look:


function print_template_javascript()
{
global $stylevar, $vbphrase, $vboptions;

print_phrase_ref_popup_javascript();

echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>';

print_label_row(iif(is_browser('ie') OR is_browser('mozilla', '20040707'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '
<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($GLOBALS['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" onClick="findInPage(document.cpform.string.value);" tabindex="1" />
&nbsp;') .
'<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['preview'] . '" accesskey="p" onclick="displayHTML();" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" />
&nbsp;
<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" accesskey="v" onclick="js_open_phrase_ref(0, 0);" tabindex="1" />
');
}


Rgds

BillyFischbach
07-10-2005, 05:13 AM
Works great, installed

sv1cec
07-10-2005, 05:26 AM
Thanks.

I know my site is not moving up to vB 3.5 any time soon, with so many hacks and patches I've made in it, so I thought maybe others are in the same boat as I am, and put this here.

Rgds

c0d3x
07-10-2005, 05:41 AM
is possible to change the colour of the selected test?

Dennis B
07-10-2005, 06:55 PM
John,

Thanks so much for this simple yet very effective mod. :up:

akanevsky
07-10-2005, 07:21 PM
Good mod, however since I use Opera, it is no use to me... How about you do the same thing for opera? :)

sv1cec
07-12-2005, 11:53 AM
I am not sure. You may try to replace that part of the code, with :


function print_template_javascript()
{
global $stylevar, $vbphrase, $vboptions;

print_phrase_ref_popup_javascript();

echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>';

print_label_row(iif(is_browser('ie') OR is_browser('mozilla', '20040707') OR is_browser('opera'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '
<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($GLOBALS['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />


And see if it is working. If not, you may also try copying the clientscript/vbulletin_templatemgr.js file from vb 3.5 to your server and see if it will work.

I have absolutely no idea about Opera.

Rgds

akanevsky
07-12-2005, 03:05 PM
Nope, it will display the field but won't search.

sv1cec
07-12-2005, 05:14 PM
It was far-fetched anyway, sorry!

Kirk Y
07-20-2005, 02:40 AM
Brilliant! I wondered why this didn't show in Firefox, excellent hack and thanks for sharing!

MorrisMcD
07-24-2005, 03:16 AM
Maybe you accidentally deleted the next line in that file? Here is what that part of the file should look:


function print_template_javascript()
{
global $stylevar, $vbphrase, $vboptions;

print_phrase_ref_popup_javascript();

echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>';

print_label_row(iif(is_browser('ie') OR is_browser('mozilla', '20040707'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '
<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($GLOBALS['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" onClick="findInPage(document.cpform.string.value);" tabindex="1" />
&nbsp;') .
'<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['preview'] . '" accesskey="p" onclick="displayHTML();" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" />
&nbsp;
<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" accesskey="v" onclick="js_open_phrase_ref(0, 0);" tabindex="1" />
');
}


Rgds


Forgot to come back to see if someone answered this yet... ;)

I was missing this

<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" onClick="findInPage(document.cpform.string.value);" tabindex="1" />

Not sure how and when I did it.. I thought I was always careful :)

Thanks for the help

sv1cec
07-24-2005, 04:01 AM
Most welcome.

Dennis B
07-25-2005, 03:03 PM
John,

This works great in FF, but... it seems now that I can't access the admincp thru IE.
Have you tried opening the admincp in IE after you installed this mod...?
It's giving me a "page not found" error... bizarre.

sv1cec
07-25-2005, 03:43 PM
It shouldn't do that. I never use IE to open AdminCP, but I just tried it and it works fine.

Something else maybe? Actually opening admincp/index.php should have absolutely nothing to do with the change suggested. It is not in effect, until you go to the template manager.

carloshax
07-25-2005, 05:52 PM
you are a star thx alot :)

sv1cec
07-25-2005, 06:28 PM
I've been called a lot of things in my life, "star" was not one of them.

Thanks! LoL

kregger
07-25-2005, 07:14 PM
Gosh, I didn't even know I was missing it. hehe Very handy! TY!!

Craig

Drago912
08-10-2005, 11:45 PM
Awesome......great job, I'm glad I dont have to manually search anymore...... :banana: :banana:

Ambie
08-13-2005, 06:57 PM
Thank you so much!!! :)

sv1cec
08-16-2005, 07:09 AM
Glad, if you like it.

akanevsky
08-16-2005, 08:46 PM
Can you plz make an opera version? thx

sv1cec
08-17-2005, 04:27 AM
Sorry, that requires knowledge I do not have, so can't do.

Hornstar
08-21-2005, 09:30 AM
omfg, this is perfect, i did not know they ever had a search thing, i have been copying and pasting it into notepad, which is a waste of time. This will save alot of time.

thankyou

Crank
10-04-2005, 10:41 PM
u r truly a timesavertnk u extremely for this *clik instal*

zoro
10-05-2005, 09:08 AM
This is great man thank you very much helped me alot :P every time i wanted edit templates i opened IE and i hate it :D

sv1cec
10-06-2005, 04:43 AM
Is there anyone who loves IE?????

Abe Babe
01-15-2006, 02:31 PM
Sorry for bumping an old thread, but I just felt I wanted to say thank you for this when I found it just now.

I used to use IE and then switched to Firefox around 18 months ago. I actually had forgotten about this feature, not really realizing that it didn't show in Firefox and got used to just pasting code into Wordpad and using the find in there. But now that I can use it again, it will certainly come in handy.

Abe Babe...