External Forum BB Codes

DeletedUser1189

Guest
Im toying with the idea of setting up an external forum for my tribe but I think one of the greatest disadvantages will be the bbcodes for village, player, ally wont be there.

Is there a way or code I can use to add them into an external forum setup so they link into game properly. Is this okay to do as well.

If it is, could someone please post an example of the code (PHP) needed. I will be able use a mod for the forum to insert custom BBcodes, buts its more how the link operates, or maybe instructions on how to go about linking to the TW information. Is it simple html link it creates, and how does it know where to reference etc?

Any help or advice on this would be appreciated.

Thanks
 
Last edited by a moderator:

DeletedUser1189

Guest
Not quite but helpful, as that looks like someone set something up as a online server where tribes can auto generate and manage an external forum. I will be building mine from the ground up using php and my own web space. I might sign upto that one though and see if I can cheeky a peek at how they have this bit working though as its exactly what im looking to be able to replicate:

TribalWars BB-Codes
The "normal" BB-Codes of TW: player, ally, village
Special BB-Codes: pi, ai and vi - PlayerInfo, AllyInfo and VillageInfo. There you get a little overview of the most important data about an player, ally or village.
 

DeletedUser1189

Guest
Okay, just looking further, and it seems the BB code just creates a link to the relevant web page, for example bb coding me as a player.

Code:
[player]Roch2001[/player]

has an actual link that looks like this:

[code]http://uk1.tribalwars.co.uk/game.php?0&screen=info_player&id=31452

As thats internally referencing the tw world one database to get the relevant ID I need to be able to replicate that on an external forum. Does this require me to make use of the world data which is available and updates. Im guessing it does, but without looking into it yet I have no idea how to incoporate that into the forum I will build and link it together.

Please PM me if your able to provide advice on where to go next
 

DeletedUser

Guest
I believe the bb-codes in TW are set to pick up links from the database.

So everytime you put

[player][/player] the variable is the gap in between. When you type it in the variable is added from what you type and it gets the link from the TW Database.
 

DeletedUser1189

Guest
Ah. Thats not too good. I know I can take the world data and stick it into a online database myself, as I was playing about last night with the automap generators after giving up hunting for help on doing this. I was then thinking it would be possible to reference my own database which would update every few hours or show by pulling the world data off automatically every now and again.

But if it can be done linking to there internal database then im not sure. Ive seen two websites which are 3rd party and offer the ability to create tribal forums, if you want an external one but Id prefer to have a private web portal on my own domain. They offer BB code functionality so I wonder how they did. I Lol, attempted to buy che.co.uk but some dude wanted around £15k for it as its a three letter domain. I just laughed, thought he might of sold it for twenty quid or something :)

Hmmm, while searching .net for link to the external forums on someones system I came across this just now.

Seagryfn
In-Game Staff

Join Date: 2008,July 17th #7 2010,January 9th, 18:28 Top
Tribal Wars will not embed html links into their in-game forums.
If you wish such features, have your tribe sign up for an external forum for another content provider.
The problem with an external forum, is that you won't be able to link BB-Code player/tribe/ally/village shortcuts in your forums. It was one or the other, and the BB-Codes help you play the game better than an entertaining wav.file.


Not looking good at the moment, more research required cause if someone else is doing it must be a way using the world data downloads

EDIT:

Although these guys followed later in the thread with following, just seems the information is hard to come by instruction wise.

Disco Biscuit
Join Date: 2009,December 14th #9 2010,January 10th, 04:55 Top
Quote:Originally Posted by Izzy Stradlin.
Not true, it just isn't as easy to have those BB codes
>

This is correct, I had to set them up for an external forum my w12 tribe made back in the day.



Not looking good at the moment, more research required cause if someone else is doing it must be a way using the world data downloads
 
Last edited by a moderator:

DeletedUser1189

Guest
Oh damn. Could someone confirm if its even allowed or not before I find out hows its done. Not sure why he would say its a security risk as its only a link after all that will only work if your logged into the game.

servy
Administrator

Join Date: 2007,March 7th
#11 2010,January 10th, 18:13 Top
Quite simply it would be a security issue to allow it and so there is no chance of it being allowed.
__________________
1) Support Ticket --- 2) Ingame Rules --- 3) Forum Punishments
 

DeletedUser

Guest
No there are ways of hacking the system etc.. and thats a big risk for TW and InnoGames to take.

Also I'm pretty sure there is a way they can send you data securely as the updating maps use something like that don't they? otherwise how'd they do it?? or do they use TWStats and if so is there a way you can use 3rd party info to create something new...
 

