PDA

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


s.molinari
07-29-2001, 10:00 PM
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
07-30-2001, 07:30 PM
thanks but i cant install it because im a complete newbie.

s.molinari
07-30-2001, 07:38 PM
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
07-30-2001, 07:46 PM
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
07-30-2001, 09:12 PM
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
07-31-2001, 12:57 AM
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
07-31-2001, 04:27 AM
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
07-31-2001, 05:18 AM
Awesome Scott :)
v cool and works great.

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

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

Scott

VirtueTech
07-31-2001, 07:42 AM
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
07-31-2001, 07:59 AM
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
07-31-2001, 09:19 AM
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
07-31-2001, 10:05 AM
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
07-31-2001, 02:34 PM
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
07-31-2001, 02:39 PM
Disable Smilies :)

RobAC
07-31-2001, 02:44 PM
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
07-31-2001, 04:59 PM
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
07-31-2001, 05:05 PM
I meant just in that post, which if you notice I edited and turned smilies off.

s.molinari
08-01-2001, 10:35 AM
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
08-01-2001, 02:15 PM
Please post screenshot of this hack.

s.molinari
08-01-2001, 05:14 PM
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
08-01-2001, 07:35 PM
Demo Board now available for a short time!

Sorry demo board is closed.


Scott

jucs
08-01-2001, 11:23 PM
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
08-01-2001, 11:29 PM
Honestly, it took me approximately 60 seconds to make all the required changes...

s.molinari
08-02-2001, 05:48 AM
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
08-02-2001, 06:59 AM
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
08-02-2001, 02:12 PM
You forgot to mention to add the code to the editpost template.

VirtueTech
08-02-2001, 03:08 PM
Dost - I did ?

dxb
08-02-2001, 08:38 PM
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
08-02-2001, 08:41 PM
Hi,
works great in 2.0.3

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

s.molinari
08-03-2001, 04:36 AM
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
08-04-2001, 03:18 PM
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
08-05-2001, 01:57 AM
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
08-05-2001, 03:56 AM
It's IE6 beta, updated as far as I know. Windows 2000 Pro, if it helps.

JJR512
08-05-2001, 04:03 AM
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
08-05-2001, 04:28 AM
I've recreated the /undefined problem. I'll look into that. Is the alt+i or b or u still not working?

Scott

JJR512
08-05-2001, 04:40 AM
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
08-05-2001, 07:03 AM
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
08-05-2001, 07:11 AM
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
08-05-2001, 02:24 PM
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
08-05-2001, 03:17 PM
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
08-05-2001, 03:39 PM
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
08-06-2001, 07:06 AM
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
08-07-2001, 03:00 AM
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
08-24-2001, 11:37 PM
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-11-2001, 08:24 AM
Is this hack working with version 2.2.0?

Grover
11-12-2001, 01:40 PM
<font size="4">O MY GOD!</font>

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
11-18-2001, 06:32 AM
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. ;)

Admin
11-18-2001, 06:53 AM
Ok, let's see how this works here. :)
<?php
echo "This is working good.";
?>

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

What the?

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

LanciaStratos
11-19-2001, 09:24 PM
Working perfect on 2.2.0! :D Great hack, thanks s.molinari! :cool:

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

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


LOL! :)

LuBi
11-27-2001, 02:42 PM
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
11-27-2001, 03:58 PM
Did you correctly make the necessary changes to the editpost template?

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

TheUnforgiven
11-28-2001, 06:19 PM
*bump* hehe i just needed this hack...

Mutt
11-28-2001, 09:32 PM
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
11-28-2001, 10:53 PM
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
11-29-2001, 01:00 AM
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
11-29-2001, 01:09 AM
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
11-29-2001, 01:54 AM
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
11-29-2001, 02:23 AM
Does anyone know if this is working with the latest vb version?

FWC
11-29-2001, 03:02 AM
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
11-29-2001, 09:50 PM
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
11-29-2001, 09:52 PM
with the original hack installed, have any of your members experienced any posting problems., javascript errors, or browser crashes?

FWC
11-29-2001, 10:09 PM
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
11-29-2001, 10:10 PM
Originally posted by Mutt
if it still doesn't work, sorry. I tried :)
Still doesn't work for me. Thanks for trying! :)

