PDA

View Full Version : New vbcode.js - vBcode and smilie user interface improvement


s.molinari
30 Jul 2001, 19:19
Hello vB Troopers,

With special permission from the Dev Team I am proud to release an improved version of vbcode.js. Any usage of this script other than in licensed vBulletin driven Boards is a direct violation of Jelsoft copyrights. Any violators will be prosecuted to the full extent of the law!

One MAJOR Improvement(note: only works with IE, NS users are out o luck! But who uses NS anyway?)

vBcode and smilies will be inserted wherever the cursor is instead of at the end of the text.

Installation
Copy the new vbcode.js file over your old one(see "Another small note" below). If you'd like to keep the old file just rename it before copying the new one.

You need to add the following text to the "message" textarea tag:
onChange=getActiveText(this) onclick=getActiveText(this)

It should basically look similiar to this:<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="2"
onChange=getActiveText(this) onclick=getActiveText(this) >$message</textarea>

Please note: The variable($message) may be different in some templates, editpost for example, so make sure to keep the original variable in the textarea attribute "name =". Otherwise the text may be missing in some instances.

This textarea can be found in the following templates:

Calendar Templates

calendar_enterevent

New Posting Templates

newreply

newthread

Private Messaging Templates

priv_forwardmultiple

priv_sendprivmsg

priv_sendtobuddies

and the editpost template

additional template changes

In the vbcode_popup_smilies template you must delete the following code:<script language="JavaScript">
function smilie(smilietext) {
opener.document.vbform.message.value += smilietext+" ";
//opener.vbform.message.focus();
}
</script>


In the vbcode__popup_smiliebits template you must change:<a href="javascript:smilie('$smilie[text]')">
to:<a href="javascript:opener.smilie('$smilie[text]')">
small note:If you use the above code pleas omit the space between java and script.


If these changes aren't made the new script WILL NOT WORK!

I hope to hear from those who use it, and please let me know if you find a bug.


vB.org is using this hack. Try it out!:D

Scott

Latest release date: 20.04.2002
Any version older than this should be updated.

smithy256
30 Jul 2001, 20:30
thanks but i cant install it because im a complete newbie.

s.molinari
30 Jul 2001, 20:38
Originally posted by smithy256
thanks but i cant install it because im a complete newbie.

Can you copy a file to your web server and cut and paste in windows?

That's all the skills you need.:)


Scott

Delhaze
30 Jul 2001, 20:46
I have the latest version installed and all is well. :)

I would also like to congratulate the VB team for allowing this file to be posted.

You have completely restored my faith with your new common sense approach.

It will also reduce the number of hits I was getting to this file on my board. :D

ThomasP
30 Jul 2001, 22:12
Hi Scott,

really a great hack! Works like a charm, "installation" was easy.

And thanks to the vB Team, too.

cu & Grüße ;)
-Tom

P.S.: At least it works in NS the way it did before, so this is not really a drawback...

RobAC
31 Jul 2001, 01:57
Found a problem with this hack. If I go to edit a post I made, the content of my post does not show up within the text field. I had to revert my editpost template back to the original. Anyone else experiencing this?

s.molinari
31 Jul 2001, 05:27
Originally posted by RobAC
Found a problem with this hack. If I go to edit a post I made, the content of my post does not show up within the text field. I had to revert my editpost template back to the original. Anyone else experiencing this?

Hello Rob,

You were probably a bit too fast. In the editpost template you probably copy and pasted over the $postinfo[message] variable. It is something I should point out in my installation instructions.

The textarea in editpost should look like this:<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="2"
onChange=getActiveText(this) onclick=getActiveText(this) >$postinfo[message]</textarea>

Scott

tubedogg
31 Jul 2001, 06:18
Awesome Scott :)
v cool and works great.

s.molinari
31 Jul 2001, 07:38
Originally posted by tubedogg
Awesome Scott :)
v cool and works great.

Thanx for the compliment Kevin. Coming from you means alot!:D

Scott

VirtueTech
31 Jul 2001, 08:42
I found the script and used it...I had problems with my netscape users...they seemed to get script errors...when this ran.

Not sure what it was...I didn't get to test it with netscape...

EDITED - I thought this was the original thread you started. I didn't see the new vbcode.js at the top of the page...I came into this thread via 'lastpost'. I got the last vbcode off Ztsky's site and that one didn't work.

This new one you posted works great! Thanks. :)

s.molinari
31 Jul 2001, 08:59
Originally posted by VirtueTech
I found the script and used it...I had problems with my netscape users...they seemed to get script errors...when this ran.

Not sure what it was...I didn't get to test it with netscape...

If you had gotten the first script I posted here (http://www.vbulletin.com/forum/showthread.php?s=&threadid=23366),
the one that was deleted, then you definitely have a faulty script. At the time I posted it, I too didn't test it with NS. My mistake......... or Netscapes?:D

The script in this post should work with NS(I tested it with 4.7). I racked my brains and searched all over the internet trying to find a fix to get it to work like it does with IE. All I was able to manage is that no errors come up with NS, but the functionality is, unfortunately, as it always was. i.e. the code is always added to the end of any previously written text. Another reason from hundereds why NS users should change over to the Explorer!;)

Scott

VirtueTech
31 Jul 2001, 10:19
Ok question: Is there any way to make this script work with the "Get More Smilies" pop-up window. So that when they click on a smiley in the pop-up window that it updates the textarea in the last spot the cursor was?

s.molinari
31 Jul 2001, 11:05
Originally posted by VirtueTech
Ok question: Is there any way to make this script work with the "Get More Smilies" pop-up window. So that when they click on a smiley in the pop-up window that it updates the textarea in the last spot the cursor was?

This is a valid problem, which I have tried to get rid of. Haven't found the trick yet.

Scott

s.molinari
31 Jul 2001, 15:34
Hello all,

I found a fix for the "get more" smilies popup window prob.
Many thanx goes to Vincent Puglia at www.pageresource.com. He basically solved the prob for me with his tips.

In the vbcode_popup_smilies template you must delete the following code:<script language="JavaScript">
function smilie(smilietext) {
opener.document.vbform.message.value += smilietext+" ";
//opener.vbform.message.focus();
}
</script>


In the vbcode__popup_smiliebits template you must change:<a href="javascript:smilie('$smilie[text]')">
to:<a href="javascript:opener.smilie('$smilie[text]')">

Scott

Uh....guys I think there is a small problem with the vbcode parser! It should read "javascript : opener.smilies" without spaces and the embarrassed face.;)

Freddie Bingham
31 Jul 2001, 15:39
Disable Smilies :)

RobAC
31 Jul 2001, 15:44
Originally posted by freddie
Disable Smilies :)

Been there, done that. The responses I got from my members were 100X more viscious than the responses I got when I tried disabling post counts. You might think I had imposed a one post allowed per week per user curfew! :)

s.molinari
31 Jul 2001, 17:59
Originally posted by freddie
Disable Smilies :)

If I were Homer I would say,"Doh!" :D

Scott

But then again, when most people post code they don't usually include smilies in it do they.:confused:

Freddie Bingham
31 Jul 2001, 18:05
I meant just in that post, which if you notice I edited and turned smilies off.

s.molinari
01 Aug 2001, 11:35
Hello users of this hack,

Does somebody have a test area on their board where guests can make post. I would like to link to it as a demo to show everyone what the new script does.

I would link to my own board but it's in german and is original vB!:)


Any help would be appreciated!


Scott

inetd
01 Aug 2001, 15:15
Please post screenshot of this hack.

s.molinari
01 Aug 2001, 18:14
Originally posted by inetd
Please post screenshot of this hack.

Hello inetd,

A screen shot is practically useless. The improvement is in the functionality and you can't take a picture of that. A screen shot would look just like any other vB Board. You wouldn't see a difference.


Scott

s.molinari
01 Aug 2001, 20:35
Demo Board now available for a short time!

Sorry demo board is closed.


Scott

jucs
02 Aug 2001, 00:23
Ugggh, too many changes..too much time for such a small improvement with no complaints now.

When I first saw this it was "cool"..just replace the file. Then, I saw the LONG list of changes to a bunch of files.

Oh well. :)

tubedogg
02 Aug 2001, 00:29
Honestly, it took me approximately 60 seconds to make all the required changes...

