fix for tabs in code tags

Post here doubts, ideas, suggestions and support requests about the website and the forums.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

fix for tabs in code tags

Post by janiii »

discussion from here: viewtopic.php?f=4&t=11561

i found a mod for phpbb that should fix the problem with tabs in code tags:
http://www.phpbb.com/mods/db/index.php? ... ib_id=9005
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: fix for tabs in code tags

Post by ThePhoenixBird »

Got it, but reading the code of this mod i think that it could break the current Geshi highligh mod, i will try to test it first :D
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: fix for tabs in code tags

Post by janiii »

DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: fix for tabs in code tags

Post by janiii »

i installed phpbb3 and added the geshi mod.
that one didnt work for me.
janiii wrote:wouldnt some of this help? http://qbnz.com/highlighter/geshi-doc.h ... -container



BUT i found a solution. there are some files to be edited. so if i could contact you tpb.. :)
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: fix for tabs in code tags

Post by janiii »

tpb, i couldn't contact you..

in includes/bbcode.php comment out these lines:

Code: Select all

$code = str_replace("\t", '   ', $code);$code = str_replace('  ', '  ', $code);$code = str_replace('  ', '  ', $code);
this will help that the tabs will not be replaced by spaces.

but in firefox there is still problem with selecting the code. if you select the code by hand, it copies the tabs. but if you click on the select all link, somehow it is wrong copied with spaces. but in IE it works fine. dont know how in opera and safari or google.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: fix for tabs in code tags

Post by ThePhoenixBird »

testing tabs on code tags fix by janiii

Code: Select all

 Index: trunk/L2_GameServer/java/net/sf/l2j/Config.java===================================================================--- trunk/L2_GameServer/java/net/sf/l2j/Config.java (revision 3238)+++ trunk/L2_GameServer/java/net/sf/l2j/Config.java (revision 3240)@@ -2379,20 +2372,21 @@ 	private static void loadFloodProtectorConfigs(final Properties properties) 	{ 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4"); 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42"); 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42"); 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16"); 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100"); 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20"); 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10"); 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");+		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1"); 	}  	/** 	 * Loads single flood protector configuration. 	 *  	 * @param properties 	 *            properties file reader 	 * @param config 	 *            flood protector configuration instance 	 * @param configString  
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

Re: fix for tabs in code tags

Post by MELERIX »

not working for me.
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: fix for tabs in code tags

Post by ThePhoenixBird »

MELERIX wrote:not working for me.
your bug report doesnt have your forum rev number or copy-paste of the forum error --closed

PS: clean your cache Ctrl+F5
PS2: this fix doesnt allow you to use TABS while writing on the "Post a Reply" text box, you need to use another text editor (wordpad, notepad++, etc) that let you use TABS and then when pasting them inside CODE tags the tabs will be preserved.

Code: Select all

					example
try to highlight with your mouse the white space in front of the example word and you will see the tabs, previously they were replaced by spaces
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

Re: fix for tabs in code tags

Post by MELERIX »

Lo que sucede Fenix es que al presionar donde dice "Seleccionar todo" luego lo pegas por ejemplo en notepad y la verdad queda ilegible, aparece todo el texto hacia el lado :S

Por cierto estoy usando IE8.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: fix for tabs in code tags

Post by janiii »

MELERIX wrote:Por cierto estoy usando IE8.
^^ lolcats comming!
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: fix for tabs in code tags

Post by ThePhoenixBird »

MELERIX wrote:Por cierto estoy usando IE8.
There is your problem, we tested on FF 3.0/3.5, Opera 9.5/10, Chrome 2.0, Safari 4 and they work perfectly. I dont care about IE6/7/8

Image
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: fix for tabs in code tags

Post by janiii »

there is some problem with the patches now. some lines get lost and there are some new lines between each line.. :/
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

Re: fix for tabs in code tags

Post by MELERIX »

janiii wrote:there is some problem with the patches now. some lines get lost and there are some new lines between each line.. :/
janiii I have the same issue with IE8 :cry:

now is impossible to copy codes using IE8... (Phoenix I know that you don't like IE8) but for me IE8 is fine.

please try mantain compatibility between diferent plataforms, in this case different software browsers: IE / Firefox / Chrome / Safari / Opera.
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: fix for tabs in code tags

Post by ThePhoenixBird »

MELERIX wrote:
janiii wrote:there is some problem with the patches now. some lines get lost and there are some new lines between each line.. :/
janiii I have the same issue with IE8 :cry:

now is impossible to copy codes using IE8... (Phoenix I know that you don't like IE8) but for me IE8 is fine.

please try mantain compatibility between diferent plataforms, in this case different software browsers: IE / Firefox / Chrome / Safari / Opera.
Try this fix:

Image

and then

Image

Save the Cheerleader
Save the World
Save the Internet
Use Firefox!!
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

Re: fix for tabs in code tags

Post by MELERIX »

please try mantain compatibility between diferent plataforms, in this case different software browsers: IE / Firefox / Chrome / Safari / Opera.
:roll:
Post Reply