Hooper
11-29-2001, 10:38 PM
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
11-29-2001, 10:50 PM
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
11-29-2001, 10:55 PM
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
11-30-2001, 12:48 AM
Ah,,,, Ok.

Thank you for the clarification. Much appreciated.

admiralapril
12-03-2001, 05:27 AM
Thank you for this great hack! It's working fine over here. :)

Parker Clack
12-03-2001, 12:53 PM
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
12-04-2001, 11:58 AM
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-12-2001, 04:23 AM
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-12-2001, 04:29 AM
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-12-2001, 03:39 PM
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
12-27-2001, 03:54 PM
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
01-02-2002, 02:07 PM
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
01-03-2002, 12:10 AM
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
01-03-2002, 12:53 AM
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
01-03-2002, 11:07 AM
@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
01-03-2002, 03:21 PM
Just wanted to say that the user I mentioned does indeed have vB code turned off.

FWC
01-03-2002, 04:42 PM
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
01-05-2002, 01:17 AM
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
01-19-2002, 02:35 PM
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
01-19-2002, 02:45 PM
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
01-19-2002, 02:52 PM
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
01-19-2002, 03:07 PM
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
01-19-2002, 03:09 PM
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
01-19-2002, 03:19 PM
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
01-19-2002, 03:20 PM
: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
01-19-2002, 03:23 PM
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
01-19-2002, 03:54 PM
GREAT HACK! Damn this helped me a lot, I hated the config before and this does nothing but help! thanks so much scott!

Lucky
01-20-2002, 01:21 AM
Thank you kindly!

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

:)

LanciaStratos
01-20-2002, 04:29 PM
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
01-20-2002, 05:49 PM
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
01-20-2002, 07:17 PM
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
01-21-2002, 04:21 AM
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 (https://vborg.vbsupport.ru/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
01-21-2002, 09:44 AM
I have not noticed this error while trying to duplicate it.

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

Thanks again!

LanciaStratos
01-21-2002, 10:03 PM
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 (https://vborg.vbsupport.ru/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
01-21-2002, 11:10 PM
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
01-21-2002, 11:57 PM
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
01-22-2002, 01:59 AM
Yeah. So far I haven't found anywhere it's not using the variables.
:eek:

Stretchr
01-22-2002, 10:41 AM
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
01-22-2002, 02:02 PM
@ 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
01-22-2002, 03:38 PM
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
01-22-2002, 07:16 PM
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
01-22-2002, 10:14 PM
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
01-23-2002, 08:38 PM
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
01-23-2002, 09:10 PM
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
01-24-2002, 04:36 AM
I still cannot figure out what this does.

FWC
01-24-2002, 05:39 AM
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
01-24-2002, 05:11 PM
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
01-24-2002, 05:54 PM
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
01-24-2002, 06:11 PM
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
01-24-2002, 07:29 PM
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
01-25-2002, 12:40 AM
Hey Scott, any ideas on what could be going on with my board? :confused:

s.molinari
01-25-2002, 03:20 PM
@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
01-25-2002, 03:23 PM
@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
01-25-2002, 04:54 PM
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
01-25-2002, 05:01 PM
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
01-25-2002, 08:46 PM
OK, thanks Scott... :)

Mutt
01-28-2002, 12:39 AM
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
01-29-2002, 04:19 PM
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-02-2002, 04:08 PM
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-02-2002, 04:11 PM
Done, i took the vbcode.js from this server and now it works... :rolleyes:

Matze

Lucky
02-24-2002, 10:40 PM
Works great on 2.2.2

Thanks friend.

SHalliday
03-16-2002, 02:44 AM
nice hack..

newsguy
03-16-2002, 06:23 PM
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":

https://vborg.vbsupport.ru/showthread.php?postid=203781#post203781

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

Erwin
03-16-2002, 08:08 PM
Sweet - thanks newsguy.

Broekie
03-22-2002, 06:53 AM
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
03-25-2002, 05:54 AM
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
03-25-2002, 05:40 PM
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
03-25-2002, 06:16 PM
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
03-25-2002, 06:46 PM
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
03-31-2002, 10:04 PM
Doesn't seem to work for me...

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

plasir
04-08-2002, 01:39 PM
i get it ! works fine !

many thanks ! :rambo:

Marc T Smith
04-12-2002, 05:57 AM
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
04-12-2002, 06:53 AM
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
04-14-2002, 03:53 AM
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
04-20-2002, 04:52 PM
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
04-20-2002, 05:12 PM
scott das kannst du selber.. editiere einfach den ersten beitrag in diesem thread. dort kannst du das ausw?hlen :).