s.molinari
02 Aug 2001, 06:48
60 seconds? Wow....:D

I made the hack and it took me 120 seconds. Seriously, about 10 minutes and the hack should be up and running. I believe my instructions are a bit more cumbersome than the actual work that they describes. So don't let my longwindedness scare you.:)


Scott

VirtueTech
02 Aug 2001, 07:59
jucs please :rolleyes:

Scott - I added the 'get more' smilies additon...works awesome....it even brings the user back to their textarea in the original window after.

I'm sure if we wanted we could even put a 'close window' in the link to so that once they choose the smilie and added it...it closed the window all in one click.


I wonder if that would be good....or if the window should stay open.

Here is the code to CLOSE the 'get more smilies' window after you click. This will allow the process of adding and closing the 'get more smilies' window a one click process.

AFTER you make both Scotts changes just change your vbcode__popup_smiliebits

From:

<a href="java script:opener.smilie('$smilie[text]')">


To:

<a href="java script:opener.smilie('$smilie[text]'),self.close()">


Very simple and makes things cleaner. Not for everyone though....some people might want to leave the window open to add more. But I'll just let the user open the window again. :cool:

Thanks again Scott and Vincent Puglia for this....truly a simple yet very useful addition.

dost
02 Aug 2001, 15:12
You forgot to mention to add the code to the editpost template.

VirtueTech
02 Aug 2001, 16:08
Dost - I did ?

dxb
02 Aug 2001, 21:38
it worked fine

except that problem with the space between the java and script drove me crazy hahahah I installed the hack twice and removed it then I noticed the space problem :) now it's working fine

thanks Scott

ThomasP
02 Aug 2001, 21:41
Hi,
works great in 2.0.3

I edited <a href="java script to <a href="javascript .
cu,
-Tom

s.molinari
03 Aug 2001, 05:36
Sorry about the java script thingy. That I believe is a special function of the [code] tag in the vbcode parser. It does that to avoid people writing JS in their posts and using willfully or not to mess up vB. I may be wrong though. :)

For those of you who cut and paste the code out of my directions please do not forget to delete the space between java and script.


Scott

JJR512
04 Aug 2001, 16:18
Mostly this hack seems to work fine, but I did notice one odd thing. When in Enhanced Mode, if you use the keyboard shortcuts for the various tags (like Ctrl+I for italics), the codes do not show up in the message. They don't show up anywhere, even at the end. The really odd thing is that the status window acts as if the code is there; if you hit Ctrl+I twice, for example, on the second time it will tell you that "You already have an open tag of this type".

Enhanced Mode works fine if you actually click the buttons. It's just the keyboard shortcuts that don't work anymore. Can a way be found to get them working again?

s.molinari
05 Aug 2001, 02:57
JJR512,

What Browser are you using? With IE 5.+ it works fine. The keypress doesn't work with NS 4.7. But then again the whole script doesn't work right with NS.

Scott

JJR512
05 Aug 2001, 04:56
It's IE6 beta, updated as far as I know. Windows 2000 Pro, if it helps.

JJR512
05 Aug 2001, 05:03
I just noticed another odd thing.

For the record, what I mentioned earlier was while posting a new thread.

This happens while posting a reply.

In Enhanced Mode, if I click the I button to begin italic text, the tag appears, and I type the text. When I click the Close Current Tag button, the /i tag appears. But if instead I click the Close All Tags button, the /i tag appears, immediately followed by another tag that says /undefined. (This also happens while starting a new thread.)

s.molinari
05 Aug 2001, 05:28
I've recreated the /undefined problem. I'll look into that. Is the alt+i or b or u still not working?

Scott

JJR512
05 Aug 2001, 05:40
No...well sort of.

Here's another aspect of the problem which looks like it's getting weirder and weirder.

If I click on "New Reply", if I'm in Normal Mode, and I hit alt+b and put some text in the pop-up box, the text, along with the bold codes, appears in the message. But if I do it again, after the first time, the popup box will appear, but when I press Enter, nothing new shows up in the message area. It doesn't matter which code I try to use the second time; it just won't work.

It looks to be similar in Enhanced Mode...the first time I use a keyboard shortcut, it shows up where the cursor is. But when I try to close it or begin a new tag, nothing new shows up. For example I can hit alt+b and the b tag shows up, but when I hit alt+x, the /b tag does not show up. If I hit alt+x again, the status thing tells me there are no open tags to close.

s.molinari
05 Aug 2001, 08:03
Hello JJR 512,

There was an error in my logic. I have corrected the problem and the new file is ready for upload in my original post. See if it works.

Scott

s.molinari
05 Aug 2001, 08:11
Hello all users of this hack,

There was a small logic error in the script. I used the same variable twice not knowing that variables in JS are considered GLOBAL. At least I think that was the prob. Anyhow, I believe it's fixed. Please download the vbcode.js file again.

Scott

JJR512
05 Aug 2001, 15:24
Even on your test board I'm having the same problem. That is, (Normal Mode, btw) if I hit alt+i, type in some text in the popup box, hit Enter, the text I typed shows up with the codes around it. So that's fine. But if I do it again, the popup box shows up, I type in my text and hit Enter, but nothing happens. The text I just typed does not go into the message, and no codes go into the message, either. The original text is still there; it's just that the new stuff doesn't go into the message.

So if it works fine for you on your test board, but doesn't work for me, then maybe that means the problem is with IE6? Can anyone else with IE6 try it on the test board?

s.molinari
05 Aug 2001, 16:17
Hello JJR512,

I tried it again just as you explained and it works fine for me. I'm using IE 5.1.

If there are other browser users out there please give the test board a try and report how the interface reacts, good or bad.

I would really appreciated it.

Up till now I know the following browsers work:

IE 5.X, without errors.(now ;))
NS 4.7, without errors but code/code with text is always added to the end of any previously written text.

Scott

fury
05 Aug 2001, 16:39
IE 5.50.4522.1800, same problem (using the keyboard shortcut method works once, but not the second time)

I just downloaded and installed it today, I should have the latest version

I'll let you know if I can find any glaring issues in the javascript file

s.molinari
06 Aug 2001, 08:06
Hello All,

Yep IE 5.5 is screwy when you use the access keys(alt+i for example). Don't know what the prob is but obviously a Browser discrepancy. IE 5.1 works fine. I'll try and see what I can do.

All I can say is just use the buttons for now. :)

Scott

JJR512
07 Aug 2001, 04:00
As I said earlier, this problem also occurred not just in 5.5, but the 6 Beta as well. The thing with the 6 Beta was that it didn't matter how you used the code the first time. I mean, you could put in the first code by using the keyboard shortcut, or by clicking the button. The thing was that the second time you used a code, like if you tried to close the tag, it wouldn't work by keyboard.

That said...

Tonight I checked Windows Update (on Microsoft's site, you know, the link that's on the Tools menu of IE), and noticed there was a new IE 6 Beta available. I downloaded/installed it, and interestingly, everything works fine now. I tried everything I could think of to test it, multiple codes at once, some by keyboard, some by button, mixing by opening with the button and closing with the keyboard, etc. Everything seems to work fine.

So if what you said is true: That IE 5.1 works fine, but 5.5 does not, and the original 6 Beta does not, then users will need to upgrade their 5.5 or original 6 Beta to the newest 6 Beta for this hack to work properly for them.

(BTW, this is all on Win2k; I have no idea if there is a new IE6 Beta for Win95/98/Me.)

theflow
25 Aug 2001, 00:37
Originally posted by s.molinari
Hello All,

Yep IE 5.5 is screwy when you use the access keys(alt+i for example). Don't know what the prob is but obviously a Browser discrepancy. IE 5.1 works fine. I'll try and see what I can do.

All I can say is just use the buttons for now. :)

Scott

Scott, this is exactly the hack I've been wanting. Thank you. I know I am late to the discussion, but tubedogg just pointed me to this thread today. I just tried it out on your test forum here:

http://www.webtroniks.de/showthread.php?&threadid=8

and I only used the buttons, not the keyboard commands, and all was well. I use IE 5.5/ windows 2000 pro... I will probably test out keyboard commands later. I didn't even know there were keyboard equivalents for vB code. doh!

Streicher
11 Nov 2001, 09:24
Is this hack working with version 2.2.0?

Grover
12 Nov 2001, 14:40
O MY GOD!