DeletedUser1189

Guest
Yeah, ive got that bit done, each world releases world data files which you can automate a cron job to download and then using php script push into a sql database. Because of that you dont touch the tw game data files directly just a text download of the world information and numbers which everything is referenced by.

Im looking into this site now after further research on .net forums, seems it can be done but no one is willing to just post the code and a decent tut on doing it. Im looking into http://www.dsphpbb.net/ now which looks like I can install a ready made template php forum and im just going to go snooping about the source code and see how they link the bbcodes and pull the data from the world data which im guessing they either update themselves and reference to it or it shows you how to host everything yourself. Im hoping its the later but they have a lot of guides on there. Shame the english section looks inferior to the german section and boards but hopefully I can gain enough knowledge to help me sort this. If anyone is interested I am using drupal which is an open source cms system to build a site for our tribe. Least thats the plan anyway :)
 

DeletedUser5377

Guest
I did a bit of looking around for assistance with Custom BB Codes - these links may be of use to you:-

http://www.phpbb.com/community/viewtopic.php?f=46&t=579376

http://www.phpbb.com/kb/article/adding-custom-bbcodes-in-phpbb3/

phpbb is an opensource bulletin board - I believe it comes with a fairly simple installer. Depending on your hosting package you may have it as a one click installable solution.

The problem is that you need to translate the text within the BB code into TW's internal ID.

E.g. a user will type a player bb code like [player]PlayerName[/player]

this needs to be translated into

<href="http://uk1.tribalwars.co.uk/staemme.php?screen=info_player&id=12345">PlayerName</href>

Where 12345 is the internal player ID - converting the player name to the internal ID is the tricky part.

You could probably build a php page that would accept the user name as a string parameter in the URL, lookup this against the player database and then forward the user seemlessly back into tribalwars at the player details page.
 
Last edited by a moderator:

DeletedUser5377

Guest
I Think I might have found what you're looking for, I may be wrong however

http://userscripts.org/scripts/review/23777

// ==UserScript==
// @name Tribal Wars Ultimate BB Codes
// @namespace Anonymous User
// @description Best bb codes for the forum and mail.
// @include http://ro*.triburile.ro/*
// @include http://en*.tribalwars.net/*
// @include http://en*.ds.ignames.net/*
// @include http://nl*.tribalwars.nl/*
// @include http://cs*.divokekmeny.cz/*
// @include http://sv*.tribalwars.se/*
// @include http://s*.tribalwars.es/*
// @include http://s*.tribalwars.fr/*
// @include http://s*.tribalwars.it/*
// @include http://pl*.plemiona.pl/*
// @include http://en*.ds.ignames.net/*
// ==/UserScript==

// ======== Variables globales del juego ========

var TW_Use_Cache = true;
var TW_Image_Base = "/graphic/";
var TW_World = null;
var TWT_World = null;
var TW_Domain = null;
var TW_DotWhat = null;
var TW_Hash = null;
var TW_Screen = null;
var TW_Mode = null;
var TW_Is_Premium = false;
var TW_Quickbar = null;
var TW_Village_Id = null;
var TW_Player_Id = null;
var TW_Villages = null;
var TW_Lang = null;
var TW_Mpt = null;
var TW_Is_Opera = window.opera ? true : false;


// ======== Hagamos los cambios ========

(function(){

if (location.href.match( /forum\.php/ )) {
CambiaForo();
return;
}

if (location.href.match( /screen=mail/ )) {
CambiaCuadroTexto();
//return;
}

})();

function CambiaForo() {

var adframes = $$("iframe");
for (i = 0; i < adframes.length; i++) {
adframes.src = 'about:blank';
}
var posts = $$("div");
for (i = 0; i < posts.length; i++) {
if (posts.innerHTML.match(/<iframe/,"gi") != null) {
posts.style.display = "none";
}
}

CambiaCuadroTexto();
}

