vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   New BB tag to do rainbow text... (https://vborg.vbsupport.ru/showthread.php?t=47509)

Zzed 01-07-2003 10:00 PM

New BB tag to do rainbow text...
 
This is a fairly simple hack that allows you to create a new BB tag to do
rainbow colors with text. It is only a few lines and the only file affected
by it is admin/functions.php.

You can see a sample output in this thread: http://www.ls1.com/forums/showthread...hreadid=225576


Note1: This hack has been done and tested on VB 2.2.9
Note2: Using other BB tags within the rainbow tags will convert the underlying HTML code in to rainbow text. :D

Note3: You can find the revised and BB code friendly version in this post

Note4: You can find the version that displays the full spectrum of colors in this post.

Chris M 01-08-2003 07:19 PM

Looks good;)

Satan

Floris 01-08-2003 07:41 PM

Please add your hack in a .txt file rather then showing it like this. Thank you.

DrkFusion 01-08-2003 08:59 PM

Hehe cool little hack :)

Drkfusionwillinstallthis

vdinh 01-08-2003 09:52 PM

Cool hack :) ... However, I have some problem with some unicode characters. They will show as #xxxx, not as the real unicode charaters. Would you please point out what should I do ?

bitbender 01-09-2003 03:14 AM

[high]* bitbender *clicks install* - clean as a whistle on my 2.2.6 :)[/high]

Zzed 01-09-2003 04:39 AM

Quote:

Originally posted by vdinh
Cool hack :) ... However, I have some problem with some unicode characters. They will show as #xxxx, not as the real unicode charaters. Would you please point out what should I do ?
I wonder if you can point me to a thread in your forums so that I can see what you are seeing. :)

Boofo 01-09-2003 06:23 AM

Zzed, I figured out how to take the black background out but how do I make the rainbow text the same size that is set for the message? It is bigger than the regular message text.

Great hack, by the way. :)

Zzed 01-09-2003 06:52 AM

Quote:

Originally posted by Boofo
Zzed, I figured out how to take the black background out but how do I make the rainbow text the same size that is set for the message? It is bigger than the regular message text.

Great hack, by the way. :)

Thank you Boofo. :)

Here is how you fix the font size. ;)

Change this line in dorainbow()

PHP Code:

$buffer .= "<font color=\"$color\">"

To this:

PHP Code:

$buffer .= "<font color=\"$color\" face=\"verdana,arial,helvetica\" size=\"2\">"


Boofo 01-09-2003 07:04 AM

That was quick. Thank you. :)

Here is what I changed to make the background transparent.

PHP Code:

$buffer "<table><tr><td bgcolor=\"\">"

It works, but is it the correct way to do it? :)

corsacrazy 01-09-2003 07:39 AM

is there a way to add this using the bb code adding option in the acp or do i have to edit my functions :(

Zzed 01-09-2003 07:40 AM

Boofo, You can actually leave out the bgcolor stuff and just use <td> by itself. ;)

corsacrazy, unfortunately to the best of my knowledge this is the only way to do it. :(

corsacrazy 01-09-2003 07:48 AM

Quote:

Originally posted by Zzed
corsacrazy, unfortunately to the best of my knowledge this is the only way to do it. :(
k cheeres ! ill give it a go !

Boofo 01-09-2003 08:16 AM

Quote:

Originally posted by Zzed
Boofo, You can actually leave out the bgcolor stuff and just use <td> by itself. ;)

DOHH!!! :) I figured that out after I wrote the message. Sorry about that. The size change works great but I can not change the size of the text to anything else within the message now for some reason. :(

sphinx 01-09-2003 09:33 AM

very nice m8

bitbender 01-09-2003 02:04 PM

Here is one example...

User name to log with: bit_user2
password: testme

Link to Thread in question

Zzed 01-09-2003 03:18 PM

Quote:

Originally posted by bitbender
Here is one example...

User name to log with: bit_user2
password: testme

Link to Thread in question

Ok, I assume you are talking about post #2 in that thread. I made a note in my original post that using BB code inside the rainbow tags will end up displaying the underlying HTML code, which is what you are seeing in there.

I can probably fix it. But it is not something that I can do any time soon. :(

nymyth 01-09-2003 04:25 PM

i installed this hack, but i dont see anything.......whats going on??

Peace

ps..i mean is there supposed to be an option that u press like php/list etc??

Silenced Soul 01-09-2003 04:44 PM

heh, pretty cool. I'll install it just for fun. :P

bitbender 01-09-2003 04:48 PM

Quote:

I can probably fix it. But it is not something that I can do any time soon
Ok, I understand.. I wondered if I read past it before.... and I did..sorry.

nymyth 01-09-2003 04:49 PM

well the code works....when i put in [ rainbow]text here[ /rainbow]

my question is do i have to do this manually each time....????or is there a drop down menu im missing??

Peace

KuraFire 01-09-2003 04:52 PM

oh god....

*winces*

What a lovely idea.. make the sourcecode of already huge threads even twice as big! :up:

Use five hundred font tags in a page! :up:

Double your bandwidth usages if people use your lovely (</sc>) hack! :up::up:

ugh...
(sorry, just felt like pointing that out ^_^)

Areku 01-09-2003 08:10 PM

Quote:

Originally posted by DrkFusion
Hehe cool little hack :)

Drkfusionwillinstallthis

Can you, DarkFusion, or anyone, explain me how to get the rainbow to act like HERE and not like the original hack? the original hack is lack of green and blueish colors of the rainbow...

Tu!

Zzed 01-09-2003 08:17 PM

Ok, here is the BB code friendly version. ;)