This is just EXACTLY what I was looking for all the time since I am using VBulletin!!!
This just has to be the BEST hack I have ever seen, yes: I AM serious!

It improves Vbulletin enormously. It was just THE most irritating part of the Vbulletin software that it was such a hassle to put the message-tags into a message.

I am thrilled that you produced this hack, Scott! Jelsoft just HAVE TO implement it in a future release. They just MUST. A BIG, BIG improvement, if you'd ask me.

Hope that you will fix all possible bugs and that your hack will be used in the future.
~Grover.

LuBi
18 Nov 2001, 07:32
Originally posted by Streicher
Is this hack working with version 2.2.0?

I don't believe so, we have 2.2.1 now and these posts are from months ago.. for the most part. Correct me if I'm wrong. ;)

Chen
18 Nov 2001, 07:53
Ok, let's see how this works here. :)
<?php
echo "This is working good.";
?>

LuBi
18 Nov 2001, 08:05
Originally posted by FireFly
Ok, let's see how this works here. :)
<?php
echo "This is working good.";
?>

What the?

punkbull
18 Nov 2001, 14:12
If I install this hack, will my Netscape users still be able to use the smilies normally?

LanciaStratos
19 Nov 2001, 22:24
Working perfect on 2.2.0! :D Great hack, thanks s.molinari! :cool:

LuBi
20 Nov 2001, 02:47
When i try to edit a post, the body part where I would edit the text posted is blank now?

DarkReaper
20 Nov 2001, 03:53
Originally posted by FireFly
Ok, let's see how this works here. :)
<?php
echo "This is working good.";
?>


LOL! :)

LuBi
27 Nov 2001, 15:42
I still need help with this code. After I installed it when members would go to edit a post the body where their text was is blank. Can anyone help me out my members are bothered by it big time :eek: mad emails

JJR512
27 Nov 2001, 16:58
Did you correctly make the necessary changes to the editpost template?

LuBi
27 Nov 2001, 17:09
Well I'll re-install and go over everything again. thanks

TheUnforgiven
28 Nov 2001, 19:19
*bump* hehe i just needed this hack...

Mutt
28 Nov 2001, 22:32
Hey everyone. I just installed this at
CCDV.com (http://ccdv.com/forum/index.php?s=) and love it, but it's missing something. when you highligh text in normal mode it correctly grabs the text and sticks in in the popup then inserts the vbcode around the text, but when in enhanced mode, the highlighted text gets lost. this is a problem

I wrote the original UBB Code buttons hack back in the day which was later used by the vb team to build these great vbcode buttons. (hey vb team, great job by the way. your code is damn pretty compared to my old messy code.) I was disappointed to see that the vbcode buttons were missing the cursor possition and highlighted text enhancements so it's great to see this addon hack.

real quick, I got a fix for this and wanted to share.

here are 2 new functions. replace the ones in this hack with these new functions and it will work.

code removed due to some error. I reposted it on the next page as an txt attachment and that code works fine.

now when in enhance mode, if you highlight some text and hit any of the top row vbcode buttons or dropdowns and the text will get surrounded by the begining and ending vbcode tags. the bottom row buttons will still open prompts.


I hope it isn't a problem for me posting this code. if this is some copyright violation or something, feel free to delete.

JJR512
28 Nov 2001, 23:53
I tried your replacements, Mutt, and what happens to me now is that in enhanced mode, if I select some text and hit a button, the text is replaced by the opening tag, not surrounded by the opening and closing tags.

Mutt
29 Nov 2001, 02:00
thats what used to happen before the new functions.

let me look at it and see if something was missed. are you sure you deleted the 2 old subs and replaced them with these 2?

JJR512
29 Nov 2001, 02:09
I selected each entire function and pasted the newer version from your earlier post over each.

To be sure, I tried it again, with the same results.

FWC
29 Nov 2001, 02:54
Originally posted by JJR512
I selected each entire function and pasted the newer version from your earlier post over each.

To be sure, I tried it again, with the same results. Same here. I thought it was just me. :)

Princeton
29 Nov 2001, 03:23
Does anyone know if this is working with the latest vb version?

FWC
29 Nov 2001, 04:02
Originally posted by princeton
Does anyone know if this is working with the latest vb version? The hack in the first post works great with 2.2.1.

Mutt
29 Nov 2001, 22:50
did you replace the fxns in the new hack javascript or the original script that comes with VB? these would only work in the new hacked javascript from the first post in this thread. I just redownloaded my copy and checked it. this is the code I used.

I'm going to try uploading the functions as an attachment.

if it still doesn't work, sorry. I tried :)

Once again, here are the directions.

Install the new vbcode javascript hack. then go into vbcode.js and replace function vbcode and function fontformat with the ones in this attachment.

this should improve text highlighting in enhanced mode

Mutt
29 Nov 2001, 22:52
with the original hack installed, have any of your members experienced any posting problems., javascript errors, or browser crashes?

FWC
29 Nov 2001, 23:09
Originally posted by Mutt
with the original hack installed, have any of your members experienced any posting problems., javascript errors, or browser crashes? My users and I have had no problems with Scott's hack.

FWC
29 Nov 2001, 23:10
Originally posted by Mutt
if it still doesn't work, sorry. I tried :)
Still doesn't work for me. Thanks for trying! :)

Hooper
29 Nov 2001, 23:38
Originally posted by FWC
Still doesn't work for me. Thanks for trying! :)

I'm lost. A post above says great in the latest vb version and this says it doesn't work? or does it?

Thanks

JJR512
29 Nov 2001, 23:50
Mutt, I edited in the new functions from your attached text file, and after that, it worked fine. Just to double-check myself, I tried editing the code from your earlier post over the code from your attached text file, and once again, it did not work fine. Finally, I reapplied the code from the attached text file, and all was well. That leads me to believe there is something wrong with the code you posted in the message, because that doesn't work while the code in the attachment does.

FWC
29 Nov 2001, 23:55
Originally posted by Hooper


I'm lost. A post above says great in the latest vb version and this says it doesn't work? or does it?

Thanks The original hack by Scott works fine. Mutt enhanced the hack. Unfortunately, the enhancement doesn't work on my board. It does for Mutt and JJR. Simple. :cool:

Hooper
30 Nov 2001, 01:48
Ah,,,, Ok.

Thank you for the clarification. Much appreciated.

admiralapril
03 Dec 2001, 06:27
Thank you for this great hack! It's working fine over here. :)

Parker Clack
03 Dec 2001, 13:53
This hack is working great with IE 6.0 on 2.2.0 but it does put an extra space between the code and the body of the text that isn't needed. Any way to reduce this? Also, in Netscape the code and smilies are inserted in the right place in the text but then the cursor returns back to the beginning of the message.

Ideas?

BTW, Mutt. I loved the work you did with the UBB code buttons. I used them for years.

Parker

Airwaves
04 Dec 2001, 12:58
If it is that good, I darent install it yet, why dont the developers include it in future versions of vbulletin ?

And you can the devs can work together to perhaps fix the netscape and the more similies pop-up window box?

LuBi
12 Dec 2001, 05:23
Originally posted by Parker Clack
This hack is working great with IE 6.0 on 2.2.0 but it does put an extra space between the code and the body of the text that isn't needed. Any way to reduce this? Also, in Netscape the code and smilies are inserted in the right place in the text but then the cursor returns back to the beginning of the message.

Ideas?

BTW, Mutt. I loved the work you did with the UBB code buttons. I used them for years.

Parker

I think the smilies add a space before and after. So since this code puts them exactly where the cursor is since your used to putting a space then hitting the smilie. I dunno I guess thats why..

Anyhow this hack doesn't work for me, I installed it and cannot uninstall it. I don't really want to uninstall but my members cannot edit their posts when they try to the body of their post comes up blank...? Any ideas?

LuBi
12 Dec 2001, 05:29
Originally posted by JJR512
Did you correctly make the necessary changes to the editpost template?

Yes I did that, still comes up blank.. what other things might ih ave done wrong to cause this? Thanks!

LuBi
12 Dec 2001, 16:39
Just wanted to say thanks to everyone who helped me out, I got it working it was the editpost thingy. The $postinfo[message] was what threw me off. Now my members can edit their posts!?!

s.molinari
27 Dec 2001, 16:54
Hello everyone,

