Jump to content











Photo
- - - - -

[Release] Botched Reboot.pro CODE converter


  • Please log in to reply
11 replies to this topic

#1 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 August 2011 - 02:57 PM

Since the board update a number of items inside CODE and CODEBOX tags have become corrupted or however are parsed incorrectly by the Board software.

As a handy tool, and as a personal sign of my total and utter disagreement with:
  • the IPB board developers
  • the way the update of the board has been implemented
please find here a small online javascript converter that may be of use until everything (maybe) will be fixed:

http://pastehtml.com.../b4t99xk89.html




[REMOVED] NOT WORKING!


EDIT: we have some competitiors for the IPB good guys, the above page (pasteHTML) does not work (whilst it does in "preview") :frusty:

The attachment system of the board is not working, and I have problems in accessing altervista.[/s] A nice day of ordinary folly. :angry7:

EDIT 2: Made a workaround to have the little thingy work in pastehtml. ;)


:cheers:
Wonko

P.S.: By attempting to switch uploaders the post got mangled with "& nbsp "'s and "& quot ;" another nice feature of the new board software apparently.
The link also got corrupted. :w00t: no prob since it didn't work anyway

Download from here:
http://www.freefileh...onvertercodebox
expand and run locally untill I find a better way.


#2 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 22 August 2011 - 04:03 PM

Hello,

Would you please make this file available on the downloads portal?

It provides integrated hosting and it is also easier to find for users of the site. The network from my workstation does not allow to visit temporary hosting sites.

#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 August 2011 - 04:12 PM

Would you please make this file available on the downloads portal?

Naah, that is for "real projects", now that "CODE" works (for new posts ONLY) I can post it, just copy and paste to a new .html document.

<script language="JavaScript">

<!--