Note: If you have installed the original version, you need to back out of it and replace it with this one.

John 01-09-2003 08:46 PM

I made a couple of changes to this - I didn't much like the black background, so I went for the dark glow option. (See attached screenshot)

John 01-09-2003 08:48 PM

To use glow like I did, simply modify the code from the hack in the first post:

Find (in functions.php):

Code:

// ###################### Startdorainbow #######################
function dorainbow($code) {
  $len = strlen($code);
  $buffer = "<table><tr><td bgcolor=\"#000000\">";
  $mul = 255/$len;
  for($x = 0;$x < $len;$x++) {
    $color_h1 = 255*sin($x/($len/3));
    $color_h2 = $mul * $x;
    $color = sprintf("#FF%02X%02X", $color_h1, $color_h2);
    $buffer .= "<font color=\"$color\">";
    $buffer .= substr($code,$x,1);
    $buffer .= "</font>";
  }
    $buffer .= "</td></tr></table>";

  return($buffer);
}

And replace with:

Code:

// ###################### Startdorainbow #######################
function dorainbow($code) {
  $len = strlen($code);
  $buffer = "<table style=\"filter:glow(color=black, strength=2)\"><tr><td>";
  $mul = 255/$len;
  for($x = 0;$x < $len;$x++) {
    $color_h1 = 255*sin($x/($len/3));
    $color_h2 = $mul * $x;
    $color = sprintf("#FF%02X%02X", $color_h1, $color_h2);
    $buffer .= "<font color=\"$color\" face=\"Verdana\" size=2><b>";
    $buffer .= substr($code,$x,1);
    $buffer .= "</b></font>";
  }
    $buffer .= "</td></tr></table>";

  return($buffer);
}


Areku 01-09-2003 08:51 PM

FAR FAR Much nicer now with the glow effect!

However how do i add the FULL range of colors and not just the red/yellow/pink ones?

Blue and green are missing from the spectrum!!

John 01-09-2003 08:53 PM

Quote:

Originally posted by Areku
FAR FAR Much nicer now with the glow effect!

However how do i add the FULL range of colors and not just the red/yellow/pink ones?

Blue and green are missing from the spectrum!!

No idea!

This code is pretty clever stuff, I can't figure it out!

Areku 01-09-2003 08:55 PM

What a weirdo!

Full range of colors is active here!!

[rainbow]supercalifragilisticumspialidociousisthewordiuseto testthisrainbowthing[/rainbow]

Areku 01-09-2003 08:56 PM

Oh!

It didn't work!!

DarkFusion, what did u use!? Manually entered that sentence colorfull?

John 01-09-2003 09:00 PM

Yes, he did (try quoting his post!)

Areku 01-09-2003 09:02 PM

I did quote his, still stunned he spent that much time!!

However there must be a way to add blue and green to the rainbow of this hack, isn't it??

John 01-09-2003 09:03 PM

There's always a way, but the maths would be more complicated.

Zzed 01-09-2003 09:07 PM

Guys, please also check out this post for the BB code friendly version ;)

https://vborg.vbsupport.ru/showthrea...386#post340386

DrkFusion 01-09-2003 09:16 PM

supercalifragilisticumspialidociousisthewordiusetotestthisrainbowthing
Also jsut a reminder to people you will use J.Eovies mod, keep in mind that the glow style can be viewed by users using IE 5.5+ I am not sure about other browsers.

Bythewayitsasecret :speechless:

Areku 01-09-2003 09:21 PM

So how many $$$ to reveal your trick Dfusion? ;)

Zzed 01-09-2003 09:22 PM

Quote:

Originally posted by DrkFusion
supercalifragilisticumspialidociousisthewordiusetotestthisrainbowthing
Also jsut a reminder to people you will use J.Eovies mod, keep in mind that the glow style can be viewed by users using IE 5.5+ I am not sure about other browsers.

Bythewayitsasecret :speechless:

You my friend are a mean person. :D j/k ;)

DrkFusion 01-09-2003 09:42 PM

By me a HiveMail Liscense :P and I will reveal to you LOL

Areku 01-10-2003 11:22 AM

U're too xpensive! ;)

Boofo 01-10-2003 11:25 AM

Quote:

Originally posted by DrkFusion
By me a HiveMail Liscense :P and I will reveal to you LOL
As one of the Kirby brothers you could reveal it to me in a pm. ;)


All times are GMT. The time now is 07:54 AM.

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.01716 seconds
  • Memory Usage 1,841KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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