I deleted my demo link since I have the best demo there is. vB.org.:)

Scott

It works perfect with IE6. I just upgraded to XP.

s.molinari
02 Jan 2002, 15:07
Hello all,

Has anyone had javascript errors when the vbcode/smilies are turned off? I had a user on our board who had a problem but up till now I haven't heard any more complaints. Can somebody who's installed this hack test it? It works fine here when I turn off vB code/smilies. And I can't seem to replicate the problem.

Scott

Brian Cruz
03 Jan 2002, 01:10
Originally posted by s.molinari
Hello all,

Has anyone had javascript errors when the vbcode/smilies are turned off? I had a user on our board who had a problem but up till now I haven't heard any more complaints. Can somebody who's installed this hack test it? It works fine here when I turn off vB code/smilies. And I can't seem to replicate the problem.

Scott

I had a member e-mail me recently saying that she got an error whenever she clicked on a text input box, preventing her from posting at all. She said she gets this error:

LINE : 182 (less often, it's 183)
CHAR : 1
ERROR : object expected
CODE : 0

With private messages she gets this error:

LINE : 275
CHAR : 1
ERROR : objected expected
CODE : 0

I'll ask her if she has the vbcode buttons turned off and get back to you.

FWC
03 Jan 2002, 01:53
Originally posted by s.molinari
Hello all,

Has anyone had javascript errors when the vbcode/smilies are turned off? I had a user on our board who had a problem but up till now I haven't heard any more complaints. Can somebody who's installed this hack test it? It works fine here when I turn off vB code/smilies. And I can't seem to replicate the problem.

Scott Wow, I just got home from work and got this message:When I try to post anything, it
says "an error occurred in the script" and it won't let me type anything in
the message box. The error is on line 256 and it says "object is expected."
I'm using AOL 7.O. Is there some incompatibility?He had vB code turned off. I tried and had no problem. I turned it on for him and sent him an email and told him to try posting again. He's not a regular, so I don't know when I'll hear back.

s.molinari
03 Jan 2002, 12:07
@FWC and Brain Cruz

Thanks for the info. I think I'll have to post a fix for this. The problem is, when the user doesn't wish to use the vB buttons or smilies we have calls to functions that don't exist. The actual vbcode.js isn't the problem but rather the calling of the functions.

Keep me posted if you here some more news and I'll try to see about adding the fix.

I was also thinking of trying to add the functionality that when a text string is highlighted and a button is pressed, then the code is added to both sides of the highlighted text. I think that would be even better, don't you?

Scott

Brian Cruz
03 Jan 2002, 16:21
Just wanted to say that the user I mentioned does indeed have vB code turned off.

FWC
03 Jan 2002, 17:42
Originally posted by s.molinari
I was also thinking of trying to add the functionality that when a text string is highlighted and a button is pressed, then the code is added to both sides of the highlighted text. I think that would be even better, don't you?

Scott That does sound good. :)

FWC
05 Jan 2002, 02:17
Originally posted by s.molinari
@FWC and Brain Cruz

Thanks for the info. I think I'll have to post a fix for this. The problem is, when the user doesn't wish to use the vB buttons or smilies we have calls to functions that don't exist. The actual vbcode.js isn't the problem but rather the calling of the functions.

Keep me posted if you here some more news and I'll try to see about adding the fix.Scott Scott, my user came back after I toggled his smilies and vBcodes back on and was able to post with no problem.

Stretchr
19 Jan 2002, 15:35
When I click inside the text box I immediately get an Object Expected Line 290 of newreply.php etc, etc, etc. I've been through all the posts here twice and didn't see a solution. I believe I've done everything correctly, including using the txt file to edit vbcode.js. I'm sure I saw something about this but I can't find where. Any ideas? I really want this hack. Thanks!
BTW I'm using IE 6

Stretchr
19 Jan 2002, 15:45
When I use the vbcode.js you provided it works but if I edit the one that comes with 2.2.1 it didn't. Is there any problem with using the file you provided with 2.2.1 or did I misunderstand the previous threads? Thanks for an EXCELLENT hack!

LuBi
19 Jan 2002, 15:52
Originally posted by Stretchr
When I use the vbcode.js you provided it works but if I edit the one that comes with 2.2.1 it didn't. Is there any problem with using the file you provided with 2.2.1 or did I misunderstand the previous threads? Thanks for an EXCELLENT hack!

No it should work, I had some trouble setting it up myself but it works on 2.2.1 wonderfully :pleased:

Stretchr
19 Jan 2002, 16:07
Thanks. I started in the old thread for this then moved to this thread. With all the posts I wanted to make sure I didn't miss something. It is a great hack and useful!

Scott MacVicar
19 Jan 2002, 16:09
i wonder why this hasn't been put into the official vBulletin release, its a huge improvement and there hasn't been any problems on browsers which support javascript, has there?

Stretchr
19 Jan 2002, 16:19
It doesn't work with NS but that's their problem. I agree that this is a must for the next vB version, though. :up:

Jawelin
19 Jan 2002, 16:20
:cry:

On vbulletin.com is now running the new next-to-release 2.2.2 and still vbcode.js is the same as before..... :zzz:

Stretchr
19 Jan 2002, 16:23
Do you know whether anyone has suggested this? Is there a place where we could start a thread for folks to voice their opinion on getting it added? They use it here so I'm kind of surprised that it didn't get the "thumbs-up" for the next edition. :confused:

Shenlong
19 Jan 2002, 16:54
GREAT HACK! Damn this helped me a lot, I hated the config before and this does nothing but help! thanks so much scott!

Lucky
20 Jan 2002, 02:21
Thank you kindly!

I was hoping something like this would have come out months ago.

:)

LanciaStratos
20 Jan 2002, 17:29
BUG REPORT!

I hate to be the bearer of bad news, but I think my members have found a bug in this hack. I've got about 267 smilies on my forum, and my members like to leave the "Get More" window open so they don't have to keep reloading the window every time they post (with all 267 smilies on it). Of course, it works great for them the first time they use it, but when they attempt to click on a smilie to insert it in a another, new message, it wipes out their entire message! :eek: You can read the thread where my members reported it right here (http://forums.gtplanet.net/showthread.php?postid=88202#post88202). Can anything be done about this?

s.molinari
20 Jan 2002, 18:49
Hello Lancia,

I just registered at your board and tried out the script as you remarked and I had no probs. Is this a general prob or just one with one user? If it is a general prob can you ask some of the users which Browser they are using?

Scott

LanciaStratos
20 Jan 2002, 20:17
Originally posted by s.molinari
Hello Lancia,

I just registered at your board and tried out the script as you remarked and I had no probs. Is this a general prob or just one with one user? If it is a general prob can you ask some of the users which Browser they are using?

Scott Well, it's pretty much a general problem - I'm experiencing it myself with IE 5.5. Since you've registered (thanks!), to simulate the problem, do the following steps...

[list=1]
Click on the reply button, like you're going to reply to a thread.
Open the "Get More" smilies window
Go back to the thread, and click on the reply button again
Now, type something in the message box
Try to insert a smilie by clicking on it in the "Get More" window that you opened earlier. You should then see that your message has been erased, and replaced by the smilie.
[/list=1]

Arathorn
21 Jan 2002, 05:21
I get the same error on my test board. I've also tried closing the more smilies screen then opening it again, but the same error occurs.

I think I have a quick fix though. Apply this add-on (http://www.vbulletin.org/forum/showthread.php?postid=148501#post148501) (post 26). It's annoying if you don't want it to close, but at least you won't lose your messages.

vb 2.2.1, IE 6, hack plus the add-on for enhanced mode added (and later the auto close add-on).

Lucky
21 Jan 2002, 10:44
I have not noticed this error while trying to duplicate it.

philphee
21 Jan 2002, 21:30
Many thanks, this solves a major gripe of all my users; "Jumping to the end of the text".

Thanks again!

LanciaStratos
21 Jan 2002, 23:03
Originally posted by Arathorn
I get the same error on my test board. I've also tried closing the more smilies screen then opening it again, but the same error occurs.

I think I have a quick fix though. Apply this add-on (http://www.vbulletin.org/forum/showthread.php?postid=148501#post148501) (post 26). It's annoying if you don't want it to close, but at least you won't lose your messages.

vb 2.2.1, IE 6, hack plus the add-on for enhanced mode added (and later the auto close add-on). Thanks Arathorn, but I'm afraid that would only make my users more mad! :)

Stretchr
22 Jan 2002, 00:10
I'm having a bit of a problem here. None of the pop-up smilies are clickable and the background is red. I've followed (I think) this somewhat confusing thread and its instructions. I used Mutt's newfxs.txt file and edited the 2.2.1 vbcode.js that came with this version. Here's a screen shot. Any ideas? I'm also not sure why the tables are red. Thanks!

LanciaStratos
22 Jan 2002, 00:57
Originally posted by Stretchr
I'm having a bit of a problem here. None of the pop-up smilies are clickable and the background is red. I've followed (I think) this somewhat confusing thread and its instructions. I used Mutt's newfxs.txt file and edited the 2.2.1 vbcode.js that came with this version. Here's a screen shot. Any ideas? I'm also not sure why the tables are red. Thanks! Man, that redness is really strange...have you checked your templates?

Stretchr
22 Jan 2002, 02:59
Yeah. So far I haven't found anywhere it's not using the variables.
:eek:

Stretchr
22 Jan 2002, 11:41
Just to show how confusing this is, here's a screen shot of the code rendered to a browser via FrontPage. (That's why the pics don't show up)

You'll notice that the colors are correct in this version, yet when it's parsed through vB, somewhere the layout gets skewed. Anyone have any ideas?

Thanks!

s.molinari
22 Jan 2002, 15:02
@ stretchr

I believe you may have made a mistake in this stepIn the vbcode__popup_smiliesbits template you must change:
<a href="java script:smilie('$smilie[text]')">
to:
<a href="java script:opener.smilie('$smilie[text]')"> Also don't forget to take out the space between java and script.

The vbcode_popup_smiliesbits should then look similar to this.<td bgcolor="$backcolor<a href="java script:opener.smilie('$smilie[text]')"><img src="$smilie[path]" border="0" alt="$smilie[title]"></a></td>
<td bgcolor="$backcolor"><normalfont>$smilie[text]</normalfont></td>

Hope that helps.

Scott

Stretchr
22 Jan 2002, 16:38
Thanks, Scott. I was wondering what a "pener" was! LOL Unfortunately, I'm left with the problem of the color (red) and that none of the pop-up smilies are clickable.

Regarding the color issue, where does the pop-up pull the table colors from?

I'm lost as to why the smiles in the pop-up are no longer clickable.
Hmmmm.

Here's another screen shot. Any help or suggestions would be greatly appreciated!
Originally posted by s.molinari
@ stretchr

I believe you may have made a mistake in this stepAlso don't forget to take out the space between java and script.

The vbcode_popup_smiliesbits should then look similar to this.<td bgcolor="$backcolor<a href="java script:opener.smilie('$smilie[text]')"><img src="$smilie[path]" border="0" alt="$smilie[title]"></a></td>
<td bgcolor="$backcolor"><normalfont>$smilie[text]</normalfont></td>

Hope that helps.

Scott

s.molinari
22 Jan 2002, 20:16
oops I see I have a small mistake in my example. Doubt it has something to do with your prob though. The first td tag is missing a ">".

You could do 1 of 2 things:

1. set up a test account on your board so i can take a look at the html code.

or...

2. Post the code here.

Scott

Stretchr
22 Jan 2002, 23:14
Scott,
I sent you the code PM because I wasn't sure about posting an entire template on here. Just for others' information, as a test I reverted to the original vbcode_popup_smiliesbits template and things seem to work normally. Unless that's a problem I'll keep it that way until and unless we can resolve this other issue. Thank you for your help.

Stretchr
23 Jan 2002, 21:38
Thanks, Scott. Wasn't seeing the forest from the trees on this one. Must have looked at that section of the code 20 times. I appreciate your help! :D

Hello Stretchr,

As I mentioned in my last post I have an error in my syntax which you also have in your template. The first td tag should look like this:

<td bgcolor="$backcolor">

If you'll notice there is a " and a > missing. Change that part and see what happens.

Scott

Xelation
23 Jan 2002, 22:10
w00t!! Took me a couple of mins to figure out what you were trying to say... but after I thought it over.... it just clicked! Great Hack... Keep it up!

Joshua Clinard
24 Jan 2002, 05:36
I still cannot figure out what this does.

FWC
24 Jan 2002, 06:39
Originally posted by Joshua Clinard
I still cannot figure out what this does. The main function is it puts the smilie wherever the cursor is instead of at the end of the message. It also allows you to highlight already typed text and click on one of the tags and have it entered automatically. My users would kill me if I ever removed this hack. :)

s.molinari
24 Jan 2002, 18:11
allows you to highlight already typed text and click on one of the tags and have it entered automatically

I don't think that part works. But it does let you place a tag or a smilie where you want it.

Scott

FWC
24 Jan 2002, 18:54
Originally posted by s.molinari


I don't think that part works. But it does let you place a tag or a smilie where you want it.

Scott I don't know. I just typed and highlighted this and hit red and it did the trick. It does on my board, too. :)

s.molinari
24 Jan 2002, 19:11
Maybe I misunderstood. When I highlight something it gets replaced with the vbcode I choose. I am using IE6.

What browser are you using?

Scott

FWC
24 Jan 2002, 20:29
Originally posted by s.molinari
Maybe I misunderstood. When I highlight something it gets replaced with the vbcode I choose. I am using IE6.

What browser are you using?

Scott IE 6 on an XP machine and a 2000 Pro machine.

And it works on both. :)

Well, I managed to break it. It was working fine until I highlighted some text and canceled the tag. :(

LanciaStratos
25 Jan 2002, 01:40
Hey Scott, any ideas on what could be going on with my board? :confused:

s.molinari
25 Jan 2002, 16:20
@lanciastratos I do believe it's a browser problem. I use IE6 and had no such problems. I did have the situation that the smilies didn't work at all after opening different reply screens but my messages never disappeared.

Scott

s.molinari
25 Jan 2002, 16:23
@fwc - Highlighting was never intended. It works for some and for others it doesn't. I do believe though the basic functions are stable.

Scott

FWC
25 Jan 2002, 17:54
Originally posted by s.molinari
@fwc - Highlighting was never intended. It works for some and for others it doesn't. I do believe though the basic functions are stable.

Scott Yes, the basic functions are very stable. But, highlighting seems to work for most of my users and they love it. :)

Stretchr
25 Jan 2002, 18:01
It's kind of funny because a lot of what I've heard from folks about this hack pertains to how great the (unintentional?)highlight feature is. Serendipity
Originally posted by s.molinari


I don't think that part works. But it does let you place a tag or a smilie where you want it.

Scott

LanciaStratos
25 Jan 2002, 21:46
OK, thanks Scott... :)

Mutt
28 Jan 2002, 01:39
If you go back throught this thread, you'll see that I posted a hack to this hack. if you make the extra mods that I posted, highlighting WILL work

alexp
29 Jan 2002, 17:19
I'm probably not allowed to do this, but adding the following function:


function insertGenericTwoParter(theForm, theValue, theMessage, defaultArg){
//theValue is the vb code
//theMessage is the message asking for the argument to the VB code

var arg=prompt(theMessage, defaultArg);

if (!arg) return; //end on cancel.

var theText=prompt("Enter text to insert between the "+theValue+" tags", "");

if (!theText) return; //end on cancel.

var tempText= "["+theValue+"="+arg+"]"+theText+"[/"+theValue+"]";

AddText(tempText,theform);

theform.message.focus();

}


...into the same .js file allows you to add new buttons for new effects at will, without having to re-hack the file.

This may be useful to someone..

Regards,
Alex

Matze
02 Feb 2002, 17:08
Nice work, but i still good a closing undefined when i use just one opened tag. When i use bold and italic or italic an underlined etc, it works fine!
-> IE5.5, W2K SP2

Matze

Matze
02 Feb 2002, 17:11
Done, i took the vbcode.js from this server and now it works... :rolleyes:

Matze

Lucky
24 Feb 2002, 23:40
Works great on 2.2.2

Thanks friend.

SHalliday
16 Mar 2002, 03:44
nice hack..

