Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2007, 10:09 AM
dirkji dirkji is offline
 
Join Date: Nov 2006
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Javascript Modification

I'm looking for a way for my forum users to input guitar tabs (a form of musical notation) into their posts. I saw this at another forum, mailed the owner and he explained me how he did it, but the problem is he's using vBulletin 3.0.3, I use 3.6.3 and I think there have been some modifications.

Here's how he explains it:

**
In the admin panel add two different BBcodes:

1ST BB CODE TO ENTER

Title: formatted Text
Tag: pre
Replacement:
<pre>
{param}
</pre>
Example: [pre]preformatted text[/pre]
Description: for entering preformatted text
Use {option} : Set this radio button to NO

2ND BB CODE TO ENTER

Title: Tabulature
Tag: tab
Replacement: <font face="Courier New,Courier,Fixedsys">{param}</font>
Example:
[tab]<br>------------------<br>------------------<br>------------------<br>------------------<br>------------------<br>------------------<br>[/tab]
Description: Use this tag when inserting tabs into a message so that everything lines up nicely.
Use {option} : Set this radio button to NO
**


Ok, I did this, no problem.


Then he explains:

**UPLOAD via FTP FORCED BINARY the two gifs. Put them in the forum > images > editor folder.
**


Ok, no problem

Then:

**
The only file you will have to FORCED ASCII download via FTP is the .js file from clientscripts folder. Add the lines of code at the bottom like in ours. Then upload your edited .js to the clientscripts FORCED ASCII.
**


He didn't specify which file, but I found out he means the file called "clientscript/vbulletin_stdedit.js". The name of that file must have changed, I guess to "clientscript/vbulletin_textedit.js". The lines of code he added are the following:

// ################################################## ###########################
// function to add preformatted tab to post
function add_tab()
{
getActiveText();
var tab_line = "------------------------------------------------------------------------\n";
var one_tab_row = tab_line + tab_line + tab_line + tab_line + tab_line + tab_line;
var multiple_tab_rows = "";
var tab_rows = prompt("How many rows of tab would you like?", "1");
if ((tab_rows > 0) && (tab_rows <= 10)) {
count = 0;
while (count < tab_rows) {
multiple_tab_rows = multiple_tab_rows + one_tab_row + "\n";
count++;
}
insert_tab_rows = "[code][tab]\n" + multiple_tab_rows + "[\/tab][\/code]\n";
} else {
alert("You must input a number from 1-10.");
insert_tab_rows = ("");
}

AddText(insert_tab_rows);
}

**


So I added them to vbulletin_textedit.js, but that's where I get stuck. Can anybody see where I go wrong and what I can do about it?


Kind Regards,

Dirk

Websites Wanted
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:16 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.03552 seconds
  • Memory Usage 2,160KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete