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)
-   -   Added js buttons in new thread/reply thread (https://vborg.vbsupport.ru/showthread.php?t=34316)

Bioderm 01-20-2002 10:00 PM

This hack adds the glow and shadow buttons with the bold and italics buttons.You must have the glow and shadow codes installed for it to work.

Files to Edit:Template(vbcode_buttons)
vbcode_language.js
vbcode.js

Under vbcode code template
>> Vbcode_buttons

add:

<input type="button" class="bginput" value=" Glow " onclick="glow(this.form,'glow','')" onmouseover="stat('glow')" title="Glow (alt+g)" accesskey="g"
><input type="button" class="bginput" value=" Shadow " onclick="shadow(this.form,'shadow','')" onmouseover="stat('shadow')" title="Shadow (alt+s)" accesskey="s"
>

near the other buttons,make it look like you want of course.

now for vbcode.js

At the bottom add:

function smilie(thesmilie) {
// inserts smilie text
document.vbform.message.value += thesmilie+" ";
document.vbform.message.focus();
}

function opensmiliewindow(x,y,sessionhash) {
// um... opens smilie overflow window.
window.open("misc.php?action=getsmilies&s"+session hash, "smilies", "toolbar=no,scrollbars=yes,resizable=yes,width="+x +",height="+y);
}

// ************************************************** *****

function glow(theform,thetype) {
// inserts glow text - [glow=color]xxx[/glow]
glowcolor = prompt(color_text_prompt,"");
var prompttext;
if (thetype == "GLOW") {
prompt_text = glow_text_prompt;
prompt_contents = "color";
}
else {
prompt_text = glow_text_prompt;
prompt_contents = "";
}
glow = prompt(prompt_text,prompt_contents);
if ((glow != null) && (glow != "")) {
if ((glowcolor != null) && (glowcolor != ""))
theform.message.value += "["+thetype+"="+glowcolor+"]"+glow+"[/"+thetype+"] ";
else
theform.message.value += "["+thetype+"="+glowcolor+"]"+glow+"[/"+thetype+"] ";
}
theform.message.focus();
}


// ************************************************** *****

function shadow(theform,thetype) {
// inserts shadowed text - [shadow=color]xxx[/shadow]
shadowcolor = prompt(color_text_prompt,"");
var prompttext;
if (thetype == "Shadow") {
prompt_text = shadow_text_prompt;
prompt_contents = "color";
}
else {
prompt_text = shadow_text_prompt;
prompt_contents = "color";
}
shadow = prompt(prompt_text,prompt_contents);
if ((shadow != null) && (shadow != "")) {
if ((shadowcolor != null) && (shadowcolor != ""))
theform.message.value += "["+thetype+"="+shadowcolor+"]"+shadow+"[/"+thetype+"] ";
else
theform.message.value += "["+thetype+"="+shadowcolor+"]"+shadow+"[/"+thetype+"] ";
}
theform.message.focus();
}


// ************************************************** *****

save and close

In vbcode_language.js add:

glow_text_prompt = "Enter the glowing text";
color_text_prompt = "Enter the color you want to use";
shadow_text_prompt = "Enter the text that you want to have a shadow around";

near:

link_text_prompt = "Enter the text to be displayed for the link (optional)";
link_url_prompt = "Enter the full URL for the link";
link_email_prompt = "Enter the email address for the link";

save and close.

Now upload the 2 js files you should have added the glow and shadow commands to your buttons list in the add/reply to views.

Always backup files before modifying them.

I did not write this code fully.

It is a modified version of the code already in these 2 files.

The reason i did this is because i saw someone asking for this ode over at www.vbulletin.com and wasnt sure if someone already made it.

Shenlong 01-21-2002 02:07 AM

screenshot?

Warlord 01-21-2002 02:30 AM

He's an Admin at my site, and he went to bed (I think) So, I'm posting the screenshot for him...

Click the glow button...
http://www.superherochat.com/warlord/1.gif
And this pops up
http://www.superherochat.com/warlord/2.gif
Enter the color you'd like to use and hit enter and you get this where you type in your text
http://www.superherochat.com/warlord/3.gif

Then it will surround your text with the appropriate tags...

Lucky 01-21-2002 09:36 AM

Good idea!

Just curious if this hack could be placed in a dropdown menu instead?

Fallout2man 01-21-2002 04:00 PM

Great hack, but, eheh. Where do I find the HTML code for glowing and shadow text. I need to add that to the Vbcodes part of the admin CP for the buttons to work. I've tried searching the net, but I haven't found much of anything on how to do it.

Bioderm 01-21-2002 06:07 PM

one sec,the post is over at vbulletin.com

Bioderm 01-21-2002 06:08 PM

<a href="http://www.vbulletin.com/forum/showthread.php?s=&threadid=24595" target="_blank">http://www.vbulletin.com/forum/showt...threadid=24595</a>

there are tohers there to im gonna work on the code for them later.

Bioderm 01-21-2002 06:09 PM

Quote:

Originally posted by Lucky
Good idea!

Just curious if this hack could be placed in a dropdown menu instead?

it probly could.ill try that later.

Psychdrone 01-21-2002 10:35 PM

I found a tad problem, ounce you click it, and go ahead and insert your code, it won't allow you to do so again...?

Lucky 01-22-2002 05:15 AM

Quote:

Originally posted by Bioderm


it probly could.ill try that later.

Sounds good,

I'll install then.


All times are GMT. The time now is 10:48 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.01144 seconds
  • Memory Usage 1,739KB
  • 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_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
  • (10)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