newsguy
16 Mar 2002, 19:23
Just wanted to say that I upgraded to 2.2.4 today and after reapplying this hack, it started to delete highlighted text in the message box (which for me in 2.2.2 was not the case).

I went back, as Mutt suggested and found his "hack to this hack", used it, and now all is well.

Here is Mutt's message with his "hack to this hack":

http://www.vbulletin.org/forum/showthread.php?postid=203781#post203781

Figured I'd just link to it for other people's convenience, and also say thanks to Mutt.

Erwin
16 Mar 2002, 21:08
Sweet - thanks newsguy.

Broekie
22 Mar 2002, 07:53
Okay, call me stupid, but I'm getting really confused with al those solutions posted everywhere along this thread...

I tried to put all the steps to apply this hack onto a vbb2.2.4 into a text file, but it didn’t take long before I lost track of which steps are actually necessary and which are not.

I know that I, as a complete new user to this forum, shouldn’t be complaining about this.
But, I would very, very much appreciate it when somebody would post the necessary steps to apply this hack to vbb2.2.4.

Please? *begging face*

plasir
25 Mar 2002, 06:54
hi!

I think so too. It's confusing for me a newbie (what's going, what's not, several hacks...uhhhh).
Is it possible to start a new thread: Cursor position Vers. 2.2.4 ?

It would be very usefull.

thx

HellRazor
25 Mar 2002, 18:40
The hack sounds great! But I'm a little confused about the entire first portion of the install instructions (where it doesn't specify exactly what portions to change in exactly what files).

Can someone post simple step-by-step install instructions for this hack for VBulletin 2.2.4? It would help out alot!

s.molinari
25 Mar 2002, 19:16
Originally posted by HellRazor
The hack sounds great! But I'm a little confused about the entire first portion of the install instructions (where it doesn't specify exactly what portions to change in exactly what files).

Can someone post simple step-by-step install instructions for this hack for VBulletin 2.2.4? It would help out alot!

Hello Hellraiser and plasir,

The instructions are in my opinion clear. Ok I wrote them. :)

Honestly though, there are no files to change except the JS file. The most changes that need to be done are to the templates and they are all listed in the first post of this thread. There are some improvements to the hack that have been added through other users and I may add them at a later date but the instructions on how to add the hack to vB will basically stay the same. Also, the instructions are applicable to 2.2.4.

Scott

HellRazor
25 Mar 2002, 19:46
Ok, let me tell you the portions I'm not sure about. :)


You need to add the following text to the "message" textarea tag:
onChange=getActiveText(this) onclick=getActiveText(this)

It should basically look similiar to this:<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="2"
onChange=getActiveText(this) onclick=getActiveText(this) >$message</textarea>


Where does the above change go? I'm not sure which file or template to make that change in.



Please note: The variable($message) may be different in some templates, editpost for example, so make sure to keep the original variable in the textarea attribute "name =". Otherwise the text may be missing in some instances.

This textarea can be found in the following templates:

Calendar Templates

calendar_enterevent

New Posting Templates

newreply

newthread

Private Messaging Templates

priv_forwardmultiple

priv_sendprivmsg

priv_sendtobuddies

and the editpost template



The section above confuses me. I know I need to edit those templates, but what exactly do I need to change?

I think I understand the rest of it. Thanks for your help!

Mac Users Group
31 Mar 2002, 23:04
Doesn't seem to work for me...

Does it make a difference if it is used on a Mac or a PC?

plasir
08 Apr 2002, 14:39
i get it ! works fine !

many thanks ! :rambo:

Marc T Smith
12 Apr 2002, 06:57
Originally posted by Mac Users Group
Doesn't seem to work for me...

Does it make a difference if it is used on a Mac or a PC?Did you get it working?

Do you mean the script breaks when using Explorer and/or Netscape on a Mac? The hack doesn't work for me acccessing this board on my Mac. It breaks the script somehow on both Explorer and Netscape on my Mac.

plasir
12 Apr 2002, 07:53
ist installed it on two boards successfully. I know that it works also fine on an third board.

I use IE (+PC).

I don't know anything about MAC, but in my opinion it doesn't matter if IE runs on PC and/or MAC.
Important is only you browser.

Marc T Smith
14 Apr 2002, 04:53
Whatever it is with the Mac java interpreter or whatever (not my field), it doesn't work with system 9.0.1 using IE or Netscape (NON-AOL) or Mozilla. As soon as I put the cursor in the reply box it errors out. After that I can't even use a smiley by clicking on it. Of course, as long as I know the code...

This may not be the case with Mac OS X - don't have it to try.

s.molinari
20 Apr 2002, 17:52
Hello all,

This hack will work with 2.2.5. :classic:

Scott

p.s. If one of the mods could please update the title to read 2.2.5. Thanx.

el3m3nt
20 Apr 2002, 18:12
scott das kannst du selber.. editiere einfach den ersten beitrag in diesem thread. dort kannst du das auswählen :).

Chris M
20 Apr 2002, 19:13
Lol...

Ich sprache ein bisschen Deutsch, aber bin ich 16 jahre alt.

Im learning it for GCSE...

Satan

s.molinari
20 Apr 2002, 19:40
Originally posted by el3m3nt
scott das kannst du selber.. editiere einfach den ersten beitrag in diesem thread. dort kannst du das auswählen :).

Danke :) Habe ich glatt verpasst.

Scott

Stretchr
20 Apr 2002, 23:29
I got an email that this hack had been updated. Has it? Or was the email generated because the version compatibility was changed?

Thanks!

Erwin
20 Apr 2002, 23:38
What's the difference between the previous versions and the one mentioned in the update email? The previous version is working very well with 2.2.5 - do I need to update? I notice the new vbcode.js file is smaller than the previous one.

Stretchr
20 Apr 2002, 23:44
Erwin,
The js code is different size? Maybe I'll d/l and run Beyond Compare and see if I can find the difference.

Stretchr
20 Apr 2002, 23:52
Erwin,
The code is different and it works again on my site. I hadn't been able to get it to work recently so I'm using the new js. If yours works as is, maybe you don't need to change.

Crazy Mofo
21 Apr 2002, 00:17
u know when you click the Get More smiles what is that called? if i want too edit it? and what is the original txt for it?

r.cakir
27 Apr 2002, 08:57
Hello everybody

I know, most of you uses the Windows OS, but there are also some vB-Boards around the world, which are designed for Mac users. I've tested this very useful Hack on my Board with all actual available Mac-Browser's under the Classic OS and Mac-OS X 10.1.x. But it doesn't work! :(

So I think it's not a Browser problem, it's more OS related. Maybe somebody in this community who also works with Mac-OS can help me. :disappointed:

TECK
21 May 2002, 08:11
scott, i use images instead of regular buttons. for some reason, every time i click on the "image" button BOLD and submit the text, it's sending me to submit and posts for me??? :O

any idea why? what should i change in the java code?

TECK
21 May 2002, 11:39
for some reason, if i enter <input type="image"...> instead of button, it messes up the script.

alexp
21 May 2002, 11:40
maybe use:

<a href="javascript: doSomething()"><img....></a>

...instead?

TECK
22 May 2002, 05:13
alex.. that will never do it. due to the algorithm used by vbcode.js.
it must be a simple edit somewhere there.. i looked everywhere with no success. i really want to use the images buttons instead of the regular ones.. :(

Chen
22 May 2002, 06:28
Actually that would also work... :rolleyes:

TECK
22 May 2002, 17:48
unfortunatelly, is not. i tried both ways. with scott's file and the default vbcode.js. it will not work.

Chen
22 May 2002, 17:54
Then you are doing something wrong.

TECK
22 May 2002, 19:37
probably. i will double check. thanks.

plcguru
08 Jun 2002, 05:59
Hi,
Anybody know how to remove the space that gets inserted after the tag is closed?

for example, if you highlight a word and then click the bold button, a space is inserted after the tag automatically. I'd like to get rid of the space.

plcguru
12 Jun 2002, 04:20
Any ideas to get rid of the space? Please??

I tried modifying the vbcode.js file, but I give up as the space still remains. The hack works extremely well but that space...

s.molinari
12 Jun 2002, 14:37
Hello plcguru,

Since this feature wasn't actually programmed into the code (really! it just happens:D) I 'll have to look into how it even happens.;)

It may take a while though, cause I'm working hard on vB-germany.:)

Maybe someone else can take a shot at it.

Scott

plcguru
23 Jun 2002, 04:44
Originally posted by s.molinari
@FWC and Brain Cruz

Thanks for the info. I think I'll have to post a fix for this. The problem is, when the user doesn't wish to use the vB buttons or smilies we have calls to functions that don't exist. The actual vbcode.js isn't the problem but rather the calling of the functions.

Keep me posted if you here some more news and I'll try to see about adding the fix.
...snip....
Scott

Was there ever a fix for this? I installed in about 3 weeks ago and I'm starting to have users complain of javascript errors. If I re-enable the VBCode for them, the problem disappears just as has been posted earier.
Any fix?
(still a great hack... :D )
Thx,
Phil

s.molinari
23 Jun 2002, 10:13
Hello plcguru,

Sorry, I had fixed this in the vB-Germany thread but forgot to update you guys.:) Shame on me.

Here is the fix. I never tested it but a couple of German users told me it works like a charm so give it a try. If you have probs. let me know. Please read the note below too!

In the newthread template replace

onChange=getActiveText(this) onclick=getActiveText(this)

with

$jsinsert

Then search for the following code in newthread.php

if ($foruminfo[allowsmilies]) {
if ($bbuserinfo[showvbcode] && $allowvbcodebuttons)
$vbcode_smilies = getclickysmilies();
eval("\$disablesmiliesoption = \"".gettemplate("newpost_disablesmiliesoption")."\";");
} else {
$disablesmiliesoption="";
}
if ($bbuserinfo[showvbcode] && $allowvbcodebuttons)
$vbcode_buttons = getcodebuttons();

and replace it with:


if ($foruminfo[allowsmilies]) {
if ($bbuserinfo[showvbcode] && $allowvbcodebuttons)
$vbcode_smilies = getclickysmilies();
$jsinsert = "onChange=getActiveText(this) onclick=getActiveText(this)";
eval("\$disablesmiliesoption = \"".gettemplate("newpost_disablesmiliesoption")."\";");
} else {
$disablesmiliesoption="";
$jsinsert="";
}
if ($bbuserinfo[showvbcode] && $allowvbcodebuttons) {
$vbcode_buttons = getcodebuttons();
$jsinsert = "onChange=getActiveText(this) onclick=getActiveText(this)";
}else{
$jsinsert = "";
}

NOTE!Of course this will only fix the js errors for a new thread. You'll have to fix the other templates and scripts too. (i.e. for new replies and private messages) If someone could post the other templates and scripts here I would be very greatfull.:)

Scott

plcguru
25 Jun 2002, 03:30
Thanks Scott,
The fix worked fine :)

The php code also needs to be changed as you wrote(exactly the same) in editpost.php and newreply.php.
Then the template changes should also be done (exactly the same as you wrote) in the editpost template and newreply template.

This fixes the javascript errors.

Regarding the private message phps (private.php and private2.php) the code is different and I didn't want to mess with it (i.e. break it :ermm: ). So, I just removed the

onChange=getActiveText(this) onclick=getActiveText(this)

code from the following templates:

priv_forwardmultiple
priv_sendprivmsg
priv_sendtobuddies

Now users don't have the added convenience when sending PMs but at least they don't get an error. A reasonable trade I think.

Awesome hack :cool: ... one of my favorites! Danke

Sinecure
27 Jun 2002, 00:59
If I get a change I'll post the modifications to the rest of the templates. I can't get around to it today, I spent like 5 hours upgrading to 2.2.6 :)

plasir
09 Jul 2002, 18:38
works 2.2.5 with 2.2.6 ?

alexp
12 Jul 2002, 16:41
works on our 2.2.6 with the original instructions from the top post on this thread. 2 mins job to implement.

still my fave hack :)

plasir
12 Jul 2002, 18:33
thx. right ! It works well. It's may favourite hack also. Extreme usefull. ;-))

Webmasta XT
27 Aug 2002, 00:28
i installed the shoutbox, than i install this hack, now the shoutbox smilies don't work, but the hack works for the rest of the forums......

Serge
22 Sep 2002, 15:53
Well I'm having problems with verison 2.2.7 with your hack I think. When I try to edit or quote someone I get a blank in the message thing.

Tigga
22 Sep 2002, 21:00
Works fine for me on 2.2.7. :)
I haven't been getting any javascript errors or extra spaces, so should I still apply the fix listed above?

Learner29
24 Sep 2002, 04:44
thank you

Bison
07 Dec 2002, 21:52
works good in 2.2.9! :D

plasir
08 Dec 2002, 17:58
thx for information !

Sefiros
14 Dec 2002, 11:17
In response to this last post, here's the correct code:

<table bgcolor="#0E3652" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="http://www.vbulletin.org/forum/images/space.gif" alt=""></td><td width="100%"><!-- spacer -->

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E" {tableouterextra} width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" {tableinnerextra} width="100%">
<tr>
<td bgcolor="$post[backcolor]" width="175" valign="top" nowrap>
<a name="post$post[postid]"></a>
$post[firstnewinsert]
<normalfont><b>$post[username]</b></normalfont><br>
<smallfont>$post[usertitle]</smallfont><br>
$post[avatar]<p>
<br>
<p> <smallfont><b>Level: $showlevel<br>
Member ID: $post[userid]</b></smallfont><br><br>
<smallfont>HP: $hp $maxhp</smallfont>
<table width="100" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td bgcolor="#0A1C40"><img src="images/bar/bhg.gif" width="$hpf%" height="9"><img src="images/bar/bhb.gif" width="1" height="9"></td>
</tr>
</table>
<smallfont>MP: $mp $maxmp</smallfont>
<table width="100" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td bgcolor="#0A1C40"><img src="images/bar/bmg.gif" width="$mpf%" height="9"><img src="images/bar/bmb.gif" width="1" height="9"></td>
</tr>
</table>
<smallfont>Exp: $ep%</smallfont>
<table width="100" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td bgcolor="#0A1C40"><img src="images/bar/bxg.gif" width="$ep%" height="9"><img src="images/bar/bxb.gif" width="1" height="9"></td>
</tr> </table>

<smallfont>Registered: $post[joindate]<br>
Location: $post[field2]<br>
Posts: $post[posts]</smallfont></td>

<td bgcolor="$post[backcolor]" width="100%" valign="top">
<smallfont>$post[icon] <b>$post[title]</b></smallfont>
<p><normalfont>$post[message]</normalfont></p>
$post[attachment]
<p>$post[signature]</p>
<p>$post[editedby]</p>
<p align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></p>
</td>
</tr>
<tr>
<td bgcolor="$post[backcolor]" width="175" height="16" nowrap><smallfont>$post[foldericon]
$post[postdate] <font color="#FF9C58">$post[posttime]</font></smallfont></td>

<td bgcolor="$post[backcolor]" width="100%" valign="middle" height="16">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td><smallfont>$onlinestatus
$post[profile] $post[pmlink] $post[useremail] $post[homepage] $post[search] $post[buddy]
<!-- $ post[icqicon] --> <!-- $ post[aimicon] --> <!-- $ post[yahooicon] -->
</smallfont></td>
<td align="right" nowrap><smallfont>
<a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="http://www.vbulletin.org/forum/images/edit.gif" border="0" alt="Edit/Delete Message"></a>
<a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="http://www.vbulletin.org/forum/images/quote.gif" border="0" alt="Reply w/Quote"></a>
</smallfont></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>

<!-- spacer --></td><td width="10"><img width="10" height="1" src="http://www.vbulletin.org/forum/images/space.gif" alt=""></td></tr></table>

LancerForums
14 Dec 2002, 15:52
I'm using smilies w/ the quickreply hack and I seem to get a javascript error only on that page with the new smilie code. Any idea what could be causing this?

I just tried running the old js code and it works, but without the additional features. Right when I switch to the new vbcode.js I get this error:
Line: 59
Char: 9
Error: 'message' is null or not an object
Code: 0
I get this same error even when I add the getActiveText functions for the textarea field.

Mark

Leo[GR]
06 Jan 2003, 10:15
Originally posted by Webmasta XT
i installed the shoutbox, than i install this hack, now the shoutbox smilies don't work, but the hack works for the rest of the forums......

I have exactly the same problem :cry:

BigJohnson
27 Jan 2003, 12:54
me too