function CambiaCuadroTexto() {

var body = $$("body");

var random = new Date;
random = random.getTime();

var xhtml = "<table class='bbcodearea'> " +
"<tr> " +
' <td>|</td>' +
' <td><a tabindex="10" href="javascript:insertBB(\'player\','+random+');"><img src="'+ TW_Image_Base +'/face.png" alt="Jugador" /></a></td>' +
' <td><a tabindex="11" href="javascript:insertBB(\'village\','+random+');"><img src="'+ TW_Image_Base +'/buildings/main.png" alt="Pueblo" /></a></td>' +
' <td><a tabindex="12" href="javascript:insertBB(\'tribe\','+random+');"><img src="'+ TW_Image_Base +'/command/support.png" alt="Tribu" /></a></td>' +
' <td>|</td>'+
' <td><a tabindex="13" href="javascript:insertBB(\'b\','+random+');"><img src="http://www.realobjects.com/fileadmin/od/eopro5/eopro/eophelp/en_US/resources/bold.gif" alt="Negrita" /></a></td>' +
' <td><a tabindex="14" href="javascript:insertBB(\'i\','+random+');"><img src="http://etsiit.ugr.es/icons/editor/italic.png" alt="Cursiva" /></a></td>' +
' <td><a tabindex="15" href="javascript:insertBB(\'u\','+random+');"><img src="http://etsiit.ugr.es/icons/editor/underline.png" alt="Subrayado" /></a></td>' +
' <td>|</td>' +
' <td><a tabindex="16" href="javascript:insertBB(\'quote\','+random+');"><img src="http://www.offthemap.com/images/site/blockquote.jpg" alt="Cita" /></a></td>' +
' <td><a tabindex="17" href="javascript:insertBB(\'url\','+random+');"><img src="http://runbut.com/Images/Hyperlink.jpg" alt="URL" /></a></td>' +
' <td><a tabindex="18" href="javascript:insertBB(\'img\','+random+');"><img src="http://www.zaburi.com/images/icons/image_add.png" alt="Imagen" /></a></td>' +
' <td>|</td>' +
' <td><a tabindex="19" href="javascript:insertBB(\'large text\','+random+');"><img src="http://forum.tribalwars.net/images/icons/icon14.gif" /></a></td>' +
' <td><a tabindex="20" href="javascript:insertBB(\'small text\','+random+');"><img src="http://forum.tribalwars.net/images/icons/icon13.gif" /></a></td>' +
' <td>|</td>' +
' <td><a tabindex="21" href="javascript:insertBB(\'white text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/White.gif" /></a></td>' +
' <td><a tabindex="22" href="javascript:insertBB(\'black text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/Black.gif" /></a></td>' +
' <td><a tabindex="23" href="javascript:insertBB(\'red text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/red.jpg" /></a></td>' +
' <td><a tabindex="24" href="javascript:insertBB(\'yellow text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/yellow.jpg" /></a></td>' +
' <td><a tabindex="25" href="javascript:insertBB(\'green text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/green.jpg" /></a></td>' +
' <td><a tabindex="26" href="javascript:insertBB(\'cyan text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/cyan.jpg" /></a></td>' +
' <td><a tabindex="27" href="javascript:insertBB(\'blue text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/blue.jpg" /></a></td>' +
' <td><a tabindex="28" href="javascript:insertBB(\'violet text\','+random+');"><img src="http://i211.photobucket.com/albums/bb9/RakizzteanEmpire/violet.jpg" /></a></td>' +
' <td>|</td>' +
"</tr> " +
' <td>|</td>' +
' <td><a tabindex="29" href="javascript:insertBB(\'smily lol\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_lol.gif" /></a></td>' +
' <td><a tabindex="30" href="javascript:insertBB(\'smily smile\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/smile.gif" /></a></td>' +
' <td><a tabindex="31" href="javascript:insertBB(\'smily idea\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_idea.gif" /></a></td>' +
' <td><a tabindex="32" href="javascript:insertBB(\'smily wink\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_wink.gif" /></a></td>' +
' <td><a tabindex="33" href="javascript:insertBB(\'smily evil\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_evil.gif" /></a></td>' +
' <td><a tabindex="34" href="javascript:insertBB(\'smily twisted\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_twisted.gif" /></a></td>' +
' <td><a tabindex="35" href="javascript:insertBB(\'smily eek\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_eek.gif" /></a></td>' +
' <td><a tabindex="36" href="javascript:insertBB(\'smily surprised\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_surprised.gif" /></a></td>' +
' <td><a tabindex="37" href="javascript:insertBB(\'smily cry\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_cry.gif" /></a></td>' +
' <td><a tabindex="38" href="javascript:insertBB(\'smily smile2\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_smile.gif" /></a></td>' +
' <td><a tabindex="39" href="javascript:insertBB(\'smily cool\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_cool.gif" /></a></td>' +
' <td><a tabindex="40" href="javascript:insertBB(\'smily sad\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_sad.gif" /></a></td>' +
' <td><a tabindex="41" href="javascript:insertBB(\'smily confused\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_confused.gif" /></a></td>' +
' <td><a tabindex="42" href="javascript:insertBB(\'smily rolleyes\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_rolleyes.gif" /></a></td>' +
' <td><a tabindex="43" href="javascript:insertBB(\'smily briggin\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_biggrin.gif" /></a></td>' +
' <td><a tabindex="44" href="javascript:insertBB(\'smily redface\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_redface.gif" /></a></td>' +
' <td><a tabindex="45" href="javascript:insertBB(\'smily razz\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_razz.gif" /></a></td>' +
' <td><a tabindex="46" href="javascript:insertBB(\'smily neutral\','+random+');"><img src="http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_neutral.gif" /></a></td>' +
' <td>|</td>' +
"</tr> " +
' <td>|</td>' +
' <td><a tabindex="47" href="javascript:insertBB(\'unit spear\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_spear.png" /></a></td>' +
' <td><a tabindex="48" href="javascript:insertBB(\'unit sword\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_sword.png" /></a></td>' +
' <td><a tabindex="49" href="javascript:insertBB(\'unit axe\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_axe.png" /></a></td>' +
' <td><a tabindex="50" href="javascript:insertBB(\'unit archer\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_archer.png" /></a></td>' +
' <td><a tabindex="51" href="javascript:insertBB(\'unit noble\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_snob.png" /></a></td>' +
' <td>|</td>' +
' <td><a tabindex="52" href="javascript:insertBB(\'unit scout\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_spy.png" /></a></td>' +
' <td><a tabindex="53" href="javascript:insertBB(\'unit lcav\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_light.png" /></a></td>' +
' <td><a tabindex="54" href="javascript:insertBB(\'unit hcav\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_heavy.png" /></a></td>' +
' <td><a tabindex="55" href="javascript:insertBB(\'unit marcher\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_marcher.png" /></a></td>' +
' <td><a tabindex="56" href="javascript:insertBB(\'unit paladin\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_knight.png" /></a></td>' +
' <td>|</td>' +
' <td><a tabindex="57" href="javascript:insertBB(\'unit ram\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_ram.png" /></a></td>' +
' <td><a tabindex="58" href="javascript:insertBB(\'unit catapult\','+random+');"><img src="http://www.tribalwars.net/graphic/unit/unit_catapult.png" /></a></td>' +
' <td>|</td>' +
"</table>";

document.body.innerHTML = document.body.innerHTML.replace( /<textarea\s/gi, xhtml+"<textarea id=\"txt_"+random+"\" ");

NuevaFuncionTW("insertBB", function(insertType, ident){

txt = document.getElementById("txt_"+ident);

var start = txt.selectionStart;
var end = txt.selectionEnd;
var txtlength = 0;
var insertButton = '';
var txtinsertBefore = '';
var txtinsertAfter = '';
var selection = '';
var selectionBefore = '';
var selectionAfter = '';

switch (insertType) {
case 'player':
txtinsertBefore = "[player]";
txtinsertAfter = "[/player]";
insertButton = 'P';
break;
case 'village':
txtinsertBefore = "[village]";
txtinsertAfter = "[/village]";
insertButton = 'V';
break;
case 'tribe':
txtinsertBefore = "[ally]";
txtinsertAfter = "[/ally]";
insertButton = 'A';
break;
case 'b':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = 'B';
break;
case 'i':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = 'I';
break;
case 'u':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = 'U';
break;
case 'quote':
txtinsertBefore = "
AUTHOR GOES HERE said:
";
txtinsertAfter = "
";
insertButton = 'Q';
break;
case 'url':
txtinsertBefore = ""; txtinsertAfter = "";
insertButton = 'L';
break;
case 'img':
txtinsertBefore = "";
txtinsertAfter = "";
insertButton = 'M';
break;
case 'large text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = 'R';
break;
case 'small text':
txtinsertBefore = "[size=7.5]";
txtinsertAfter = "[/size]";
insertButton = 'S';
break;
case 'smily lol':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_lol.gif";
txtinsertAfter = "";
insertButton = '1';
break;
case 'smily smile':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/smile.gif";
txtinsertAfter = "";
insertButton = '2';
break;
case 'smily idea':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_idea.gif";
txtinsertAfter = "";
insertButton = '3';
break;
case 'smily wink':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_wink.gif";
txtinsertAfter = "";
insertButton = '4';
break;
case 'smily evil':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_evil.gif";
txtinsertAfter = "";
insertButton = '5';
break;
case 'smily twisted':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_twisted.gif";
txtinsertAfter = "";
insertButton = '6';
break;
case 'smily eek':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_eek.gif";
txtinsertAfter = "";
insertButton = '7';
break;
case 'smily surprised':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_surprised.gif";
txtinsertAfter = "";
insertButton = '8';
break;
case 'smily cry':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_cry.gif";
txtinsertAfter = "";
insertButton = '9';
break;
case 'smily smile2':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_smile.gif";
txtinsertAfter = "";
insertButton = '10';
break;
case 'smily cool':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_cool.gif";
txtinsertAfter = "";
insertButton = '11';
break;
case 'smily sad':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_sad.gif";
txtinsertAfter = "";
insertButton = '12';
break;
case 'smily confused':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_confused.gif";
txtinsertAfter = "";
insertButton = '13';
break;
case 'smily rolleyes':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_rolleyes.gif";
txtinsertAfter = "";
insertButton = '14';
break;
case 'smily briggin':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_biggrin.gif";
txtinsertAfter = "";
insertButton = '15';
break;
case 'smily redface':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_redface.gif";
txtinsertAfter = "";
insertButton = '16';
break;
case 'smily razz':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_razz.gif";
txtinsertAfter = "";
insertButton = '17';
break;
case 'smily neutral':
txtinsertBefore = "http://forum.tribalwars.net/images/smilies/phpbb_smilies/icon_neutral.gif";
txtinsertAfter = "";
insertButton = '18';
break;
case 'unit spear':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_spear.png";
txtinsertAfter = "";
insertButton = '19';
break;
case 'unit sword':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_sword.png";
txtinsertAfter = "";
insertButton = '20';
break;
case 'unit axe':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_axe.png";
txtinsertAfter = "";
insertButton = '21';
break;
case 'unit archer':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_archer.png";
txtinsertAfter = "";
insertButton = '22';
break;
case 'unit noble':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_snob.png";
txtinsertAfter = "";
insertButton = '23';
break;
case 'unit scout':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_spy.png";
txtinsertAfter = "";
insertButton = '24';
break;
case 'unit lcav':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_light.png";
txtinsertAfter = "";
insertButton = '25';
break;
case 'unit hcav':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_heavy.png";
txtinsertAfter = "";
insertButton = '26';
break;
case 'unit marcher':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_marcher.png";
txtinsertAfter = "";
insertButton = '27';
break;
case 'unit paladin':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_knight.png";
txtinsertAfter = "";
insertButton = '28';
break;
case 'unit ram':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_ram.png";
txtinsertAfter = "";
insertButton = '29';
break;
case 'unit catapult':
txtinsertBefore = "http://www.tribalwars.net/graphic/unit/unit_catapult.png";
txtinsertAfter = "";
insertButton = '30';
break;
case 'black text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '31';
break;
case 'white text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '32';
break;
case 'red text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '33';
break;
case 'yellow text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '34';
break;
case 'green text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '35';
break;
case 'cyan text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '36';
break;
case 'blue text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '37';
break;
case 'violet text':
txtinsertBefore = "";
txtinsertAfter = "
";
insertButton = '38';
break;
}

if (start == end) {
txt.value = txt.value.substr(0, start) + txtinsertBefore + txtinsertAfter + txt.value.substr(end, txt.value.length);
} else {
txtlength = txt.value.length;
selection = txt.value.substr(start, (end - start));
selectionBefore = txt.value.substr(0, start);
selectionAfter = txt.value.substr(end, txtlength);

if (insertButton == 'V' && selection.match(/(\d+){3}([\/|]+){1}(\d+){3}/gi)) {
selection = selection.replace(/(.*)(\d+)(\d+)(\d+)([\/|]+){1}(\d+)(\d+)(\d+)(.*)/gi, "$2$3$4|$6$7$8");
}

txt.value = selectionBefore + txtinsertBefore + selection + txtinsertAfter + selectionAfter;

}
});


}


// ======== Funciones necesarias ========

// Atajos DOM
function $(elm_id){
return document.getElementById(elm_id);
}

function $$(tag_name){
return document.getElementsByTagName(tag_name);
}

function NuevaFuncionTW(func, new_func){

if(typeof unsafeWindow == "object"){
unsafeWindow[func] = new_func;
}else if(TW_Is_Opera){
window[func] = new_func;
/*
window.opera.defineMagicFunction(
func,
function(oRealFunc, oThis, oParam1, oParam2){
return oParam1.getElementById('oParam2').style;
}
);
*/
}
}
 

DeletedUser14

Guest
I got sick of reading so I am not sure if you got your answer yet.

But I can make bb-codes for an external forum work if you want some help on how to do it pm me and we can talk.
 
Top