vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [RELEASE vB2.0] Code Buttons and Clickable Smilies (major update) (https://vborg.vbsupport.ru/showthread.php?t=10830)

Kier 03-08-2001 07:04 PM

1 Attachment(s)
Latest version: 1.4 / 12th March 2001

http://kier.3dfrontier.com/vbhacks/vbcode.gif

This major rewrite of my original vbcode buttons hack now supports two code-entering modes, allowing complex nesting of vBcode tags, a limited number of clickable smilies on the posting page and a smiley overflow popup window.

Version 1.2 updates:
New replacement functions for array.push() and array.pop(), which are unsupported in IE versions less than 5.5. Everything should work properly in IE4.0, IE5.0 now. Also added a simple inline help/prompt system.
Version 1.4 updates:
Enhanced mode no longer allows multiple open tags of the same type ({b}{b}{b}xxxxx) etc).
Templateized the whole system for easier addition of more fonts/colours/sizes etc.
Moved all text-prompts to a separate vbcode_language.js file for easy modification for non-english boards
Updated documentation to fix spellchecker problems
Various cosmetic changes, mainly to prevent Nutscrape from messing it up...

Full documentation / installation / upgrade instructions are available here
A basic demo can be seen here.

The templates and code for the hack are attached to this post.

Please post comments, suggestions and questions in this thread.

03-08-2001 09:20 PM

Awsome, really really awsome hack. It just looks plain beautiful. The 404 thing i was talking about is nothing. It was just a bad server.

03-08-2001 09:22 PM

Aah, glad it works for you :)

03-08-2001 10:39 PM

wow, you did that smileys change already!!! you are a complete star. Thanks so much going to install this today.

03-08-2001 10:42 PM

p.s. before i go for this, are there any changes that result from the change to beta3 i just installed?

03-08-2001 10:44 PM

I'm just looking at the Beta3 code right now, but as far as I can see, there are no changes required to this hack for vB2.0b3 compatability :)

[edit]I've just finished upgrading, and the installation instructions for vb2.0beta2 require no modifications for beta3 installation.[/edit]

03-08-2001 11:36 PM

Ok what happened to me:

i) i could only find one place to change the code inside the private template?

ii) one of the template changes required you to add the name=vbcode as the form had apparently not been named. Perhaps add this to instructions

iii) the "enhanced mode" just gives me a javascript error

iv) when i tried to reply to a private message i just get "array". I don't know if this is because of the the vb beta 3 upgrade or because of the hack or beacuse i could not find the second place to edit the tempalte.

Thanks for a great hack getting these few things fixed would be wicked :)

03-08-2001 11:55 PM

i) i could only find one place to change the code inside the private template?

Sorry, that was an error in the documentation. It's calendar.php that requires the double replacement, not private.php

ii) one of the template changes required you to add the name=vbcode as the form had apparently not been named. Perhaps add this to instructions

Done

iii) the "enhanced mode" just gives me a javascript error

That's wierd... I can't reproduce that at all, and I've tested with IE5, IE5.5, NS4.6 and NS6.0... have you got a link to a page where I can see this happening?

iv) when i tried to reply to a private message i just get "array". I don't know if this is because of the the vb beta 3 upgrade or because of the hack or beacuse i could not find the second place to edit the tempalte.

Likewise, I can't reproduce that either. A link would help in the diagnosis.

03-09-2001 12:01 AM

<a href="http://ascifi.com/forums/newreply.php?action=newreply&threadid=2987" target="_blank">http://ascifi.com/forums/newreply.ph...&threadid=2987</a>

is a place to try but you would have to register don't worry if you don't have time at the mo.

The smileys are also not coming in with reply but i think this is probably me not installing it properly. I am not sure how i could have done the "array" thing or the javascript error though.

03-09-2001 12:08 AM

Quote:

Originally posted by chrispadfield

The smileys are also not coming in with reply

Yeah that was me, fixed it. Not sure about the others though?

03-09-2001 12:09 AM

Chris, try out this dummy page and see if you still get javascript errors:

http://kier.3dfrontier.com/vbhacks/vbcode_example.htm

Oh, and what browser are you using?

03-09-2001 12:11 AM

javascript error is

"object does not support this propery or method"

at line 87 and 90

03-09-2001 12:11 AM

yes, same error. IE 5.00

03-09-2001 12:20 AM

I've just tried it with another copy of IE5.0 and it would seem that IE5 doesn't support the <arrayname>.push(var) method...

I'm looking for a workaround.

It works fine in IE5.5 and all versions of Nutscrape.

03-09-2001 12:24 AM

i am using my non standard comp hence ie5 though i should upgrade it.. but i bet some of my users will use ie5.00 so a work round would be good.

cheers...

any ideas on that array in pm? perhaps it is a vb beta 3 thing (has anyone upgraded?)

03-09-2001 12:30 AM

also when i edit a post, the post appears blank. Is this perhaps because of changing the name for the form? will it make a difference?

03-09-2001 12:32 AM

Your PM array problem is easy to fix:

Just replace your message textarea with this:

<TEXTAREA NAME="message" ROWS=20 COLS=60 WRAP="VIRTUAL">$message[message]</TEXTAREA>

In fact, you seem to have lost quite a few of the correct variables for the contents of your textarea elements in your templates. Review the default templates and check that you have the correct variables inbetween the <textarea> and </textarea> tags. This will fix your editpost and priv_sendprivmsg problems.

Finding a workaround for IE versions less than 5.5 having no array.push() method is going to be a little more tricky...

03-09-2001 12:39 AM

thanks, just found the text area problem, silly me :)

Looking forward to the advanced fix although the "simple" version works brilliantly.

03-09-2001 12:51 AM

Dig out a copy of Nutscrape or upgrade to IE5.5 and try out the 'enhanced' mode - now that kicks ass ;)

Hmm... workaround....

03-09-2001 12:57 AM

just tried nutscrape 4.6 a horrible browser... anyway had a few problems.

I did:

italic with the promt, (I)
and then some text
and then closed it.. fine

so got

[*I]sdfsfsdfdf[*/I]

then i used the buttons tounderline, italic and bold typed some text and then said close all. But i got:

[*/U][*/I][*/I][*/U][*/U][*/I][*/I][*/I][*/I][*/I]

for some reason.

The other thing is that pressing "close" makes the cursor go to the start of the text box which is pretty annoying...

03-09-2001 05:56 AM

ok, this is kinda off the topic but, i love your smilies, can you please post them here or tell me where i can get the,

thanks

03-09-2001 12:10 PM

Gee Chris, you seem to have quite a collection of broken browsers ;)

just tried nutscrape 4.6 a horrible browser...

indeed ;)

italic with the promt, (I)
and then some text
and then closed it.. fine

so got

[*I]sdfsfsdfdf[*/I]


I have to admit that for about 10 minutes there I was really confused as to why the script would be putting asterisks into your tags... then I worked out what you were saying :rolleyes:

then i used the buttons tounderline, italic and bold typed some text and then said close all. But i got:

[*/U][*/I][*/I][*/U][*/U][*/I][*/I][*/I][*/I][*/I]


This sounds like another problem with the array.push() and array.pop methods, which are used to store and retrieve the tag history. I can't reproduce it on the version of NS4.6 I have here, but hopefully the workaround will fix this for you.

The other thing is that pressing "close" makes the cursor go to the start of the text box which is pretty annoying...

This always happens with NS4.6, I'm afraid there's no way to position the cursor at the end of the text in that browser. It does pop to the end using later browsers though.

03-09-2001 12:12 PM

Quote:

Originally posted by surfichris
ok, this is kinda off the topic but, i love your smilies, can you please post them here or tell me where i can get them, thanks
The majority of those smilies are the old ones from vB1.1x, which is still available for download in the members' area.

03-09-2001 12:29 PM

Quote:

Originally posted by surfichris
ok, this is kinda off the topic but, i love your smilies, can you please post them here or tell me where i can get the,


thanks

Crap loads here
http://www.smilecwm.com/

03-09-2001 01:40 PM

that is the absolute nuts

that is amazing, and i want it

ok 1st get vB2 then gt a book on PHP then add that hack !

(then come back here when i have broken my forum)

~Ben

03-09-2001 02:34 PM

thanks a lot, i should have said i added the * to stop vbcode happening, sorry ;)