function CODE_convert(val){

var BAD_CODE = val.value

BETTER_CODE=BAD_CODE

 

BETTER_CODE=BETTER_CODE.replace(/'/g,"'")

BETTER_CODE=BETTER_CODE.replace(/&#40;/g,"(")

BETTER_CODE=BETTER_CODE.replace(/&#41;/g,")")

BETTER_CODE=BETTER_CODE.replace(/"/g,"\"")

BETTER_CODE=BETTER_CODE.replace(/&#58;/g,":")

BETTER_CODE=BETTER_CODE.replace(/&#91;/g,"[")

BETTER_CODE=BETTER_CODE.replace(/&#93;/g,"]")

 

val.value="::... BEGIN CONVERTED CODE ...::"+ "\n" + BETTER_CODE

val.value+="\n" + "::... END CONVERTED CODE ...::"

}

</script>

 

 

<title>Converter for reboot.pro botched contents of code and codebox tags"</title>

<body>

<br />

<br />

<center>

<font size="4" face="arial"> Converter for reboot.pro botched contents of code and codebox tags</br>

<br />

<font size="2" face="arial"> by your friendly neighbourhood <b>jaclaz</b></br>

<br />

<font size="2" face="arial"><b>jaclaz</b> is sorry for the accident that evidently occurred to the good IPB developers. :-( </br>

<font size="2" face="arial">apparently a similar one only happened once before to poor <b>Mike</b>:</br>

<P ALIGN=CENTER><A HREF="http://www.miketheheadlesschicken.org/story.php">Mike the Headless Chicken</A></P>

<br />

<font size="2" face="arial">This trivial and possibly very badly coded javascript takes care of the most common items:</br>

<font size="2" face="arial">& # 39; actually means ' or single quote</br>

<font size="2" face="arial">& # 40; actually means ( or left bracket</br>

<font size="2" face="arial">& # 41; actually means ) or right bracket</br>

<font size="2" face="arial">& # 34; actually means " or double quotes</br>

<font size="2" face="arial">& # 58; actually means : or colon</br>

<font size="2" face="arial">& # 91; actually means " or left square bracket</br>

<font size="2" face="arial">& # 93; actually means " or right square bracket</br>

 

<br />

<font size="2" face="arial">besides my bad javascript coding, result won't be anyway "perfect" in some cases, see this as an example:</br>

 

<P ALIGN=CENTER><A HREF="http://reboot.pro/10122/">ANSI BOOT.INI</A></P>

<form name="The_form">

 

<br />

<br />

<textarea name="The_area" cols="120" rows="8"></textarea>

<br />

<br />

<input type="button" value="BAD Code -> GOOD one" onclick="CODE_convert(document.The_form.The_area)" />

<input type="button" value="Clear" onclick="window.location.reload()" />

<br />

<br />

<br />

<font size="2" face="arial">&#8220;It's too bad that stupidity isn't painful.&#8221; (Anton LaVey)</br>

</center>

</body></html>

BTW, what you really should do is find a way to fix the corrupted posts instead of playing with my half-@§§ed scripts. ;)

:cheers:
Wonko

#4 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 22 August 2011 - 04:15 PM

I will use your list of botched characters as reference.

#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 August 2011 - 04:25 PM

I will use your list of botched characters as reference.


Well, don't use the code but the textual part.
Just as a proof of how stupid is the board software, out of 7"identical" lilnes:


BETTER_CODE=BETTER_CODE.replace(/'/g,"'")

BETTER_CODE=BETTER_CODE.replace(/&#40;/g,"(")

BETTER_CODE=BETTER_CODE.replace(/&#41;/g,")")

BETTER_CODE=BETTER_CODE.replace(/"/g,"\"")

BETTER_CODE=BETTER_CODE.replace(/&#58;/g,":")

BETTER_CODE=BETTER_CODE.replace(/&#91;/g,"[")

BETTER_CODE=BETTER_CODE.replace(/&#93;/g,"]")


EVEN INSIDE "CODE", the first and fourth one are PARSED ANYWAY (and doesn't makes any sense like "replace any quote with a quote" or "replace any double quote with a double quote" :w00t:
FIrst line should be (remove spaces);
BETTER_CODE=BETTER_CODE.replace(/& # 39;/g,"'")
Fourth line should be (remove spaces):

BETTER_CODE=BETTER_CODE.replace(/& # 34;/g,"\"")

JFYI, in the stupid editor still CTRL+C and CTRL+V don't work and it still jumps up and down, if you press ENTER (newline) after an emoticon, the emoticon gets deleted, the suggestion by mikorist to disable advanced editing is moot since you also turn off ALL the "normal" formatting buttons.

:cheers:
Wonko

#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 August 2011 - 06:29 PM

Let's do a test:

space
! ! exclamation mark
" " quotation mark
# # number sign
$ $ dollar sign
% % percent sign
& & ampersand
' ' apostrophe
( ( left parenthesis
) ) right parenthesis
* * asterisk
+ + plus sign
, , comma
- - hyphen
. . period
/ / slash
0 0 digit 0
1 1 digit 1
2 2 digit 2
3 3 digit 3
4 4 digit 4
5 5 digit 5
6 6 digit 6
7 7 digit 7
8 8 digit 8
9 9 digit 9
: : colon
; ; semicolon
< < less-than
= = equals-to
> > greater-than
? ? question mark
@ @ at sign
A A uppercase A
B B uppercase B
C C uppercase C
D D uppercase D
E E uppercase E
F F uppercase F
G G uppercase G
H H uppercase H
I I uppercase I
J J uppercase J
K K uppercase K
L L uppercase L
M M uppercase M
N N uppercase N
O O uppercase O
P P uppercase P
Q Q uppercase Q
R R uppercase R
S S uppercase S
T T uppercase T
U U uppercase U
V V uppercase V
W W uppercase W
X X uppercase X
Y Y uppercase Y
Z Z uppercase Z
[ [ left square bracket
\ \ backslash
] ] right square bracket
^ ^ caret
_ _ underscore
` ` grave accent
a a lowercase a
b b lowercase b
c c lowercase c
d d lowercase d
e e lowercase e
f f lowercase f
g g lowercase g
h h lowercase h
i i lowercase i
j j lowercase j
k k lowercase k
l l lowercase l
m m lowercase m
n n lowercase n
o o lowercase o
p p lowercase p
q q lowercase q
r r lowercase r
s s lowercase s
t t lowercase t
u u lowercase u
v v lowercase v
w w lowercase w
x x lowercase x
y y lowercase y
z z lowercase z
{ { left curly brace
| | vertical bar
} } right curly brace
~ ~ tilde


&#32; space

! ! exclamation mark

" " quotation mark

# &#35; number sign

$ &#36; dollar sign

% &#37; percent sign

& & ampersand

' ' apostrophe

( &#40; left parenthesis

) &#41; right parenthesis

* &#42; asterisk

+ &#43; plus sign

, &#44; comma

- &#45; hyphen

. . period

/ &#47; slash

0 &#48; digit 0

1 &#49; digit 1

2 &#50; digit 2

3 &#51; digit 3

4 &#52; digit 4

5 &#53; digit 5

6 &#54; digit 6

7 &#55; digit 7

8 &#56; digit 8

9 &#57; digit 9

: &#58; colon

; &#59; semicolon

< < less-than

= &#61; equals-to

> > greater-than

? &#63; question mark

@ &#64; at sign

A &#65; uppercase A

B &#66; uppercase B

C &#67; uppercase C

D &#68; uppercase D

E &#69; uppercase E

F &#70; uppercase F

G &#71; uppercase G

H &#72; uppercase H

I &#73; uppercase I

J &#74; uppercase J

K &#75; uppercase K

L &#76; uppercase L

M &#77; uppercase M

N &#78; uppercase N

O &#79; uppercase O

P &#80; uppercase P

Q &#81; uppercase Q

R &#82; uppercase R

S &#83; uppercase S

T &#84; uppercase T

U &#85; uppercase U

V &#86; uppercase V

W &#87; uppercase W

X &#88; uppercase X

Y &#89; uppercase Y

Z &#90; uppercase Z

[ &#91; left square bracket

\ &#92; backslash

] &#93; right square bracket

^ &#94; caret

_ &#95; underscore

` &#96; grave accent

a &#97; lowercase a

b &#98; lowercase b

c &#99; lowercase c

d &#100; lowercase d

e &#101; lowercase e

f &#102; lowercase f

g &#103; lowercase g

h &#104; lowercase h

i &#105; lowercase i

j &#106; lowercase j

k &#107; lowercase k

l &#108; lowercase l

m &#109; lowercase m

n &#110; lowercase n

o &#111; lowercase o

p &#112; lowercase p

q &#113; lowercase q

r &#114; lowercase r

s &#115; lowercase s

t &#116; lowercase t

u &#117; lowercase u

v &#118; lowercase v

w &#119; lowercase w

x &#120; lowercase x

y &#121; lowercase y

z &#122; lowercase z

{ &#123; left curly brace

| &#124; vertical bar

} &#125; right curly brace

~ &#126; tilde

&amp;#32; space<BR>! &amp;#33; exclamation mark<BR>" &amp;#34; quotation mark<BR># &amp;#35; number sign<BR>$ &amp;#36; dollar sign<BR>% &amp;#37; percent sign<BR>&amp; &amp;#38; ampersand<BR>' &amp;#39; apostrophe<BR>( &amp;#40; left parenthesis<BR>) &amp;#41; right parenthesis<BR>* &amp;#42; asterisk<BR>+ &amp;#43; plus sign<BR>, &amp;#44; comma<BR>- &amp;#45; hyphen<BR>. &amp;#46; period<BR>/ &amp;#47; slash<BR>0 &amp;#48; digit 0<BR>1 &amp;#49; digit 1<BR>2 &amp;#50; digit 2<BR>3 &amp;#51; digit 3<BR>4 &amp;#52; digit 4<BR>5 &amp;#53; digit 5<BR>6 &amp;#54; digit 6<BR>7 &amp;#55; digit 7<BR>8 &amp;#56; digit 8<BR>9 &amp;#57; digit 9<BR>: &amp;#58; colon<BR>; &amp;#59; semicolon<BR>&lt; &amp;#60; less-than<BR>= &amp;#61; equals-to<BR>&gt; &amp;#62; greater-than<BR>? &amp;#63; question mark<BR>@ &amp;#64; at sign<BR>A &amp;#65; uppercase A<BR>B &amp;#66; uppercase B<BR>C &amp;#67; uppercase C<BR>D &amp;#68; uppercase D<BR>E &amp;#69; uppercase E<BR>F &amp;#70; uppercase F<BR>G &amp;#71; uppercase G<BR>H &amp;#72; uppercase H<BR>I &amp;#73; uppercase I<BR>J &amp;#74; uppercase J<BR>K &amp;#75; uppercase K<BR>L &amp;#76; uppercase L<BR>M &amp;#77; uppercase M<BR>N &amp;#78; uppercase N<BR>O &amp;#79; uppercase O<BR>P &amp;#80; uppercase P<BR>Q &amp;#81; uppercase Q<BR>R &amp;#82; uppercase R<BR>S &amp;#83; uppercase S<BR>T &amp;#84; uppercase T<BR>U &amp;#85; uppercase U<BR>V &amp;#86; uppercase V<BR>W &amp;#87; uppercase W<BR>X &amp;#88; uppercase X<BR>Y &amp;#89; uppercase Y<BR>Z &amp;#90; uppercase Z<BR>[ &amp;#91; left square bracket<BR>\ &amp;#92; backslash<BR>] &amp;#93; right square bracket<BR>^ &amp;#94; caret<BR>_ &amp;#95; underscore<BR>` &amp;#96; grave accent<BR>a &amp;#97; lowercase a<BR>b &amp;#98; lowercase b<BR>c &amp;#99; lowercase c<BR>d &amp;#100; lowercase d<BR>e &amp;#101; lowercase e<BR>f &amp;#102; lowercase f<BR>g &amp;#103; lowercase g<BR>h &amp;#104; lowercase h<BR>i &amp;#105; lowercase i<BR>j &amp;#106; lowercase j<BR>k &amp;#107; lowercase k<BR>l &amp;#108; lowercase l<BR>m &amp;#109; lowercase m<BR>n &amp;#110; lowercase n<BR>o &amp;#111; lowercase o<BR>p &amp;#112; lowercase p<BR>q &amp;#113; lowercase q<BR>r &amp;#114; lowercase r<BR>s &amp;#115; lowercase s<BR>t &amp;#116; lowercase t<BR>u &amp;#117; lowercase u<BR>v &amp;#118; lowercase v<BR>w &amp;#119; lowercase w<BR>x &amp;#120; lowercase x<BR>y &amp;#121; lowercase y<BR>z &amp;#122; lowercase z<BR>{ &amp;#123; left curly brace<BR>| &amp;#124; vertical bar<BR>} &amp;#125; right curly brace<BR>~ &amp;#126; tilde
&lt;script language="JavaScript"&gt;<BR>&lt;!--<BR>function CODE_convert(val){<BR>var BAD_CODE = val.value<BR>BETTER_CODE=BAD_CODE<BR><BR>BETTER_CODE=BETTER_CODE.replace(/&amp;#39;/g,"'")<BR>BETTER_CODE=BETTER_CODE.replace(/&amp;#40;/g,"(")<BR>BETTER_CODE=BETTER_CODE.replace(/&amp;#41;/g,")")<BR>BETTER_CODE=BETTER_CODE.replace(/&amp;#34;/g,"\"")<BR>BETTER_CODE=BETTER_CODE.replace(/&amp;#58;/g,":")<BR>BETTER_CODE=BETTER_CODE.replace(/&amp;#91;/g,"[")<BR>BETTER_CODE=BETTER_CODE.replace(/&amp;#93;/g,"]")<BR><BR>val.value="::... BEGIN CONVERTED CODE ...::"+ "\n"  + BETTER_CODE<BR>val.value+="\n" + "::... END CONVERTED CODE ...::"<BR>}<BR>&lt;/script&gt;<BR><BR><BR>&lt;title&gt;Converter for reboot.pro botched contents of code and codebox tags"&lt;/title&gt;<BR>&lt;body&gt;<BR>&lt;br /&gt;<BR>&lt;br /&gt;<BR>&lt;center&gt;<BR>&lt;font size="4" face="arial"&gt; Converter for reboot.pro botched contents of code and codebox tags&lt;/br&gt; <BR>&lt;br /&gt;<BR>&lt;font size="2" face="arial"&gt; by your friendly neighbourhood &lt;b&gt;jaclaz&lt;/b&gt;&lt;/br&gt;<BR>&lt;br /&gt;<BR>&lt;font size="2" face="arial"&gt;&lt;b&gt;jaclaz&lt;/b&gt; is sorry for the accident that evidently occurred to the good IPB developers. :-( &lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;apparently a similar one only happened once before to poor &lt;b&gt;Mike&lt;/b&gt;:&lt;/br&gt;<BR>&lt;P ALIGN=CENTER&gt;&lt;A HREF="http://www.miketheheadlesschicken.org/story.php"&gt;Mike the Headless Chicken&lt;/A&gt;&lt;/P&gt;<BR>&lt;br /&gt;<BR>&lt;font size="2" face="arial"&gt;This trivial and possibly very badly coded javascript takes care of the most common items:&lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;&amp; # 39; actually means ' or single quote&lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;&amp; # 40; actually means ( or left bracket&lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;&amp; # 41; actually means ) or right bracket&lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;&amp; # 34; actually means " or double quotes&lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;&amp; # 58; actually means : or colon&lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;&amp; # 91; actually means " or left square bracket&lt;/br&gt;<BR>&lt;font size="2" face="arial"&gt;&amp; # 93; actually means " or right square bracket&lt;/br&gt;<BR><BR>&lt;br /&gt;<BR>&lt;font size="2" face="arial"&gt;besides my bad javascript coding, result won't be anyway "perfect" in some cases, see this as an example:&lt;/br&gt;<BR><BR>&lt;P ALIGN=CENTER&gt;&lt;A HREF="http://reboot.pro/10122/"&gt;ANSI BOOT.INI&lt;/A&gt;&lt;/P&gt;<BR>&lt;form name="The_form"&gt;<BR><BR>&lt;br /&gt;<BR>&lt;br /&gt;<BR>&lt;textarea name="The_area" cols="120" rows="8"&gt;&lt;/textarea&gt;<BR>&lt;br /&gt;<BR>&lt;br /&gt;<BR>&lt;input type="button" value="BAD Code -&gt; GOOD one" onclick="CODE_convert(document.The_form.The_area)" /&gt;<BR>&lt;input type="button" value="Clear" onclick="window.location.reload()" /&gt;<BR>&lt;br /&gt;<BR>&lt;br /&gt;<BR>&lt;br /&gt;<BR>&lt;font size="2" face="arial"&gt;&#8220;It's too bad that stupidity isn't painful.&#8221; (Anton LaVey)&lt;/br&gt;<BR>&lt;/center&gt;<BR>&lt;/body&gt;&lt;/html&gt;<BR><BR>



Hmmm. :dubbio:

:cheers:
Wonko

#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 August 2011 - 10:03 AM

Ok, small converter is in post #1 on pastehtml and it works allright. :smiling9:

:cheers:
Wonko

#8 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 23 August 2011 - 01:29 PM

I can run grep on our database file to manually convert those symbols. Mikorist reported success on his board with this approach and now you mention plenty more symbols than what we initially thought that needed translation.

Will wait a few more days so that this can be properly tested, probably during the weekend when the board is less busy so that we can bring it offline for an hour and proceed with all these conversions.

#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 August 2011 - 02:43 PM

I can run grep on our database file to manually convert those symbols. Mikorist reported success on his board with this approach and now you mention plenty more symbols than what we initially thought that needed translation.

Will wait a few more days so that this can be properly tested, probably during the weekend when the board is less busy so that we can bring it offline for an hour and proceed with all these conversions.


The test was just the "standard" printable ASCII.

I have (personally and WITHOUT searching) found NOT any other "strange" character than the 7 I put in the half-@§§ed javascript.

But if running grep on the offline database, it should not make that much difference running it with "all" the ASCII character codes.

The list I posted for testing was taken from here:
http://www.w3schools...s/ref_ascii.asp

it copies/pastes nicely :).

The "partial conversion" in "current" CODE is however to be checked, as it anyway represents a deviation from ANY standard, HTML codes inside CODE should EITHER be ALL parsed and translated (stupid behaviour) OR "left as they are" (strongly ADVISED)
NO EXCEPTION!

Even the stupid alternative is LESS stupid than "parsing and translating a few ones". :w00t: :frusty:

BTW, since after all I'm a nice guy :smiling9:, I won't comment the working (actually complete failure at it) of the other two "advanced items" I put in the test post above, respectively CODE (but taken from the dropdown list) and "html code".

:cheers:
Wonko

#10 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 12 December 2011 - 05:07 AM

I can run grep on our database file to manually convert those symbols. Mikorist reported success on his board with this approach and now you mention plenty more symbols than what we initially thought that needed translation.

Will wait a few more days so that this can be properly tested, probably during the weekend when the board is less busy so that we can bring it offline for an hour and proceed with all these conversions.

Nuno, any progress on this issue?

#11 sfinktah

sfinktah

    Frequent Member

  • Advanced user
  • 217 posts
  • Location:Der Äther
  • Interests:/(C(++|#)|P(HP|XE)|(OS|Linu)X|8051)/
  •  
    Australia

Posted 12 December 2011 - 05:35 AM

It just requires a run through html_decode_entities() in PHP.

That's what I do when I need to decode someone on here.

For instance, the encoded sample that was pasted above

G &#71; uppercase G
H &#72; uppercase H
I &#73; uppercase I
J &#74; uppercase J
K &#75; uppercase K
L &#76; uppercase L


i pasted into a file called "1", and then ran it through a basic html_entity_decode:

Spoiler


#12 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 22 December 2011 - 07:12 PM

Nuno, any progress on this issue?

Yep, I'm working on this matter. Progress is going slow, I'm applying changes but they are not being reflected on the database for some odd reason. I tried refreshing the cache but still no dice. Will keep looking for a solution.

It just requires a run through html_decode_entities() in PHP.

For small files this is nice, however I can't use PHP to handle the bulky 600Mb SQL file since it passes over the allowed memory usage. I've done a Java app for this task: http://reboot.pro/fi...-of-text-files/

Doesn't get all HTML entities but I was hoping that it would translate the most necessary chars back to the original state.

Other forum sites surely passed through the same issues, can anyone find out how they solved this mess? :huh:

Let's see if we can use the Xmas time to get this thing back to order.

:cheers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users