Chris M
04-20-2002, 06:13 PM
Lol...

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

Im learning it for GCSE...

Satan

s.molinari
04-20-2002, 06:40 PM
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
04-20-2002, 10:29 PM
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
04-20-2002, 10:38 PM
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
04-20-2002, 10:44 PM
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
04-20-2002, 10:52 PM
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
04-20-2002, 11:17 PM
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
04-27-2002, 07:57 AM
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
05-21-2002, 07:11 AM
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
05-21-2002, 10:39 AM
for some reason, if i enter <input type="image"...> instead of button, it messes up the script.

alexp
05-21-2002, 10:40 AM
maybe use:

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

...instead?

TECK
05-22-2002, 04:13 AM
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.. :(

Admin
05-22-2002, 05:28 AM
Actually that would also work... :rolleyes:

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

Admin
05-22-2002, 04:54 PM
Then you are doing something wrong.

TECK
05-22-2002, 06:37 PM
probably. i will double check. thanks.

plcguru
06-08-2002, 04:59 AM
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
06-12-2002, 03:20 AM
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
06-12-2002, 01:37 PM
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
06-23-2002, 03:44 AM
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
06-23-2002, 09:13 AM
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
06-25-2002, 02:30 AM
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
06-26-2002, 11:59 PM
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
07-09-2002, 05:38 PM
works 2.2.5 with 2.2.6 ?

alexp
07-12-2002, 03:41 PM
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
07-12-2002, 05:33 PM
thx. right ! It works well. It's may favourite hack also. Extreme usefull. ;-))

Webmasta XT
08-26-2002, 11:28 PM
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
09-22-2002, 02:53 PM
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
09-22-2002, 08:00 PM
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
09-24-2002, 03:44 AM
thank you

Bison
12-07-2002, 08:52 PM
works good in 2.2.9! :D

plasir
12-08-2002, 04:58 PM
thx for information !

Sefiros
12-14-2002, 10:17 AM
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="https://vborg.vbsupport.ru/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="https://vborg.vbsupport.ru/images/edit.gif" border="0" alt="Edit/Delete Message"></a>
<a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="https://vborg.vbsupport.ru/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="https://vborg.vbsupport.ru/images/space.gif" alt=""></td></tr></table>

LancerForums
12-14-2002, 02:52 PM
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]
01-06-2003, 09:15 AM
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
01-27-2003, 11:54 AM
me too

Leo[GR]
01-27-2003, 12:24 PM
Any solution to this probem ? Please ?

o0stephane0o
01-27-2003, 09:01 PM
are you german? How come you speak such a good english?

Leo[GR]
01-28-2003, 04:14 AM
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-02-2003, 01:08 AM
As stated by a few others, the hack works great on everything except for the shoutbox :(

Xyphen
03-01-2003, 03:21 PM
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
03-19-2003, 09:36 AM
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
03-19-2003, 10:12 AM
so can any 1 give us the hack at the final updated ?

catocom2
03-19-2003, 02:40 PM
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
03-25-2003, 12:51 AM
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
03-25-2003, 01:29 PM
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
03-26-2003, 11:32 PM
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
04-09-2003, 07:33 PM
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
05-24-2003, 09:13 PM
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
05-25-2003, 09:30 AM
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
06-03-2003, 06:27 PM
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
06-03-2003, 08:54 PM
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
06-03-2003, 09:14 PM
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-05-2003, 11:35 PM
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-06-2003, 12:02 AM
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-06-2003, 12:10 AM
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
07-01-2003, 08:41 PM
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
07-05-2003, 02:11 AM
This hack doesn't seem to work on my board. I believe it's because I have the following firefly hacks installed:

https://vborg.vbsupport.ru/showthread.php?s=&threadid=25888
https://vborg.vbsupport.ru/showthread.php?s=&threadid=25996
:(

Anybody think they can help me?

The M.I.P.
12-13-2003, 10:16 PM
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
02-01-2004, 08:59 AM
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
02-01-2004, 07:44 PM
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!