Leo[GR]
27 Jan 2003, 13:24
Any solution to this probem ? Please ?

o0stephane0o
27 Jan 2003, 22:01
are you german? How come you speak such a good english?

Leo[GR]
28 Jan 2003, 05:14
Originally posted by o0stephane0o
are you german? How come you speak such a good english?

If you're talking to me, no. I am Greek :D

WebMasterAJ
02 Feb 2003, 02:08
As stated by a few others, the hack works great on everything except for the shoutbox :(

Xyphen
01 Mar 2003, 16:21
The solution is.

You upload the *Orignal* vbcode.js file as vbcodeshout.js, then edit the shoutbox template replace vbcode.js with vbcodeshout.js. Thats all. If it doesn't work, let me know, and I'll help.

Edit: There is a problem that I am looking a solution for, if someone can make this work on vB2.3.0 let me know please, thank you. ;)

Doubledoom
19 Mar 2003, 10:36
installed and working on 2.3.0. The last bit "vbcode_popup_smiliesbits" could not be completed as that bit of code to change is not present. However, the hack is working without that change.

Sun Boy
19 Mar 2003, 11:12
so can any 1 give us the hack at the final updated ?

catocom2
19 Mar 2003, 15:40
I just installed this on 2.3.0 per instructions
in the first post, also added it in my quick reply code.
:banana: It Works!
Thanks for this great hack/fix!
I've been using it at JJRs for a while, and thought I'd give
it a try since I updated to 2.3.0

I haven't thouroughly tested, but the
New Thread
New Reply
and my
Quick replybox
all work fine so far.;)

catocom2
25 Mar 2003, 01:51
Well now I stumped :surprised:

I had some other unrelated problems (I think) and decided
to do a fresh 2.3.0 install, I did install this on an upgraded
board, and it did work fine, but since I've done a fresh install
and tried to reinstall this hack, I've noticed some other slight
changes in the code. I did'nt think much about it and installed
the changes anyway.
It just doesn't seem to do anything new now. :surprised:
I'v when back over all the templates about 4 times and
tried different similar variables, but still the same.
I've even compared the templates, side by side with the
ones that were working and still no joy.
I'm wondering now if there's some other file that needs to
be hacked.

catocom2
25 Mar 2003, 14:29
Well so far,
my best guess is that it has something to do with the new "get more" function.
My old updated board didn't have that, and I only had about 15
smilies, all in one box.

catocom2
27 Mar 2003, 00:32
Man this is really wierd..
I didn't change anything, and it just decided to start working today. :confused:

may have been my cookies or something.

woohoo :banana:

SloppyGoat
09 Apr 2003, 20:33
I installed it on 2.3.0, and the get more smilies was acting very erratic. It would disappear after clicking something. I'm not sure what was going on, but something just ain't right. That was in editpost I was testing. Has this hack been confirmed to work right in 2.3.0 yet? Also, if so, are there two lines in editpost that need to be changed? Maybe I did it wrong? Is there a way to have the smilies not hide every time you click them, like it would normally be?

[edit]
After observing here, I guess that's just the way it works.
That's all that was freaking me out, actually. But I'd still like to know if the window can act like it used to.

tkeil69575
24 May 2003, 22:13
hi s.molinari ,
could it be that using this hack the focus to the smilie popup window is lost ... ehm to put it another way would it be possible after inserting a smilie to reset the focus to the smilie popup windows???

thanks
tina

s.molinari
25 May 2003, 10:30
Hi yall,

Sorry, but I really haven't had time to keep this hack up-to-date with my ventures at vbulletin-germany.com, which means you guys and gals are on your own. I hope you will forgive me.

Scott

Clarity
03 Jun 2003, 19:27
Anyone running 2.3.0 who is just now installing this for the first time, let me try and save you some time.

D/L the new .js from the first post in the thread and follow all the instructions in that post except for vbcode_popup_smiliesbits.

Test the functionality on your board (in both enhanced and normal mode). Normal is likely working, enhanced may not be. If that's the case, go to page 5 of this thread, and look for Mutt's post that includes an attachment. Download, and follow his instructions that involves making two pastes into the .js file.

Go back and test your functionality in enhanced, it should now be working. Thanks Mutt, you rule.

Now create a post, and click on "Get More" Smilies. Click on one to add it. Doesn't work, right?

The vbcode_popup_smiliesbits edit that you didn't do must have been for an old version. Go in there now, and simply turn this;

"><a href="#" onclick="smilie('$smilie[text]');

into this;

"><a href="#" onclick="opener.smilie('$smilie[text]');

Note that you're only adding 'opener.' -- that's it. Go back to your board and test everything, but you should be done. I was running an otherwise stock 2.3.0 clean install, and all of this did the trick.

I'm beyond newbie and clueless with all of this stuff, but I was able to get it all working properly. So everyone else should be encouraged by that.

Thanks SO much for this modification, and all the input from people in this thread to help get it going. Hoping that this little update/consolidation of the process can be a help to someone who was as clueless as I going in. If not, everything you need is in this thread somewhere.

s.molinari
03 Jun 2003, 21:54
Hi Clarity,

Thanx for the heads up.:) And sorry to all that I haven't kept this hack up to date for the later versions. However, a good note is, vB3 uses a modified version of this hack for the non-wysiwyg post, thread, calendar and PM editor. :) Cool huh?

Scott

Clarity
03 Jun 2003, 22:14
It's up to date enough for someone like me (read: non-tech oriented) to figure it out. ;)

Thanks a million for an outstanding modification, and I'm very happy to hear it's in v3.

The_Huntress
06 Jun 2003, 00:35
i have a lil prob.. on 'get more smilies' when i click on a smilie to place it before a certain word it places it but erases the word *scratches head*

oh and since im comp illiterated, what do you mean when you say " Test the functionality on your board (in both enhanced and normal mode)." ?

Clarity
06 Jun 2003, 01:02
When posting, there are two radio buttons in the vbCode field. One for Normal Mode, one for Enhanced. When your testing the functionality of this hack, make sure you try highlighting a word and pressing one of the buttons (B/I/U) with each mode.

The_Huntress
06 Jun 2003, 01:10
k dat works thanks :)

and you do know what may be causing the other prob?

ETA: nm fixed it. am having a diff prob now tho.. since i installed this hack the smilies underneath the shoutbox text box dont work :(

Frozen Dreams
01 Jul 2003, 21:41
somehow I must have messed up the bb tags in normal mode :( ... in enhanced about 75% of them work but in normal mode not at all
this happens in editpost, newreply, newthread etc :(
can someone help? where do I need to look in order to fix this :$

Gutspiller
05 Jul 2003, 03:11
This hack doesn't seem to work on my board. I believe it's because I have the following firefly hacks installed:

http://www.vbulletin.org/forum/showthread.php?s=&threadid=25888
http://www.vbulletin.org/forum/showthread.php?s=&threadid=25996
:(

Anybody think they can help me?

The M.I.P.
13 Dec 2003, 23:16
I get JavaScript error with Opera 7:
Event thread: onclick
Error:
name: TypeError
message: Statement on line 53: Expression evaluated to null or undefined and is not convertible to Object: document.selection
Backtrace:
Line 53 of linked script http://localhost/vBtest/vbcode.js
text = text;
In unknown script
getActiveText(this);
At unknown location
{event handler trampoline}

Line 53 is located in getActiveText() and looks liketext = (document.all) ? document.selection.createRange().text : document.getSelection();Is there a fix to this?

NecroSocial
01 Feb 2004, 09:59
Got a new recent issue. In vB 2.3.4 the installation of this hack goes fine. However when using the vB Quick Links toolbar in enhanced mode users who highlight their text and click a button have their text replaced by the code their attempting to use. So instead of making a word bold, the word would be replaced by the [B] tag. Has anyone had this issue?

-Necro

admiralapril
01 Feb 2004, 20:44
Got a new recent issue. In vB 2.3.4 the installation of this hack goes fine. However when using the vB Quick Links toolbar in enhanced mode users who highlight their text and click a button have their text replaced by the code their attempting to use. So instead of making a word bold, the word would be replaced by the [B] tag. Has anyone had this issue?
I have always had this issue with VB 2.x. I've always had to do the codes by hand. The buttons wouldn't work properly. VB 3.0 rocks, though!