Perhaps i should start a collection of rubbish old browers hehe... really need to upgrade them all...!

03-09-2001 04:36 PM

I've just updated this to version 1.2, including a fix for older versions of IE. Check the first post in the thread for more. :)

03-09-2001 05:17 PM

Looks very good! One thing though; The standard javascript-prompts are ugly as hell, it would be very nice if a next version contains self designed popups where you can fill in some parameters...

03-09-2001 05:18 PM

One question though: Why don't you use the vbulletin standard template mechanism in order to integrate it fully into it and make it easier to let it be included in a next version?

03-09-2001 06:28 PM

added this to b3 and when i enter the calendar and try to enter a pub event nothing shows up the template seems to be unchanged but if i goto the templates they are all there as require dthe custom ones and the changed calendar_enterevent ???
any ideas

03-09-2001 06:29 PM

i love the hack, the only annoying thing is it means you can't use the tab button so easily when replying to get to the post box... to get that to work would require a major rehash of the templates (puting the text box on the left where Your Reply is now and the putting all the vb code and smileys on the right.) maybe in the future i might do this though.

03-09-2001 06:44 PM

Quote:

Originally posted by pestilence
added this to b3 and when i enter the calendar and try to enter a pub event nothing shows up the template seems to be unchanged but if i goto the templates they are all there as require dthe custom ones and the changed calendar_enterevent ???
any ideas

calendar requires the change to be made twice, did you do it twice (one for public one for private events i assume).

edit: that is in calendar.php i mean.

03-09-2001 06:59 PM

This could be fixed with the 'tabindex' property:

Quote:

The TABINDEX attribute can be used to set a tabbing order for the user to navigate around the main <FORM>. For example, if <FORM> elements have TABINDEX properties set, when the user is focused on an element, pressing the 'Tab' key will pass the focus to the element with the next highest TABINDEX property.

03-09-2001 07:29 PM

thanx mate spot on i forgot the second instance :) works like a charm now...kudos to kier on a job well done :)

03-09-2001 08:04 PM

Kier, i have most of them but i don't see the paddle pop one in the members area, maybe it was because i am half asleep

03-10-2001 07:02 AM

How to specify the max number of smilies to display on the posting page? in another word how to set value of $maxSmilies ?

03-10-2001 08:04 AM

Quote:

Originally posted by Mas*Mind
One question though: Why don't you use the vbulletin standard template mechanism in order to integrate it fully into it and make it easier to let it be included in a next version?
Most of the hack is handled through the standard template system. The only thing that isn't done with templates is the text for the onmouseover prompt box. All the text for this is included in the vbcode.js file, in order to speed-up page load times, as the vbcode.js file is cached by the browser. It's easy to find the text to replace in the vbcode.js file though, if you want to change it.

Quote:

Originally posted by Mas*Mind
Looks very good! One thing though; The standard javascript-prompts are ugly as hell, it would be very nice if a next version contains self designed popups where you can fill in some parameters...
The only thing that uses a javascript alert() prompt in version 1.2 is the [help] link. If you are referring to the actual text prompt boxes, I won't be altering these, as loading a new page for each prompt is (IMO) too slow and unneccesary for a simple text input.

Quote:

Originally posted by epic
How to specify the max number of smilies to display on the posting page? in another word how to set value of $maxSmilies ?
This is explained in the documentation. Simply add two arguments to the call to getclickysmilies() on each page.

For a table with 3 columns and 10 smilies, use this:

PHP Code:

$vbcode_smilies getclickysmilies(3,10); 


03-10-2001 09:02 AM

Kier-

Just wanted to say thanks for the great hack.... I got it up and running in no time thanks to the great docs, and really love it.

Thanks :)

03-10-2001 04:09 PM

Parse error: parse error in ./global.php on line 78

After I uploaded admin/functions.php :(

03-10-2001 06:04 PM

Quote:

Originally posted by DeathLoad
Parse error: parse error in ./global.php on line 78

After I uploaded admin/functions.php :(

Without a more in-depth explanation of your error, all I can suggest is that you didn't copy the new code into functions.php properly.


All times are GMT. The time now is 01:35 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01317 seconds
  • Memory Usage 1,825KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete